rk30:add akm8975 support
authorlw <lw@rock-chips.com>
Thu, 1 Mar 2012 06:49:35 +0000 (14:49 +0800)
committerlw <lw@rock-chips.com>
Thu, 1 Mar 2012 06:49:35 +0000 (14:49 +0800)
arch/arm/mach-rk30/board-rk30-sdk.c
arch/arm/mach-rk30/include/mach/board.h
arch/arm/plat-rk/include/plat/board.h

index 47e292a59e90c2c127c99ac598871c2087f89b68..c87edce5d5755a89f651d228a29e7324cca420e1 100755 (executable)
@@ -291,6 +291,40 @@ static struct mma8452_platform_data mma8452_info = {
        .orientation = { -1, 0, 0, 0, 0, 1, 0, -1, 0},
 };
 #endif
+#if defined (CONFIG_COMPASS_AK8975)
+static struct akm8975_platform_data akm8975_info =
+{
+       .m_layout = 
+       {
+               {
+                       {1, 0, 0 },
+                       {0, -1, 0 },
+                       {0,     0, -1 },
+               },
+
+               {
+                       {1, 0, 0 },
+                       {0, 1, 0 },
+                       {0,     0, 1 },
+               },
+
+               {
+                       {1, 0, 0 },
+                       {0, 1, 0 },
+                       {0,     0, 1 },
+               },
+
+               {
+                       {1, 0, 0 },
+                       {0, 1, 0 },
+                       {0,     0, 1 },
+               },
+       }
+
+};
+
+#endif
+
 #if defined(CONFIG_GYRO_L3G4200D)
 
 #include <linux/l3g4200d.h>
@@ -375,6 +409,15 @@ static struct i2c_board_info __initdata i2c0_info[] = {
              .platform_data  = &mma8452_info,
            },
 #endif
+#if defined (CONFIG_COMPASS_AK8975)
+       {
+               .type           = "ak8975",
+               .addr           = 0x0d,
+               .flags          = 0,
+               .irq            = RK30_PIN4_PC1,
+               .platform_data  = &akm8975_info,
+       },
+#endif
 #if defined (CONFIG_GYRO_L3G4200D)
        {
                .type           = "l3g4200d_gryo",
index 07d71ef0ee1cc9df5bf96220135dbe6131b48e34..551e5da66f279a1ab61c3cf66a1c16da805b1f55 100755 (executable)
@@ -22,18 +22,6 @@ struct rk30_i2c_platform_data {
        int (*io_deinit)(void);
 };
 
-struct mma8452_platform_data {
-       u16     model;
-       u16     swap_xy;
-       u16     swap_xyz;
-       signed char orientation[9];
-       int     (*get_pendown_state)(void);
-       int     (*init_platform_hw)(void);
-       int     (*mma8452_platform_sleep)(void);
-       int     (*mma8452_platform_wakeup)(void);
-       void    (*exit_platform_hw)(void);
-};
-
 extern struct rk29_sdmmc_platform_data default_sdmmc0_data;
 extern struct rk29_sdmmc_platform_data default_sdmmc1_data;
 
index 40b96dcd4e4f146ed576b614269d11787f23ace0..7fca0a4ab1ac82eca11384c36c34fb1bd6fcbd3d 100644 (file)
@@ -76,6 +76,26 @@ struct rk29_sdmmc_platform_data {
        int write_prt;
 };
 
+struct mma8452_platform_data {
+       u16     model;
+       u16     swap_xy;
+       u16     swap_xyz;
+       signed char orientation[9];
+       int     (*get_pendown_state)(void);
+       int     (*init_platform_hw)(void);
+       int     (*mma8452_platform_sleep)(void);
+       int     (*mma8452_platform_wakeup)(void);
+       void    (*exit_platform_hw)(void);
+};
+
+struct akm8975_platform_data {
+       short m_layout[4][3][3];
+       char project_name[64];
+       int gpio_DRDY;
+};
+
+
+
 #define BOOT_MODE_NORMAL               0
 #define BOOT_MODE_FACTORY2             1
 #define BOOT_MODE_RECOVERY             2