linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Felix Radensky <felix@embedded-sol.com>
To: Ayman El-Khashab <AymanE@tanisys.com>
Cc: Linuxppc-embedded@ozlabs.org
Subject: Re: Device tree configuration for I2C eeprom
Date: Tue, 04 Nov 2008 22:04:20 +0200	[thread overview]
Message-ID: <4910AAC4.2090303@embedded-sol.com> (raw)
In-Reply-To: <16691A8B34B5D9458EA3A1C37A11555A0137F85A@tanisys-ex2.Tanisys.Local>

Ayman El-Khashab wrote:
> Felix Radensky <mailto:felix@embedded-sol.com> said on Tuesday, November
> 04, 2008 10:46 AM:
>
>   
>> If you're using Denx kernel, you should add your  at24 device
>> to i2c_devices[] in drivers/i2c/busses/i2c-ibm_of.c This will
>> pass your device tree data to at24 driver.
>>     
>
> I am using the Denx kernel and I see the at24 printing out in dmesg.
> Here is 
> my latest device tree.  Further, I changed the aforementioned file by
> adding
> the following lines as shown.  The at24 driver is in i2c/chips/at24.c
>
> But I still do not see anything obvious show up that I can open to read
> and
> write the eeprom ... what am I missing.  I would have thought there must
> be
> a working example somewhere?
>
>
>
> static struct i2c_driver_device i2c_devices[] __initdata = {
>         {"ricoh,rs5c372a", "rtc-rs5c372", "rs5c372a",},
>         {"ricoh,rs5c372b", "rtc-rs5c372", "rs5c372b",},
>         {"ricoh,rv5c386",  "rtc-rs5c372", "rv5c386",},
>         {"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",},
>         {"dallas,ds1307",  "rtc-ds1307",  "ds1307",},
>         {"dallas,ds1337",  "rtc-ds1307",  "ds1337",},
>         {"dallas,ds1338",  "rtc-ds1307",  "ds1338",},
>         {"dallas,ds1339",  "rtc-ds1307",  "ds1339",},
>         {"dallas,ds1340",  "rtc-ds1307",  "ds1340",},
>         {"stm,m41t00",     "rtc-ds1307",  "m41t00"},
>         {"dallas,ds1374",  "rtc-ds1374",  "rtc-ds1374",},
>         {"stm,m41t80",     "rtc-m41t80",  "m41t80",},
>         {"atmel,at24c128", "at24",        "at24c128",},
>         {"spd,at24c02",    "at24",        "at24c02",},
> };
>
>
>
>                        IIC0: i2c@ef600700 {
>                                 compatible = "ibm,iic-460ex", "ibm,iic";
>                                 reg = <0xef600700 0x00000014>;
>                                 interrupt-parent = <&UIC0>;
>                                 interrupts = <0x2 0x4>;
>                                 #address-cells = <1>;
>                                 #size-cells = <0>;
>
>                                 at24@50 {
>                                         compatible = "atmel,at24c128";
>                                         reg = <0x50>;
>                                 };
>                                 spd@51 {
>                                         compatible = "spd,at24c02";
>                                         reg = <0x51>;
>                                 };
>                                 at24@52 {
>                                         compatible = "atmel,at24c128";
>                                         reg = <0x52>;
>                                 };
>                                 at24@53 {
>                                         compatible = "atmel,at24c128";
>                                         reg = <0x53>;
>                                 };
>   
The first entry in the table matches "compatible" property in device tree,
the second one - i2c driver name, and the third one - i2c device name in
the driver id table (see at24_ids[] in at24.c). So in your case it should
look like this:

{"atmel,at24c128",  "at24",   "24c128"}
{"spd,at24c02",       "at24",   "spd"}

Felix.

  reply	other threads:[~2008-11-04 20:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-18 19:44 Device tree configuration for I2C eeprom Ayman El-Khashab
2008-09-18 22:13 ` Sebastian Siewior
2008-09-18 22:21   ` Jon Smirl
2008-09-19  5:04     ` Grant Likely
2008-09-19  7:12       ` Sebastian Siewior
2008-09-19  7:44         ` Grant Likely
2008-09-19  8:12           ` Sebastian Siewior
2008-11-04 16:28         ` Grant Likely
2008-11-04 16:29           ` Grant Likely
2008-11-04 17:17             ` Sebastian Andrzej Siewior
2008-11-04 16:07       ` Ayman El-Khashab
2008-11-04 16:45         ` Felix Radensky
2008-11-04 19:52           ` Ayman El-Khashab
2008-11-04 20:04             ` Felix Radensky [this message]
2008-11-04 21:00               ` Ayman El-Khashab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4910AAC4.2090303@embedded-sol.com \
    --to=felix@embedded-sol.com \
    --cc=AymanE@tanisys.com \
    --cc=Linuxppc-embedded@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).