summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/or51211.c
diff options
context:
space:
mode:
authorKenneth Aafloy <devnull@localhost>2005-03-10 15:19:09 +0000
committerKenneth Aafloy <devnull@localhost>2005-03-10 15:19:09 +0000
commit708e16aaae7d95031cd5bef16f6f0614f0d5d0d6 (patch)
treed4c829a542d0aaec100fd1535d0325f900a60fa1 /linux/drivers/media/dvb/frontends/or51211.c
parent89ae1ce33391e2fe76f7949e4f584ed5424c51f4 (diff)
downloadmediapointer-dvb-s2-708e16aaae7d95031cd5bef16f6f0614f0d5d0d6.tar.gz
mediapointer-dvb-s2-708e16aaae7d95031cd5bef16f6f0614f0d5d0d6.tar.bz2
- remove bttv dependency from frontend
Diffstat (limited to 'linux/drivers/media/dvb/frontends/or51211.c')
-rw-r--r--linux/drivers/media/dvb/frontends/or51211.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/linux/drivers/media/dvb/frontends/or51211.c b/linux/drivers/media/dvb/frontends/or51211.c
index 1e8b1ea45..1b0ff61c6 100644
--- a/linux/drivers/media/dvb/frontends/or51211.c
+++ b/linux/drivers/media/dvb/frontends/or51211.c
@@ -130,27 +130,7 @@ static int or51211_load_firmware (struct dvb_frontend* fe,
for (i = 0; i < 248; i++)
tudata[i+337] = fw->data[145+i];
- /* RESET DEVICE
- * reset is controled by GPIO-0
- * when set to 0 causes reset and when to 1 for normal op
- * must remain reset for 128 clock cycles on a 50Mhz clock
- * also PRM1 PRM2 & PRM4 are controled by GPIO-1,GPIO-2 & GPIO-4
- * We assume that the reset has be held low long enough or we
- * have been reset by a power on. When the driver is unloaded
- * reset set to 0 so if reloaded we have been reset.
- */
- /* reset & PRM1,2&4 are outputs */
- i = bttv_gpio_enable(state->bt->bttv_nr, 0x001F, 0x001F);
- if (i != 0) {
- printk(KERN_WARNING "or51211: Init Error - Can't Reset DVR "
- "(%i)\n",i);
- }
- bttv_write_gpio(state->bt->bttv_nr, 0x001F, 0x0000); /* Reset */
- msleep(20);
- /* Now set for normal operation */
- bttv_write_gpio(state->bt->bttv_nr, 0x0001F, 0x0001);
- /* wait for operation to begin */
- msleep(500);
+ state->config->reset(fe);
if (i2c_writebytes(state,state->config->demod_address,tudata,585)) {
printk(KERN_WARNING "or51211: load_firmware error 1\n");
@@ -187,8 +167,7 @@ static int or51211_setmode(struct dvb_frontend* fe, int mode)
struct or51211_state* state = fe->demodulator_priv;
u8 rec_buf[14];
- bttv_write_gpio(state->bt->bttv_nr, 0x0002, mode); /* Reset */
- msleep(20);
+ state->config->setmode(fe, mode);
if (i2c_writebytes(state,state->config->demod_address,run_buf,2)) {
printk(KERN_WARNING "or51211: setmode error 1\n");
@@ -580,17 +559,14 @@ static int or51211_get_tune_settings(struct dvb_frontend* fe,
static void or51211_release(struct dvb_frontend* fe)
{
struct or51211_state* state = fe->demodulator_priv;
-
- /* Now in reset condition */
- bttv_write_gpio(state->bt->bttv_nr, 0x0001, 0x0000);
+ state->config->sleep(fe);
kfree(state);
}
static struct dvb_frontend_ops or51211_ops;
struct dvb_frontend* or51211_attach(const struct or51211_config* config,
- struct i2c_adapter* i2c,
- struct bt878 *bt)
+ struct i2c_adapter* i2c)
{
struct or51211_state* state = NULL;
@@ -602,7 +578,6 @@ struct dvb_frontend* or51211_attach(const struct or51211_config* config,
/* Setup the state */
state->config = config;
state->i2c = i2c;
- state->bt = bt;
memcpy(&state->ops, &or51211_ops, sizeof(struct dvb_frontend_ops));
state->initialized = 0;
state->current_frequency = 0;