diff --git a/Makefile b/Makefile index cea78efc..5d59ceb8 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/drivers/i2c/chips/akm8973.c b/drivers/i2c/chips/akm8973.c index a7e6ccbc..470eff22 100644 --- a/drivers/i2c/chips/akm8973.c +++ b/drivers/i2c/chips/akm8973.c @@ -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]);