diff options
Diffstat (limited to 'drivers/media/video/saa7115.c')
-rw-r--r-- | drivers/media/video/saa7115.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index c0e66a88be4f..44873a016c2c 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -1228,30 +1228,32 @@ static int saa711x_s_radio(struct v4l2_subdev *sd) | |||
1228 | return 0; | 1228 | return 0; |
1229 | } | 1229 | } |
1230 | 1230 | ||
1231 | static int saa711x_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *route) | 1231 | static int saa711x_s_routing(struct v4l2_subdev *sd, |
1232 | u32 input, u32 output, u32 config) | ||
1232 | { | 1233 | { |
1233 | struct saa711x_state *state = to_state(sd); | 1234 | struct saa711x_state *state = to_state(sd); |
1234 | u32 input = route->input; | ||
1235 | u8 mask = (state->ident == V4L2_IDENT_SAA7111) ? 0xf8 : 0xf0; | 1235 | u8 mask = (state->ident == V4L2_IDENT_SAA7111) ? 0xf8 : 0xf0; |
1236 | 1236 | ||
1237 | v4l2_dbg(1, debug, sd, "decoder set input %d output %d\n", route->input, route->output); | 1237 | v4l2_dbg(1, debug, sd, "decoder set input %d output %d\n", |
1238 | input, output); | ||
1239 | |||
1238 | /* saa7111/3 does not have these inputs */ | 1240 | /* saa7111/3 does not have these inputs */ |
1239 | if ((state->ident == V4L2_IDENT_SAA7113 || | 1241 | if ((state->ident == V4L2_IDENT_SAA7113 || |
1240 | state->ident == V4L2_IDENT_SAA7111) && | 1242 | state->ident == V4L2_IDENT_SAA7111) && |
1241 | (route->input == SAA7115_COMPOSITE4 || | 1243 | (input == SAA7115_COMPOSITE4 || |
1242 | route->input == SAA7115_COMPOSITE5)) { | 1244 | input == SAA7115_COMPOSITE5)) { |
1243 | return -EINVAL; | 1245 | return -EINVAL; |
1244 | } | 1246 | } |
1245 | if (route->input > SAA7115_SVIDEO3) | 1247 | if (input > SAA7115_SVIDEO3) |
1246 | return -EINVAL; | 1248 | return -EINVAL; |
1247 | if (route->output > SAA7115_IPORT_ON) | 1249 | if (output > SAA7115_IPORT_ON) |
1248 | return -EINVAL; | 1250 | return -EINVAL; |
1249 | if (state->input == route->input && state->output == route->output) | 1251 | if (state->input == input && state->output == output) |
1250 | return 0; | 1252 | return 0; |
1251 | v4l2_dbg(1, debug, sd, "now setting %s input %s output\n", | 1253 | v4l2_dbg(1, debug, sd, "now setting %s input %s output\n", |
1252 | (route->input >= SAA7115_SVIDEO0) ? "S-Video" : "Composite", | 1254 | (input >= SAA7115_SVIDEO0) ? "S-Video" : "Composite", |
1253 | (route->output == SAA7115_IPORT_ON) ? "iport on" : "iport off"); | 1255 | (output == SAA7115_IPORT_ON) ? "iport on" : "iport off"); |
1254 | state->input = route->input; | 1256 | state->input = input; |
1255 | 1257 | ||
1256 | /* saa7111 has slightly different input numbering */ | 1258 | /* saa7111 has slightly different input numbering */ |
1257 | if (state->ident == V4L2_IDENT_SAA7111) { | 1259 | if (state->ident == V4L2_IDENT_SAA7111) { |
@@ -1260,10 +1262,10 @@ static int saa711x_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing * | |||
1260 | /* saa7111 specific */ | 1262 | /* saa7111 specific */ |
1261 | saa711x_write(sd, R_10_CHROMA_CNTL_2, | 1263 | saa711x_write(sd, R_10_CHROMA_CNTL_2, |
1262 | (saa711x_read(sd, R_10_CHROMA_CNTL_2) & 0x3f) | | 1264 | (saa711x_read(sd, R_10_CHROMA_CNTL_2) & 0x3f) | |
1263 | ((route->output & 0xc0) ^ 0x40)); | 1265 | ((output & 0xc0) ^ 0x40)); |
1264 | saa711x_write(sd, R_13_RT_X_PORT_OUT_CNTL, | 1266 | saa711x_write(sd, R_13_RT_X_PORT_OUT_CNTL, |
1265 | (saa711x_read(sd, R_13_RT_X_PORT_OUT_CNTL) & 0xf0) | | 1267 | (saa711x_read(sd, R_13_RT_X_PORT_OUT_CNTL) & 0xf0) | |
1266 | ((route->output & 2) ? 0x0a : 0)); | 1268 | ((output & 2) ? 0x0a : 0)); |
1267 | } | 1269 | } |
1268 | 1270 | ||
1269 | /* select mode */ | 1271 | /* select mode */ |
@@ -1276,7 +1278,7 @@ static int saa711x_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing * | |||
1276 | (saa711x_read(sd, R_09_LUMA_CNTL) & 0x7f) | | 1278 | (saa711x_read(sd, R_09_LUMA_CNTL) & 0x7f) | |
1277 | (state->input >= SAA7115_SVIDEO0 ? 0x80 : 0x0)); | 1279 | (state->input >= SAA7115_SVIDEO0 ? 0x80 : 0x0)); |
1278 | 1280 | ||
1279 | state->output = route->output; | 1281 | state->output = output; |
1280 | if (state->ident == V4L2_IDENT_SAA7114 || | 1282 | if (state->ident == V4L2_IDENT_SAA7114 || |
1281 | state->ident == V4L2_IDENT_SAA7115) { | 1283 | state->ident == V4L2_IDENT_SAA7115) { |
1282 | saa711x_write(sd, R_83_X_PORT_I_O_ENA_AND_OUT_CLK, | 1284 | saa711x_write(sd, R_83_X_PORT_I_O_ENA_AND_OUT_CLK, |