summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-core.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 8ed03d65a34e..5f74ea467d4e 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -120,7 +120,6 @@ void saa7134_track_gpio(struct saa7134_dev *dev, char *msg)
void saa7134_set_gpio(struct saa7134_dev *dev, int bit_no, int value)
{
u32 index, bitval;
- u8 sync_control;
index = 1 << bit_no;
switch (value) {
@@ -140,22 +139,40 @@ void saa7134_set_gpio(struct saa7134_dev *dev, int bit_no, int value)
dprintk("setting GPIO%d to tristate\n", bit_no);
saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, index, 0);
break;
- case 4: /* sync output on GPIO 22 for tda8275a, 50Hz*/
- case 5: /* sync output on GPIO 22 for tda8275a, 60Hz*/
- if (bit_no == 22) {
- dprintk("setting GPIO22 to vsync %d\n", value - 4);
+ }
+}
+
+int saa7134_tuner_callback(void *ptr, int command, int arg)
+{
+ u8 sync_control;
+ struct saa7134_dev *dev = ptr;
+
+ switch (dev->tuner_type) {
+ case TUNER_PHILIPS_TDA8290:
+ switch (command) {
+ case 0: /* switch LNA gain through GPIO 22*/
+ saa7134_set_gpio(dev, 22, arg) ;
+ break;
+ case 1: /* vsync output at GPIO22. 50 / 60Hz */
+ dprintk("setting GPIO22 to vsync %d\n", arg);
saa_andorb(SAA7134_VIDEO_PORT_CTRL3, 0x80, 0x80);
saa_andorb(SAA7134_VIDEO_PORT_CTRL6, 0x0f, 0x03);
- if (value == 5)
+ if (arg == 1)
sync_control = 11;
else
sync_control = 17;
saa_writeb(SAA7134_VGATE_START, sync_control);
saa_writeb(SAA7134_VGATE_STOP, sync_control + 1);
saa_andorb(SAA7134_MISC_VGATE_MSB, 0x03, 0x00);
+ break;
+ default:
+ return -EINVAL;
}
break;
+ default:
+ return -ENODEV;
}
+ return 0;
}
/* ------------------------------------------------------------------ */