Backports from 2.6:

* Default to kind lm83 if forced.
* Fix temperature macros.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2656 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2004-08-09 18:36:02 +00:00
1 parent 76fd9cd677
commit fd5761aac5
1 file changed
+9 -2
+9 -2
View File
@@ -83,8 +83,11 @@ SENSORS_INSMOD_1(lm83);
* The LM83 uses signed 8-bit values.
*/
#define TEMP_FROM_REG(val) (val > 127 ? val-256 : val)
#define TEMP_TO_REG(val) (val < 0 ? val+256 : val)
#define TEMP_FROM_REG(val) ((val) > 127 ? (val) - 0x100 : (val))
#define TEMP_TO_REG(val) ((val) <= -50 ? -50 + 0x100 : \
(val) >= 127 ? 127 : \
(val) >= 0 ? (val) : \
(val) + 0x100)
static const u8 LM83_REG_R_TEMP[] = {
LM83_REG_R_LOCAL_TEMP,
@@ -276,6 +279,10 @@ static int lm83_detect(struct i2c_adapter *adapter, int address, unsigned
* are skipped.
*/
/* Default to an LM83 if forced */
if (kind == 0)
kind = lm83;
if (kind < 0) /* detection */
{
if (((i2c_smbus_read_byte_data(new_client, LM83_REG_R_STATUS1)