diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-13 20:00:50 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-13 20:00:50 -0300 |
commit | eb97af7a1c842f6958f57fe8f9dbd93471d17948 (patch) | |
tree | aab8522fdbd5a23c8fc7b0a8a27d2354b4258022 /linux/drivers/media/video/zoran | |
parent | bd5114e836d5c39563589881b3d9da0cf06624f1 (diff) | |
parent | 70e434a0770289c85c4cf61a2956160e24d76bcf (diff) | |
download | mediapointer-dvb-s2-eb97af7a1c842f6958f57fe8f9dbd93471d17948.tar.gz mediapointer-dvb-s2-eb97af7a1c842f6958f57fe8f9dbd93471d17948.tar.bz2 |
merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-notify
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/zoran')
-rw-r--r-- | linux/drivers/media/video/zoran/zoran_card.c | 22 | ||||
-rw-r--r-- | linux/drivers/media/video/zoran/zoran_device.c | 36 | ||||
-rw-r--r-- | linux/drivers/media/video/zoran/zoran_device.h | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/zoran/zoran_driver.c | 12 |
4 files changed, 26 insertions, 47 deletions
diff --git a/linux/drivers/media/video/zoran/zoran_card.c b/linux/drivers/media/video/zoran/zoran_card.c index 4a76df3f8..29007f9b5 100644 --- a/linux/drivers/media/video/zoran/zoran_card.c +++ b/linux/drivers/media/video/zoran/zoran_card.c @@ -38,9 +38,7 @@ #include <linux/proc_fs.h> #include <linux/i2c.h> #include <linux/i2c-algo-bit.h> -#include "compat.h" #include <linux/videodev2.h> -#include <media/v4l2-common.h> #include <linux/spinlock.h> #include <linux/sem.h> #include <linux/kmod.h> @@ -49,8 +47,10 @@ #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 "compat.h" #include "videocodec.h" #include "zoran.h" @@ -1197,6 +1197,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 @@ -1227,6 +1240,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; diff --git a/linux/drivers/media/video/zoran/zoran_device.c b/linux/drivers/media/video/zoran/zoran_device.c index 9d93dd8c0..54a04ea5c 100644 --- a/linux/drivers/media/video/zoran/zoran_device.c +++ b/linux/drivers/media/video/zoran/zoran_device.c @@ -1590,8 +1590,8 @@ zoran_init_hardware (struct zoran *zr) route.input = zr->card.input[zr->input].muxsel; decoder_call(zr, core, init, 0); - decoder_s_std(zr, zr->norm); - decoder_s_routing(zr, &route); + decoder_call(zr, tuner, s_std, zr->norm); + decoder_call(zr, video, s_routing, &route); encoder_call(zr, core, init, 0); encoder_call(zr, video, s_std_output, zr->norm); @@ -1656,35 +1656,3 @@ zr36057_init_vfe (struct zoran *zr) reg |= ZR36057_VDCR_Triton; btwrite(reg, ZR36057_VDCR); } - -/* - * Interface to decoder and encoder chips using i2c bus - */ - -int decoder_s_std(struct zoran *zr, v4l2_std_id std) -{ - int res; - - /* Bt819 needs to reset its FIFO buffer using #FRST pin and - LML33 card uses GPIO(7) for that. */ - if (zr->card.type == LML33) - GPIO(zr, 7, 0); - res = decoder_call(zr, tuner, s_std, std); - if (zr->card.type == LML33) - GPIO(zr, 7, 1); /* Pull #FRST high. */ - return res; -} - -int decoder_s_routing(struct zoran *zr, struct v4l2_routing *route) -{ - int res; - - /* Bt819 needs to reset its FIFO buffer using #FRST pin and - LML33 card uses GPIO(7) for that. */ - if (zr->card.type == LML33) - GPIO(zr, 7, 0); - res = decoder_call(zr, video, s_routing, route); - if (zr->card.type == LML33) - GPIO(zr, 7, 1); /* Pull #FRST high. */ - return res; -} diff --git a/linux/drivers/media/video/zoran/zoran_device.h b/linux/drivers/media/video/zoran/zoran_device.h index e0a4f0ff9..bf8c94d03 100644 --- a/linux/drivers/media/video/zoran/zoran_device.h +++ b/linux/drivers/media/video/zoran/zoran_device.h @@ -98,7 +98,4 @@ extern int pass_through; #define encoder_call(zr, o, f, args...) \ v4l2_subdev_call(zr->encoder, o, f, ##args) -int decoder_s_std(struct zoran *zr, v4l2_std_id std); -int decoder_s_routing(struct zoran *zr, struct v4l2_routing *route); - #endif /* __ZORAN_DEVICE_H__ */ diff --git a/linux/drivers/media/video/zoran/zoran_driver.c b/linux/drivers/media/video/zoran/zoran_driver.c index a194bf180..7ef3c015d 100644 --- a/linux/drivers/media/video/zoran/zoran_driver.c +++ b/linux/drivers/media/video/zoran/zoran_driver.c @@ -1457,7 +1457,7 @@ zoran_set_norm (struct zoran *zr, v4l2_std_id std = 0; decoder_call(zr, video, querystd, &std); - decoder_s_std(zr, std); + decoder_call(zr, tuner, s_std, std); /* let changes come into effect */ ssleep(2); @@ -1469,7 +1469,7 @@ zoran_set_norm (struct zoran *zr, "%s: %s - no norm detected\n", ZR_DEVNAME(zr), __func__); /* reset norm */ - decoder_s_std(zr, zr->norm); + decoder_call(zr, tuner, s_std, zr->norm); return -EIO; } @@ -1488,7 +1488,7 @@ zoran_set_norm (struct zoran *zr, if (on) zr36057_overlay(zr, 0); - decoder_s_std(zr, norm); + decoder_call(zr, tuner, s_std, norm); encoder_call(zr, video, s_std_output, norm); if (on) @@ -1530,7 +1530,7 @@ zoran_set_input (struct zoran *zr, route.input = zr->card.input[input].muxsel; zr->input = input; - decoder_s_routing(zr, &route); + decoder_call(zr, video, s_routing, &route); return 0; } @@ -1783,7 +1783,7 @@ jpgreqbuf_unlock_and_return: goto gstat_unlock_and_return; } - decoder_s_routing(zr, &route); + decoder_call(zr, video, s_routing, &route); /* sleep 1 second */ ssleep(1); @@ -1794,7 +1794,7 @@ jpgreqbuf_unlock_and_return: /* restore previous input and norm */ route.input = zr->card.input[zr->input].muxsel; - decoder_s_routing(zr, &route); + decoder_call(zr, video, s_routing, &route); gstat_unlock_and_return: mutex_unlock(&zr->resource_lock); |