Commit 665a566d authored by Imre Deak's avatar Imre Deak Committed by Juha Yrjola

ads7846: fix endianness on coordinate values

Remove conversion from Big Endian to CPU order in the ads7846 driver.
We expect the uWire SPI driver to do this for us. Also the shift on read
values should be only 3, since we have a dummy clock at the beginning.
Signed-off-by: default avatarImre Deak <imre.deak@nokia.com>
Signed-off-by: default avatarJuha Yrjölä <juha.yrjola@nokia.com>
parent bce5b8ee
...@@ -257,10 +257,10 @@ static void ads7846_rx(void *ads) ...@@ -257,10 +257,10 @@ static void ads7846_rx(void *ads)
/* adjust: 12 bit samples (left aligned), built from /* adjust: 12 bit samples (left aligned), built from
* two 8 bit values writen msb-first. * two 8 bit values writen msb-first.
*/ */
x = be16_to_cpu(ts->tc.x) >> 4; x = ts->tc.x >> 3;
y = be16_to_cpu(ts->tc.y) >> 4; y = ts->tc.y >> 3;
z1 = be16_to_cpu(ts->tc.z1) >> 4; z1 = ts->tc.z1 >> 3;
z2 = be16_to_cpu(ts->tc.z2) >> 4; z2 = ts->tc.z2 >> 3;
/* range filtering */ /* range filtering */
if (x == MAX_12BIT) if (x == MAX_12BIT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment