From patchwork Sat Apr 24 14:18:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wayne Thomas X-Patchwork-Id: 94847 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3OEIuiI025258 for ; Sat, 24 Apr 2010 14:18:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752096Ab0DXOSz (ORCPT ); Sat, 24 Apr 2010 10:18:55 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]:38647 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711Ab0DXOSy (ORCPT ); Sat, 24 Apr 2010 10:18:54 -0400 Received: by wwg30 with SMTP id 30so502052wwg.19 for ; Sat, 24 Apr 2010 07:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:cc:content-type; bh=WkVej034xOxq+ukwBIvYAbuvus40+WaadYfA4FcBmZo=; b=OzPdJVJgSsTNo4QCiWZ8mAQnNXtj/9OZBcyZe2ai4iU/pPIn5ZSbSs0T7L82TQxZt5 kciJMm+WZJfZu33XrlTYLkoWXVfymtnDBv39247VGDI51CorsarU+CTDyR/vYWCWcjbg XqO1vpnul2eHOHQCO3vKzM43anTaurNXU4Lx0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=s6lrRVGh/wU5oNs1ZuF1Jhv4fILcOSPLSPsPdT9lO8Br9x9g8rUWfOttqhqjSf0D/s RvM0lXSl1GRvBCf1enrvNGgbUaRAyyEFQznM+17wzxFSCPJenkTEn7/WlC3Iqtcm/Rms 1EGOmYsEFD3+QkzRG5ov1yiQpTY7TrwfbT+lY= MIME-Version: 1.0 Received: by 10.216.185.82 with SMTP id t60mr1886931wem.149.1272118731855; Sat, 24 Apr 2010 07:18:51 -0700 (PDT) Received: by 10.216.6.206 with HTTP; Sat, 24 Apr 2010 07:18:51 -0700 (PDT) Date: Sat, 24 Apr 2010 16:18:51 +0200 Message-ID: Subject: HID: expand hid-topseed driver to support BTC "Emprex 3009URF III Vista MCE Remote" From: Wayne Thomas To: jkosina@suse.cz, linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 24 Apr 2010 14:18:56 +0000 (UTC) diff -uprN linux-2.6.33-clean/drivers/hid/hid-ids.h linux/drivers/hid/hid-ids.h --- linux-2.6.33-clean/drivers/hid/hid-ids.h 2010-04-22 21:04:17.000000000 +0200 +++ linux/drivers/hid/hid-ids.h 2010-04-23 07:09:59.000000000 +0200 @@ -116,6 +116,9 @@ #define USB_VENDOR_ID_BERKSHIRE 0x0c98 #define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140 +#define USB_VENDOR_ID_BTC 0x046e +#define USB_DEVICE_ID_BTC_EMPREX_REMOTE 0x5578 + #define USB_VENDOR_ID_CH 0x068e #define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2 #define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4 diff -uprN linux-2.6.33-clean/drivers/hid/hid-topseed.c linux/drivers/hid/hid-topseed.c --- linux-2.6.33-clean/drivers/hid/hid-topseed.c 2010-04-22 20:48:43.000000000 +0200 +++ linux/drivers/hid/hid-topseed.c 2010-04-22 21:29:20.000000000 +0200 @@ -3,6 +3,9 @@ * * Copyright (c) 2008 Lev Babiev * based on hid-cherry driver + * + * Modified to also support BTC "Emprex 3009URF III Vista MCE Remote" + * */ /* @@ -24,23 +27,29 @@ static int ts_input_mapping(struct hid_d struct hid_field *field, struct hid_usage *usage, unsigned long **bit, int *max) { - if ((usage->hid & HID_USAGE_PAGE) != 0x0ffbc0000) + if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) return 0; switch (usage->hid & HID_USAGE) { - case 0x00d: ts_map_key_clear(KEY_HOME); break; - case 0x024: ts_map_key_clear(KEY_MENU); break; - case 0x025: ts_map_key_clear(KEY_TV); break; - case 0x048: ts_map_key_clear(KEY_RED); break; - case 0x047: ts_map_key_clear(KEY_GREEN); break; - case 0x049: ts_map_key_clear(KEY_YELLOW); break; - case 0x04a: ts_map_key_clear(KEY_BLUE); break; - case 0x04b: ts_map_key_clear(KEY_ANGLE); break; - case 0x04c: ts_map_key_clear(KEY_LANGUAGE); break; - case 0x04d: ts_map_key_clear(KEY_SUBTITLE); break; - case 0x031: ts_map_key_clear(KEY_AUDIO); break; - case 0x032: ts_map_key_clear(KEY_TEXT); break; - case 0x033: ts_map_key_clear(KEY_CHANNEL); break; + case 0x00d: ts_map_key_clear(KEY_HOME); break; + case 0x024: ts_map_key_clear(KEY_MENU); break; + case 0x025: ts_map_key_clear(KEY_TV); break; + case 0x031: ts_map_key_clear(KEY_AUDIO); break; + case 0x032: ts_map_key_clear(KEY_TEXT); break; + case 0x033: ts_map_key_clear(KEY_CHANNEL); break; + case 0x047: ts_map_key_clear(KEY_MP3); break; + case 0x048: ts_map_key_clear(KEY_DVD); break; + case 0x049: ts_map_key_clear(KEY_CAMERA); break; + case 0x04a: ts_map_key_clear(KEY_VIDEO); break; + case 0x04b: ts_map_key_clear(KEY_ANGLE); break; + case 0x04c: ts_map_key_clear(KEY_LANGUAGE); break; + case 0x04d: ts_map_key_clear(KEY_SUBTITLE); break; + case 0x050: ts_map_key_clear(KEY_RADIO); break; + case 0x05b: ts_map_key_clear(KEY_RED); break; + case 0x05c: ts_map_key_clear(KEY_GREEN); break; + case 0x05d: ts_map_key_clear(KEY_YELLOW); break; + case 0x05e: ts_map_key_clear(KEY_BLUE); break; + case 0x05a: ts_map_key_clear(KEY_TEXT); break; default: return 0; } @@ -50,6 +59,7 @@ static int ts_input_mapping(struct hid_d static const struct hid_device_id ts_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) }, + { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) }, { } }; MODULE_DEVICE_TABLE(hid, ts_devices); diff -uprN linux-2.6.33-clean/drivers/hid/Kconfig linux/drivers/hid/Kconfig --- linux-2.6.33-clean/drivers/hid/Kconfig 2010-04-22 20:48:43.000000000 +0200 +++ linux/drivers/hid/Kconfig 2010-04-22 21:29:20.000000000 +0200 @@ -80,6 +80,13 @@ config HID_BELKIN ---help--- Support for Belkin Flip KVM and Wireless keyboard. +config HID_BTC + tristate "BTC Emprex remote control support" if EMBEDDED + depends on USB_HID + default y + ---help--- + Say Y if you have a BTC Emprex remote control. + config HID_CHERRY tristate "Cherry" if EMBEDDED depends on USB_HID diff -uprN linux-2.6.33-clean/drivers/hid/Makefile linux/drivers/hid/Makefile --- linux-2.6.33-clean/drivers/hid/Makefile 2010-04-22 20:48:43.000000000 +0200 +++ linux/drivers/hid/Makefile 2010-04-22 21:29:20.000000000 +0200 @@ -22,6 +22,7 @@ endif obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o obj-$(CONFIG_HID_APPLE) += hid-apple.o obj-$(CONFIG_HID_BELKIN) += hid-belkin.o +obj-$(CONFIG_HID_BTC) += hid-topseed.o obj-$(CONFIG_HID_CHERRY) += hid-cherry.o obj-$(CONFIG_HID_CHICONY) += hid-chicony.o obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o