Revert "Removed compass offset hack. It only "worked" if the phone was lying flat anyway, and only for some people."

Rajko assures me this works for most people, so I'll leave it until I get more feedback one way or another.

This reverts commit c60f5846d6.
This commit is contained in:
Jon Benson
2010-09-29 15:31:51 +10:00
parent 935a9ce797
commit 2dbf06e5df

View File

@@ -260,6 +260,18 @@ static void AKECS_Report_Value(short *rbuf)
rbuf[6], rbuf[7], rbuf[8]);
#endif
/* Offset compass hack taken from michyprimas kernel */
short valueint = rbuf[0];
if ((valueint + 85) < 360)
{
rbuf[0] = valueint + 85;
}
else
{
short diff = 359 - valueint;
rbuf[0] = 85 - diff;
}
/* Report magnetic sensor information */
if (atomic_read(&m_flag)) {
input_report_abs(data->input_dev, ABS_RX, rbuf[0]);