From: Ian Molton <spyro@f2s.com>
To: linux-kernel@vger.kernel.org
Cc: linux-dvb@linuxtv.org
Subject: [DVB] tda1004x frontend regression
Date: Mon, 12 Jul 2004 00:26:01 +0100 [thread overview]
Message-ID: <20040712002601.48427258.spyro@f2s.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 674 bytes --]
Hi.
Attached is a diff I've made.
I tried the 2.6.7-bk20 driver for the tda1004x frontend on my DVB-T card, only to find out that it failed to work, unlike the 2.6.5 driver which appeared to work well.
I assumed this was due to my firmware being out of date but this was not the case.
I discovered the problem was related to some additions made to the driver, and commenting them out allowed things to work again. Ther is also a dodgy looking alteration to some pointer (fe->data).
In the course of my fiddling, I added support to the firmware list for the latest (2.17d) firmware.
all this is in the attached diff, and the driver works in this modified state for me.
[-- Attachment #2: diff_dvb --]
[-- Type: application/octet-stream, Size: 2823 bytes --]
--- drivers/media/dvb/frontends/tda1004x.c.new 2004-07-12 00:16:41.000000000 +0100
+++ drivers/media/dvb/frontends/tda1004x.c 2004-07-12 00:11:37.000000000 +0100
@@ -184,7 +184,8 @@
int fw_offset;
int fw_size;
};
-static struct fwinfo tda10045h_fwinfo[] = { {.file_size = 286720,.fw_offset = 0x34cc5,.fw_size = 30555} };
+static struct fwinfo tda10045h_fwinfo[] = { {.file_size = 286720,.fw_offset = 0x34cc5,.fw_size = 30555},
+ {.file_size = 303104,.fw_offset = 0x37ef9,.fw_size = 30554} };
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} };
@@ -1306,7 +1307,7 @@
{
int status = 0;
struct dvb_i2c_bus *i2c = fe->i2c;
- struct tda1004x_state *tda_state = (struct tda1004x_state *) fe->data;
+ struct tda1004x_state *tda_state = (struct tda1004x_state *) &(fe->data);
dprintk("%s: cmd=0x%x\n", __FUNCTION__, cmd);
@@ -1368,6 +1369,7 @@
tda_state->initialised = 1;
return status;
+#if 0
case FE_GET_TUNE_SETTINGS:
{
struct dvb_frontend_tune_settings* fesettings = (struct dvb_frontend_tune_settings*) arg;
@@ -1376,6 +1378,7 @@
fesettings->max_drift = 166667*2;
return 0;
}
+#endif
default:
return -EOPNOTSUPP;
@@ -1392,7 +1395,7 @@
int fe_type = -1;
int tuner_type = -1;
struct tda1004x_state tda_state;
- struct tda1004x_state* ptda_state;
+// struct tda1004x_state* ptda_state;
struct i2c_msg tuner_msg = {.addr=0, .flags=0, .buf=0, .len=0 };
static u8 td1344_init[] = { 0x0b, 0xf5, 0x88, 0xab };
static u8 td1316_init[] = { 0x0b, 0xf5, 0x85, 0xab };
@@ -1485,20 +1488,24 @@
// upload firmware
if ((status = tda1004x_fwupload(i2c, &tda_state)) != 0) return status;
+#if 0
// create the real state we'll be passing about
if ((ptda_state = (struct tda1004x_state*) kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL)) == NULL) {
return -ENOMEM;
}
memcpy(ptda_state, &tda_state, sizeof(struct tda1004x_state));
*data = ptda_state;
+#endif
// register
switch(tda_state.fe_type) {
case FE_TYPE_TDA10045H:
- return dvb_register_frontend(tda1004x_ioctl, i2c, ptda_state, &tda10045h_info);
+ return dvb_register_frontend(tda1004x_ioctl, i2c, (void *)(*((u32*) &tda_state)), &tda10045h_info);
+// return dvb_register_frontend(tda1004x_ioctl, i2c, ptda_state, &tda10045h_info);
case FE_TYPE_TDA10046H:
- return dvb_register_frontend(tda1004x_ioctl, i2c, ptda_state, &tda10046h_info);
+ return dvb_register_frontend(tda1004x_ioctl, i2c, (void *)(*((u32*) &tda_state)), &tda10046h_info);
+// return dvb_register_frontend(tda1004x_ioctl, i2c, ptda_state, &tda10046h_info);
}
// should not get here
reply other threads:[~2004-07-11 23:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040712002601.48427258.spyro@f2s.com \
--to=spyro@f2s.com \
--cc=linux-dvb@linuxtv.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®