From 3050e1049d0c264b26b83b1023906fb790fed264 Mon Sep 17 00:00:00 2001 From: lyx Date: Thu, 19 May 2011 20:04:40 -0700 Subject: [PATCH] add mpu3050 board struct --- arch/arm/mach-rk29/board-rk29-a22-rfkill.c | 4 +- arch/arm/mach-rk29/board-rk29-a22.c | 51 ++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rk29/board-rk29-a22-rfkill.c b/arch/arm/mach-rk29/board-rk29-a22-rfkill.c index b28a5523a5c0..14367abd92fe 100755 --- a/arch/arm/mach-rk29/board-rk29-a22-rfkill.c +++ b/arch/arm/mach-rk29/board-rk29-a22-rfkill.c @@ -45,8 +45,8 @@ struct bt_ctrl #define BT_GPIO_POWER RK29_PIN5_PD6 #define IOMUX_BT_GPIO_POWER rk29_mux_api_set(GPIO5D6_SDMMC1PWREN_NAME, GPIO5H_GPIO5D6); -#define BT_GPIO_RESET RK29_PIN6_PC4 -#define BT_GPIO_WAKE_UP RK29_PIN6_PC5 +#define BT_GPIO_RESET RK29_PIN6_PC7 +#define BT_GPIO_WAKE_UP RK29_PIN6_PD0 #define BT_GPIO_WAKE_UP_HOST //RK2818_PIN_PA7 #define IOMUX_BT_GPIO_WAKE_UP_HOST() //rk2818_mux_api_set(GPIOA7_FLASHCS3_SEL_NAME,0); diff --git a/arch/arm/mach-rk29/board-rk29-a22.c b/arch/arm/mach-rk29/board-rk29-a22.c index 3f1966fe00cc..a9e85d13d6ef 100755 --- a/arch/arm/mach-rk29/board-rk29-a22.c +++ b/arch/arm/mach-rk29/board-rk29-a22.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include @@ -1434,6 +1436,46 @@ struct platform_device rk28_device_headset = { }; #endif +#if defined (CONFIG_SENSORS_MPU3050) +/*mpu3050*/ +static struct mpu3050_platform_data mpu3050_data = { + .int_config = 0x10, + //.orientation = { 1, 0, 0,0, -1, 0,0, 0, 1 }, + //.orientation = { 0, 1, 0,-1, 0, 0,0, 0, -1 }, + .orientation = { -1, 0, 0,0, -1, 0, 0, 0, -1 }, + .level_shifter = 0, +#if defined (CONFIG_SENSORS_KXTF9) + .accel = { + .get_slave_descr = kxtf9_get_slave_descr , + .adapt_num = 0, // The i2c bus to which the mpu device is + // connected + .irq = RK29_PIN6_PC4, + .bus = EXT_SLAVE_BUS_SECONDARY, //The secondary I2C of MPU + .address = 0x0f, + //.orientation = { 1, 0, 0,0, 1, 0,0, 0, 1 }, + //.orientation = { 0, -1, 0,-1, 0, 0,0, 0, -1 }, + //.orientation = { 0, 1, 0,1, 0, 0,0, 0, -1 }, + .orientation = {1, 0, 0, 0, -1, 0, 0, 0, -1}, + }, +#endif +#if defined (CONFIG_SENSORS_AK8975) + .compass = { + .get_slave_descr = ak8975_get_slave_descr,/*ak5883_get_slave_descr,*/ + .adapt_num = 0, // The i2c bus to which the compass device is. + // It can be difference with mpu + // connected + .irq = RK29_PIN6_PC5, + .bus = EXT_SLAVE_BUS_PRIMARY, + .address = 0x0d, + //.orientation = { -1, 0, 0,0, -1, 0,0, 0, 1 }, + //.orientation = { 0, -1, 0,-1, 0, 0,0, 0, -1 }, + .orientation = { 0, 1, 0,1, 0, 0,0, 0, -1 }, + }, +#endif +}; +#endif + + /***************************************************************************************** * i2c devices * author: kfx@rock-chips.com @@ -1614,6 +1656,15 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = { .irq = RK29_PIN2_PA3, }, #endif +#if defined (CONFIG_SENSORS_MPU3050) + { + .type = "mpu3050", + .addr = 0x68, + .flags = 0, + .irq = RK29_PIN5_PA3, + .platform_data = &mpu3050_data, + }, +#endif }; #endif -- 2.34.1