public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: LMML <linux-media@vger.kernel.org>
Cc: Andy Walls <awalls@radix.net>, Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Mike Isely <isely@pobox.com>
Subject: [PATCH 6/6] saa7134: Simplify handling of IR on AVerMedia Cardbus
Date: Sat, 4 Apr 2009 14:31:37 +0200	[thread overview]
Message-ID: <20090404143137.46899c20@hyperion.delvare> (raw)
In-Reply-To: <20090404142427.6e81f316@hyperion.delvare>

Now that we instantiate I2C IR devices explicitly, we can skip probing
altogether on boards where the I2C IR device address is known. The
AVerMedia Cardbus are two of these boards.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
 linux/drivers/media/video/saa7134/saa7134-input.c |   35 +++------------------
 1 file changed, 5 insertions(+), 30 deletions(-)

--- v4l-dvb.orig/linux/drivers/media/video/saa7134/saa7134-input.c	2009-04-04 10:41:44.000000000 +0200
+++ v4l-dvb/linux/drivers/media/video/saa7134/saa7134-input.c	2009-04-04 10:47:10.000000000 +0200
@@ -691,22 +691,6 @@ void saa7134_probe_i2c_ir(struct saa7134
 		I2C_CLIENT_END
 	};
 
-	unsigned char subaddr, data;
-	struct i2c_msg msg_avermedia[] = { {
-		.addr = 0x40,
-		.flags = 0,
-		.len = 1,
-		.buf = &subaddr,
-	}, {
-		.addr = 0x40,
-		.flags = I2C_M_RD,
-		.len = 1,
-		.buf = &data,
-	} };
-
-	struct i2c_client *client;
-	int rc;
-
 	if (disable_ir) {
 		dprintk("IR has been disabled, not probing for i2c remote\n");
 		return;
@@ -753,6 +737,10 @@ void saa7134_probe_i2c_ir(struct saa7134
 		init_data.get_key = get_key_beholdm6xx;
 		init_data.ir_codes = ir_codes_behold;
 		break;
+	case SAA7134_BOARD_AVERMEDIA_CARDBUS:
+	case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
+		info.addr = 0x40;
+		break;
 	}
 
 	if (init_data.name)
@@ -764,20 +752,7 @@ void saa7134_probe_i2c_ir(struct saa7134
 	}
 
 	/* Address not known, fallback to probing */
-	client = i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
-	if (client)
-		return;
-
-	/* Special case for AVerMedia Cardbus remote */
-	subaddr = 0x0d;
-	rc = i2c_transfer(&dev->i2c_adap, msg_avermedia, 2);
-	dprintk(KERN_DEBUG "probe 0x%02x/0x%02x @ %s: %s\n",
-		msg_avermedia[0].addr, subaddr, dev->i2c_adap.name,
-		(2 == rc) ? "yes" : "no");
-	if (2 == rc) {
-		info.addr = msg_avermedia[0].addr;
-		i2c_new_device(&dev->i2c_adap, &info);
-	}
+	i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
 }
 
 static int saa7134_rc5_irq(struct saa7134_dev *dev)

