From: wuhao Date: Tue, 12 Mar 2013 08:46:20 +0000 (+0800) Subject: rk3188 ds1006h: configuration the akm8963 based sensors framework X-Git-Tag: firefly_0821_release~7427 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3de7a5ccb617af622294b2c21bf0659d43281e0d;p=firefly-linux-kernel-4.4.55.git rk3188 ds1006h: configuration the akm8963 based sensors framework --- diff --git a/arch/arm/configs/rk3188_ds1006h_defconfig b/arch/arm/configs/rk3188_ds1006h_defconfig index 1d259a1f4450..0e5cd993d4f4 100644 --- a/arch/arm/configs/rk3188_ds1006h_defconfig +++ b/arch/arm/configs/rk3188_ds1006h_defconfig @@ -194,11 +194,8 @@ CONFIG_MTD_NAND_IDS=y CONFIG_MTD_RKNAND=y CONFIG_BLK_DEV_LOOP=y CONFIG_MISC_DEVICES=y -CONFIG_SENSORS_AK8963=y CONFIG_UID_STAT=y CONFIG_APANIC=y -CONFIG_3G_MODULE=y -CONFIG_MT6229=y CONFIG_SCSI=y CONFIG_BLK_DEV_SD=y CONFIG_SCSI_MULTI_LUN=y @@ -251,6 +248,7 @@ CONFIG_LIGHT_SENSOR_DEVICE=y CONFIG_SENSOR_DEVICE=y CONFIG_GSENSOR_DEVICE=y CONFIG_COMPASS_DEVICE=y +CONFIG_COMPASS_AK8963=y CONFIG_GYROSCOPE_DEVICE=y CONFIG_LIGHT_DEVICE=y CONFIG_LS_PHOTORESISTOR=y diff --git a/arch/arm/mach-rk3188/board-rk3188-ds1006h.c b/arch/arm/mach-rk3188/board-rk3188-ds1006h.c index 24c0d5ac129d..d90e7d96f546 100755 --- a/arch/arm/mach-rk3188/board-rk3188-ds1006h.c +++ b/arch/arm/mach-rk3188/board-rk3188-ds1006h.c @@ -259,17 +259,44 @@ static struct sensor_platform_data lis3dh_info = { .irq_enable = 1, .poll_delay_ms = 30, .init_platform_hw = lis3dh_init_platform_hw, - .orientation = {-1, 0, 0, 0, 0, -1, 0, 1, 0}, + .orientation = {-1, 0, 0, 0, 1, 0, 0, 0, -1}, }; #endif -#if (defined(CONFIG_SENSORS_AK8963) || defined(CONFIG_SENSORS_AK8963_MODULE)) -static struct akm8963_platform_data akm_platform_data_8963 = { - .gpio_DRDY = RK30_PIN3_PD7, - .gpio_RST = 0, - .layout = 3, - .outbit = 1, -}; +#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_LS_PHOTORESISTOR) @@ -1294,15 +1321,16 @@ static struct i2c_board_info __initdata i2c0_info[] = { .platform_data = &lis3dh_info, }, #endif -#if defined (CONFIG_SENSORS_AK8963) - { - .type = "akm8963", - .addr = 0x0d, - .flags = I2C_CLIENT_WAKE, - .irq = RK30_PIN3_PD7, - .platform_data = &akm_platform_data_8963, - }, +#if defined (CONFIG_COMPASS_AK8963) + { + .type = "ak8963", + .addr = 0x0d, + .flags = 0, + .irq = RK30_PIN3_PD7, + .platform_data = &akm8963_info, + }, #endif + #if defined (CONFIG_LS_PHOTORESISTOR) { .type = "ls_photoresistor",