> -----Original Message----- > From: Jean Delvare [mailto:khali@xxxxxxxxxxxx] > Sent: 2011年11月14日 16:02 > To: Tang Yuantian-B29983 > Cc: lm-sensors@xxxxxxxxxxxxxx; Tang Yuantian-B29983; Huang Changming- > R66093; Tabi Timur-B04825 > Subject: Re: [PATCH] hwmon: (pmbus) Fix two issues > > Hi Tang, > > On Mon, 14 Nov 2011 13:41:06 +0800, Yuantian.Tang@xxxxxxxxxxxxx wrote: > > From: Tang Yuantian <B29983@xxxxxxxxxxxxx> > > > > 1. Not all platforms support i2c_smbus_read_block_data function. > > Use i2c_smbus_read_i2c_block_data instead. > > You can't do that. These are two different transfer formats, they are not > interchangeable. If the device wants the SMBus block format, then you > have to use this in the driver. If the bus driver doesn't support that, > it has to be fixed. In general it is only a matter of adding support for > I2C_M_RECV_LEN to the bus driver. You can check in > i2c-core:i2c_smbus_xfer_emulated() for a reference implementation. > [Yuantian:] almost all platform's i2c driver don't support i2c_smbus_read_block_data. Why can't we just use i2c_smbus_read_i2c_block_data instead. Beside, according my test, i2c_smbus_read_block_data can't return correct value, But i2c_smbus_read_i2c_block_data. I think i2c_smbus_read_i2c_block_data is only right choice. > > 2. Not all zlxx chips's id start with zlxx. zl6100's id starts with > > 0x10. Take this situation into account. > > No, this is incorrect. 0x10 is the first byte returned because SMBus > block reads receive the block length as the first byte. 0x10 == 16, which > is the length of the ID for these chips, this is no coincidence. > This is a bug introduced by your above change of SMBus block read for I2C > block read. > > So, nack. > [Yuantian:] I misunderstand the 0x10. But the existing zl6100 driver didn't consider it too. And still need to be fixed. > > Signed-off-by: Tang Yuantian <Yuantian.Tang@xxxxxxxxxxxxx> > > --- > > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > > branch: master > > test platform: P1022DS > > > > drivers/hwmon/pmbus/zl6100.c | 21 ++++++++++++++------- > > 1 files changed, 14 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/hwmon/pmbus/zl6100.c > > b/drivers/hwmon/pmbus/zl6100.c index 2bc9800..8e2fd52 100644 > > --- a/drivers/hwmon/pmbus/zl6100.c > > +++ b/drivers/hwmon/pmbus/zl6100.c > > @@ -26,6 +26,7 @@ > > #include <linux/i2c.h> > > #include <linux/ktime.h> > > #include <linux/delay.h> > > +#include <linux/ctype.h> > > > -- > Jean Delvare _______________________________________________ lm-sensors mailing list lm-sensors@xxxxxxxxxxxxxx http://lists.lm-sensors.org/mailman/listinfo/lm-sensors