Added compass offset and compiler optimization options from michyprima's kernel

This commit is contained in:
Jon Benson 2010-09-27 14:39:23 +10:00
parent 92eb70e2d8
commit 7237858375
2 changed files with 14 additions and 1 deletions

View File

@ -525,7 +525,7 @@ all: vmlinux
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os
else
KBUILD_CFLAGS += -O2
KBUILD_CFLAGS += -O2 -mcpu=cortex-a8 -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3
endif
include $(srctree)/arch/$(SRCARCH)/Makefile

View File

@ -259,6 +259,19 @@ static void AKECS_Report_Value(short *rbuf)
printk(KERN_INFO" G_Sensor: x = %d LSB, y = %d LSB, z = %d LSB\n",
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]);