usb/keyboard: remove leds set/unset for usb keyboard in driver/kernel
authorfeng wang <feng.a.wang@intel.com>
Tue, 21 Feb 2012 06:58:17 +0000 (14:58 +0800)
committerbuildbot <buildbot@intel.com>
Wed, 29 Feb 2012 05:23:50 +0000 (21:23 -0800)
BZ: 19068

In ICS, framework will handle the leds for usb keyboard and handle
related function. In keyboard driver, leds are also set/unset but
the implementation conflicts with that of the framework.
The implementation of framework is same as google/samsung ICS phone.
So remove leds set/unset functon in keyboard driver.
Please note that the implementation of android is different from
other linux base platform like ubuntu.

Change-Id: I22b5289bdc26482b6881e421b742fec370aa3b2d
Signed-off-by: feng wang <feng.a.wang@intel.com>
Reviewed-on: http://android.intel.com:8080/36013
Reviewed-by: Zhuang, Jin Can <jin.can.zhuang@intel.com>
Reviewed-by: Tang, Richard <richard.tang@intel.com>
Reviewed-by: Meng, Zhe <zhe.meng@intel.com>
Tested-by: Meng, Zhe <zhe.meng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/tty/vt/keyboard.c
include/linux/kbd_kern.h

index 3761ccf..7a8eb2b 100644 (file)
@@ -1041,6 +1041,7 @@ static int kbd_update_leds_helper(struct input_handle *handle, void *data)
  * registered yet but we already getting updates form VT to
  * update led state.
  */
+#ifndef CONFIG_ANDROID
 static void kbd_bh(unsigned long dummy)
 {
        unsigned char leds = getleds();
@@ -1053,6 +1054,7 @@ static void kbd_bh(unsigned long dummy)
 }
 
 DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
+#endif
 
 #if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) ||\
     defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) ||\
@@ -1319,7 +1321,9 @@ static void kbd_event(struct input_handle *handle, unsigned int event_type,
 
        spin_unlock(&kbd_event_lock);
 
+#ifndef CONFIG_ANDROID
        tasklet_schedule(&keyboard_tasklet);
+#endif
        do_poke_blanked_console = 1;
        schedule_console_callback();
 }
@@ -1391,6 +1395,7 @@ static void kbd_disconnect(struct input_handle *handle)
  * Start keyboard handler on the new keyboard by refreshing LED state to
  * match the rest of the system.
  */
+#ifndef CONFIG_ANDROID
 static void kbd_start(struct input_handle *handle)
 {
        tasklet_disable(&keyboard_tasklet);
@@ -1400,6 +1405,9 @@ static void kbd_start(struct input_handle *handle)
 
        tasklet_enable(&keyboard_tasklet);
 }
+#else
+static void kbd_start(struct input_handle *handle) {}
+#endif
 
 static const struct input_device_id kbd_ids[] = {
        {
@@ -1446,8 +1454,10 @@ int __init kbd_init(void)
        if (error)
                return error;
 
+#ifndef CONFIG_ANDROID
        tasklet_enable(&keyboard_tasklet);
        tasklet_schedule(&keyboard_tasklet);
+#endif
 
        return 0;
 }
index ec2d17b..4019258 100644 (file)
@@ -5,7 +5,9 @@
 #include <linux/interrupt.h>
 #include <linux/keyboard.h>
 
+#ifndef CONFIG_ANDROID
 extern struct tasklet_struct keyboard_tasklet;
+#endif
 
 extern int shift_state;
 
@@ -79,10 +81,14 @@ extern void (*kbd_ledfunc)(unsigned int led);
 extern int set_console(int nr);
 extern void schedule_console_callback(void);
 
+#ifndef CONFIG_ANDROID
 static inline void set_leds(void)
 {
        tasklet_schedule(&keyboard_tasklet);
 }
+#else
+static inline void set_leds(void) {}
+#endif
 
 static inline int vc_kbd_mode(struct kbd_struct * kbd, int flag)
 {