diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-09 12:25:37 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-09 12:25:37 -0500 |
commit | 9bb13a6dc3a6f68c990264838ff0493d900c48d7 (patch) | |
tree | 274f9dfdcbbbff9f7a382df772a6f2efa9247cc7 /drivers/media/video/msp3400.c | |
parent | e1bc80adaf801bf75ca176b9c1b60b3cceee1e03 (diff) |
V4L/DVB (3233): 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 'drivers/media/video/msp3400.c')
-rw-r--r-- | drivers/media/video/msp3400.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index fd0589352822..11235c1ac5c6 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c | |||
@@ -54,6 +54,7 @@ | |||
54 | 54 | ||
55 | #include <linux/videodev.h> | 55 | #include <linux/videodev.h> |
56 | #include <media/audiochip.h> | 56 | #include <media/audiochip.h> |
57 | #include <media/v4l2-common.h> | ||
57 | #include "msp3400.h" | 58 | #include "msp3400.h" |
58 | 59 | ||
59 | /* ---------------------------------------------------------------------- */ | 60 | /* ---------------------------------------------------------------------- */ |
@@ -2104,23 +2105,36 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
2104 | if (a->index<0||a->index>2) | 2105 | if (a->index<0||a->index>2) |
2105 | return -EINVAL; | 2106 | return -EINVAL; |
2106 | 2107 | ||
2107 | if (a->index==2) { | 2108 | msp3400_dbg("Setting audio out on msp34xx to input %i\n",a->index); |
2108 | if (a->mode == V4L2_AUDMODE_32BITS) | ||
2109 | msp->i2s_mode=1; | ||
2110 | else | ||
2111 | msp->i2s_mode=0; | ||
2112 | } | ||
2113 | msp3400_dbg("Setting audio out on msp34xx to input %i, mode %i\n",a->index,msp->i2s_mode); | ||
2114 | msp3400c_set_scart(client,msp->in_scart,a->index+1); | 2109 | msp3400c_set_scart(client,msp->in_scart,a->index+1); |
2115 | 2110 | ||
2116 | break; | 2111 | break; |
2117 | } | 2112 | } |
2113 | case VIDIOC_INT_I2S_CLOCK_FREQ: | ||
2114 | { | ||
2115 | u32 *a=(u32 *)arg; | ||
2116 | |||
2117 | msp3400_dbg("Setting I2S speed to %d\n",*a); | ||
2118 | |||
2119 | switch (*a) { | ||
2120 | case 1024000: | ||
2121 | msp->i2s_mode=0; | ||
2122 | break; | ||
2123 | case 2048000: | ||
2124 | msp->i2s_mode=1; | ||
2125 | break; | ||
2126 | default: | ||
2127 | return -EINVAL; | ||
2128 | } | ||
2129 | break; | ||
2130 | } | ||
2131 | |||
2118 | case VIDIOC_QUERYCTRL: | 2132 | case VIDIOC_QUERYCTRL: |
2119 | { | 2133 | { |
2120 | struct v4l2_queryctrl *qc = arg; | 2134 | struct v4l2_queryctrl *qc = arg; |
2121 | int i; | 2135 | int i; |
2122 | 2136 | ||
2123 | msp3400_dbg("VIDIOC_QUERYCTRL"); | 2137 | msp3400_dbg("VIDIOC_QUERYCTRL\n"); |
2124 | 2138 | ||
2125 | for (i = 0; i < ARRAY_SIZE(msp34xx_qctrl); i++) | 2139 | for (i = 0; i < ARRAY_SIZE(msp34xx_qctrl); i++) |
2126 | if (qc->id && qc->id == msp34xx_qctrl[i].id) { | 2140 | if (qc->id && qc->id == msp34xx_qctrl[i].id) { |