linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* I2C and devicetrees
@ 2012-12-05 22:36 Peter Huewe
       [not found] ` <201212052336.24233.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Huewe @ 2012-12-05 22:36 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA

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?

Here's a short example:
device tree:
test {
        compatible = "vendor,device1", "vendor,device2";
        reg = <0x20>;
}

The driver has in its id table only this entry:
static const struct i2c_device_id my_i2c_table[] = {
        {"device2", 0},
        {},
};

-> "vendor,device2" matches and the driver is called.
--> Is i2c_client.name guaranteed to be "device2" ?







Second question:
Where would you probably add an i2c tpm? 
Would you add it to
 Documentation/devicetree/bindings/i2c/trivial-devices.txt
or if it's not trivial add it to a new file under
 Documentation/devicetree/bindings/i2c/

or create a new folder 
 Documentation/devicetree/bindings/tpm
as there probably are more i2c tpms to come in the near future.

I'd probably prefer the first one, whereas Google already uses the second 
option:
http://git.chromium.org/gitweb/?p=chromiumos/third_party/kernel.git;a=history;f=Documentation/devicetree/bindings/tpm;hb=refs/heads/chromeos-3.4


Thanks,
PeterH

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-03-02  0:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-05 22:36 I2C and devicetrees Peter Huewe
     [not found] ` <201212052336.24233.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
2012-12-11 20:21   ` Olof Johansson
     [not found]     ` <CAOesGMhUVwB4+kuCA8hSmfhoVzkznNbjj6hjngDMaQkB83WqjQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-11 20:56       ` Stephen Warren
     [not found]         ` <50C79DE8.2090201-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-12-14 20:38           ` Grant Likely
2013-02-12 16:34             ` Gerlando Falauto
     [not found]               ` <511A6F26.20801-SkAbAL50j+5BDgjK7y7TUQ@public.gmane.org>
2013-03-01 15:33                 ` Thomas De Schampheleire
2013-03-01 19:56                 ` Thomas De Schampheleire
     [not found]                   ` <CAAXf6LXW7RXUgqOSwKKDfByK24qNdRGHgkEhN7eVN=BQKbAZmg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-01 21:47                     ` Mitch Bradley
     [not found]                       ` <5131220E.70407-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2013-03-01 23:17                         ` Stephen Warren
     [not found]                           ` <51313726.6010204-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-03-02  0:00                             ` Mitch Bradley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).