summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/tda1004x.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/frontends/tda1004x.c')
-rw-r--r--linux/drivers/media/dvb/frontends/tda1004x.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c
index 53163099c..e02981cd6 100644
--- a/linux/drivers/media/dvb/frontends/tda1004x.c
+++ b/linux/drivers/media/dvb/frontends/tda1004x.c
@@ -21,15 +21,17 @@
*/
/*
- This driver needs a copy of the DLL "ttlcdacc.dll" from the Haupauge or Technotrend
- windows driver saved as '/usr/lib/hotplug/firmware/tda1004x.bin'.
- You can also pass the complete file name with the module parameter 'tda1004x_firmware'.
+ 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.
- 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/
- 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
+*/
#include <linux/kernel.h>
@@ -369,6 +371,8 @@ static int tda1004x_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *tda
struct fwinfo* fwInfo = NULL;
unsigned long timeout;
+ u8 data1, data2;
+
// DSP parameters
switch(tda_state->fe_type) {
case FE_TYPE_TDA10045H:
@@ -404,6 +408,8 @@ static int tda1004x_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *tda
fw_size = fwInfo[fwinfo_idx].fw_size;
fw_offset = fwInfo[fwinfo_idx].fw_offset;
+ firmware = fw->data + fw_offset;
+
// set some valid bandwith parameters before uploading
switch(tda_state->fe_type) {
case FE_TYPE_TDA10045H:
@@ -481,8 +487,11 @@ static int tda1004x_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *tda
// check upload was OK
tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFC4, 0x10, 0); // we want to read from the DSP
tda1004x_write_byte(i2c, tda_state, TDA1004X_DSP_CMD, 0x67);
- if ((tda1004x_read_byte(i2c, tda_state, TDA1004X_DSP_DATA1) != 0x67) ||
- (tda1004x_read_byte(i2c, tda_state, TDA1004X_DSP_DATA2) != dspVersion)) {
+
+ data1 = tda1004x_read_byte(i2c, tda_state, TDA1004X_DSP_DATA1);
+ data2 = tda1004x_read_byte(i2c, tda_state, TDA1004X_DSP_DATA2);
+ printk("d1:0x%02x, d2:0x%02x\n",data1,data2);
+ if (data1 != 0x67 || data2 != dspVersion) {
printk("%s: firmware upload failed!\n", __FUNCTION__);
return -EIO;
}
@@ -1443,6 +1452,7 @@ static int attach_adapter(struct i2c_adapter *adapter)
kfree(client);
return -ENOMEM;
}
+ state->i2c = adapter;
ret = tda1004x_attach(adapter, state);
if (ret) {
@@ -1467,6 +1477,7 @@ static int attach_adapter(struct i2c_adapter *adapter)
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.fw", &client->dev);
if (ret) {
printk("tda1004x: firmware upload timeout\n");
@@ -1477,12 +1488,14 @@ static int attach_adapter(struct i2c_adapter *adapter)
printk("tda1004x: firmware upload failed\n");
goto out;
}
-
+
switch(state->fe_type) {
case FE_TYPE_TDA10045H:
ret = dvb_register_frontend_new (tda1004x_ioctl, state->dvb, (void*) state, &tda10045h_info);
+ break;
case FE_TYPE_TDA10046H:
ret = dvb_register_frontend_new (tda1004x_ioctl, state->dvb, (void*) state, &tda10046h_info);
+ break;
default:
BUG_ON(1);
}
@@ -1515,16 +1528,6 @@ static int detach_client(struct i2c_client *client)
static int command (struct i2c_client *client, unsigned int cmd, void *arg)
{
struct tda1004x_state *state = (struct tda1004x_state*)i2c_get_clientdata(client);
- struct dvb_frontend_info *info = NULL;
-
- switch(state->fe_type) {
- case FE_TYPE_TDA10045H:
- info = &tda10045h_info;
- case FE_TYPE_TDA10046H:
- info = &tda10046h_info;
- default:
- BUG_ON(1);
- }
dprintk ("%s\n", __FUNCTION__);
@@ -1579,7 +1582,3 @@ MODULE_LICENSE("GPL");
MODULE_PARM(tda1004x_debug, "i");
MODULE_PARM_DESC(tda1004x_debug, "enable verbose debug messages");
-
-MODULE_PARM(tda1004x_firmware, "s");
-MODULE_PARM_DESC(tda1004x_firmware, "Where to find the firmware file");
-