Skip to contentSkip to conversation

I2C controller i2c-mv64xxx.c not compliant

DISCUSSION Rodolfo Giometti 2 participants 2 messages Nov 15, 2010 – Feb 11, 2011 1 message not in the archive I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

Hello,

I'm using a ltc4266 (PoE chip) with the Marvell i2c controller (CPU Feroceon 88FR131).

The ltc4266 wants a repeated START during a write/read sequence, i.e. in order to read a register with the following messages:

        u8 reg = <address>;
	u8 val;
        struct i2c_msg msg[] = {
                { client->addr, 0, 1, &reg },
                { client->addr, I2C_M_RD, 1, &val },
        };

the master _must_ send a repeated START at beginning of the read message otherwise the ltc4266 will reset its internal address register and the master will read the register 0x00 each time!

Looking at the code the i2c-mv64xxx.c driver sends a STOP at each message's end, but into the file include/linux/i2c.h is stated:

* Except when I2C "protocol mangling" is used, all I2C adapters implement
* the standard rules for I2C transactions. Each transaction begins with a
* START. That is followed by the slave address, and a bit encoding read
* versus write. Then follow all the data bytes, possibly including a byte
* with SMBus PEC. The transfer terminates with a NAK, or when all those
* bytes have been transferred and ACKed. If this is the last message in a
* group, it is followed by a STOP. Otherwise it is followed by the next
* @i2c_msg transaction segment, beginning with a (repeated) START.

Any suggestions in order to fix it?

Ciao,

Rodolfo

Signature · 5 lines
GNU/Linux Solutions                  e-mail: giometti-AVVDYK/kqiJWk0Htik3J/[email protected]
Linux Device Driver                          [email protected]
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it

A message that is not in the archive (sent off-list or not yet received): 20101115145406.GE3372-AVVDYK/kqiJWk0Htik3J/[email protected]

#2 lore raw

Hi Rodolfo,

Rodolfo Giometti said the following:

Quoted 2 lines

I'm using a ltc4266 (PoE chip) with the Marvell i2c controller (CPU Feroceon 88FR131).

you already solved your issue, but where did you get register and functional description of LTC from? Is it under NDA? I couldn't find it in the web, just a file named 4266fa.pdf not specifying registers. Are you willing to share your driver?

Signature · 2 lines
KR
Michael