From 299cea916787b786765a8d62f4239be2efc7a07c Mon Sep 17 00:00:00 2001 From: Fei Yang Date: Fri, 13 Jan 2012 14:17:37 -0800 Subject: [PATCH] GPIO-KEYS: combine two gpio-keys devices into one BZ: 20893 There are currently two "gpio-keys" platform devices defined in the kernel with the same string name, one is in blackbay_pr2.c and the other in mrst.c. This is causing problem when registering the second one. Solution is to combine them into one platform device. Change-Id: I83385db305f68e59c7878aed46b5defd66ec9d8e Signed-off-by: Fei Yang Reviewed-on: http://android.intel.com:8080/32692 Reviewed-by: Gross, Mark Reviewed-by: Kuppuswamy, Sathyanarayanan Tested-by: Ng, Cheon-woei Reviewed-by: buildbot Tested-by: buildbot --- arch/x86/platform/mfld/blackbay_pr2.c | 27 --------------------------- arch/x86/platform/mrst/mrst.c | 2 ++ 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/arch/x86/platform/mfld/blackbay_pr2.c b/arch/x86/platform/mfld/blackbay_pr2.c index 33c3a49..5212781 100644 --- a/arch/x86/platform/mfld/blackbay_pr2.c +++ b/arch/x86/platform/mfld/blackbay_pr2.c @@ -166,32 +166,6 @@ static struct i2c_board_info pr2_i2c_bus5_devs[] = { }, }; -static struct gpio_keys_button gpio_button[] = { - {KEY_VOLUMEUP, 32, 1, "vol_up", EV_KEY, 0, 20}, - {KEY_VOLUMEDOWN, 31, 1, "vol_down", EV_KEY, 0, 20}, - {KEY_CAMERA, 43, 1, "cam_capture", EV_KEY, 0, 20}, - {KEY_CAMERA_FOCUS, 36, 1, "cam_focus", EV_KEY, 0, 20}, -}; - -static struct gpio_keys_platform_data mrst_gpio_keys = { - .buttons = gpio_button, - .rep = 1, - .nbuttons = 4, -}; - -static struct platform_device pb_device = { - .name = "gpio-keys", - .id = -1, - .dev = { - .platform_data = &mrst_gpio_keys, - }, -}; - -static void bkbpr2_gpio_keys_init() -{ - platform_device_register(&pb_device); -} - static void register_board_i2c_devs() { i2c_register_board_info(5, pr2_i2c_bus5_devs, @@ -206,7 +180,6 @@ static int __init platform_bkbpr2_subsys_init(void) case MFLD_BID_PR3: case MFLD_BID_PR3_PNP: register_board_i2c_devs(); - bkbpr2_gpio_keys_init(); return 0; default: return 1; diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c index 053149d..4c75ddd 100644 --- a/arch/x86/platform/mrst/mrst.c +++ b/arch/x86/platform/mrst/mrst.c @@ -2430,6 +2430,8 @@ static struct gpio_keys_button gpio_button[] = { {KEY_CAMERA_FOCUS, -1, 1, "camera_half", EV_KEY, 0, 20}, {SW_KEYPAD_SLIDE, -1, 1, "MagSw1", EV_SW, 0, 20}, {SW_KEYPAD_SLIDE, -1, 1, "MagSw2", EV_SW, 0, 20}, + {KEY_CAMERA, -1, 1, "cam_capture", EV_KEY, 0, 20}, + {KEY_CAMERA_FOCUS, -1, 1, "cam_focus", EV_KEY, 0, 20}, }; static struct gpio_keys_platform_data mrst_gpio_keys = { -- 2.7.4