summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/msp3400-driver.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-12-26 13:57:00 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-12-26 13:57:00 +0000
commitf12863ef9f416661a0701b40684653e682edd686 (patch)
tree16d647cda8cd9cc2ba619652844035c857504583 /linux/drivers/media/video/msp3400-driver.c
parent47f8c542de6bd81e34cd5a3731686720f9b2b73f (diff)
downloadmediapointer-dvb-s2-f12863ef9f416661a0701b40684653e682edd686.tar.gz
mediapointer-dvb-s2-f12863ef9f416661a0701b40684653e682edd686.tar.bz2
Fixed API to set I2S speed control
- Created a new ioctl to control I2S speed. Old calls to an inadequate V4L2 API replaced. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media/video/msp3400-driver.c')
-rw-r--r--linux/drivers/media/video/msp3400-driver.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c
index 47c4d51cf..94f3b8d21 100644
--- a/linux/drivers/media/video/msp3400-driver.c
+++ b/linux/drivers/media/video/msp3400-driver.c
@@ -57,6 +57,7 @@
#include <linux/videodev.h>
#include <media/audiochip.h>
+#include <media/v4l2-common.h>
#include "msp3400.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include "i2c-compat.h"
@@ -2199,23 +2200,36 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
if (a->index<0||a->index>2)
return -EINVAL;
- if (a->index==2) {
- if (a->mode == V4L2_AUDMODE_32BITS)
- msp->i2s_mode=1;
- else
- msp->i2s_mode=0;
- }
- msp3400_dbg("Setting audio out on msp34xx to input %i, mode %i\n",a->index,msp->i2s_mode);
+ msp3400_dbg("Setting audio out on msp34xx to input %i\n",a->index);
msp3400c_set_scart(client,msp->in_scart,a->index+1);
break;
}
+ case VIDIOC_INT_I2S_CLOCK_FREQ:
+ {
+ u32 *a=(u32 *)arg;
+
+ msp3400_dbg("Setting I2S speed to %d\n",*a);
+
+ switch (*a) {
+ case 1024000:
+ msp->i2s_mode=0;
+ break;
+ case 2048000:
+ msp->i2s_mode=1;
+ break;
+ default:
+ return -EINVAL;
+ }
+ break;
+ }
+
case VIDIOC_QUERYCTRL:
{
struct v4l2_queryctrl *qc = arg;
int i;
- msp3400_dbg("VIDIOC_QUERYCTRL");
+ msp3400_dbg("VIDIOC_QUERYCTRL\n");
for (i = 0; i < ARRAY_SIZE(msp34xx_qctrl); i++)
if (qc->id && qc->id == msp34xx_qctrl[i].id) {