Re: Re: [video4linux-cvs] [hg:v4l-dvb] Add support for Opera S1- DVB-USB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marco Gittler wrote:
>>> +/* I2C */
>>> +
>>>     
>>
>> Looks like i2c is using the 8-bit addresses instead of 7-bit
>> addresses, just
>> like how m920x, gl861 and au6610 did at first...  This needs to be fixed.
>>   
> this seem very difficult. the device uses 16 bit (or better 2 byte for
> addressing something)
> the big problem ist that f.e. 0xb880 must READ data (remote-code) and
> another example
> voltage switch: the adress changes from 0xb600 to 0xb601. (both write to
> device)
> 
> so is not using standard i2c addresses and must be complete other handled.
> i mean a wrapper for the address stuff must be ni to make if full i2c
> comaptible.
> 
> the device is not the best i every saw ;), so the design is also not so
> nice.
> 
> any help how the convert from the addr to i2c addr can be done is welcome.

OK.  We will have time to revisit this issue -- just try to keep it in the back
of your mind.

>>  
>>> +static int opera1_usb_i2c_msgxfer(struct dvb_usb_device *dev, u16 addr,
>>> +               u8 * buf, u16 len, int flag)
>>> +{
>>> + int ret = 0;
>>> + u8 request;
>>> + u16 value;
>>> +
>>> + if (!dev) {
>>> +     info("no usb_device");
>>> +     return -EINVAL;
>>> + }
>>> + if (mutex_lock_interruptible(&dev->usb_mutex) < 0)
>>> +     return -EAGAIN;
>>> +
>>> + request = (addr & 0xff00) >> 8;
>>> + if (!request)
>>> +     request = 0xb1;
>>> + value = (addr & 0xff);
>>> + if (flag & OPERA_READ_MSG) {
>>> +     value |= 0x01;
>>> + }
>>> + if (request == 0xa0)
>>> +     value = 0xe600;
>>> + ret = opera1_xilinx_rw(dev->udev, request, value, buf, len, flag);
>>> +
>>> + mutex_unlock(&dev->usb_mutex);
>>> + return ret;
>>> +}
>>> +

[snip]

>>> +static int opera1_tuner_attach(struct dvb_usb_adapter *adap)
>>> +{
>>> + adap->pll_addr = 0xc0;
>>> + adap->pll_desc = &dvb_pll_opera1;
>>> + adap->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
>>>     
>>
>> We should be using "dvb_attach(dvb_pll_attach, adap->fe, 0x60,
>> &adap->dev->i2c_adap, &dvb_pll_opera1)" here, instead.
>>
>> also, please note the usage of 8-bit i2c addr instead of standard 7-bit.
>>
>>
>>   
> done, except the i2c addr (reason is like above)

fine.  Once the i2c handling is converted, we'll change this as appropriate.
This will be OK in the meantime.

>>> + return 0;
>>> +}
>>> +

[snip]

>>> +static struct dvb_usb_device_properties opera1_properties = {
>>> + .caps = DVB_USB_IS_AN_I2C_ADAPTER,
>>> + .usb_ctrl = CYPRESS_FX2,
>>> + .firmware = "opera.fw",
>>>     
>>
>> Please see the other firmware names...  we should conform to the
>> standard, and
>> name it:
>>
>> "dvb-usb-opera-01.fw"
>>   
> done
> firmware extract utility is coming soon

OK.


> 
> ------------------------------------------------------------------------
> 

Thanks for the patch....  Please remember that your sign-off is required with
every patch, in order for us to apply it to the kernel source.

For THIS patch below, I submit my own:

Signed-off-by: Michael Krufky <mkrufky@xxxxxxxxxxx>

Please respond to this email with yours.

...there is still one trivial whitespace problem, though.  see below:


> diff -r c8b73ec18b42 linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
> --- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h	Thu Apr 19 12:04:50 2007 -0300
> +++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-ids.h	Thu Apr 19 19:04:37 2007 +0200
> @@ -32,13 +32,13 @@
>  #define USB_VID_LITEON				0x04ca
>  #define USB_VID_MEDION				0x1660
>  #define USB_VID_MSI				0x0db0
> +#define USB_VID_OPERA1				0x695c
>  #define USB_VID_PINNACLE			0x2304
>  #define USB_VID_VISIONPLUS			0x13d3
>  #define USB_VID_TWINHAN				0x1822
>  #define USB_VID_ULTIMA_ELECTRONIC		0x05d8
>  #define USB_VID_UNIWILL				0x1584
>  #define USB_VID_WIDEVIEW			0x14aa
> -#define USB_VID_OPERA1				0x695c
>  
>  /* Product IDs */
>  #define USB_PID_ADSTECH_USB2_COLD			0xa333
> diff -r c8b73ec18b42 linux/drivers/media/dvb/dvb-usb/opera1.c
> --- a/linux/drivers/media/dvb/dvb-usb/opera1.c	Thu Apr 19 12:04:50 2007 -0300
> +++ b/linux/drivers/media/dvb/dvb-usb/opera1.c	Thu Apr 19 19:53:36 2007 +0200
> @@ -256,9 +256,8 @@ static int opera1_frontend_attach(struct
>  
>  static int opera1_tuner_attach(struct dvb_usb_adapter *adap)
>  {
> -	adap->pll_addr = 0xc0;
> -	adap->pll_desc = &dvb_pll_opera1;
> -	adap->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
> +	dvb_attach(dvb_pll_attach, adap->fe, 0xc0,
> +				  &adap->dev->i2c_adap, &dvb_pll_opera1);

the 1st char of "&adap->dev .......  "  should line up directly below the 1st
char of "dvb_pll_attach".  not a big problem, but should be fixed before commit.

>  	return 0;
>  }
>  
> @@ -478,7 +477,7 @@ static struct dvb_usb_device_properties 
>  static struct dvb_usb_device_properties opera1_properties = {
>  	.caps = DVB_USB_IS_AN_I2C_ADAPTER,
>  	.usb_ctrl = CYPRESS_FX2,
> -	.firmware = "opera.fw",
> +	.firmware = "dvb-usb-opera-01.fw",
>  	.size_of_priv = sizeof(struct opera1_state),
>  
>  	.power_ctrl = opera1_power_ctrl,
> @@ -533,7 +532,7 @@ static int opera1_probe(struct usb_inter
>  	if (udev->descriptor.idProduct == USB_PID_OPERA1_WARM &&
>  		udev->descriptor.idVendor == USB_VID_OPERA1 &&
>  		(d == NULL
> -			|| opera1_xilinx_load_firmware(udev, "opera1-fpga.fw") != 0)
> +			|| opera1_xilinx_load_firmware(udev, "dvb-usb-opera1-fpga.fw") != 0)
>  		) {
>  		return -EINVAL;
>  	}
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> linux-dvb mailing list
> linux-dvb@xxxxxxxxxxx
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb


-- 
Michael Krufky


_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux