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>
Subject: [PATCH 5/6] saa7134: Simplify handling of IR on MSI TV@nywhere Plus
Date: Fri, 17 Apr 2009 22:33:30 +0200	[thread overview]
Message-ID: <20090417223330.441162e6@hyperion.delvare> (raw)
In-Reply-To: <20090417222927.7a966350@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 MSI
TV@nywhere Plus is one of these boards.

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

--- v4l-dvb.orig/linux/drivers/media/video/saa7134/saa7134-input.c	2009-04-17 14:53:35.000000000 +0200
+++ v4l-dvb/linux/drivers/media/video/saa7134/saa7134-input.c	2009-04-17 15:10:55.000000000 +0200
@@ -692,9 +692,6 @@ void saa7134_probe_i2c_ir(struct saa7134
 		I2C_CLIENT_END
 	};
 
-	const unsigned short addr_list_msi[] = {
-		0x30, I2C_CLIENT_END
-	};
 	struct i2c_msg msg_msi = {
 		.addr = 0x50,
 		.flags = I2C_M_RD,
@@ -748,6 +745,15 @@ void saa7134_probe_i2c_ir(struct saa7134
 		init_data.name = "MSI TV@nywhere Plus";
 		init_data.get_key = get_key_msi_tvanywhere_plus;
 		init_data.ir_codes = ir_codes_msi_tvanywhere_plus;
+		info.addr = 0x30;
+		/* MSI TV@nywhere Plus controller doesn't seem to
+		   respond to probes unless we read something from
+		   an existing device. Weird...
+		   REVISIT: might no longer be needed */
+		rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1);
+		dprintk(KERN_DEBUG "probe 0x%02x @ %s: %s\n",
+			msg_msi.addr, dev->i2c_adap.name,
+			(1 == rc) ? "yes" : "no");
 		break;
 	case SAA7134_BOARD_HAUPPAUGE_HVR1110:
 		init_data.name = "HVR 1110";
@@ -767,18 +773,14 @@ void saa7134_probe_i2c_ir(struct saa7134
 
 	if (init_data.name)
 		info.platform_data = &init_data;
-	client = i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
-	if (client)
+	/* No need to probe if address is known */
+	if (info.addr) {
+		i2c_new_device(&dev->i2c_adap, &info);
 		return;
+	}
 
-	/* MSI TV@nywhere Plus controller doesn't seem to
-	   respond to probes unless we read something from
-	   an existing device. Weird... */
-	rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1);
-	dprintk(KERN_DEBUG "probe 0x%02x @ %s: %s\n",
-		msg_msi.addr, dev->i2c_adap.name,
-		(1 == rc) ? "yes" : "no");
-	client = i2c_new_probed_device(&dev->i2c_adap, &info, addr_list_msi);
+	/* Address not known, fallback to probing */
+	client = i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
 	if (client)
 		return;
 

-- 
Jean Delvare

  parent reply	other threads:[~2009-04-17 20:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17 20:29 [PATCH 0/6] ir-kbd-i2c conversion to the new i2c binding model (v2) Jean Delvare
2009-04-17 20:30 ` [PATCH 1/6] ir-kbd-i2c: Don't use i2c_client.name for our own needs Jean Delvare
2009-04-17 20:31 ` [PATCH 2/6] ir-kbd-i2c: Switch to the new-style device binding model Jean Delvare
2009-04-17 23:35   ` Mike Isely
2009-04-18  9:25     ` Jean Delvare
2009-04-18 13:16       ` Jean Delvare
2009-04-18 13:53         ` Mike Isely
2009-04-23  9:00           ` Jean Delvare
2009-04-24  2:44             ` Mike Isely
2009-05-02  1:30               ` Mike Isely
2009-05-02  7:12                 ` Jean Delvare
2009-05-11  8:17                   ` Mauro Carvalho Chehab
2009-04-17 20:32 ` [PATCH 3/6] ir-kbd-i2c: Use initialization data Jean Delvare
2009-04-17 20:32 ` [PATCH 4/6] ir-kbd-i2c: Don't assume all IR receivers are supported Jean Delvare
2009-04-17 20:33 ` Jean Delvare [this message]
2009-04-17 20:34 ` [PATCH 6/6] saa7134: Simplify handling of IR on AVerMedia Cardbus E506R Jean Delvare
2009-04-29 12:29 ` [PATCH 0/6] ir-kbd-i2c conversion to the new i2c binding model (v2) Jean Delvare
2009-04-29 22:40   ` hermann pitton
2009-04-30  2:58   ` Devin Heitmueller
  -- strict thread matches above, loose matches on Subject: below --
2009-04-04 12:24 [PATCH 0/6] ir-kbd-i2c conversion to the new i2c binding model Jean Delvare
2009-04-04 12:30 ` [PATCH 5/6] saa7134: Simplify handling of IR on MSI TV@nywhere Plus 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=20090417223330.441162e6@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=linux-media@vger.kernel.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