Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Re: Full featured card summary
On Saturday 13 March 2004 19:13, Alfred Zastrow wrote:
> Andrew de Quincey schrieb:
> > Argh :( Thanks for testing
> >
> > OK, this new version has all the parameters set back to what they were.
> >
> > (I've not changed the kmalloc thing yet; want to find the problem out
> > first)
>
> Bingo, this one is working !!!! :-)
Glad to hear it!!! Right, bear with me; we have to find out which change fixed
it.
Can you try this last patch please so we can identify it.
Andreas, I swapped the inversion readings round in this one in FE_GET_FRONTEND
(to be like alps_bsrv2)... Is this right, or should it be as it is in CVS
HEAD?
Index: linux/drivers/media/dvb/frontends/ves1x93.c
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/frontends/ves1x93.c,v
retrieving revision 1.6
diff -u -r1.6 ves1x93.c
--- linux/drivers/media/dvb/frontends/ves1x93.c 11 Mar 2004 18:44:19 -0000 1.6
+++ linux/drivers/media/dvb/frontends/ves1x93.c 13 Mar 2004 19:37:50 -0000
@@ -68,10 +68,10 @@
*/
static u8 init_1893_tab [] = {
- 0x01, 0xa4, 0x35, 0x80, 0x2a, 0x0b, 0x55, 0xc4,
+ 0x01, 0xa4, 0x35, 0x81, 0x2a, 0x0b, 0x55, 0xc4,
0x09, 0x69, 0x00, 0x86, 0x4c, 0x28, 0x7f, 0x00,
0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x80, 0x00, 0x21, 0xb0, 0x14, 0x00, 0xdc, 0x00,
+ 0x80, 0x00, 0x31, 0xb0, 0x14, 0x00, 0xdc, 0x00,
0x81, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x55, 0x00, 0x00, 0x7f, 0x00
@@ -110,6 +110,11 @@
1,1,1,0,1,1,1,1, 1,1,1,1,1
};
+struct ves1x93_state {
+ fe_spectral_inversion_t inversion;
+};
+
+
static int ves1x93_writereg (struct dvb_i2c_bus *i2c, u8 reg, u8 data)
{
@@ -284,10 +289,7 @@
return -EINVAL;
}
- /* needs to be saved for FE_GET_FRONTEND */
- init_1x93_tab[0x0c] = (init_1x93_tab[0x0c] & 0x3f) | val;
-
- return ves1x93_writereg (i2c, 0x0c, init_1x93_tab[0x0c]);
+ return ves1x93_writereg (i2c, 0x0c, (init_1x93_tab[0x0c] & 0x3f) | val);
}
@@ -452,6 +454,7 @@
static int ves1x93_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
{
struct dvb_i2c_bus *i2c = fe->i2c;
+ struct ves1x93_state *state = (struct ves1x93_state*) fe->data;
switch (cmd) {
case FE_GET_INFO:
@@ -529,6 +532,7 @@
ves1x93_set_fec (i2c, p->u.qpsk.fec_inner);
ves1x93_set_symbolrate (i2c, p->u.qpsk.symbol_rate);
ves1x93_afc (i2c, p->frequency, p->u.qpsk.symbol_rate);
+ state->inversion = p->inversion;
break;
}
@@ -546,9 +550,9 @@
* inversion indicator is only valid
* if auto inversion was used
*/
- if (!(init_1x93_tab[0x0c] & 0x80))
+ if (state->inversion == INVERSION_AUTO)
p->inversion = (ves1x93_readreg (i2c, 0x0f) & 2) ?
- INVERSION_OFF : INVERSION_ON;
+ INVERSION_ON : INVERSION_OFF;
p->u.qpsk.fec_inner = ves1x93_get_fec (i2c);
/* XXX FIXME: timing offset !! */
break;
@@ -581,6 +585,7 @@
static int ves1x93_attach (struct dvb_i2c_bus *i2c, void **data)
{
u8 identity = ves1x93_readreg(i2c, 0x1e);
+ struct ves1x93_state* state;
switch (identity) {
case 0xdc: /* VES1893A rev1 */
@@ -597,12 +602,19 @@
return -ENODEV;
}
- return dvb_register_frontend (ves1x93_ioctl, i2c, NULL, &ves1x93_info);
+ if ((state = kmalloc(sizeof(struct ves1x93_state), GFP_KERNEL)) == NULL) {
+ return -ENOMEM;
+ }
+ state->inversion = INVERSION_OFF;
+ *data = state;
+
+ return dvb_register_frontend (ves1x93_ioctl, i2c, (void*) state, &ves1x93_info);
}
static void ves1x93_detach (struct dvb_i2c_bus *i2c, void *data)
{
+ kfree(data);
dvb_unregister_frontend (ves1x93_ioctl, i2c);
}
Home |
Main Index |
Thread Index