summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-01 10:06:12 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-03 15:57:28 -0200
commit77e97ba2da47fe75bb9a835bb43a29e046c60f99 (patch)
tree755a0d0ed57f9a1fc3903be86d54d9fa8d2fec0f
parent0d88d0916b988d37edac35407688bc4b009c916b (diff)
[media] cx231xx: disable I2C errors during i2c_scan
Otherwise, it would produce lots of useless messages like: cx231xx: cx231xx_send_usb_command: failed with status --32 After this patch, I2C scan will produce an useful report: [ 9494.050807] cx231xx: i2c_scan: checking for I2C devices on port=0 .. [ 9494.074928] cx231xx: i2c scan: Completed Checking for I2C devices on port=0. [ 9494.074936] cx231xx: i2c_scan: checking for I2C devices on port=3 .. [ 9494.098934] cx231xx: i2c scan: Completed Checking for I2C devices on port=3. [ 9494.098942] cx231xx: i2c_scan: checking for I2C devices on port=2 .. [ 9494.118440] cx231xx: i2c scan: Completed Checking for I2C devices on port=2. [ 9494.118448] cx231xx: i2c_scan: checking for I2C devices on port=4 .. [ 9494.141889] cx231xx: i2c scan: Completed Checking for I2C devices on port=4. [ 9494.060182] cx231xx: i2c scan: found device @ 0x40 [???] [ 9494.062953] cx231xx: i2c scan: found device @ 0x60 [colibri] [ 9494.066071] cx231xx: i2c scan: found device @ 0x88 [hammerhead] [ 9494.067383] cx231xx: i2c scan: found device @ 0x98 [???] [ 9494.090113] cx231xx: i2c scan: found device @ 0xa0 [eeprom] [ 9494.106463] cx231xx: i2c scan: found device @ 0x60 [colibri] [ 9494.113762] cx231xx: i2c scan: found device @ 0xc0 [tuner] [ 9494.121882] cx231xx: i2c scan: found device @ 0x20 [???] Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-core.c2
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-i2c.c5
-rw-r--r--drivers/media/usb/cx231xx/cx231xx.h2
3 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c
index c5842a1ea104..66e8f8ae9be4 100644
--- a/drivers/media/usb/cx231xx/cx231xx-core.c
+++ b/drivers/media/usb/cx231xx/cx231xx-core.c
@@ -227,7 +227,7 @@ int cx231xx_send_usb_command(struct cx231xx_i2c *i2c_bus,
/* call common vendor command request */
status = cx231xx_send_vendor_cmd(dev, &ven_req);
- if (status < 0) {
+ if (status < 0 && !dev->i2c_scan_running) {
pr_err("%s: failed with status -%d\n",
__func__, status);
}
diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 5a0604711be0..f99857e6c842 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -496,6 +496,9 @@ void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port)
if (!i2c_scan)
return;
+ /* Don't generate I2C errors during scan */
+ dev->i2c_scan_running = true;
+
memset(&client, 0, sizeof(client));
client.adapter = cx231xx_get_i2c_adap(dev, i2c_port);
@@ -512,6 +515,8 @@ void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port)
}
pr_info("i2c scan: Completed Checking for I2C devices on port=%d.\n",
i2c_port);
+
+ dev->i2c_scan_running = false;
}
/*
diff --git a/drivers/media/usb/cx231xx/cx231xx.h b/drivers/media/usb/cx231xx/cx231xx.h
index aeee721a8eef..253f2437c0f1 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -610,6 +610,8 @@ struct cx231xx {
unsigned int has_audio_class:1;
unsigned int has_alsa_audio:1;
+ unsigned int i2c_scan_running:1; /* true only during i2c_scan */
+
struct cx231xx_fmt *format;
struct v4l2_device v4l2_dev;