Re: I2C and devicetrees
From: Stephen Warren <hidden>
Date: 2012-12-11 20:56:08
Also in:
linux-i2c
On 12/11/2012 01:21 PM, Olof Johansson wrote:
[+devicetree-discuss] On Wed, Dec 5, 2012 at 2:36 PM, Peter Huewe [off-list ref] wrote:quoted
Hi, I have a short question about the relations between i2c and devicetrees. I was wondering is the device part of the compatible string of a (trivial) i2c device instanciated via devicetree _always_ identical to name in i2c_client.name ? Or can it be somehow different?It can be different, but the driver will then need to add a OF table that matches the probing. By default the i2c/dt core code will strip off the vendor prefix (before ",") and try probing with the rest of the device name. If that doesn't match the client name, that is when you need the additional table.
While relying on the prefix stripping works, I think I recall Grant mentioning that people shouldn't rely on it - namely that any I2C device that gets instantiated from DT should contain the OF match table explicitly. I CC'd Grant in case I'm mis-quoting him.