adckey: 增加名字板级自定义,允许厂商在Android中定义不同的键盘映射
author黄涛 <huangtao@rock-chips.com>
Sun, 10 Oct 2010 10:28:18 +0000 (18:28 +0800)
committer黄涛 <huangtao@rock-chips.com>
Sun, 10 Oct 2010 10:29:00 +0000 (18:29 +0800)
arch/arm/mach-rk2818/board-raho.c
arch/arm/mach-rk2818/include/mach/board.h
drivers/input/keyboard/rk2818_adckey.c

index e624460d8eb62cdf3f39ee08904d67f2ce2b0bd5..ced91f7df2b94e5117a0011adce74865101d7538 100755 (executable)
@@ -2051,7 +2051,7 @@ static unsigned char gInitKeyCode[] =
        ENDCALL,KEYSTART,KEY_WAKEUP,
 };
 
-struct adc_key_data rk2818_adc_key = {
+static struct adc_key_data rk2818_adc_key = {
     .pin_playon     = PLAY_ON_PIN,
     .playon_level   = PLAY_ON_LEVEL,
     .adc_empty      = 1000,
@@ -2065,6 +2065,7 @@ struct adc_key_data rk2818_adc_key = {
 
 struct rk2818_adckey_platform_data rk2818_adckey_platdata = {
        .adc_key = &rk2818_adc_key,
+       .name = "raho-keypad",
 };
 
 #if CONFIG_ANDROID_TIMED_GPIO
index 6f9f9c4315f6967911334b3d3805b3a5507294c9..21d117d9614d23d1835fb5909f4faee6516ffc59 100755 (executable)
@@ -262,6 +262,7 @@ struct rk2818_adckey_platform_data {
        int (*io_init)(void);
        int (*io_deinit)(void);
        struct adc_key_data *adc_key;
+       const char *name;
 };
 
 struct  jgball_data {
index 686c892695b044f3e226ce0796406ce7597dacb2..a7d613c5b93286482500207270a1e300a5553344 100755 (executable)
@@ -279,7 +279,7 @@ static int __devinit rk28_adckey_probe(struct platform_device *pdev)
                goto failed_free;
        }
 
-       input_dev->name = pdev->name;
+       input_dev->name = pdata->name ? pdata->name : pdev->name;
        //input_dev->id.bustype = BUS_HOST;
        input_dev->open = rk28_adckey_open;
        input_dev->close = rk28_adckey_close;