From patchwork Sun Dec 26 19:38:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 433181 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBRKCV52025997 for ; Mon, 27 Dec 2010 20:14:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752578Ab0LZTiJ (ORCPT ); Sun, 26 Dec 2010 14:38:09 -0500 Received: from adelie.canonical.com ([91.189.90.139]:45830 "EHLO adelie.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752508Ab0LZTiI (ORCPT ); Sun, 26 Dec 2010 14:38:08 -0500 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1PWwPu-0008IE-QI; Sun, 26 Dec 2010 19:38:06 +0000 Received: from c-83-233-18-148.cust.bredband2.com ([83.233.18.148] helo=[192.168.8.102]) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PWwPu-0000N4-Jc; Sun, 26 Dec 2010 19:38:06 +0000 Message-ID: <4D17999E.4000500@canonical.com> Date: Sun, 26 Dec 2010 20:38:06 +0100 From: David Henningsson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: Mauro Carvalho Chehab CC: linux-media@vger.kernel.org Subject: Re: [PATCH] DVB: TechnoTrend CT-3650 IR support References: <4D170785.1070306@canonical.com> <4D1729DB.80406@infradead.org> In-Reply-To: <4D1729DB.80406@infradead.org> 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 (demeter1.kernel.org [140.211.167.41]); Mon, 27 Dec 2010 20:14:04 +0000 (UTC) From 8c42121a08c5dabbd1a943cc1e5726ed99f0d957 Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Sun, 26 Dec 2010 14:23:58 +0100 Subject: [PATCH] DVB: IR support for CT-3650 Signed-off-by: David Henningsson --- drivers/media/dvb/dvb-usb/ttusb2.c | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) mode change 100644 => 100755 debian/rules diff --git a/debian/rules b/debian/rules old mode 100644 new mode 100755 diff --git a/drivers/media/dvb/dvb-usb/ttusb2.c b/drivers/media/dvb/dvb-usb/ttusb2.c index a6de489..ded8a4b 100644 --- a/drivers/media/dvb/dvb-usb/ttusb2.c +++ b/drivers/media/dvb/dvb-usb/ttusb2.c @@ -128,6 +128,27 @@ static struct i2c_algorithm ttusb2_i2c_algo = { .functionality = ttusb2_i2c_func, }; +/* command to poll IR receiver (copied from pctv452e.c) */ +#define CMD_GET_IR_CODE 0x1b + +/* IR */ +static int tt3650_rc_query(struct dvb_usb_device *d) +{ + int ret; + u8 rx[9]; /* A CMD_GET_IR_CODE reply is 9 bytes long */ + ret = ttusb2_msg(d, CMD_GET_IR_CODE, NULL, 0, rx, sizeof(rx)); + if (ret != 0) + return ret; + + if (rx[8] & 0x01) { + /* got a "press" event */ + deb_info("%s: cmd=0x%02x sys=0x%02x\n", __func__, rx[2], rx[3]); + rc_keydown(d->rc_dev, rx[2], 0); + } + return 0; +} + + /* Callbacks for DVB USB */ static int ttusb2_identify_state (struct usb_device *udev, struct dvb_usb_device_properties *props, struct dvb_usb_device_description **desc, @@ -345,6 +366,13 @@ static struct dvb_usb_device_properties ttusb2_properties_ct3650 = { .size_of_priv = sizeof(struct ttusb2_state), + .rc.core = { + .rc_interval = 250, + .rc_codes = RC_MAP_TT_1500, + .rc_query = tt3650_rc_query, + .allowed_protos = RC_TYPE_UNKNOWN, + }, + .num_adapters = 1, .adapter = { { -- 1.7.1