summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/bt8xx
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/bt8xx
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/bt8xx')
-rw-r--r--linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 73ce1f661..9116e2fdd 100644
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -376,10 +376,53 @@ static int or51211_request_firmware(struct dvb_frontend* fe, const struct firmwa
return request_firmware(fw, name, &bt->bt->dev->dev);
}
+static void or51211_setmode(struct dvb_frontend * fe, int mode)
+{
+ struct dvb_bt8xx_card *bt = fe->dvb->priv;
+ bttv_write_gpio(bt->bttv_nr, 0x0002, mode); /* Reset */
+ msleep(20);
+}
+
+static void or51211_reset(struct dvb_frontend * fe)
+{
+ struct dvb_bt8xx_card *bt = fe->dvb->priv;
+
+ /* 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 */
+ int ret = bttv_gpio_enable(bt->bttv_nr, 0x001F, 0x001F);
+ if (ret != 0) {
+ printk(KERN_WARNING "or51211: Init Error - Can't Reset DVR "
+ "(%i)\n", ret);
+ }
+ bttv_write_gpio(bt->bttv_nr, 0x001F, 0x0000); /* Reset */
+ msleep(20);
+ /* Now set for normal operation */
+ bttv_write_gpio(bt->bttv_nr, 0x0001F, 0x0001);
+ /* wait for operation to begin */
+ msleep(500);
+}
+
+static void or51211_sleep(struct dvb_frontend * fe)
+{
+ struct dvb_bt8xx_card *bt = fe->dvb->priv;
+ bttv_write_gpio(bt->bttv_nr, 0x0001, 0x0000);
+}
+
static struct or51211_config or51211_config = {
.demod_address = 0x15,
.request_firmware = or51211_request_firmware,
+ .setmode = or51211_setmode,
+ .reset = or51211_reset,
+ .sleep = or51211_sleep,
};
@@ -474,7 +517,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
break;
case BTTV_PC_HDTV:
- card->fe = or51211_attach(&or51211_config, card->i2c_adapter, card->bt);
+ card->fe = or51211_attach(&or51211_config, card->i2c_adapter);
if (card->fe != NULL) {
break;
}