Commit 8229da50 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[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: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 9d7b848e
......@@ -344,7 +344,7 @@ static int af9035_identify_state(struct dvb_usb_device *d, const char **name)
return ret;
}
static int af9035_download_firmware_af9035(struct dvb_usb_device *d,
static int af9035_download_firmware_old(struct dvb_usb_device *d,
const struct firmware *fw)
{
int ret, i, j, len;
......@@ -430,7 +430,7 @@ static int af9035_download_firmware_af9035(struct dvb_usb_device *d,
return ret;
}
static int af9035_download_firmware_it9135(struct dvb_usb_device *d,
static int af9035_download_firmware_new(struct dvb_usb_device *d,
const struct firmware *fw)
{
int ret, i, i_prev;
......@@ -540,10 +540,10 @@ static int af9035_download_firmware(struct dvb_usb_device *d,
}
}
if (state->chip_type == 0x9135)
ret = af9035_download_firmware_it9135(d, fw);
if (fw->data[0] == 0x01)
ret = af9035_download_firmware_old(d, fw);
else
ret = af9035_download_firmware_af9035(d, fw);
ret = af9035_download_firmware_new(d, fw);
if (ret < 0)
goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment