From: linjh Date: Tue, 9 Oct 2012 14:43:22 +0000 (+0800) Subject: rk2928-phonepad-sdk: add kxtik gsensor support X-Git-Tag: firefly_0821_release~8459 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d8224526a42112142532eef8c9fed38757f07be1;p=firefly-linux-kernel-4.4.55.git rk2928-phonepad-sdk: add kxtik gsensor support [reference files] modified: arch/arm/configs/rk2928_phonepad_defconfig arch/arm/mach-rk2928/board-rk2928-phonepad.c --- diff --git a/arch/arm/configs/rk2928_phonepad_defconfig b/arch/arm/configs/rk2928_phonepad_defconfig index 92508e9da614..e9893dbad88a 100644 --- a/arch/arm/configs/rk2928_phonepad_defconfig +++ b/arch/arm/configs/rk2928_phonepad_defconfig @@ -240,9 +240,9 @@ CONFIG_TOUCHSCREEN_I30=y CONFIG_INPUT_MISC=y CONFIG_INPUT_KEYCHORD=y CONFIG_INPUT_UINPUT=y -CONFIG_GS_MMA7660=y CONFIG_SENSOR_DEVICE=y CONFIG_GSENSOR_DEVICE=y +CONFIG_GS_KXTIK=y # CONFIG_SERIO is not set # CONFIG_CONSOLE_TRANSLATIONS is not set # CONFIG_LEGACY_PTYS is not set diff --git a/arch/arm/mach-rk2928/board-rk2928-phonepad.c b/arch/arm/mach-rk2928/board-rk2928-phonepad.c index b85cd2e3db8e..d78acdef9a19 100755 --- a/arch/arm/mach-rk2928/board-rk2928-phonepad.c +++ b/arch/arm/mach-rk2928/board-rk2928-phonepad.c @@ -395,10 +395,9 @@ static struct sensor_platform_data mma7660_info = { }; #endif -#ifdef CONFIG_GS_KXTIK - +#if defined (CONFIG_GS_KXTIK) #define KXTIK_INT_PIN RK2928_PIN3_PD1 - +#if 0 static int kxtik_init_hw(void) { int ret = 0; @@ -425,7 +424,21 @@ static struct gsensor_platform_data kxtik_pdata = { .exit_platform_hw = kxtik_exit_hw, .orientation = {-1, 0, 0, 0, 0, -1, 0, 1, 0}, }; +#endif +static int kxtik_init_platform_hw(void) +{ + printk("%s: >>>>>>>>>>>>>>>>\n\n\n", __func__); + return 0; +} +static struct sensor_platform_data kxtik_pdata = { + .type = SENSOR_TYPE_ACCEL, + .irq_enable = 1, + .poll_delay_ms = 30, + .init_platform_hw = kxtik_init_platform_hw, + .orientation = {-1, 0, 0, 0, 0, -1, 0, 1, 0}, + //.orientation = {0, 1, 0, 0, 0, -1, 1, 0, 0}, +}; #endif /* CONFIG_GS_KXTIK*/ #ifdef CONFIG_INPUT_AP321XX @@ -754,8 +767,11 @@ static struct i2c_board_info __initdata i2c1_info[] = { }, #endif -#ifdef CONFIG_GS_KXTIK - { I2C_BOARD_INFO("kxtik", 0x0F), +#if defined (CONFIG_GS_KXTIK) + { + .type = "gs_kxtik", + .addr = 0x0F, + .flags = 0, .platform_data = &kxtik_pdata, .irq = KXTIK_INT_PIN, // Replace with appropriate GPIO setup },