aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/zoran/zoran_card.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-03-08 17:04:38 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 12:43:21 -0300
commit1cd3c0fa927084549005fc22e54d99684b314f14 (patch)
treeffec4f2829239216640983e0102f4638493a1140 /drivers/media/video/zoran/zoran_card.c
parent98ec633972a70cf71d71bc8762804f0af4792d08 (diff)
V4L/DVB (11022): zoran/bt819: use new notify functionality.
Bt819 needs the parent driver to drive a GPIO pin low and high in order to reset its fifo. Use the new notify callback for this. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/zoran/zoran_card.c')
-rw-r--r--drivers/media/video/zoran/zoran_card.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/media/video/zoran/zoran_card.c b/drivers/media/video/zoran/zoran_card.c
index b5d228d91b0..ec9b6ef5609 100644
--- a/drivers/media/video/zoran/zoran_card.c
+++ b/drivers/media/video/zoran/zoran_card.c
@@ -39,7 +39,6 @@
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include <linux/videodev2.h>
-#include <media/v4l2-common.h>
#include <linux/spinlock.h>
#include <linux/sem.h>
#include <linux/kmod.h>
@@ -48,8 +47,9 @@
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
-
-#include <asm/io.h>
+#include <linux/io.h>
+#include <media/v4l2-common.h>
+#include <media/bt819.h>
#include "videocodec.h"
#include "zoran.h"
@@ -1196,6 +1196,19 @@ zoran_setup_videocodec (struct zoran *zr,
return m;
}
+static int zoran_subdev_notify(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
+{
+ struct zoran *zr = to_zoran(sd->v4l2_dev);
+
+ /* Bt819 needs to reset its FIFO buffer using #FRST pin and
+ LML33 card uses GPIO(7) for that. */
+ if (cmd == BT819_FIFO_RESET_LOW)
+ GPIO(zr, 7, 0);
+ else if (cmd == BT819_FIFO_RESET_HIGH)
+ GPIO(zr, 7, 1);
+ return 0;
+}
+
/*
* Scan for a Buz card (actually for the PCI controller ZR36057),
* request the irq and map the io memory
@@ -1226,6 +1239,7 @@ static int __devinit zoran_probe(struct pci_dev *pdev,
ZORAN_NAME, __func__);
return -ENOMEM;
}
+ zr->v4l2_dev.notify = zoran_subdev_notify;
if (v4l2_device_register(&pdev->dev, &zr->v4l2_dev))
goto zr_free_mem;
zr->pci_dev = pdev;