All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Henningsson <david.henningsson@canonical.com>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] DVB: TechnoTrend CT-3650 IR support
Date: Sun, 26 Dec 2010 20:38:06 +0100	[thread overview]
Message-ID: <4D17999E.4000500@canonical.com> (raw)
In-Reply-To: <4D1729DB.80406@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 1859 bytes --]

On 2010-12-26 12:41, Mauro Carvalho Chehab wrote:
> Hi David,
>
> Em 26-12-2010 07:14, David Henningsson escreveu:
>> Hi Linux-media,
>>
>> As a spare time project I bought myself a TT CT-3650, to see if I could get it working. Waling Dijkstra did write a IR&  CI patch for this model half a year ago, so I was hopeful. (Reference: http://www.mail-archive.com/linux-media@vger.kernel.org/msg19860.html )
>>
>> Having tested the patch, the IR is working (tested all keys via the "evtest" tool), however descrambling is NOT working.
>>
>> Waling's patch was reviewed but never merged. So I have taken the IR part of the patch, cleaned it up a little, and hopefully this part is ready for merging now. Patch is against linux-2.6.git.
>
> Could you please rebase it to work with the rc_core support? I suspect that you
> based it on a kernel older than .36, as the dvb_usb rc struct changed.

Ok, I have now done this, but I'm not completely satisfied, perhaps you 
can help out a little? I'm new to IR/RC stuff, but I feel I'm missing 
correct "repeat" functionality, i e, if you keep a key pressed it 
appears as separate key presses with whatever interval set as 
.rc_interval. (This was probably a problem with the old patch as well.) 
Is there any support for this is rc_core?

I'm attaching a temporary patch (just for review) so you know what I'm 
talking about.

> The better is to base it over the latest V4L/DVB/RC development git, available at:
> 	http://git.linuxtv.org/media_tree.git

Ok. I was probably confused with this entry: 
http://linuxtv.org/news.php?entry=2010-01-19.mchehab
telling me to base it on v4l-dvb.git, which is not updated for four 
months. However, http://git.linuxtv.org/ correctly lists the 
media_tree.git as the repository of choice.

Thanks for the review!

-- 
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic

[-- Attachment #2: 0001-DVB-IR-CT-3650.patch --]
[-- Type: text/x-patch, Size: 1878 bytes --]

>From 8c42121a08c5dabbd1a943cc1e5726ed99f0d957 Mon Sep 17 00:00:00 2001
From: David Henningsson <david.henningsson@canonical.com>
Date: Sun, 26 Dec 2010 14:23:58 +0100
Subject: [PATCH] DVB: IR support for CT-3650

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
 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


  reply	other threads:[~2010-12-26 19:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-26  9:14 [PATCH] DVB: TechnoTrend CT-3650 IR support David Henningsson
2010-12-26 11:41 ` Mauro Carvalho Chehab
2010-12-26 19:38   ` David Henningsson [this message]
2010-12-27  9:54     ` Mauro Carvalho Chehab
2010-12-27 15:54       ` David Henningsson
2010-12-27 16:51         ` Mauro Carvalho Chehab
2010-12-27 19:02           ` David Henningsson
2010-12-27 21:28             ` Mauro Carvalho Chehab
2010-12-29 12:04               ` David Henningsson
2010-12-29 12:37                 ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D17999E.4000500@canonical.com \
    --to=david.henningsson@canonical.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.