diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-03-19 04:48:51 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-24 14:26:56 -0500 |
commit | 427725748b38997628d95ffdf8501bcc176cf631 (patch) | |
tree | 247159488fe2fa0bacd908e1353cfbb22ec9ece1 /drivers/media | |
parent | 8bf2f8e747700419cc5bbc56c4496774eb8f2f1f (diff) |
V4L/DVB (3578): Make scart definitions easier to handle
For the new routing implementation it is easier if all the 'normal'
scart inputs (IN1-IN4) are consecutive.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/msp3400-driver.c | 30 | ||||
-rw-r--r-- | drivers/media/video/msp3400.h | 17 |
2 files changed, 24 insertions, 23 deletions
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index bd0b036c5cab..db6a52771c1b 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c | |||
@@ -245,31 +245,31 @@ int msp_write_dsp(struct i2c_client *client, int addr, int val) | |||
245 | * ----------------------------------------------------------------------- */ | 245 | * ----------------------------------------------------------------------- */ |
246 | 246 | ||
247 | static int scarts[3][9] = { | 247 | static int scarts[3][9] = { |
248 | /* MASK IN1 IN2 IN1_DA IN2_DA IN3 IN4 MONO MUTE */ | 248 | /* MASK IN1 IN2 IN3 IN4 IN1_DA IN2_DA MONO MUTE */ |
249 | /* SCART DSP Input select */ | 249 | /* SCART DSP Input select */ |
250 | { 0x0320, 0x0000, 0x0200, -1, -1, 0x0300, 0x0020, 0x0100, 0x0320 }, | 250 | { 0x0320, 0x0000, 0x0200, 0x0300, 0x0020, -1, -1, 0x0100, 0x0320 }, |
251 | /* SCART1 Output select */ | 251 | /* SCART1 Output select */ |
252 | { 0x0c40, 0x0440, 0x0400, 0x0c00, 0x0040, 0x0000, 0x0840, 0x0800, 0x0c40 }, | 252 | { 0x0c40, 0x0440, 0x0400, 0x0000, 0x0840, 0x0c00, 0x0040, 0x0800, 0x0c40 }, |
253 | /* SCART2 Output select */ | 253 | /* SCART2 Output select */ |
254 | { 0x3080, 0x1000, 0x1080, 0x0000, 0x0080, 0x2080, 0x3080, 0x2000, 0x3000 }, | 254 | { 0x3080, 0x1000, 0x1080, 0x2080, 0x3080, 0x0000, 0x0080, 0x2000, 0x3000 }, |
255 | }; | 255 | }; |
256 | 256 | ||
257 | static char *scart_names[] = { | 257 | static char *scart_names[] = { |
258 | "mask", "in1", "in2", "in1 da", "in2 da", "in3", "in4", "mono", "mute" | 258 | "in1", "in2", "in3", "in4", "in1 da", "in2 da", "mono", "mute" |
259 | }; | 259 | }; |
260 | 260 | ||
261 | void msp_set_scart(struct i2c_client *client, int in, int out) | 261 | void msp_set_scart(struct i2c_client *client, int in, int out) |
262 | { | 262 | { |
263 | struct msp_state *state = i2c_get_clientdata(client); | 263 | struct msp_state *state = i2c_get_clientdata(client); |
264 | 264 | ||
265 | state->in_scart=in; | 265 | state->in_scart = in; |
266 | 266 | ||
267 | if (in >= 1 && in <= 8 && out >= 0 && out <= 2) { | 267 | if (in >= 0 && in <= 7 && out >= 0 && out <= 2) { |
268 | if (-1 == scarts[out][in]) | 268 | if (-1 == scarts[out][in + 1]) |
269 | return; | 269 | return; |
270 | 270 | ||
271 | state->acb &= ~scarts[out][SCART_MASK]; | 271 | state->acb &= ~scarts[out][0]; |
272 | state->acb |= scarts[out][in]; | 272 | state->acb |= scarts[out][in + 1]; |
273 | } else | 273 | } else |
274 | state->acb = 0xf60; /* Mute Input and SCART 1 Output */ | 274 | state->acb = 0xf60; /* Mute Input and SCART 1 Output */ |
275 | 275 | ||
@@ -585,7 +585,7 @@ static int msp_set_ctrl(struct i2c_client *client, struct v4l2_control *ctrl) | |||
585 | static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | 585 | static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) |
586 | { | 586 | { |
587 | struct msp_state *state = i2c_get_clientdata(client); | 587 | struct msp_state *state = i2c_get_clientdata(client); |
588 | int scart = 0; | 588 | int scart = -1; |
589 | 589 | ||
590 | if (msp_debug >= 2) | 590 | if (msp_debug >= 2) |
591 | v4l_i2c_print_ioctl(client, cmd); | 591 | v4l_i2c_print_ioctl(client, cmd); |
@@ -694,7 +694,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
694 | { | 694 | { |
695 | struct msp_matrix *mspm = arg; | 695 | struct msp_matrix *mspm = arg; |
696 | 696 | ||
697 | msp_set_scart(client, mspm->input, mspm->output); | 697 | msp_set_scart(client, mspm->input - 1, mspm->output); |
698 | break; | 698 | break; |
699 | } | 699 | } |
700 | 700 | ||
@@ -735,7 +735,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
735 | state->mode = -1; | 735 | state->mode = -1; |
736 | break; | 736 | break; |
737 | } | 737 | } |
738 | if (scart) { | 738 | if (scart >= 0) { |
739 | state->rxsubchans = V4L2_TUNER_SUB_STEREO; | 739 | state->rxsubchans = V4L2_TUNER_SUB_STEREO; |
740 | msp_set_scart(client, scart, 0); | 740 | msp_set_scart(client, scart, 0); |
741 | msp_write_dsp(client, 0x000d, 0x1900); | 741 | msp_write_dsp(client, 0x000d, 0x1900); |
@@ -885,12 +885,14 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
885 | (state->rxsubchans & V4L2_TUNER_SUB_STEREO) ? "stereo" : "mono", | 885 | (state->rxsubchans & V4L2_TUNER_SUB_STEREO) ? "stereo" : "mono", |
886 | (state->rxsubchans & V4L2_TUNER_SUB_LANG2) ? ", dual" : ""); | 886 | (state->rxsubchans & V4L2_TUNER_SUB_LANG2) ? ", dual" : ""); |
887 | } else { | 887 | } else { |
888 | v4l_info(client, "Mode: %s\n", p); | 888 | if (state->opmode == OPMODE_AUTODETECT) |
889 | v4l_info(client, "Mode: %s\n", p); | ||
889 | v4l_info(client, "Standard: %s (%s%s)\n", | 890 | v4l_info(client, "Standard: %s (%s%s)\n", |
890 | msp_standard_std_name(state->std), | 891 | msp_standard_std_name(state->std), |
891 | (state->rxsubchans & V4L2_TUNER_SUB_STEREO) ? "stereo" : "mono", | 892 | (state->rxsubchans & V4L2_TUNER_SUB_STEREO) ? "stereo" : "mono", |
892 | (state->rxsubchans & V4L2_TUNER_SUB_LANG2) ? ", dual" : ""); | 893 | (state->rxsubchans & V4L2_TUNER_SUB_LANG2) ? ", dual" : ""); |
893 | } | 894 | } |
895 | v4l_info(client, "Audmode: 0x%04x\n", state->audmode); | ||
894 | v4l_info(client, "ACB: 0x%04x\n", state->acb); | 896 | v4l_info(client, "ACB: 0x%04x\n", state->acb); |
895 | break; | 897 | break; |
896 | } | 898 | } |
diff --git a/drivers/media/video/msp3400.h b/drivers/media/video/msp3400.h index 6fb5c8c994e7..7fac3ad6228d 100644 --- a/drivers/media/video/msp3400.h +++ b/drivers/media/video/msp3400.h | |||
@@ -20,15 +20,14 @@ | |||
20 | #define MSP_MODE_BTSC 8 | 20 | #define MSP_MODE_BTSC 8 |
21 | #define MSP_MODE_EXTERN 9 | 21 | #define MSP_MODE_EXTERN 9 |
22 | 22 | ||
23 | #define SCART_MASK 0 | 23 | #define SCART_IN1 0 |
24 | #define SCART_IN1 1 | 24 | #define SCART_IN2 1 |
25 | #define SCART_IN2 2 | 25 | #define SCART_IN3 2 |
26 | #define SCART_IN1_DA 3 | 26 | #define SCART_IN4 3 |
27 | #define SCART_IN2_DA 4 | 27 | #define SCART_IN1_DA 4 |
28 | #define SCART_IN3 5 | 28 | #define SCART_IN2_DA 5 |
29 | #define SCART_IN4 6 | 29 | #define SCART_MONO 6 |
30 | #define SCART_MONO 7 | 30 | #define SCART_MUTE 7 |
31 | #define SCART_MUTE 8 | ||
32 | 31 | ||
33 | #define SCART_DSP_IN 0 | 32 | #define SCART_DSP_IN 0 |
34 | #define SCART1_OUT 1 | 33 | #define SCART1_OUT 1 |