Re: [PATCH 6/7] [media] cx231xx-i2c: fix i2c_scan modprobe parameter

2014-11-01 Thread Mauro Carvalho Chehab
Em Sat, 01 Nov 2014 17:46:41 +0100
Matthias Schwarzott  escreveu:

> On 01.11.2014 14:38, Mauro Carvalho Chehab wrote:
> > This device doesn't properly implement read with a zero bytes
> > len. So, use 1 byte for I2C scan.
> > 
> Yes, the idea sounds good, but we should fix this in the code in
> cx231xx_i2c_check_for_device.

Yeah, fixing it there has the advantage that it would also be possible
to scan it via i2cdetect.

Regards,
Mauro
> 
> > Signed-off-by: Mauro Carvalho Chehab 
> > 
> > diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c 
> > b/drivers/media/usb/cx231xx/cx231xx-i2c.c
> > index 1a0d9efeb209..9b7e5a155e34 100644
> > --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
> > +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
> > @@ -502,7 +502,7 @@ void cx231xx_do_i2c_scan(struct cx231xx *dev, int 
> > i2c_port)
> > i2c_port);
> > for (i = 0; i < 128; i++) {
> > client.addr = i;
> > -   rc = i2c_master_recv(&client, &buf, 0);
> > +   rc = i2c_master_recv(&client, &buf, 1);
> > if (rc < 0)
> > continue;
> > pr_info("i2c scan: found device @ 0x%x  [%s]\n",
> > 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/7] [media] cx231xx-i2c: fix i2c_scan modprobe parameter

2014-11-01 Thread Matthias Schwarzott
On 01.11.2014 14:38, Mauro Carvalho Chehab wrote:
> This device doesn't properly implement read with a zero bytes
> len. So, use 1 byte for I2C scan.
> 
Yes, the idea sounds good, but we should fix this in the code in
cx231xx_i2c_check_for_device.

> Signed-off-by: Mauro Carvalho Chehab 
> 
> diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c 
> b/drivers/media/usb/cx231xx/cx231xx-i2c.c
> index 1a0d9efeb209..9b7e5a155e34 100644
> --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
> +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
> @@ -502,7 +502,7 @@ void cx231xx_do_i2c_scan(struct cx231xx *dev, int 
> i2c_port)
>   i2c_port);
>   for (i = 0; i < 128; i++) {
>   client.addr = i;
> - rc = i2c_master_recv(&client, &buf, 0);
> + rc = i2c_master_recv(&client, &buf, 1);
>   if (rc < 0)
>   continue;
>   pr_info("i2c scan: found device @ 0x%x  [%s]\n",
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] [media] cx231xx-i2c: fix i2c_scan modprobe parameter

2014-11-01 Thread Mauro Carvalho Chehab
This device doesn't properly implement read with a zero bytes
len. So, use 1 byte for I2C scan.

Signed-off-by: Mauro Carvalho Chehab 

diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c 
b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 1a0d9efeb209..9b7e5a155e34 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -502,7 +502,7 @@ void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port)
i2c_port);
for (i = 0; i < 128; i++) {
client.addr = i;
-   rc = i2c_master_recv(&client, &buf, 0);
+   rc = i2c_master_recv(&client, &buf, 1);
if (rc < 0)
continue;
pr_info("i2c scan: found device @ 0x%x  [%s]\n",
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html