Hi Jean,
I found the reason why drivers/i2c/busses/i2c-viapro.c is not supporting I2C_SMBUS_PROC_CALL. The reason I found is as per the data sheet of Via Chip set the "SMBus Command Protocol field" should be set as bits 4-2 in "SMBus Host Control" register. But in the function static int vt596_transaction(u8 size) we are setting the "SMBus Command Protocol field" as bits 2-0: outb_p(0x40 | size, SMBHSTCNT); (Line 134 in drivers/i2c/busses/i2c-viapro.c) When I changed the statement to shift the Protocol field by 2 bits I2C_SMBUS_PROC_CALL worked and REPEATED START is being generated as per SMBus Process call specification. outb_p(0x40 | (size<<2), SMBHSTCNT); Could you please confirm whether the reason I found is valid or not? Please find attached the patch I wrote. The Via Motherboard I am using is EPIA Ex 1500G. Thank you, Prakash -----Original Message----- From: Jean Delvare [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2008 3:29 AM To: Mortha, Prakash Cc: Linux I2C Subject: Re: Question about vt82c596 SMBus driver (Via I2c Bus driver) Hi Prakash, Removing Kyosti and Mark, who have stepped back long ago, and adding the i2c mailing list instead, where people may have insight about your problem. On Thu, 25 Sep 2008 10:25:50 -0400, Mortha, Prakash wrote: > I am working with I2c bus driver in Via Ex mother board. > > I am trying to communicate with Micronas chip (MAP5401) on SMBus. > > I need to send 1 sub command and 2 bytes of register address and then > have to read 2 bytes of data. For this to work I am trying to implement > I2C_SMBUS_PROC_CALL in function vt596_access() in the file > drivers/i2c/busses/i2c-viapro.c > > One of the requirement here is I need to send REPEATED START after > sending 1 command byte and 2 register address bytes before reading 2 > data bytes. But when I use the logic analyzer I could see that a STOP > being sent when I expect a REPEATED START. > > How to I implement SMBus Process Call functionality. Please guide me. Well, these VIA chips aren't I2C chips where you have full control of the clock and data lines, but SMBus master chips with a limited set of commands available. The SMBus Process Call is one of these commands, it is supposed to be supported by the VIA chips (protocol = 0100b). Adding support to the i2c-viapro driver should be trivial. However, if you did that and the logic analyzer reveals that the VIA chip doesn't implement the command properly, then this is a hardware bug and unfortunately there's nothing we can do. This makes me a bit curious... did you test the other commands with your logic analyzer to make sure they are correct? Can you show us the patch you wrote? What exact VIA chip are you using? -- Jean Delvare
i2c-viapro.patch
Description: i2c-viapro.patch
_______________________________________________ i2c mailing list i2c@lm-sensors.org http://lists.lm-sensors.org/mailman/listinfo/i2c