linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: Q: define i2c nodes in device tree?
@ 2009-03-27 13:05 Albrecht Dreß
  2009-03-27 22:07 ` Timur Tabi
  2009-03-27 23:06 ` David Gibson
  0 siblings, 2 replies; 5+ messages in thread
From: Albrecht Dreß @ 2009-03-27 13:05 UTC (permalink / raw)
  To: linuxppc-dev

Hi Timur:

> You need to have a "gpio I2C" device driver that registers the same name =
as what's in the DTS, like this:

Thanks, that did the trick; a proper naming is apparently

pca8575:gpio@20 {
        compatible =3D "nxp,pca8575";
        device_type =3D "gpio";
        reg =3D <0x20 1>;
};

Now the driver is called, but complains that no platform data is present.  =
Still have to figure out how to pass that... :-/

An other confusing thing: although the probe function fails with error -EIN=
VAL, the device gets registered:

<7>[    0.801814] i2c 1-0020: uevent
<7>[    0.802213] pcf857x 1-0020: probe
<7>[    0.802236] pcf857x 1-0020: no platform data
<4>[    0.802265] pcf857x: probe of 1-0020 failed with error -22
<7>[    0.807980] i2c-adapter i2c-1: client [pca8575] registered with bus i=
d 1-0020

# ls -al /sys/devices/f0000000.soc5200/f0003d40.i2c/i2c-adapter/i2c-1/
drwxr-xr-x    6 0        0               0 Jan  1 00:00 .
drwxr-xr-x    3 0        0               0 Jan  1 00:00 ..
drwxr-xr-x    2 0        0               0 Jan  1 00:00 1-0020
drwxr-xr-x    2 0        0               0 Jan  1 00:00 1-0021
drwxr-xr-x    2 0        0               0 Jan  1 00:00 1-0022
[...]

Is this the intended behaviour?

Thanks, Albrecht.

Zerrei=DFen Sie die Netze der Phisher, Hacker und Betr=FCger!
Ihre Internet-Sicherheits-Seiten auf Arcor.de bieten alle Infos und Hilfsmi=
ttel, die Sie zum sicheren Surfen brauchen! Play it safe!
http://www.arcor.de/footer-sicherheit/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Q: define i2c nodes in device tree?
@ 2009-03-26 18:44 Albrecht Dreß
  2009-03-26 20:02 ` Timur Tabi
  0 siblings, 1 reply; 5+ messages in thread
From: Albrecht Dreß @ 2009-03-26 18:44 UTC (permalink / raw)
  To: Linux PPC Development

[-- Attachment #1: Type: text/plain, Size: 1424 bytes --]

Hi all,

I have some probably dumb questions regarding the definition of i2c  
slaves in the of device tree file...

My test system is a lite5200b board to which I attached two pca8575 io  
expander chips at i2c addresses 0x20 and 0x21.  Using the stock kernel  
2.6.29, I added the driver from the GPIO section, but I couldn't figure  
out how to add them to the dts file.  I tried e.g.

<snip>
i2c@3d40 {
	[...]
         compatible = "fsl,mpc5200b-i2c","fsl,mpc5200-i2c","fsl-i2c";
         [...]

         gpio@20 {
                 compatible = "pcf857x";
                 device_type = "gpio";
                 reg = <0x20 1>;
	};
};
</snip>

and some other like "gpio-controller" instead of "gpio" but (surprise)  
it doesn't work - dmesg says that the driver is registered, but nothing  
else shows up.  Unfortunately, I couldn't find documentation about the  
naming conventions of the i2c child nodes.

As I actually want to use the chips as parallel io (not separate  
gpio's) and thus would need to write my own driver I wonder if I really  
have to declare it in the device tree?  Would the simple way -just load  
the kernel module as with arm/intel- also work?  Would it be possible  
to use additional resources like an interrupt pin on the '5200 without  
the device tree?

Any information about a proper approach would be really helpful!

Thanks in advance, Albrecht.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2009-03-27 23:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-27 13:05 Q: define i2c nodes in device tree? Albrecht Dreß
2009-03-27 22:07 ` Timur Tabi
2009-03-27 23:06 ` David Gibson
  -- strict thread matches above, loose matches on Subject: below --
2009-03-26 18:44 Albrecht Dreß
2009-03-26 20:02 ` Timur Tabi

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).