Skip to contentSkip to conversation

ads7846 updates, mostly for hwmon

PATCH In review David Brownell 2 participants 2 messages May 3, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ads7846 updates, mostly for hwmon

Here's a patch for the ads7846 driver ... mostly adds hwmon support, but it also handles the byte order correctly. (That is, the fix should not have been in the OMAP tree's ads7846 code, but in omap_uwire instead.)

It goes no top of the omap_uwire patch, and also the OSK/Mistral update I sent a few days ago.

(I've sent a separate version of this patch upstream already, which doesn't need to revert those byteswap changes).

- Dave

The ads784x chips include not just touchscreen sensors but also temperature and voltage sensors, which are traditional hwmon fodder.

- Register with the hwmon framework
* hwmon needs to use subsys_init() so it's available early enough
- Adopt hwmon convention for presenting voltages:
* Report voltages in millivolts
* Attribute names are "in[0-8]_input" (meaningless, ugh)
- Be more accurate for the hwmon values:
* vBATT gets range-adjusted
* Discard the extra bit sent before the sample.

Battery measurements help during battery recharge monitoring. On OSK/Mistral, the measured voltage agreed with a multimeter until the fourth decimal place.

NOTE: this version is only for the OMAP tree, which has some byteswap bugs (and other changes) that are not found in the upstream kernels.

drivers/input/touchscreen/Kconfig +4 -1
Index: osk/drivers/input/touchscreen/Kconfig
===================================================================
@@ -14,10 +14,13 @@ if INPUT_TOUCHSCREEN
 config TOUCHSCREEN_ADS7846
 	tristate "ADS 7846 based touchscreens"
 	depends on SPI_MASTER
+	select HWMON
 	help
 	  Say Y here if you have a touchscreen interface using the
 	  ADS7846 controller, and your board-specific initialization
-	  code includes that in its table of SPI devices.
+	  code includes that in its table of SPI devices.  You will
+	  also get hwmon interfaces for the temperature and voltage
+	  sensors this chip provides.
 
 	  If unsure, say N (but it's safe to say "Y").
 
drivers/hwmon/hwmon.c +1 -1
Index: osk/drivers/hwmon/hwmon.c
===================================================================
@@ -102,7 +102,7 @@ static void __exit hwmon_exit(void)
 	class_destroy(hwmon_class);
 }
 
-module_init(hwmon_init);
+subsys_initcall(hwmon_init);
 module_exit(hwmon_exit);
 
 EXPORT_SYMBOL_GPL(hwmon_device_register);
drivers/input/touchscreen/ads7846.c +121 -62

329 lines not on this page · raw message

#1 lore raw
Quoted 6 lines · David Brownell

Here's a patch for the ads7846 driver ... mostly adds hwmon support, but it also handles the byte order correctly. (That is, the fix should not have been in the OMAP tree's ads7846 code, but in omap_uwire instead.)

It goes no top of the omap_uwire patch, and also the OSK/Mistral update I sent a few days ago.

Thanks, I've pushed all your 5 patches.

Quoted 2 lines

(I've sent a separate version of this patch upstream already, which doesn't need to revert those byteswap changes).

OK

Regards,

Tony