diff options
author | Andrew de Quincy <devnull@localhost> | 2004-08-26 17:36:56 +0000 |
---|---|---|
committer | Andrew de Quincy <devnull@localhost> | 2004-08-26 17:36:56 +0000 |
commit | 743c0cb9646b60661e2b69252bd823ce1c4d849f (patch) | |
tree | 0b1a91932e2613de8bc50118dcb0e38dfdb39f65 /linux/drivers/media/dvb/frontends/tda1004x.c | |
parent | 91ba2b1fb86350da268d00d6d6520ac70e880360 (diff) | |
download | mediapointer-dvb-s2-743c0cb9646b60661e2b69252bd823ce1c4d849f.tar.gz mediapointer-dvb-s2-743c0cb9646b60661e2b69252bd823ce1c4d849f.tar.bz2 |
Update everything to point to the new firmware download script
Diffstat (limited to 'linux/drivers/media/dvb/frontends/tda1004x.c')
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda1004x.c | 109 |
1 files changed, 30 insertions, 79 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c index c3640cd3b..064175cb3 100644 --- a/linux/drivers/media/dvb/frontends/tda1004x.c +++ b/linux/drivers/media/dvb/frontends/tda1004x.c @@ -19,20 +19,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - /* - This driver needs a copy of the DLL "ttlcdacc.dll" from the Haupauge or Technotrend - windows driver. - - Currently the DLL from v2.15a of the technotrend driver is supported. Other versions can - be added reasonably painlessly. - - Windows driver URL: http://www.technotrend.de/ - - wget http://www.technotrend.de/new/215/TTweb_215a_budget_20_05_2003.zip - unzip -j TTweb_215a_budget_20_05_2003.zip Software/Oem/PCI/App/ttlcdacc.dll -*/ -#define TDA1004X_DEFAULT_FIRMWARE "tda1004x.bin" + * This driver needs external firmware. Please use the commands + * "<kerneldir>/Documentation/dvb/get_dvb_firmware tda10045", + * "<kerneldir>/Documentation/dvb/get_dvb_firmware tda10046" to + * download/extract them, and then copy them to /usr/lib/hotplug/firmware. + */ +#define TDA10045_DEFAULT_FIRMWARE "dvb-fe-tda10045.fw" +#define TDA10046_DEFAULT_FIRMWARE "dvb-fe-tda10046.fw" #include <linux/init.h> #include <linux/module.h> @@ -180,32 +174,6 @@ struct tda1004x_state { int dspVersion; }; -struct fwinfo { - int file_size; - int fw_offset; - int fw_size; -}; - -static struct fwinfo tda10045h_fwinfo[] = { - { - .file_size = 286720, - .fw_offset = 0x34cc5, - .fw_size = 30555 - }, -}; - -static int tda10045h_fwinfo_count = sizeof(tda10045h_fwinfo) / sizeof(struct fwinfo); - -static struct fwinfo tda10046h_fwinfo[] = { - { - .file_size = 286720, - .fw_offset = 0x3c4f9, - .fw_size = 24479 - } -}; - -static int tda10046h_fwinfo_count = sizeof(tda10046h_fwinfo) / sizeof(struct fwinfo); - static int tda1004x_write_byte(struct i2c_adapter *i2c, struct tda1004x_state *tda_state, int reg, int data) { int ret; @@ -402,22 +370,6 @@ static int tda1004x_do_upload(struct i2c_adapter *i2c, struct tda1004x_state *st return 0; } -static int tda1004x_find_extraction_params(struct fwinfo* fwInfo, int fwInfoCount, int size) -{ - int fwinfo_idx; - - for (fwinfo_idx = 0; fwinfo_idx < fwInfoCount; fwinfo_idx++) { - if (fwInfo[fwinfo_idx].file_size == size) - break; - } - if (fwinfo_idx >= fwInfoCount) { - printk("tda1004x: Unsupported firmware uploaded.\n"); - return -EIO; - } - - return fwinfo_idx; -} - static int tda1004x_check_upload_ok(struct i2c_adapter *i2c, struct tda1004x_state *state) { u8 data1, data2; @@ -437,15 +389,19 @@ static int tda1004x_check_upload_ok(struct i2c_adapter *i2c, struct tda1004x_sta } -static int tda10045_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *state, const struct firmware *fw) +static int tda10045_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *state, struct i2c_client *client) { - int index; int ret; + const struct firmware *fw; - index = tda1004x_find_extraction_params(tda10045h_fwinfo, tda10045h_fwinfo_count, fw->size); - if (index < 0) - return index; - + /* request the firmware, this will block until someone uploads it */ + printk("tda1004x: waiting for firmware upload...\n"); + ret = request_firmware(&fw, TDA10045_DEFAULT_FIRMWARE, &client->dev); + if (ret) { + printk("tda1004x: no firmware upload (timeout or file not found?)\n"); + return ret; + } + /* set some valid bandwith parameters before uploading */ /* reset chip */ @@ -457,7 +413,7 @@ static int tda10045_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *sta /* set parameters */ tda10045h_set_bandwidth(i2c, state, BANDWIDTH_8_MHZ); - ret = tda1004x_do_upload(i2c, state, fw->data + tda10045h_fwinfo[index].fw_offset, tda10045h_fwinfo[index].fw_size); + ret = tda1004x_do_upload(i2c, state, fw->data, fw->size); if (ret) return ret; @@ -472,15 +428,19 @@ static int tda10045_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *sta return 0; } -static int tda10046_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *state, const struct firmware *fw) +static int tda10046_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *state, struct i2c_client *client) { unsigned long timeout; - int index; int ret; + const struct firmware *fw; - index = tda1004x_find_extraction_params(tda10046h_fwinfo, tda10046h_fwinfo_count, fw->size); - if (index < 0) - return index; + /* request the firmware, this will block until someone uploads it */ + printk("tda1004x: waiting for firmware upload...\n"); + ret = request_firmware(&fw, TDA10046_DEFAULT_FIRMWARE, &client->dev); + if (ret) { + printk("tda1004x: no firmware upload (timeout or file not found?)\n"); + return ret; + } /* set some valid bandwith parameters before uploading */ @@ -497,7 +457,7 @@ static int tda10046_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *sta tda1004x_write_byte(i2c, state, TDA10046H_FREQ_PHY2_LSB, 0x2c); tda1004x_write_mask(i2c, state, TDA1004X_CONFC4, 8, 8); // going to boot from HOST - ret = tda1004x_do_upload(i2c, state, fw->data + tda10046h_fwinfo[index].fw_offset, tda10046h_fwinfo[index].fw_size); + ret = tda1004x_do_upload(i2c, state, fw->data, fw->size); if (ret) return ret; @@ -1449,7 +1409,6 @@ static int attach_adapter(struct i2c_adapter *adapter) { struct i2c_client *client; struct tda1004x_state *state; - const struct firmware *fw; int ret; dprintk ("%s\n", __FUNCTION__); @@ -1486,21 +1445,13 @@ static int attach_adapter(struct i2c_adapter *adapter) // upload firmware BUG_ON(!state->dvb); - /* request the firmware, this will block until someone uploads it */ - printk("tda1004x: waiting for firmware upload...\n"); - ret = request_firmware(&fw, TDA1004X_DEFAULT_FIRMWARE, &client->dev); - if (ret) { - printk("tda1004x: no firmware upload (timeout or file not found?)\n"); - goto out; - } - switch(state->fe_type) { case FE_TYPE_TDA10045H: state->dspCodeCounterReg = TDA10045H_FWPAGE; state->dspCodeInReg = TDA10045H_CODE_IN; state->dspVersion = 0x2c; - ret = tda10045_fwupload(adapter, state, fw); + ret = tda10045_fwupload(adapter, state, client); if (ret) { printk("tda1004x: firmware upload failed\n"); goto out; @@ -1515,7 +1466,7 @@ static int attach_adapter(struct i2c_adapter *adapter) state->dspCodeInReg = TDA10046H_CODE_IN; state->dspVersion = 0x20; - ret = tda10046_fwupload(adapter, state, fw); + ret = tda10046_fwupload(adapter, state, client); if (ret) { printk("tda1004x: firmware upload failed\n"); goto out; |