Re: pca953x GPIO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 28 Dec 2010 17:04:37 +0100, Joan Pau Beltran wrote:
> Now i2cdump give this output
> (all lines except the first one stripped because they are empty):
> 
> i2cdump -y 2 0x20
> No size specified (using byte-data access)
>       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
> 00: ff ff ff ff 00 00 ff ff XX XX XX XX XX XX XX XX    ........XXXXXXXX
> 
> I am surprised about these values. The port has 8 gpio pins available,
> so it seems their addresses are the ones in 000-007
> (or shoud I say they are represented in the chip's register 000-007?).

No, it doesn't work like that. You'll have to download the datasheet
for your GPIO chip from nxp.com, to find out the meaning of each
register. The details are normally hidden from you if you use the
pca953x driver, but as you decided to go the hard way...

> However, since there is nothing connected to the gpio pins,
> I expected all their values to be equal 00. Is this normal?
>  From where can these values can come from?

You really want to read the datasheet. With i2cdump, i2cget and i2cset,
you get raw access to the device registers, so don't expect anything to
be easy and straightforward.

> (...)
> It seems that I should add i2c-dev and i2c-i801 to my /etc/modules.
> Can someone confirm that? Would it be better to make udev load them 
> automatically?
> How can this be done?

i2c-i801 should get loaded automatically, as it is a PCI driver. If it
isn't on your system, make sure you didn't blacklist it. The following
command may help:

$ /sbin/modprobe -c | grep i2c_i801

i2c-dev is never loaded automatically, so you indeed have to add it
to /etc/modules (or whatever your distribution-specific mechanism is)
if you need it. OTOH you have to be root to run i2cdump or i2cget, so
you might as well load i2c-dev manually as root too.

-- 
Jean Delvare
http://khali.linux-fr.org/wishlist.html
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux