Searched hist:ffa458c1bd9b6f653008d450f337602f3d52a646 (Results 1 – 2 of 2) sorted by relevance
/linux/include/linux/spi/ |
H A D | ads7846.h | ffa458c1bd9b6f653008d450f337602f3d52a646 Sun Jan 08 22:34:21 CET 2006 David Brownell <david-b@pacbell.net> [PATCH] spi: ads7846 driver
This is a driver for the ADS7846 touchscreen sensor, derived from the corgi_ts and omap_ts drivers. Key differences from those two:
- Uses the new SPI framework (minimalist version) - <linux/spi/ads7846.h> abstracts board-specific touchscreen info - Sysfs attributes for the temperature and voltage sensors - Uses fewer ARM-specific IRQ primitives
The temperature and voltage sensors show up in sysfs like this:
$ pwd /sys/devices/platform/omap-uwire/spi2.0 $ ls bus@ input:event0@ power/ temp1 vbatt driver@ modalias temp0 vaux $ cat modalias ads7846 $ cat temp0 991 $ cat temp1 1177 $
So far only basic testing has been done. There's a fair amount of hardware that uses this sensor, and which also runs Linux, which should eventually be able to use this driver.
One portability note may be of special interest. It turns out that not all SPI controllers are happy issuing requests that do things like "write 8 bit command, read 12 bit response". Most of them seem happy to handle various word sizes, so the issue isn't "12 bit response" but rather "different rx and tx write sizes", despite that being a common MicroWire convention. So this version of the driver no longer reads 12 bit native-endian words; it reads 16-bit big-endian responses, then byteswaps them and shifts the results to discard the noise.
Signed-off-by: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
/linux/drivers/input/touchscreen/ |
H A D | ads7846.c | diff 820830ec918f6c3dcd77a54a1c6198ab57407916 Wed Nov 18 00:33:24 CET 2020 Oleksij Rempel <o.rempel@pengutronix.de> Input: ads7846 - fix integer overflow on Rt calculation
In some rare cases the 32 bit Rt value will overflow if z2 and x is max, z1 is minimal value and x_plate_ohms is relatively high (for example 800 ohm). This would happen on some screen age with low pressure.
There are two possible fixes: - make Rt 64bit - reorder calculation to avoid overflow
The second variant seems to be preferable, since 64 bit calculation on 32 bit system is a bit more expensive.
Fixes: ffa458c1bd9b6f653008d450f337602f3d52a646 ("spi: ads7846 driver") Co-developed-by: David Jander <david@protonic.nl> Signed-off-by: David Jander <david@protonic.nl> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.kernel.org/r/20201113112240.1360-1-o.rempel@pengutronix.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> ffa458c1bd9b6f653008d450f337602f3d52a646 Sun Jan 08 22:34:21 CET 2006 David Brownell <david-b@pacbell.net> [PATCH] spi: ads7846 driver
This is a driver for the ADS7846 touchscreen sensor, derived from the corgi_ts and omap_ts drivers. Key differences from those two:
- Uses the new SPI framework (minimalist version) - <linux/spi/ads7846.h> abstracts board-specific touchscreen info - Sysfs attributes for the temperature and voltage sensors - Uses fewer ARM-specific IRQ primitives
The temperature and voltage sensors show up in sysfs like this:
$ pwd /sys/devices/platform/omap-uwire/spi2.0 $ ls bus@ input:event0@ power/ temp1 vbatt driver@ modalias temp0 vaux $ cat modalias ads7846 $ cat temp0 991 $ cat temp1 1177 $
So far only basic testing has been done. There's a fair amount of hardware that uses this sensor, and which also runs Linux, which should eventually be able to use this driver.
One portability note may be of special interest. It turns out that not all SPI controllers are happy issuing requests that do things like "write 8 bit command, read 12 bit response". Most of them seem happy to handle various word sizes, so the issue isn't "12 bit response" but rather "different rx and tx write sizes", despite that being a common MicroWire convention. So this version of the driver no longer reads 12 bit native-endian words; it reads 16-bit big-endian responses, then byteswaps them and shifts the results to discard the noise.
Signed-off-by: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|