-- 
Jean Delvare

  parent reply	other threads:[~2009-04-04 12:31 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-04 12:24 [PATCH 0/6] ir-kbd-i2c conversion to the new i2c binding model Jean Delvare
2009-04-04 12:26 ` [PATCH 1/6] cx18: Fix the handling of i2c bus registration error Jean Delvare
2009-04-04 12:46   ` Andy Walls
2009-04-04 14:23     ` Jean Delvare
2009-04-04 22:30       ` Andy Walls
2009-04-07  9:31     ` Jean Delvare
2009-04-07 12:14       ` Andy Walls
2009-04-04 12:27 ` [PATCH 2/6] ir-kbd-i2c: Don't use i2c_client.name for our own needs Jean Delvare
2009-04-04 12:28 ` [PATCH 3/6] ir-kbd-i2c: Switch to the new-style device binding model Jean Delvare
2009-04-04 13:42   ` Andy Walls
2009-04-04 16:05     ` Mike Isely
2009-04-04 22:24       ` Andy Walls
2009-04-04 22:39         ` Andy Walls
2009-04-04 22:51     ` Jean Delvare
2009-04-05  1:50       ` Andy Walls
2009-04-05 13:08         ` Jean Delvare
2009-04-05 18:13           ` Andy Walls
2009-04-04 15:51   ` Mike Isely
2009-04-04 23:05     ` Jean Delvare
2009-04-04 23:29       ` Mike Isely
2009-04-05 14:18         ` Jean Delvare
2009-04-05 18:33           ` Mike Isely
2009-04-05 20:19             ` Andy Walls
2009-04-06  3:48               ` Trent Piepho
2009-04-06  3:53             ` pvrusb2 IR changes coming [was: [PATCH 3/6] ir-kbd-i2c: Switch to the new-style device binding model] Mike Isely
2009-04-05  5:46       ` [PATCH 3/6] ir-kbd-i2c: Switch to the new-style device binding model Hans Verkuil
2009-04-05  9:14         ` Mauro Carvalho Chehab
2009-04-05 12:44           ` Andy Walls
2009-04-06 13:08             ` Mauro Carvalho Chehab
2009-04-05 14:05         ` Jean Delvare
2009-04-05 19:35           ` Andy Walls
2009-04-06  9:04             ` Jean Delvare
2009-04-06 12:06               ` Andy Walls
2009-04-05 14:37         ` Janne Grunau
2009-04-05 16:37           ` Jean Delvare
2009-04-05 16:58             ` Janne Grunau
2009-04-05 17:39           ` Andy Walls
2009-04-05 18:31             ` Janne Grunau
2009-04-05 18:58               ` Andy Walls
2009-04-05 20:22                 ` Jean Delvare
2009-04-05 21:22                   ` hermann pitton
2009-04-05 22:00                     ` Andy Walls
2009-04-05 22:21                       ` hermann pitton
2009-04-06  1:49                       ` hermann pitton
2009-04-06  1:51                       ` Mauro Carvalho Chehab
2009-04-06  2:52                         ` Mike Isely
2009-04-06  3:26                           ` hermann pitton
2009-04-06  4:44                           ` Trent Piepho
2009-04-06 12:31                           ` Mauro Carvalho Chehab
2009-04-06  8:40                     ` Jean Delvare
2009-04-06 21:10                       ` hermann pitton
2009-04-07  9:27                         ` Jean Delvare
2009-04-08  3:02                           ` CityK
2009-04-08 11:31                             ` Mauro Carvalho Chehab
2009-04-12 17:37                               ` CityK
2009-04-12 23:35                                 ` hermann pitton
2009-04-09 19:15                         ` Oldrich Jedlicka
2009-04-17 13:42                           ` Jean Delvare
2009-04-06 13:13               ` Jarod Wilson
2009-04-05 18:48         ` Mike Isely
2009-04-06 10:54           ` Mauro Carvalho Chehab
2009-04-04 12:29 ` [PATCH 4/6] ir-kbd-i2c: Use initialization data Jean Delvare
2009-04-04 12:30 ` [PATCH 5/6] saa7134: Simplify handling of IR on MSI TV@nywhere Plus Jean Delvare
2009-04-04 12:31 ` Jean Delvare [this message]
2009-04-04 15:58 ` [PATCH 0/6] ir-kbd-i2c conversion to the new i2c binding model Mike Isely
2009-04-05 10:01 ` Mauro Carvalho Chehab
2009-04-05 14:40   ` Jean Delvare
2009-04-05 18:40     ` Mike Isely
2009-04-06  0:22     ` Test results for ir-kbd-i2c.c changes (Re: [PATCH 0/6] ir-kbd-i2c conversion to the new i2c binding model) Andy Walls
2009-04-06  8:54       ` Jean Delvare
2009-04-06 11:56         ` Andy Walls
2009-04-06 11:11           ` Jean Delvare
  -- strict thread matches above, loose matches on Subject: below --
2009-04-09 21:12 [PATCH 6/6] saa7134: Simplify handling of IR on AVerMedia Cardbus Oldrich Jedlicka
2009-04-17 13:45 ` Jean Delvare
2009-04-17 16:16   ` Oldrich Jedlicka
2009-04-17 16:57     ` Jean Delvare

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=20090404143137.46899c20@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=awalls@radix.net \
    --cc=hverkuil@xs4all.nl \
    --cc=isely@pobox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox