summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/tda826x.c
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-07-30 16:22:11 -0300
committerAndrew de Quincey <adq_dvb@lidskialf.net>2006-07-30 16:22:11 -0300
commit2f9530f29aefb5377fc1724160f75a7efbf9b241 (patch)
tree1c0e22fb7b78deb0a8beb7ea844b211b2434eff7 /linux/drivers/media/dvb/frontends/tda826x.c
parent82abf0a8d6ab0e905c9badcda6bdb41dc432deb1 (diff)
downloadmediapointer-dvb-s2-2f9530f29aefb5377fc1724160f75a7efbf9b241.tar.gz
mediapointer-dvb-s2-2f9530f29aefb5377fc1724160f75a7efbf9b241.tar.bz2
tda826x: Remove 0-byte I2C write; put tuner_ops info in static struct
From: Trent Piepho <xyzzy@speakeasy.org> Remove the 0-byte write that precedes 2-byte read. Move initialize the info field in the static tuner_ops definition, so that it doesn't need to be done manually. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'linux/drivers/media/dvb/frontends/tda826x.c')
-rw-r--r--linux/drivers/media/dvb/frontends/tda826x.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda826x.c b/linux/drivers/media/dvb/frontends/tda826x.c
index 2921eb82f..f594eab44 100644
--- a/linux/drivers/media/dvb/frontends/tda826x.c
+++ b/linux/drivers/media/dvb/frontends/tda826x.c
@@ -110,6 +110,11 @@ static int tda826x_get_frequency(struct dvb_frontend *fe, u32 *frequency)
}
static struct dvb_tuner_ops tda826x_tuner_ops = {
+ .info = {
+ .name = "Philips TDA826X",
+ .frequency_min = 950000,
+ .frequency_min = 2175000
+ },
.release = tda826x_release,
.sleep = tda826x_sleep,
.set_params = tda826x_set_params,
@@ -120,13 +125,12 @@ struct dvb_frontend *tda826x_attach(struct dvb_frontend *fe, int addr, struct i2
{
struct tda826x_priv *priv = NULL;
u8 b1 [] = { 0, 0 };
- struct i2c_msg msg [] = { { .addr = addr, .flags = 0, .buf = NULL, .len = 0 },
- { .addr = addr, .flags = I2C_M_RD, .buf = b1, .len = 2 } };
+ struct i2c_msg msg [] = { { .addr = addr, .flags = I2C_M_RD, .buf = b1, .len = 2 } };
int ret;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
- ret = i2c_transfer (i2c, msg, 2);
+ ret = i2c_transfer (i2c, msg, 1);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
@@ -144,9 +148,6 @@ struct dvb_frontend *tda826x_attach(struct dvb_frontend *fe, int addr, struct i2
priv->has_loopthrough = has_loopthrough;
memcpy(&fe->ops.tuner_ops, &tda826x_tuner_ops, sizeof(struct dvb_tuner_ops));
- strncpy(fe->ops.tuner_ops.info.name, "Philips TDA826X", 128);
- fe->ops.tuner_ops.info.frequency_min = 950000;
- fe->ops.tuner_ops.info.frequency_min = 2175000;
fe->tuner_priv = priv;
printk("%s:\n", __FUNCTION__);