From: Jean Delvare <khali@linux-fr.org>
To: LMML <linux-media@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
Andy Walls <awalls@radix.net>, Hans Verkuil <hverkuil@xs4all.nl>,
Mike Isely <isely@pobox.com>
Subject: [PATCH 6/8] saa7134: Simplify handling of IR on AVerMedia Cardbus E506R
Date: Wed, 13 May 2009 21:52:44 +0200 [thread overview]
Message-ID: <20090513215244.0860aca1@hyperion.delvare> (raw)
In-Reply-To: <20090513214559.0f009231@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 E506R is one of these boards.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Oldrich Jedlicka <oldium.pro@seznam.cz>
---
linux/drivers/media/video/saa7134/saa7134-input.c | 33 +++------------------
1 file changed, 5 insertions(+), 28 deletions(-)
--- v4l-dvb.orig/linux/drivers/media/video/saa7134/saa7134-input.c 2009-04-30 10:38:49.000000000 +0200
+++ v4l-dvb/linux/drivers/media/video/saa7134/saa7134-input.c 2009-04-30 10:39:10.000000000 +0200
@@ -702,20 +702,6 @@ void saa7134_probe_i2c_ir(struct saa7134
.buf = NULL,
};
- 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) {
@@ -779,6 +765,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_501:
+ case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
+ info.addr = 0x40;
+ break;
}
if (init_data.name)
@@ -790,20 +780,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
next prev parent reply other threads:[~2009-05-13 19:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-13 19:45 [PATCH 0/8] ir-kbd-i2c conversion to the new i2c binding model (v3) Jean Delvare
2009-05-13 19:48 ` [PATCH 1/8] ir-kbd-i2c: Don't use i2c_client.name for our own needs Jean Delvare
2009-05-13 19:48 ` [PATCH 2/8] ir-kbd-i2c: Switch to the new-style device binding model Jean Delvare
2009-05-13 19:49 ` [PATCH 3/8] ir-kbd-i2c: Use initialization data Jean Delvare
2009-05-13 19:50 ` [PATCH 4/8] ir-kbd-i2c: Don't assume all IR receivers are supported Jean Delvare
2009-05-13 19:51 ` [PATCH 5/8] saa7134: Simplify handling of IR on MSI TV@nywhere Plus Jean Delvare
2009-05-13 19:52 ` Jean Delvare [this message]
2009-05-13 19:55 ` [PATCH 7/8] ivtv: Probe more I2C addresses for IR devices Jean Delvare
2009-05-13 19:56 ` [PATCH 8/8] pvrusb2: Instantiate ir_video I2C device by default Jean Delvare
2009-05-17 21:56 ` Mike Isely
2009-05-14 19:25 ` [PATCH 0/8] ir-kbd-i2c conversion to the new i2c binding model (v3) Oldřich Jedlička
2009-05-14 19:26 ` Jean Delvare
2009-05-17 21:55 ` Mike Isely
2009-05-18 7:18 ` 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=20090513215244.0860aca1@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