From patchwork Tue Jun 15 16:23:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zidlicky X-Patchwork-Id: 106247 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 o5FGLCKn014900 for ; Tue, 15 Jun 2010 16:21:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756863Ab0FOQUp (ORCPT ); Tue, 15 Jun 2010 12:20:45 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:43744 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756421Ab0FOQUm (ORCPT ); Tue, 15 Jun 2010 12:20:42 -0400 Received: by bwz7 with SMTP id 7so2784200bwz.19 for ; Tue, 15 Jun 2010 09:20:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:received:date:from:to :subject:message-id:mime-version:content-type:content-disposition :user-agent; bh=MayzqhwEv0/nJG5iwUR7urwldZKvTkj8WO0z9oFrzNo=; b=TBxzKc+iEbFjAyQgSKA5O12nDCvJ2dzi/rw8vt9AtMj1Unv5cnRBvkE5qQTrPEmizs diFI4BCP+YxHU0cXaGRh9xyWSvUATqrmJlZ46pgB5iBkNJlwgvgNtTXAHaAtEjICzNcS L4VwfUIGbHLrZClYRS9h5b338ED6/JTewnzXw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=waEwd5HtcVBZ4NVDFmNcx5LufQ2gv6P10KQ/YeE5mu+42WrxEhipr17U5A7jyw9q/2 pjeqRbZPMBBq6yocaROHF8MAGFw6KaSfmKMrW3DE43jA2Nrh4umocwpFCNs2F3TGsus/ Ifz7dtUps+w1MGnUoMYxxxmKCsYaTmtszexcY= Received: by 10.204.79.214 with SMTP id q22mr5607558bkk.109.1276618840704; Tue, 15 Jun 2010 09:20:40 -0700 (PDT) Received: from localhost.localdomain (184.121.113.82.net.de.o2.com [82.113.121.184]) by mx.google.com with ESMTPS id z17sm25069470bkx.18.2010.06.15.09.20.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 15 Jun 2010 09:20:40 -0700 (PDT) Received: from rz by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1OOYun-0001vq-Cf for linux-media@vger.kernel.org; Tue, 15 Jun 2010 18:23:05 +0200 Date: Tue, 15 Jun 2010 18:23:05 +0200 From: Richard Zidlicky To: linux-media@vger.kernel.org Subject: [PATCH] support for Hauppauge WinTV MiniStic IR remote Message-ID: <20100615162305.GA4585@linux-m68k.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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]); Tue, 15 Jun 2010 16:21:28 +0000 (UTC) --- linux-2.6.34/drivers/media/dvb/siano/smsir.h.rz 2010-06-11 11:24:20.000000000 +0200 +++ linux-2.6.34/drivers/media/dvb/siano/smsir.h 2010-06-11 01:12:54.000000000 +0200 @@ -30,6 +30,7 @@ enum ir_kb_type { SMS_IR_KB_DEFAULT_TV, + SMS_IR_KB_HCW_DSR0112, SMS_IR_KB_HCW_SILVER }; --- linux-2.6.34/drivers/media/dvb/siano/smsir.c.rz 2010-06-11 10:07:32.000000000 +0200 +++ linux-2.6.34/drivers/media/dvb/siano/smsir.c 2010-06-15 18:08:37.000000000 +0200 @@ -54,6 +54,34 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, + [SMS_IR_KB_HCW_DSR0112] = { + .ir_protocol = IR_RC5, + .rc5_kbd_address = KEYBOARD_ADDRESS_LIGHTING, + .keyboard_layout_map = { + KEY_0, KEY_1, KEY_2, + KEY_3, KEY_4, KEY_5, + KEY_6, KEY_7, KEY_8, + KEY_9, KEY_TEXT, KEY_RED, + KEY_RADIO, KEY_MENU, + KEY_SUBTITLE, + KEY_MUTE, KEY_VOLUMEUP, + KEY_VOLUMEDOWN, KEY_PREVIOUS, 0, + KEY_UP, KEY_DOWN, KEY_LEFT, + KEY_RIGHT, KEY_VIDEO, KEY_AUDIO, + KEY_MHP, KEY_EPG, KEY_TV, + 0, KEY_NEXTSONG, KEY_EXIT, + KEY_CHANNELUP, KEY_CHANNELDOWN, + KEY_CHANNEL, 0, + KEY_PREVIOUSSONG, KEY_ENTER, + KEY_SLEEP, 0, 0, KEY_BLUE, + 0, 0, 0, 0, KEY_GREEN, 0, + KEY_PAUSE, 0, KEY_REWIND, + 0, KEY_FASTFORWARD, KEY_PLAY, + KEY_STOP, KEY_RECORD, + KEY_YELLOW, 0, 0, KEY_SELECT, + KEY_ZOOM, KEY_POWER, 0, 0 + } + }, [SMS_IR_KB_HCW_SILVER] = { .ir_protocol = IR_RC5, .rc5_kbd_address = KEYBOARD_ADDRESS_LIGHTING1, @@ -120,6 +148,7 @@ sms_log("kernel input keycode (from ir) %d", keycode); input_report_key(coredev->ir.input_dev, keycode, 1); + input_report_key(coredev->ir.input_dev, keycode, 0); input_sync(coredev->ir.input_dev); } @@ -247,6 +276,8 @@ int sms_ir_init(struct smscore_device_t *coredev) { struct input_dev *input_dev; + int i; + u16 *key_map; sms_log("Allocating input device"); input_dev = input_allocate_device(); @@ -278,7 +309,14 @@ /* Key press events only */ input_dev->evbit[0] = BIT_MASK(EV_KEY); - input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0); + + key_map = keyboard_layout_maps[coredev->ir.ir_kb_type].keyboard_layout_map; + + memset (input_dev->keybit, 0, sizeof(input_dev->keybit)); + for (i=0; ikeybit); + } sms_log("Input device (IR) %s is set for key events", input_dev->name); --- linux-2.6.34/drivers/media/dvb/siano/sms-cards.c.rz 2010-06-09 14:37:19.000000000 +0200 +++ linux-2.6.34/drivers/media/dvb/siano/sms-cards.c 2010-06-11 01:08:49.000000000 +0200 @@ -64,6 +64,8 @@ .type = SMS_NOVA_B0, .fw[DEVICE_MODE_ISDBT_BDA] = "sms1xxx-hcw-55xxx-isdbt-02.fw", .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw", + .ir_kb_type = SMS_IR_KB_HCW_DSR0112, + .board_cfg.ir = 4, .board_cfg.leds_power = 26, .board_cfg.led0 = 27, .board_cfg.led1 = 28,