mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-10 16:30:50 +00:00
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:
1 parent
76fd9cd677
commit
fd5761aac5
1 file changed
+9
-2
+9
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user