add ak8963 sample code
authorluowei <lw@rock-chips.com>
Fri, 16 Aug 2013 09:42:33 +0000 (17:42 +0800)
committerluowei <lw@rock-chips.com>
Fri, 16 Aug 2013 09:43:00 +0000 (17:43 +0800)
arch/arm/mach-rk3188/board-rk3188-sdk.c

index 1ecde6f6f52a3dd74ff713bc97fffbe534370312..7e02094e6eb09cd2dd02080806c0b23ead0adf85 100755 (executable)
@@ -436,6 +436,48 @@ static struct sensor_platform_data akm8975_info =
 
 #endif
 
+#if defined (CONFIG_COMPASS_AK8963)
+static struct sensor_platform_data akm8963_info =
+{
+       .type = SENSOR_TYPE_COMPASS,
+       .irq_enable = 1,
+       .poll_delay_ms = 30,
+       .layout = 8,
+       .m_layout = 
+       {
+               //compass
+               {
+                       {0, 1, 0},
+                       {-1, 0, 0},
+                       {0, 0, 1},
+               },
+               
+               {
+                       {1, 0, 0},
+                       {0, 1, 0},
+                       {0, 0, 1},
+               },
+               
+               //gsensor
+               {
+                       {0, -1, 0},
+                       {1, 0, 0},
+                       {0, 0, -1},
+               },
+               
+               {
+                       {1, 0, 0},
+                       {0, 1, 0},
+                       {0, 0, 1},
+               },
+
+               
+       }
+};
+
+#endif
+
+
 #if defined(CONFIG_GYRO_L3G4200D)
 
 #include <linux/l3g4200d.h>
@@ -1482,6 +1524,16 @@ static struct i2c_board_info __initdata i2c0_info[] = {
                .platform_data = &akm8975_info,
        },
 #endif
+#if defined (CONFIG_COMPASS_AK8963)
+       {
+               .type          = "ak8963",
+               .addr          = 0x0d,
+               .flags         = 0,
+               .irq           = RK30_PIN3_PD7, 
+               .platform_data = &akm8963_info,
+       },
+#endif
+
 #if defined (CONFIG_GYRO_L3G4200D)
        {
                .type          = "l3g4200d_gryo",