Touchscreen controller temperature patch

John S. Skogtvedt jss2k2 at getmail.no
Thu Nov 15 00:24:22 CET 2007


A forum user requested[1] the feature to get the DS temperature.

I haven't done any "kernel hacking" before but I gave it a shot.

The patch isn't 100% clean. I'm not sure about overloading the
FIFO_POWER case and and 3 bits of the temperature (20.12 fixed point) is
lost. But that probably shouldn't matter, the temperature isn't that
accurate anyway.

The temperature returned is that on the touchscreen controller chip, not
external/ambient temperature.

Usage:
 apply patch, boot, cat /proc/tsc_temp

Is the patch clean enough to be committed? And is this a feature we want?


[1] http://www.dslinux.org/f0rums/viewtopic.php?t=403

>From http://www.bottledlight.com/ds/index.php/Misc/TouchScreen :

"""Temperature calculation:

Temperature diode two has a 91 times larger current, and the absolute
temperature can be calculated based on the measurements of the two
sensors. I'll present a fixed point algorithm for computing the
temperature in degrees C (see the TSC 2046 datasheet for the original
equation).
temperature(deg C) = 8490 * (V_I91 - V_I1) - 273*4096; (in 20.12 fixed
point)"""
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tsc_temp.diff
Url: http://mailman.dslinux.in-berlin.de/pipermail/dslinux-devel-dslinux.in-berlin.de/attachments/20071115/35721a47/attachment.txt 


More information about the dslinux-devel mailing list