aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-04-02 12:35:00 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 00:57:38 -0400
commitc7c0b34c27bbf0671807e902fbfea6270c8f138d (patch)
tree2d44aae2ae76ee47ca12262967ac5711bcc047b6 /drivers/media/video/em28xx
parentb7f8292c96463810edfecff70dd4631d47e5a36b (diff)
V4L/DVB (3712): Fix video input setting of em28xx, use _INT_S_VIDEO_ROUTING in tvp5150
- Use new routing input defines in em28xx-cards.c - Fix S-Video settings for tvp5150-based cards (input was copied from saa7115 based cards and worked only because S-Video was selected in the default: case) - Replace VIDIOC_S_INPUT by VIDIOC_INT_S_VIDEO_ROUTING in em28xx-video.c - Remove the now obsolete VIDIOC_S_INPUT handler in saa7115.c - Add VIDIOC_INT_G/S_VIDEO_ROUTING in tvp5150.c - Add new media/tvp5150.h with the routing defines. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c58
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c18
2 files changed, 41 insertions, 35 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 3ba3439db580..eb8132bff313 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -29,6 +29,8 @@
29#include <linux/usb.h> 29#include <linux/usb.h>
30#include <media/tuner.h> 30#include <media/tuner.h>
31#include <media/msp3400.h> 31#include <media/msp3400.h>
32#include <media/saa7115.h>
33#include <media/tvp5150.h>
32#include <media/tveeprom.h> 34#include <media/tveeprom.h>
33#include <media/audiochip.h> 35#include <media/audiochip.h>
34#include <media/v4l2-common.h> 36#include <media/v4l2-common.h>
@@ -46,11 +48,11 @@ struct em28xx_board em28xx_boards[] = {
46 .decoder = EM28XX_SAA7113, 48 .decoder = EM28XX_SAA7113,
47 .input = {{ 49 .input = {{
48 .type = EM28XX_VMUX_COMPOSITE1, 50 .type = EM28XX_VMUX_COMPOSITE1,
49 .vmux = 0, 51 .vmux = SAA7115_COMPOSITE0,
50 .amux = 1, 52 .amux = 1,
51 },{ 53 },{
52 .type = EM28XX_VMUX_SVIDEO, 54 .type = EM28XX_VMUX_SVIDEO,
53 .vmux = 9, 55 .vmux = SAA7115_SVIDEO3,
54 .amux = 1, 56 .amux = 1,
55 }}, 57 }},
56 }, 58 },
@@ -64,11 +66,11 @@ struct em28xx_board em28xx_boards[] = {
64 .decoder = EM28XX_SAA7113, 66 .decoder = EM28XX_SAA7113,
65 .input = {{ 67 .input = {{
66 .type = EM28XX_VMUX_COMPOSITE1, 68 .type = EM28XX_VMUX_COMPOSITE1,
67 .vmux = 0, 69 .vmux = SAA7115_COMPOSITE0,
68 .amux = 1, 70 .amux = 1,
69 },{ 71 },{
70 .type = EM28XX_VMUX_SVIDEO, 72 .type = EM28XX_VMUX_SVIDEO,
71 .vmux = 9, 73 .vmux = SAA7115_SVIDEO3,
72 .amux = 1, 74 .amux = 1,
73 }}, 75 }},
74 }, 76 },
@@ -82,11 +84,11 @@ struct em28xx_board em28xx_boards[] = {
82 .decoder = EM28XX_SAA7113, 84 .decoder = EM28XX_SAA7113,
83 .input = {{ 85 .input = {{
84 .type = EM28XX_VMUX_COMPOSITE1, 86 .type = EM28XX_VMUX_COMPOSITE1,
85 .vmux = 0, 87 .vmux = SAA7115_COMPOSITE0,
86 .amux = 1, 88 .amux = 1,
87 },{ 89 },{
88 .type = EM28XX_VMUX_SVIDEO, 90 .type = EM28XX_VMUX_SVIDEO,
89 .vmux = 9, 91 .vmux = SAA7115_SVIDEO3,
90 .amux = 1, 92 .amux = 1,
91 }}, 93 }},
92 }, 94 },
@@ -100,15 +102,15 @@ struct em28xx_board em28xx_boards[] = {
100 .decoder = EM28XX_SAA7113, 102 .decoder = EM28XX_SAA7113,
101 .input = {{ 103 .input = {{
102 .type = EM28XX_VMUX_TELEVISION, 104 .type = EM28XX_VMUX_TELEVISION,
103 .vmux = 2, 105 .vmux = SAA7115_COMPOSITE2,
104 .amux = 1, 106 .amux = 1,
105 },{ 107 },{
106 .type = EM28XX_VMUX_COMPOSITE1, 108 .type = EM28XX_VMUX_COMPOSITE1,
107 .vmux = 0, 109 .vmux = SAA7115_COMPOSITE0,
108 .amux = 1, 110 .amux = 1,
109 },{ 111 },{
110 .type = EM28XX_VMUX_SVIDEO, 112 .type = EM28XX_VMUX_SVIDEO,
111 .vmux = 9, 113 .vmux = SAA7115_SVIDEO3,
112 .amux = 1, 114 .amux = 1,
113 }}, 115 }},
114 }, 116 },
@@ -122,15 +124,15 @@ struct em28xx_board em28xx_boards[] = {
122 .decoder = EM28XX_SAA7113, 124 .decoder = EM28XX_SAA7113,
123 .input = {{ 125 .input = {{
124 .type = EM28XX_VMUX_TELEVISION, 126 .type = EM28XX_VMUX_TELEVISION,
125 .vmux = 2, 127 .vmux = SAA7115_COMPOSITE2,
126 .amux = 0, 128 .amux = 0,
127 },{ 129 },{
128 .type = EM28XX_VMUX_COMPOSITE1, 130 .type = EM28XX_VMUX_COMPOSITE1,
129 .vmux = 0, 131 .vmux = SAA7115_COMPOSITE0,
130 .amux = 1, 132 .amux = 1,
131 },{ 133 },{
132 .type = EM28XX_VMUX_SVIDEO, 134 .type = EM28XX_VMUX_SVIDEO,
133 .vmux = 9, 135 .vmux = SAA7115_SVIDEO3,
134 .amux = 1, 136 .amux = 1,
135 }}, 137 }},
136 }, 138 },
@@ -146,11 +148,11 @@ struct em28xx_board em28xx_boards[] = {
146 /*FIXME: S-Video not tested */ 148 /*FIXME: S-Video not tested */
147 .input = {{ 149 .input = {{
148 .type = EM28XX_VMUX_TELEVISION, 150 .type = EM28XX_VMUX_TELEVISION,
149 .vmux = 0, 151 .vmux = TVP5150_COMPOSITE0,
150 .amux = MSP_INPUT_DEFAULT, 152 .amux = MSP_INPUT_DEFAULT,
151 },{ 153 },{
152 .type = EM28XX_VMUX_SVIDEO, 154 .type = EM28XX_VMUX_SVIDEO,
153 .vmux = 2, 155 .vmux = TVP5150_SVIDEO,
154 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, 156 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
155 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART), 157 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
156 }}, 158 }},
@@ -165,15 +167,15 @@ struct em28xx_board em28xx_boards[] = {
165 .decoder = EM28XX_SAA7114, 167 .decoder = EM28XX_SAA7114,
166 .input = {{ 168 .input = {{
167 .type = EM28XX_VMUX_TELEVISION, 169 .type = EM28XX_VMUX_TELEVISION,
168 .vmux = 4, 170 .vmux = SAA7115_COMPOSITE4,
169 .amux = 0, 171 .amux = 0,
170 },{ 172 },{
171 .type = EM28XX_VMUX_COMPOSITE1, 173 .type = EM28XX_VMUX_COMPOSITE1,
172 .vmux = 0, 174 .vmux = SAA7115_COMPOSITE0,
173 .amux = 1, 175 .amux = 1,
174 },{ 176 },{
175 .type = EM28XX_VMUX_SVIDEO, 177 .type = EM28XX_VMUX_SVIDEO,
176 .vmux = 9, 178 .vmux = SAA7115_SVIDEO3,
177 .amux = 1, 179 .amux = 1,
178 }}, 180 }},
179 }, 181 },
@@ -188,15 +190,15 @@ struct em28xx_board em28xx_boards[] = {
188 .decoder = EM28XX_SAA7113, 190 .decoder = EM28XX_SAA7113,
189 .input = {{ 191 .input = {{
190 .type = EM28XX_VMUX_TELEVISION, 192 .type = EM28XX_VMUX_TELEVISION,
191 .vmux = 2, 193 .vmux = SAA7115_COMPOSITE2,
192 .amux = 0, 194 .amux = 0,
193 },{ 195 },{
194 .type = EM28XX_VMUX_COMPOSITE1, 196 .type = EM28XX_VMUX_COMPOSITE1,
195 .vmux = 0, 197 .vmux = SAA7115_COMPOSITE0,
196 .amux = 1, 198 .amux = 1,
197 },{ 199 },{
198 .type = EM28XX_VMUX_SVIDEO, 200 .type = EM28XX_VMUX_SVIDEO,
199 .vmux = 9, 201 .vmux = SAA7115_SVIDEO3,
200 .amux = 1, 202 .amux = 1,
201 }}, 203 }},
202 }, 204 },
@@ -211,15 +213,15 @@ struct em28xx_board em28xx_boards[] = {
211 .decoder = EM28XX_SAA7113, 213 .decoder = EM28XX_SAA7113,
212 .input = {{ 214 .input = {{
213 .type = EM28XX_VMUX_TELEVISION, 215 .type = EM28XX_VMUX_TELEVISION,
214 .vmux = 2, 216 .vmux = SAA7115_COMPOSITE2,
215 .amux = 0, 217 .amux = 0,
216 },{ 218 },{
217 .type = EM28XX_VMUX_COMPOSITE1, 219 .type = EM28XX_VMUX_COMPOSITE1,
218 .vmux = 0, 220 .vmux = SAA7115_COMPOSITE0,
219 .amux = 1, 221 .amux = 1,
220 },{ 222 },{
221 .type = EM28XX_VMUX_SVIDEO, 223 .type = EM28XX_VMUX_SVIDEO,
222 .vmux = 9, 224 .vmux = SAA7115_SVIDEO3,
223 .amux = 1, 225 .amux = 1,
224 }}, 226 }},
225 }, 227 },
@@ -234,15 +236,15 @@ struct em28xx_board em28xx_boards[] = {
234 .decoder = EM28XX_SAA7113, 236 .decoder = EM28XX_SAA7113,
235 .input = {{ 237 .input = {{
236 .type = EM28XX_VMUX_TELEVISION, 238 .type = EM28XX_VMUX_TELEVISION,
237 .vmux = 2, 239 .vmux = SAA7115_COMPOSITE2,
238 .amux = 0, 240 .amux = 0,
239 },{ 241 },{
240 .type = EM28XX_VMUX_COMPOSITE1, 242 .type = EM28XX_VMUX_COMPOSITE1,
241 .vmux = 0, 243 .vmux = SAA7115_COMPOSITE0,
242 .amux = 1, 244 .amux = 1,
243 },{ 245 },{
244 .type = EM28XX_VMUX_SVIDEO, 246 .type = EM28XX_VMUX_SVIDEO,
245 .vmux = 9, 247 .vmux = SAA7115_SVIDEO3,
246 .amux = 1, 248 .amux = 1,
247 }}, 249 }},
248 }, 250 },
@@ -254,11 +256,11 @@ struct em28xx_board em28xx_boards[] = {
254 .decoder = EM28XX_SAA7113, 256 .decoder = EM28XX_SAA7113,
255 .input = {{ 257 .input = {{
256 .type = EM28XX_VMUX_COMPOSITE1, 258 .type = EM28XX_VMUX_COMPOSITE1,
257 .vmux = 0, 259 .vmux = SAA7115_COMPOSITE0,
258 .amux = 1, 260 .amux = 1,
259 },{ 261 },{
260 .type = EM28XX_VMUX_SVIDEO, 262 .type = EM28XX_VMUX_SVIDEO,
261 .vmux = 9, 263 .vmux = SAA7115_SVIDEO3,
262 .amux = 1, 264 .amux = 1,
263 }}, 265 }},
264 }, 266 },
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index cf7cdf9ef617..1a0062b649a8 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -170,8 +170,12 @@ static int em28xx_config(struct em28xx *dev)
170static void em28xx_config_i2c(struct em28xx *dev) 170static void em28xx_config_i2c(struct em28xx *dev)
171{ 171{
172 struct v4l2_frequency f; 172 struct v4l2_frequency f;
173 struct v4l2_routing route;
174
175 route.input = INPUT(dev->ctl_input)->vmux;
176 route.output = 0;
173 em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, NULL); 177 em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, NULL);
174 em28xx_i2c_call_clients(dev, VIDIOC_S_INPUT, &dev->ctl_input); 178 em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route);
175 em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL); 179 em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL);
176 180
177 /* configure tuner */ 181 /* configure tuner */
@@ -206,19 +210,19 @@ static void em28xx_empty_framequeues(struct em28xx *dev)
206 210
207static void video_mux(struct em28xx *dev, int index) 211static void video_mux(struct em28xx *dev, int index)
208{ 212{
209 int input, ainput; 213 int ainput;
214 struct v4l2_routing route;
210 215
211 input = INPUT(index)->vmux; 216 route.input = INPUT(index)->vmux;
217 route.output = 0;
212 dev->ctl_input = index; 218 dev->ctl_input = index;
213 dev->ctl_ainput = INPUT(index)->amux; 219 dev->ctl_ainput = INPUT(index)->amux;
214 220
215 em28xx_i2c_call_clients(dev, VIDIOC_S_INPUT, &input); 221 em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route);
216 222
217 em28xx_videodbg("Setting input index=%d, vmux=%d, amux=%d\n",index,input,dev->ctl_ainput); 223 em28xx_videodbg("Setting input index=%d, vmux=%d, amux=%d\n",index,route.input,dev->ctl_ainput);
218 224
219 if (dev->has_msp34xx) { 225 if (dev->has_msp34xx) {
220 struct v4l2_routing route;
221
222 if (dev->i2s_speed) 226 if (dev->i2s_speed)
223 em28xx_i2c_call_clients(dev, VIDIOC_INT_I2S_CLOCK_FREQ, &dev->i2s_speed); 227 em28xx_i2c_call_clients(dev, VIDIOC_INT_I2S_CLOCK_FREQ, &dev->i2s_speed);
224 route.input = dev->ctl_ainput; 228 route.input = dev->ctl_ainput;