From 426343ef34fac426e619176c84cb2e263b9ed23d Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 13 Oct 2011 17:15:11 -0400 Subject: hwmon: (lm75) Document why clones are not detected Explain why clones of the LM75 are generally not detected by the driver, and why this isn't going to change. Also update the documentation to reflect the list of chip names currently supported by the driver. Signed-off-by: Jean Delvare Signed-off-by: Guenter Roeck --- drivers/hwmon/lm75.c | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'drivers') diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c index 669481baac00..90126a2a1e44 100644 --- a/drivers/hwmon/lm75.c +++ b/drivers/hwmon/lm75.c @@ -249,19 +249,30 @@ static int lm75_detect(struct i2c_client *new_client, I2C_FUNC_SMBUS_WORD_DATA)) return -ENODEV; - /* Now, we do the remaining detection. There is no identification- - dedicated register so we have to rely on several tricks: - unused bits, registers cycling over 8-address boundaries, - addresses 0x04-0x07 returning the last read value. - The cycling+unused addresses combination is not tested, - since it would significantly slow the detection down and would - hardly add any value. - - The National Semiconductor LM75A is different than earlier - LM75s. It has an ID byte of 0xaX (where X is the chip - revision, with 1 being the only revision in existence) in - register 7, and unused registers return 0xff rather than the - last read value. */ + /* + * Now, we do the remaining detection. There is no identification- + * dedicated register so we have to rely on several tricks: + * unused bits, registers cycling over 8-address boundaries, + * addresses 0x04-0x07 returning the last read value. + * The cycling+unused addresses combination is not tested, + * since it would significantly slow the detection down and would + * hardly add any value. + * + * The National Semiconductor LM75A is different than earlier + * LM75s. It has an ID byte of 0xaX (where X is the chip + * revision, with 1 being the only revision in existence) in + * register 7, and unused registers return 0xff rather than the + * last read value. + * + * Note that this function only detects the original National + * Semiconductor LM75 and the LM75A. Clones from other vendors + * aren't detected, on purpose, because they are typically never + * found on PC hardware. They are found on embedded designs where + * they can be instantiated explicitly so detection is not needed. + * The absence of identification registers on all these clones + * would make their exhaustive detection very difficult and weak, + * and odds are that the driver would bind to unsupported devices. + */ /* Unused bits */ conf = i2c_smbus_read_byte_data(new_client, 1); -- cgit v1.2.3