aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2013-03-07 15:59:55 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-21 18:00:38 -0400
commit8229da506488ec67a051593fe452ee54e91c70cf (patch)
tree803412f07fb70be3b4ef7d32bc14b22248e98717
parent9d7b848e4311a77a9c62df481278e6efb23cba4a (diff)
[media] af9035: select firmware loader according to firmware
AF9035 and IT9135 supports two different firmware format. Select correct loader according to first byte of firmware file. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/usb/dvb-usb-v2/af9035.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index ce8cccb8946a..75d99aec10b6 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -344,7 +344,7 @@ err:
344 return ret; 344 return ret;
345} 345}
346 346
347static int af9035_download_firmware_af9035(struct dvb_usb_device *d, 347static int af9035_download_firmware_old(struct dvb_usb_device *d,
348 const struct firmware *fw) 348 const struct firmware *fw)
349{ 349{
350 int ret, i, j, len; 350 int ret, i, j, len;
@@ -430,7 +430,7 @@ err:
430 return ret; 430 return ret;
431} 431}
432 432
433static int af9035_download_firmware_it9135(struct dvb_usb_device *d, 433static int af9035_download_firmware_new(struct dvb_usb_device *d,
434 const struct firmware *fw) 434 const struct firmware *fw)
435{ 435{
436 int ret, i, i_prev; 436 int ret, i, i_prev;
@@ -540,10 +540,10 @@ static int af9035_download_firmware(struct dvb_usb_device *d,
540 } 540 }
541 } 541 }
542 542
543 if (state->chip_type == 0x9135) 543 if (fw->data[0] == 0x01)
544 ret = af9035_download_firmware_it9135(d, fw); 544 ret = af9035_download_firmware_old(d, fw);
545 else 545 else
546 ret = af9035_download_firmware_af9035(d, fw); 546 ret = af9035_download_firmware_new(d, fw);
547 if (ret < 0) 547 if (ret < 0)
548 goto err; 548 goto err;
549 549