From 5625cae35ef9f70888efd411999c68aa4435b0ce Mon Sep 17 00:00:00 2001 From: hjc Date: Wed, 7 Aug 2013 15:34:58 +0800 Subject: [PATCH] rk3028a_86v: add support gsensor lis3dh and emmc_rk --- arch/arm/configs/rk3028a_86v_defconfig | 4 +- arch/arm/mach-rk3026/board-rk3028a-86v.c | 160 +++++++++++++++++++++++ 2 files changed, 163 insertions(+), 1 deletion(-) diff --git a/arch/arm/configs/rk3028a_86v_defconfig b/arch/arm/configs/rk3028a_86v_defconfig index 3c4246e3174e..401b7a60d05d 100644 --- a/arch/arm/configs/rk3028a_86v_defconfig +++ b/arch/arm/configs/rk3028a_86v_defconfig @@ -247,6 +247,7 @@ CONFIG_INPUT_KEYCHORD=y CONFIG_INPUT_UINPUT=y CONFIG_GS_MMA7660=y CONFIG_GS_MMA8452=y +CONFIG_GS_LIS3DH=y CONFIG_SENSOR_DEVICE=y CONFIG_GSENSOR_DEVICE=y CONFIG_GS_MXC6225=y @@ -397,7 +398,8 @@ CONFIG_MMC=y CONFIG_MMC_UNSAFE_RESUME=y CONFIG_MMC_EMBEDDED_SDIO=y CONFIG_MMC_PARANOID_SD_INIT=y -CONFIG_MMC_BLOCK_MINORS=12 +CONFIG_MMC_BLOCK_MINORS=32 +CONFIG_EMMC_RK=y CONFIG_SDMMC_RK29=y CONFIG_NEW_LEDS=y CONFIG_LEDS_CLASS=y diff --git a/arch/arm/mach-rk3026/board-rk3028a-86v.c b/arch/arm/mach-rk3026/board-rk3028a-86v.c index 39b8e7054d0c..5185366fb972 100755 --- a/arch/arm/mach-rk3026/board-rk3028a-86v.c +++ b/arch/arm/mach-rk3026/board-rk3028a-86v.c @@ -517,8 +517,129 @@ static struct sensor_platform_data mxc6225_info = { .orientation = { 0, -1, 0, 1, 0, 0, 0, 0, 0}, }; #endif +#if defined (CONFIG_GS_LIS3DH) +#define LIS3DH_INT_PIN GS_INT_PIN + + static int lis3dh_init_platform_hw(void) + { + + return 0; + } + + static struct sensor_platform_data lis3dh_info = { + .type = SENSOR_TYPE_ACCEL, + .irq_enable = 1, + .poll_delay_ms = 30, + .init_platform_hw = lis3dh_init_platform_hw, + .orientation = {1, 0, 0, 0, 1, 0, 0, 0, 1}, + }; +#endif + +#if defined (CONFIG_COMPASS_AK8975) +static struct sensor_platform_data akm8975_info = +{ + .type = SENSOR_TYPE_COMPASS, + .irq_enable = 1, + .poll_delay_ms = 30, + .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_COMPASS_AK8963) +static struct sensor_platform_data akm8963_info = +{ + .type = SENSOR_TYPE_COMPASS, + .irq_enable = 1, + .poll_delay_ms = 30, + .m_layout = + { + { + {0, 1, 0}, + {1, 0, 0}, + {0, 0, -1}, + }, + + { + {1, 0, 0}, + {0, 1, 0}, + {0, 0, 1}, + }, + + { + {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 +#define L3G4200D_INT_PIN RK30_PIN0_PB4 + +static int l3g4200d_init_platform_hw(void) +{ + return 0; +} + +static struct sensor_platform_data l3g4200d_info = { + .type = SENSOR_TYPE_GYROSCOPE, + .irq_enable = 1, + .poll_delay_ms = 30, + .orientation = {0, 1, 0, -1, 0, 0, 0, 0, 1}, + .init_platform_hw = l3g4200d_init_platform_hw, + .x_min = 40,//x_min,y_min,z_min = (0-100) according to hardware + .y_min = 40, + .z_min = 20, +}; + +#endif + +#ifdef CONFIG_LS_CM3217 +static struct sensor_platform_data cm3217_info = { + .type = SENSOR_TYPE_LIGHT, + .irq_enable = 0, + .poll_delay_ms = 500, +}; + +#endif + /*********************************************************** * keyboard ************************************************************/ @@ -1277,6 +1398,45 @@ static struct i2c_board_info __initdata i2c1_info[] = { .platform_data = &mma8452_info, }, #endif +#if defined (CONFIG_GS_LIS3DH) + { + .type = "gs_lis3dh", + .addr = 0x19, //0x19(SA0-->VCC), 0x18(SA0-->GND) + .flags = 0, + .irq = LIS3DH_INT_PIN, + .platform_data = &lis3dh_info, + }, +#endif +#if defined (CONFIG_COMPASS_AK8975) + { + .type = "ak8975", + .addr = 0x0d, + .flags = 0, + .irq = RK30_PIN3_PD7, + .platform_data = &akm8975_info, + .irq = RK30_PIN3_PD7, + .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", + .addr = 0x69, + .flags = 0, + .irq = L3G4200D_INT_PIN, + .platform_data = &l3g4200d_info, + }, +#endif + }; #endif -- 2.34.1