add mpu3050 board struct

This commit is contained in:
lyx
2011-05-19 20:04:40 -07:00
parent d31235fb8c
commit 3050e1049d
2 changed files with 53 additions and 2 deletions

View File

@@ -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);

View File

@@ -24,6 +24,8 @@
#include <linux/mmc/host.h>
#include <linux/android_pmem.h>
#include <linux/usb/android_composite.h>
#include <linux/mpu.h>
#include <linux/mpu3050.h>
#include <mach/hardware.h>
#include <asm/setup.h>
@@ -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