diff options
author | codeworkx <daniel.hillenbrand@codeworkx.de> | 2012-06-02 13:09:29 +0200 |
---|---|---|
committer | codeworkx <daniel.hillenbrand@codeworkx.de> | 2012-06-02 13:09:29 +0200 |
commit | c6da2cfeb05178a11c6d062a06f8078150ee492f (patch) | |
tree | f3b4021d252c52d6463a9b3c1bb7245e399b009c /drivers/hid | |
parent | c6d7c4dbff353eac7919342ae6b3299a378160a6 (diff) | |
download | kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.zip kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.tar.gz kernel_samsung_smdk4412-c6da2cfeb05178a11c6d062a06f8078150ee492f.tar.bz2 |
samsung update 1
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-core.c | 3 | ||||
-rw-r--r-- | drivers/hid/hid-debug.c | 5 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 2 | ||||
-rw-r--r-- | drivers/hid/hid-input.c | 7 | ||||
-rw-r--r-- | drivers/hid/hid-magicmouse.c | 13 | ||||
-rw-r--r-- | drivers/hid/hid-multitouch.c | 10 | ||||
-rw-r--r-- | drivers/hid/hid-samsung.c | 59 |
7 files changed, 92 insertions, 7 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 763797d..fce12de 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1265,9 +1265,11 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) hid_warn(hdev, "can't create sysfs report descriptor attribute err: %d\n", ret); + /* [Security Log] hid_info(hdev, "%s: %s HID v%x.%02x %s [%s] on %s\n", buf, bus, hdev->version >> 8, hdev->version & 0xff, type, hdev->name, hdev->phys); + */ return 0; } @@ -1479,6 +1481,7 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS) }, { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD) }, { HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) }, { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER) }, diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index bae4874..9a243ca 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -450,6 +450,11 @@ void hid_dump_field(struct hid_field *field, int n, struct seq_file *f) { seq_printf(f, "Logical("); hid_resolv_usage(field->logical, f); seq_printf(f, ")\n"); } + if (field->application) { + tab(n, f); + seq_printf(f, "Application("); + hid_resolv_usage(field->application, f); seq_printf(f, ")\n"); + } tab(n, f); seq_printf(f, "Usage(%d)\n", field->maxusage); for (j = 0; j < field->maxusage; j++) { tab(n+2, f); hid_resolv_usage(field->usage[j].hid, f); seq_printf(f, "\n"); diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 206f750..f48815f 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -582,7 +582,9 @@ #define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17 #define USB_VENDOR_ID_SAMSUNG 0x0419 +#define USB_VENDOR_ID_SAMSUNG_ELECTRONICS 0x04e8 #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001 +#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD 0x7021 #define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600 #define USB_VENDOR_ID_SIGMA_MICRO 0x1c4f diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 6559e2e..1483c82 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -971,6 +971,9 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) * UGCI) cram a lot of unrelated inputs into the * same interface. */ hidinput->report = report; + if (hid->driver->input_register && + hid->driver->input_register(hid, hidinput)) + goto out_cleanup; if (input_register_device(hidinput->input)) goto out_cleanup; hidinput = NULL; @@ -978,6 +981,10 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) } } + if (hidinput && hid->driver->input_register && + hid->driver->input_register(hid, hidinput)) + goto out_cleanup; + if (hidinput && input_register_device(hidinput->input)) goto out_cleanup; diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index 56d0539..c696f7f 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c @@ -365,8 +365,10 @@ static int magicmouse_raw_event(struct hid_device *hdev, return 1; } -static void magicmouse_setup_input(struct input_dev *input, struct hid_device *hdev) +static int magicmouse_setup_input(struct hid_device *hdev, struct hid_input *hi) { + struct input_dev *input = hi->input; + __set_bit(EV_KEY, input->evbit); if (input->id.product == USB_DEVICE_ID_APPLE_MAGICMOUSE) { @@ -426,6 +428,8 @@ static void magicmouse_setup_input(struct input_dev *input, struct hid_device *h __set_bit(EV_MSC, input->evbit); __set_bit(MSC_RAW, input->mscbit); } + + return 0; } static int magicmouse_input_mapping(struct hid_device *hdev, @@ -478,12 +482,6 @@ static int magicmouse_probe(struct hid_device *hdev, goto err_free; } - /* We do this after hid-input is done parsing reports so that - * hid-input uses the most natural button and axis IDs. - */ - if (msc->input) - magicmouse_setup_input(msc->input, hdev); - if (id->product == USB_DEVICE_ID_APPLE_MAGICMOUSE) report = hid_register_report(hdev, HID_INPUT_REPORT, MOUSE_REPORT_ID); @@ -548,6 +546,7 @@ static struct hid_driver magicmouse_driver = { .remove = magicmouse_remove, .raw_event = magicmouse_raw_event, .input_mapping = magicmouse_input_mapping, + .input_register = magicmouse_setup_input, }; static int __init magicmouse_init(void) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 685d8e4..2074cb3 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -213,6 +213,16 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, struct mt_class *cls = td->mtclass; __s32 quirks = cls->quirks; + /* Only map fields from TouchScreen or TouchPad collections. + * We need to ignore fields that belong to other collections + * such as Mouse that might have the same GenericDesktop usages. */ + if (field->application == HID_DG_TOUCHSCREEN) + set_bit(INPUT_PROP_DIRECT, hi->input->propbit); + else if (field->application == HID_DG_TOUCHPAD) + set_bit(INPUT_PROP_POINTER, hi->input->propbit); + else + return 0; + switch (usage->hid & HID_USAGE_PAGE) { case HID_UP_GENDESK: diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c index 3c1fd8a..3d19fd4 100644 --- a/drivers/hid/hid-samsung.c +++ b/drivers/hid/hid-samsung.c @@ -131,6 +131,61 @@ static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev, return 1; } +static int samsung_kbd_input_mapping(struct hid_device *hdev, + struct hid_input *hi, struct hid_field *field, struct hid_usage *usage, + unsigned long **bit, int *max) +{ + if (!(HID_UP_CONSUMER == (usage->hid & HID_USAGE_PAGE) || + HID_UP_KEYBOARD == (usage->hid & HID_USAGE_PAGE))) + return 0; + + dbg_hid("samsung wireless keyboard input mapping event [0x%x]\n", + usage->hid & HID_USAGE); + + if (HID_UP_KEYBOARD == (usage->hid & HID_USAGE_PAGE)) { + switch (usage->hid & HID_USAGE) { + set_bit(EV_REP, hi->input->evbit); + /* Only for UK keyboard */ + /* key found */ + case 0x32: samsung_kbd_mouse_map_key_clear(KEY_KBDILLUMTOGGLE); break; + case 0x64: samsung_kbd_mouse_map_key_clear(KEY_BACKSLASH); break; + default: + return 0; + } + } + + if (HID_UP_CONSUMER == (usage->hid & HID_USAGE_PAGE)) { + switch (usage->hid & HID_USAGE) { + /* report 2 */ + /* MENU */ + case 0x040: samsung_kbd_mouse_map_key_clear(KEY_MENU); break; + case 0x18a: samsung_kbd_mouse_map_key_clear(KEY_MAIL); break; + case 0x196: samsung_kbd_mouse_map_key_clear(KEY_WWW); break; + case 0x19e: samsung_kbd_mouse_map_key_clear(KEY_SCREENLOCK); break; + case 0x221: samsung_kbd_mouse_map_key_clear(KEY_SEARCH); break; + case 0x223: samsung_kbd_mouse_map_key_clear(KEY_HOMEPAGE); break; + /* RECENTAPPS */ + case 0x301: samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY1); break; + /* APPLICATION */ + case 0x302: samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY2); break; + /* Voice search */ + case 0x305: samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY4); break; + /* QPANEL on/off */ + case 0x306: samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY5); break; + /* SIP on/off */ + case 0x307: samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY3); break; + /* LANG */ + case 0x308: samsung_kbd_mouse_map_key_clear(KEY_LANGUAGE); break; + case 0x30a: samsung_kbd_mouse_map_key_clear(KEY_BRIGHTNESSDOWN); break; + case 0x30b: samsung_kbd_mouse_map_key_clear(KEY_BRIGHTNESSUP); break; + default: + return 0; + } + } + + return 1; +} + static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { @@ -148,6 +203,9 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi, if (USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE == hdev->product) ret = samsung_kbd_mouse_input_mapping(hdev, hi, field, usage, bit, max); + else if (USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD == hdev->product) + ret = samsung_kbd_input_mapping(hdev, + hi, field, usage, bit, max); return ret; } @@ -186,6 +244,7 @@ err_free: static const struct hid_device_id samsung_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD) }, { } }; MODULE_DEVICE_TABLE(hid, samsung_devices); |