linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Siewior <linuxppc-embedded@ml.breakpoint.cc>
To: Ayman El-Khashab <AymanE@tanisys.com>
Cc: Linuxppc-embedded@ozlabs.org
Subject: Re: Device tree configuration for I2C eeprom
Date: Fri, 19 Sep 2008 00:13:35 +0200	[thread overview]
Message-ID: <20080918221335.GA6420@Chamillionaire.breakpoint.cc> (raw)
In-Reply-To: <16691A8B34B5D9458EA3A1C37A11555A0137F7B6@tanisys-ex2.Tanisys.Local>

* Ayman El-Khashab | 2008-09-18 14:44:44 [-0500]:

>Here is a snippet from the dts file, and I assume I need something like
>what I've added:
> 
>                        IIC0: i2c@ef600700 {
>                                compatible = "ibm,iic-460ex", "ibm,iic";
>                                reg = <ef600700 14>;
>                                interrupt-parent = <&UIC0>;
>                                interrupts = <2 4>;
>                                #address-cells = <1>;
>                                #size-cells = <0>;
>                                rtc@68 {
>                                        compatible = "stm,m41t80";
>                                        reg = <68>;
>                                };
>                                eeprom@50 {
>                                        compatible = "?????";
> 						    something
>                                        something;
>                                };

This should look like:
|                        IIC0: i2c@ef600700 {
|                                compatible = "ibm,iic-460ex", "ibm,iic";
|                                reg = <ef600700 14>;
|                                interrupt-parent = <&UIC0>;
|                                interrupts = <2 4>;
|                                #address-cells = <1>;
|                                #size-cells = <0>;
|                                rtc@68 {
|                                        compatible = "m41t80";
|                                        reg = <68>;
|                                };
|                                eeprom@50 {
|                                        compatible = "eeprom";
|                                        reg = <50>;
|                                };

Compatible is the ID of the driver. You can find it in the driver
itself: if you look in ./drivers/rtc/rtc-m41t80.c you will find a struct
m41t80_id which contains the ids. The same applies to the eeprom driver.
You might want to update your dts from current kernel tree which
contains the "/dts-v1/" tag at the beginning and then your field must
contain an 0x prefix.

>Once I do all that, how does one use the eeprom driver to read and write
>this part?
The eeprom driver should create an eeprom file somewhere in /sys I am
not sure where exactly. The help entry in Kconfig says that is module
provides only RO access to the eeprom.

Sebastian

  reply	other threads:[~2008-09-18 22:13 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 [this message]
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
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=20080918221335.GA6420@Chamillionaire.breakpoint.cc \
    --to=linuxppc-embedded@ml.breakpoint.cc \
    --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).