diff options
author | Pete Eberlein <pete@sensoray.com> | 2008-10-30 12:56:33 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-06 13:52:06 -0800 |
commit | d73f822ce775e004836ffc01ce9feae27d0d65cf (patch) | |
tree | 4b731a46fdd6536417ff5f1ee8d2091500ccb83e /drivers/staging/go7007/saa7134-go7007.c | |
parent | b2d6a78d9f5323dcb69f7e10476f9fd001c296ff (diff) | |
download | op-kernel-dev-d73f822ce775e004836ffc01ce9feae27d0d65cf.zip op-kernel-dev-d73f822ce775e004836ffc01ce9feae27d0d65cf.tar.gz |
Staging: go7007: saa7134 updates
- Added documentation including README files from the original go7007
driver package.
- Added Video4Linux2 MPEG controls.
- Added Video4Linux2 audio ioctls, which pass thru to the i2c driver.
- Improved saa7134 interface, to pass thru controls and video settings.
- Fixed a bug in sony tuner, as reported by Bifferos on the Go7007 wiki.
Signed-off-by: Pete Eberlein <pete@sensoray.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/go7007/saa7134-go7007.c')
-rw-r--r-- | drivers/staging/go7007/saa7134-go7007.c | 52 |
1 files changed, 50 insertions, 2 deletions
diff --git a/drivers/staging/go7007/saa7134-go7007.c b/drivers/staging/go7007/saa7134-go7007.c index c4a6d8e..665bbf5 100644 --- a/drivers/staging/go7007/saa7134-go7007.c +++ b/drivers/staging/go7007/saa7134-go7007.c @@ -27,7 +27,7 @@ #include <linux/usb.h> #include <linux/i2c.h> #include <asm/byteorder.h> -#include <media/audiochip.h> +#include <media/v4l2-common.h> #include "saa7134-reg.h" #include "saa7134.h" @@ -314,7 +314,13 @@ static int saa7134_go7007_stream_start(struct go7007 *go) static int saa7134_go7007_stream_stop(struct go7007 *go) { struct saa7134_go7007 *saa = go->hpi_context; - struct saa7134_dev *dev = saa->dev; + struct saa7134_dev *dev; + + if (!saa) + return -EINVAL; + dev = saa->dev; + if (!dev) + return -EINVAL; /* Shut down TS FIFO */ saa_clearl(SAA7134_MAIN_CTRL, SAA7134_MAIN_CTRL_TE5); @@ -373,6 +379,47 @@ static int saa7134_go7007_send_firmware(struct go7007 *go, u8 *data, int len) return 0; } +static int saa7134_go7007_send_command(struct go7007 *go, unsigned int cmd, + void *arg) +{ + struct saa7134_go7007 *saa = go->hpi_context; + struct saa7134_dev *dev = saa->dev; + + switch (cmd) { + case VIDIOC_S_STD: + { + v4l2_std_id *std = arg; + return saa7134_s_std_internal(dev, NULL, std); + } + case VIDIOC_G_STD: + { + v4l2_std_id *std = arg; + *std = dev->tvnorm->id; + return 0; + } + case VIDIOC_QUERYCTRL: + { + struct v4l2_queryctrl *ctrl = arg; + if (V4L2_CTRL_ID2CLASS(ctrl->id) == V4L2_CTRL_CLASS_USER) + return saa7134_queryctrl(NULL, NULL, ctrl); + } + case VIDIOC_G_CTRL: + { + struct v4l2_control *ctrl = arg; + if (V4L2_CTRL_ID2CLASS(ctrl->id) == V4L2_CTRL_CLASS_USER) + return saa7134_g_ctrl_internal(dev, NULL, ctrl); + } + case VIDIOC_S_CTRL: + { + struct v4l2_control *ctrl = arg; + if (V4L2_CTRL_ID2CLASS(ctrl->id) == V4L2_CTRL_CLASS_USER) + return saa7134_s_ctrl_internal(dev, NULL, ctrl); + } + } + return -EINVAL; + +} + static struct go7007_hpi_ops saa7134_go7007_hpi_ops = { .interface_reset = saa7134_go7007_interface_reset, .write_interrupt = saa7134_go7007_write_interrupt, @@ -380,6 +427,7 @@ static struct go7007_hpi_ops saa7134_go7007_hpi_ops = { .stream_start = saa7134_go7007_stream_start, .stream_stop = saa7134_go7007_stream_stop, .send_firmware = saa7134_go7007_send_firmware, + .send_command = saa7134_go7007_send_command, }; /********************* Add/remove functions *********************/ |