summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-gpio.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-12-21 21:33:36 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 19:04:15 -0200
commit0e614cd1a5a09b36a3b6d0fff8a08a97800d3cce (patch)
treeae5eb3832437a256976353302e57313579f580c3 /drivers/media/video/ivtv/ivtv-gpio.c
parent3f51451b516eeb19d3c1ea311ee8845fc80b5135 (diff)
V4L/DVB (6896): ivtv: add XC2028 support for Club3D cards
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-gpio.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-gpio.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/media/video/ivtv/ivtv-gpio.c b/drivers/media/video/ivtv/ivtv-gpio.c
index 132fb5f7136..688cd385668 100644
--- a/drivers/media/video/ivtv/ivtv-gpio.c
+++ b/drivers/media/video/ivtv/ivtv-gpio.c
@@ -22,6 +22,7 @@
#include "ivtv-driver.h"
#include "ivtv-cards.h"
#include "ivtv-gpio.h"
+#include "tuner-xc2028.h"
#include <media/tuner.h>
/*
@@ -122,6 +123,29 @@ void ivtv_reset_ir_gpio(struct ivtv *itv)
write_reg(curdir, IVTV_REG_GPIO_DIR);
}
+/* Xceive tuner reset function */
+int ivtv_reset_tuner_gpio(void *dev, int cmd, int value)
+{
+ struct i2c_algo_bit_data *algo = dev;
+ struct ivtv *itv = algo->data;
+ int curdir, curout;
+
+ if (cmd != XC2028_TUNER_RESET)
+ return 0;
+ IVTV_DEBUG_INFO("Resetting tuner\n");
+ curout = read_reg(IVTV_REG_GPIO_OUT);
+ curdir = read_reg(IVTV_REG_GPIO_DIR);
+ curdir |= (1 << 12); /* GPIO bit 12 */
+
+ curout &= ~(1 << 12);
+ write_reg(curout, IVTV_REG_GPIO_OUT);
+ schedule_timeout_interruptible(msecs_to_jiffies(1));
+
+ curout |= (1 << 12);
+ write_reg(curout, IVTV_REG_GPIO_OUT);
+ schedule_timeout_interruptible(msecs_to_jiffies(1));
+ return 0;
+}
void ivtv_gpio_init(struct ivtv *itv)
{