* [PATCH] af9015 : more robust eeprom parsing
@ 2010-03-21 11:14 matthieu castet
2010-05-13 21:28 ` Antti Palosaari
0 siblings, 1 reply; 2+ messages in thread
From: matthieu castet @ 2010-03-21 11:14 UTC (permalink / raw)
To: linux-media; +Cc: Antti Palosaari
[-- Attachment #1: Type: text/plain, Size: 339 bytes --]
the af9015 eeprom parsing accept 0x38 as 2nd demodulator. But this is impossible because the
first one is already hardcoded to 0x38.
This remove a special case for AverMedia AVerTV Volar Black HD.
Also in af9015_copy_firmware don't hardcode the 2nd demodulator address to 0x3a.
Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
[-- Attachment #2: af9015.diff --]
[-- Type: text/x-diff, Size: 1459 bytes --]
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c
index d797538..f93767e 100644
--- a/drivers/media/dvb/dvb-usb/af9015.c
+++ b/drivers/media/dvb/dvb-usb/af9015.c
@@ -493,7 +493,7 @@ static int af9015_copy_firmware(struct dvb_usb_device *d)
/* wait 2nd demodulator ready */
msleep(100);
- ret = af9015_read_reg_i2c(d, 0x3a, 0x98be, &val);
+ ret = af9015_read_reg_i2c(d, af9015_af9013_config[1].demod_address, 0x98be, &val);
if (ret)
goto error;
else
@@ -913,8 +913,13 @@ static int af9015_read_config(struct usb_device *udev)
ret = af9015_rw_udev(udev, &req);
if (ret)
goto error;
- af9015_af9013_config[1].demod_address = val;
+ if (val != AF9015_I2C_DEMOD)
+ af9015_af9013_config[1].demod_address = val;
+ else
+ af9015_config.dual_mode = 0;
+ }
+ if (af9015_config.dual_mode) {
/* enable 2nd adapter */
for (i = 0; i < af9015_properties_count; i++)
af9015_properties[i].num_adapters = 2;
@@ -1023,11 +1028,6 @@ error:
if (le16_to_cpu(udev->descriptor.idVendor) == USB_VID_AVERMEDIA &&
le16_to_cpu(udev->descriptor.idProduct) == USB_PID_AVERMEDIA_A850) {
deb_info("%s: AverMedia A850: overriding config\n", __func__);
- /* disable dual mode */
- af9015_config.dual_mode = 0;
- /* disable 2nd adapter */
- for (i = 0; i < af9015_properties_count; i++)
- af9015_properties[i].num_adapters = 1;
/* set correct IF */
af9015_af9013_config[0].tuner_if = 4570;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] af9015 : more robust eeprom parsing
2010-03-21 11:14 [PATCH] af9015 : more robust eeprom parsing matthieu castet
@ 2010-05-13 21:28 ` Antti Palosaari
0 siblings, 0 replies; 2+ messages in thread
From: Antti Palosaari @ 2010-05-13 21:28 UTC (permalink / raw)
To: matthieu castet; +Cc: linux-media
Terve!
And sorry I have been "out of the office" for few months... Now I am
back and I think I have again time for this project...
On 03/21/2010 01:14 PM, matthieu castet wrote:
> the af9015 eeprom parsing accept 0x38 as 2nd demodulator. But this is
> impossible because the
> first one is already hardcoded to 0x38.
> This remove a special case for AverMedia AVerTV Volar Black HD.
I don't like this. It adds one more rather unnecessary if(). Of course
we can validity check many kind of values from eeprom but I think it is
not rather wise. Just trust eeprom and if there is device which does
have garbage content in eeprom then add special case for that broken
device. Currently AverMedia AVerTV Volar Black HD (A850) is only device
I know which does have bad eeprom content.
> Also in af9015_copy_firmware don't hardcode the 2nd demodulator address
> to 0x3a.
This one looks good.
>
>
> Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
regards
Antti
--
http://palosaari.fi/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-13 21:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-21 11:14 [PATCH] af9015 : more robust eeprom parsing matthieu castet
2010-05-13 21:28 ` Antti Palosaari
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox