Skip to contentSkip to conversation

TI TMP101 driver

PATCH Ben Dooks 4 participants 10 messages May 19, 2005

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

Driver for the TI TMP101 i2c temperature sensor chip.

Note, although the TMP101 is capable of SM-Bus alert, I do not have that capability on any of the systems I have these chips fitted on, so have not tested it

-------------- next part --------------

drivers/i2c/chips/Kconfig +11 -0
diff -urN -X ../dontdiff linux-2.6.11-rc4-bk5/drivers/i2c/chips/Kconfig linux-2.6.11-rc4-bk5-tmp101/drivers/i2c/chips/Kconfig
@@ -264,6 +264,17 @@
 	  This driver can also be built as a module.  If so, the module
 	  will be called smsc47m1.
 
+config SENSORS_TMP101
+	tristate "TI TMP101"
+	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
+	help
+	  Say y here for support for the TI TMP101 temperature monitoring
+	  chip.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called tmp101.o
+
 config SENSORS_VIA686A
 	tristate "VIA686A"
 	depends on I2C && PCI && EXPERIMENTAL
drivers/i2c/chips/Makefile +1 -0
diff -urN -X ../dontdiff linux-2.6.11-rc4-bk5/drivers/i2c/chips/Makefile linux-2.6.11-rc4-bk5-tmp101/drivers/i2c/chips/Makefile
@@ -32,6 +32,7 @@
 obj-$(CONFIG_SENSORS_RTC8564)	+= rtc8564.o
 obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
 obj-$(CONFIG_SENSORS_SMSC47M1)	+= smsc47m1.o
+obj-$(CONFIG_SENSORS_TMP101)	+= tmp101.o
 obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
 obj-$(CONFIG_SENSORS_W83L785TS)	+= w83l785ts.o
 obj-$(CONFIG_ISP1301_OMAP)	+= isp1301_omap.o
drivers/i2c/chips/tmp101.c +582 -0

582 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Mark Studebaker

isn't this chip compatible with the LM75 and its driver? what's different about it if anything?

configuration register is different, the temperature comparison is also different (tmp101 has low/high range)

Quoted 12 lines
Quoted 10 lines · Ben Dooks

Driver for the TI TMP101 i2c temperature sensor chip.

Note, although the TMP101 is capable of SM-Bus alert, I do not have that capability on any of the systems I have these chips fitted on, so have not tested it

Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
#2 lore raw
In reply to Ben Dooks

Hi Ben, hi Mark,

Quoted 5 lines
Quoted 2 lines

isn't this chip compatible with the LM75 and its driver? what's different about it if anything?

configuration register is different, the temperature comparison is also different (tmp101 has low/high range)

Configuration is extended but compatible. Your driver doesn't seem to make use of the extra configuration bits (only raises OS/ALERT, which is already set by default).

I also see no difference in the comparison mechanism. Tlow and Thigh are misnomers, if you look at the output transfer functions diagrams (page 6 of the datasheet) you see that it really is a high limit with an hysteresis, just like the LM75 has.

I agree with Mark, your driver is essentially redundant with the lm75 driver. I invite you to test the lm75 driver on your device. You might need to use the force parameter (the detection method is quite tricky) but otherwise I'd expect it to work just fine. If it does, we might simply need to tweak the detection function (once more) to recognize the TMP101.

See this thread for a previous discussion on this same topic:
http://archives.andrew.net.au/lm-sensors/msg26681.html

(Side question, where do you have such a chip? Seems to be quite rarely used.)

Thanks,

Signature · 1 line
Jean Delvare
#3 lore raw
In reply to Ben Dooks

Hi Mark,

Quoted 3 lines

I'm going to fix the lm75 driver to only rewrite the CMP/INT bit, and only if it's set to INT, OK?
This will be kinder to compatible chips.

I'd even say: just make sure that bit 0 (shutdown) is clear, and leave all the rest untouched. I just finished my lm92 driver for Linux 2.6 and that's what I did. We shall not change any bit we do not *need* to change.

Thanks,

Signature · 1 line
Jean Delvare
#4 lore raw
In reply to Ben Dooks
Quoted 11 lines · Jean Delvare

Hi Ben, hi Mark,

Quoted 5 lines
Quoted 2 lines

isn't this chip compatible with the LM75 and its driver? what's different about it if anything?

configuration register is different, the temperature comparison is also different (tmp101 has low/high range)

Configuration is extended but compatible. Your driver doesn't seem to make use of the extra configuration bits (only raises OS/ALERT, which is already set by default).

The driver also has resolution control.

Quoted 11 lines

I also see no difference in the comparison mechanism. Tlow and Thigh are misnomers, if you look at the output transfer functions diagrams (page 6 of the datasheet) you see that it really is a high limit with an hysteresis, just like the LM75 has.

I agree with Mark, your driver is essentially redundant with the lm75 driver. I invite you to test the lm75 driver on your device. You might need to use the force parameter (the detection method is quite tricky) but otherwise I'd expect it to work just fine. If it does, we might simply need to tweak the detection function (once more) to recognize the TMP101.

I'll try and check it

Quoted 5 lines

See this thread for a previous discussion on this same topic:
http://archives.andrew.net.au/lm-sensors/msg26681.html

(Side question, where do you have such a chip? Seems to be quite rarely used.)

All new boards by Simtec Electronics... the EB2410ITX and at least one custom board for a client.

Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
#5 lore raw
In reply to Ben Dooks
Quoted 11 lines · Mark Studebaker
Quoted 10 lines · Jean Delvare

Hi Ben, hi Mark,

Quoted 5 lines
Quoted 2 lines

isn't this chip compatible with the LM75 and its driver? what's different about it if anything?

configuration register is different, the temperature comparison is also different (tmp101 has low/high range)

Quoted 7 lines
Quoted 3 lines

Configuration is extended but compatible. Your driver doesn't seem to make use of the extra configuration bits (only raises OS/ALERT, which is already set by default).

I'm going to fix the lm75 driver to only rewrite the CMP/INT bit, and only if it's set to INT, OK?
This will be kinder to compatible chips.

Would it be possible to have an option to add converter resolution control at the same time please?

If the data-sheet had said it was an lm75 compatible, it'd have saved me a bit of time. gah.

Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
#6 lore raw
In reply to Ben Dooks

isn't this chip compatible with the LM75 and its driver? what's different about it if anything?

Quoted 10 lines · Ben Dooks

Driver for the TI TMP101 i2c temperature sensor chip.

Note, although the TMP101 is capable of SM-Bus alert, I do not have that capability on any of the systems I have these chips fitted on, so have not tested it

#7 lore raw
In reply to Ben Dooks
Quoted 10 lines · Ben Dooks
Quoted 2 lines · Mark Studebaker

isn't this chip compatible with the LM75 and its driver? what's different about it if anything?

configuration register is different, the temperature comparison is also different (tmp101 has low/high range)

The configuration register is compatible, and in any case the LM75 driver doesn't do anything with the register other than write it to 0 (which we should probably remove anyway).

The TMP101 datasheet labels the low limit "low" but it is really a hysteresis, as is clear from figure 4 (which is essentially identical to Figure 4 in the LM75 datasheet). Recall that "comparator" mode is the standard for all our drivers.

Does the LM75 driver work for you? I don't see why it wouldn't... please try it and let us know.

The one interesting difference is the TMP101 has extended precision. That may be worth supporting, although whether that would be better added to the lm75 driver as an option or creating a new driver is an open question...

mds

#8 lore raw
In reply to Ben Dooks
Quoted 6 lines · Jean Delvare

Hi Ben, hi Mark,

Quoted 3 lines
Quoted 2 lines

isn't this chip compatible with the LM75 and its driver? what's different about it if anything?

Quoted 7 lines
Quoted 2 lines

configuration register is different, the temperature comparison is also different (tmp101 has low/high range)

Configuration is extended but compatible. Your driver doesn't seem to make use of the extra configuration bits (only raises OS/ALERT, which is already set by default).

I'm going to fix the lm75 driver to only rewrite the CMP/INT bit, and only if it's set to INT, OK?
This will be kinder to compatible chips.

#9 lore raw
In reply to Ben Dooks
Quoted 24 lines · Ben Dooks
Quoted 13 lines · Mark Studebaker
Quoted 11 lines · Jean Delvare

Hi Ben, hi Mark,

Quoted 5 lines
Quoted 2 lines

isn't this chip compatible with the LM75 and its driver? what's different about it if anything?

configuration register is different, the temperature comparison is also different (tmp101 has low/high range)

Quoted 7 lines
Quoted 3 lines

Configuration is extended but compatible. Your driver doesn't seem to make use of the extra configuration bits (only raises OS/ALERT, which is already set by default).

I'm going to fix the lm75 driver to only rewrite the CMP/INT bit, and only if it's set to INT, OK?
This will be kinder to compatible chips.

Quoted 6 lines

Would it be possible to have an option to add converter resolution control at the same time please?

If the data-sheet had said it was an lm75 compatible, it'd have saved me a bit of time. gah.

yes we'd consider a patch to add a resolution parameter (res?) we'd have to review the other chip datasheets (see list in doc/chips/lm75) to see if they also support selectable resolution, you may need a second parameter (or perhaps force_tmp101) to cause the driver to write the new resolution...

if you're writing chip drivers, it's good to check doc/chips/SUMMARY to see if there is a similar chip before you start a new driver from scratch...

once you let us know the lm75 driver works, we'll update our docs to reflect support for the tmp100/101.

mds