aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/msp3400-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/msp3400-driver.c')
-rw-r--r--drivers/media/video/msp3400-driver.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index aa8c556b6ba1..9b05a0ab776d 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -66,26 +66,26 @@ MODULE_LICENSE("GPL");
66 66
67/* module parameters */ 67/* module parameters */
68static int opmode = OPMODE_AUTO; 68static int opmode = OPMODE_AUTO;
69int debug = 0; /* debug output */ 69int msp_debug = 0; /* msp_debug output */
70int once = 0; /* no continous stereo monitoring */ 70int msp_once = 0; /* no continous stereo monitoring */
71int amsound = 0; /* hard-wire AM sound at 6.5 Hz (france), 71int msp_amsound = 0; /* hard-wire AM sound at 6.5 Hz (france),
72 the autoscan seems work well only with FM... */ 72 the autoscan seems work well only with FM... */
73int standard = 1; /* Override auto detect of audio standard, if needed. */ 73int msp_standard = 1; /* Override auto detect of audio msp_standard, if needed. */
74int dolby = 0; 74int msp_dolby = 0;
75 75
76int stereo_threshold = 0x190; /* a2 threshold for stereo/bilingual 76int msp_stereo_thresh = 0x190; /* a2 threshold for stereo/bilingual
77 (msp34xxg only) 0x00a0-0x03c0 */ 77 (msp34xxg only) 0x00a0-0x03c0 */
78 78
79/* read-only */ 79/* read-only */
80module_param(opmode, int, 0444); 80module_param(opmode, int, 0444);
81 81
82/* read-write */ 82/* read-write */
83module_param(once, bool, 0644); 83module_param_named(once,msp_once, bool, 0644);
84module_param(debug, int, 0644); 84module_param_named(debug,msp_debug, int, 0644);
85module_param(stereo_threshold, int, 0644); 85module_param_named(stereo_threshold,msp_stereo_thresh, int, 0644);
86module_param(standard, int, 0644); 86module_param_named(standard,msp_standard, int, 0644);
87module_param(amsound, bool, 0644); 87module_param_named(amsound,msp_amsound, bool, 0644);
88module_param(dolby, bool, 0644); 88module_param_named(dolby,msp_dolby, bool, 0644);
89 89
90MODULE_PARM_DESC(opmode, "Forces a MSP3400 opmode. 0=Manual, 1=Autodetect, 2=Autodetect and autoselect"); 90MODULE_PARM_DESC(opmode, "Forces a MSP3400 opmode. 0=Manual, 1=Autodetect, 2=Autodetect and autoselect");
91MODULE_PARM_DESC(once, "No continuous stereo monitoring"); 91MODULE_PARM_DESC(once, "No continuous stereo monitoring");
@@ -127,7 +127,7 @@ int msp_reset(struct i2c_client *client)
127 { client->addr, I2C_M_RD, 2, read }, 127 { client->addr, I2C_M_RD, 2, read },
128 }; 128 };
129 129
130 v4l_dbg(3, client, "msp_reset\n"); 130 v4l_dbg(3, msp_debug, client, "msp_reset\n");
131 if (i2c_transfer(client->adapter, &reset[0], 1) != 1 || 131 if (i2c_transfer(client->adapter, &reset[0], 1) != 1 ||
132 i2c_transfer(client->adapter, &reset[1], 1) != 1 || 132 i2c_transfer(client->adapter, &reset[1], 1) != 1 ||
133 i2c_transfer(client->adapter, test, 2) != 2) { 133 i2c_transfer(client->adapter, test, 2) != 2) {
@@ -165,7 +165,7 @@ static int msp_read(struct i2c_client *client, int dev, int addr)
165 return -1; 165 return -1;
166 } 166 }
167 retval = read[0] << 8 | read[1]; 167 retval = read[0] << 8 | read[1];
168 v4l_dbg(3, client, "msp_read(0x%x, 0x%x): 0x%x\n", dev, addr, retval); 168 v4l_dbg(3, msp_debug, client, "msp_read(0x%x, 0x%x): 0x%x\n", dev, addr, retval);
169 return retval; 169 return retval;
170} 170}
171 171
@@ -190,7 +190,7 @@ static int msp_write(struct i2c_client *client, int dev, int addr, int val)
190 buffer[3] = val >> 8; 190 buffer[3] = val >> 8;
191 buffer[4] = val & 0xff; 191 buffer[4] = val & 0xff;
192 192
193 v4l_dbg(3, client, "msp_write(0x%x, 0x%x, 0x%x)\n", dev, addr, val); 193 v4l_dbg(3, msp_debug, client, "msp_write(0x%x, 0x%x, 0x%x)\n", dev, addr, val);
194 for (err = 0; err < 3; err++) { 194 for (err = 0; err < 3; err++) {
195 if (i2c_master_send(client, buffer, 5) == 5) 195 if (i2c_master_send(client, buffer, 5) == 5)
196 break; 196 break;
@@ -273,7 +273,7 @@ void msp_set_scart(struct i2c_client *client, int in, int out)
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
276 v4l_dbg(1, client, "scart switch: %s => %d (ACB=0x%04x)\n", 276 v4l_dbg(1, msp_debug, client, "scart switch: %s => %d (ACB=0x%04x)\n",
277 scart_names[in], out, state->acb); 277 scart_names[in], out, state->acb);
278 msp_write_dsp(client, 0x13, state->acb); 278 msp_write_dsp(client, 0x13, state->acb);
279 279
@@ -285,7 +285,7 @@ void msp_set_mute(struct i2c_client *client)
285{ 285{
286 struct msp_state *state = i2c_get_clientdata(client); 286 struct msp_state *state = i2c_get_clientdata(client);
287 287
288 v4l_dbg(1, client, "mute audio\n"); 288 v4l_dbg(1, msp_debug, client, "mute audio\n");
289 msp_write_dsp(client, 0x0000, 0); 289 msp_write_dsp(client, 0x0000, 0);
290 msp_write_dsp(client, 0x0007, 1); 290 msp_write_dsp(client, 0x0007, 1);
291 if (state->has_scart2_out_volume) 291 if (state->has_scart2_out_volume)
@@ -303,7 +303,7 @@ void msp_set_audio(struct i2c_client *client)
303 if (!state->muted) 303 if (!state->muted)
304 val = (state->volume * 0x7f / 65535) << 8; 304 val = (state->volume * 0x7f / 65535) << 8;
305 305
306 v4l_dbg(1, client, "mute=%s volume=%d\n", 306 v4l_dbg(1, msp_debug, client, "mute=%s volume=%d\n",
307 state->muted ? "on" : "off", state->volume); 307 state->muted ? "on" : "off", state->volume);
308 308
309 msp_write_dsp(client, 0x0000, val); 309 msp_write_dsp(client, 0x0000, val);
@@ -321,7 +321,7 @@ void msp_set_audio(struct i2c_client *client)
321 treble = ((state->treble - 32768) * 0x60 / 65535) << 8; 321 treble = ((state->treble - 32768) * 0x60 / 65535) << 8;
322 loudness = state->loudness ? ((5 * 4) << 8) : 0; 322 loudness = state->loudness ? ((5 * 4) << 8) : 0;
323 323
324 v4l_dbg(1, client, "balance=%d bass=%d treble=%d loudness=%d\n", 324 v4l_dbg(1, msp_debug, client, "balance=%d bass=%d treble=%d loudness=%d\n",
325 state->balance, state->bass, state->treble, state->loudness); 325 state->balance, state->bass, state->treble, state->loudness);
326 326
327 msp_write_dsp(client, 0x0001, bal << 8); 327 msp_write_dsp(client, 0x0001, bal << 8);
@@ -341,12 +341,12 @@ int msp_modus(struct i2c_client *client)
341 struct msp_state *state = i2c_get_clientdata(client); 341 struct msp_state *state = i2c_get_clientdata(client);
342 342
343 if (state->radio) { 343 if (state->radio) {
344 v4l_dbg(1, client, "video mode selected to Radio\n"); 344 v4l_dbg(1, msp_debug, client, "video mode selected to Radio\n");
345 return 0x0003; 345 return 0x0003;
346 } 346 }
347 347
348 if (state->v4l2_std & V4L2_STD_PAL) { 348 if (state->v4l2_std & V4L2_STD_PAL) {
349 v4l_dbg(1, client, "video mode selected to PAL\n"); 349 v4l_dbg(1, msp_debug, client, "video mode selected to PAL\n");
350 350
351#if 1 351#if 1
352 /* experimental: not sure this works with all chip versions */ 352 /* experimental: not sure this works with all chip versions */
@@ -357,11 +357,11 @@ int msp_modus(struct i2c_client *client)
357#endif 357#endif
358 } 358 }
359 if (state->v4l2_std & V4L2_STD_NTSC) { 359 if (state->v4l2_std & V4L2_STD_NTSC) {
360 v4l_dbg(1, client, "video mode selected to NTSC\n"); 360 v4l_dbg(1, msp_debug, client, "video mode selected to NTSC\n");
361 return 0x2003; 361 return 0x2003;
362 } 362 }
363 if (state->v4l2_std & V4L2_STD_SECAM) { 363 if (state->v4l2_std & V4L2_STD_SECAM) {
364 v4l_dbg(1, client, "video mode selected to SECAM\n"); 364 v4l_dbg(1, msp_debug, client, "video mode selected to SECAM\n");
365 return 0x0003; 365 return 0x0003;
366 } 366 }
367 return 0x0003; 367 return 0x0003;
@@ -619,7 +619,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
619 u16 *sarg = arg; 619 u16 *sarg = arg;
620 int scart = 0; 620 int scart = 0;
621 621
622 if (debug >= 2) 622 if (msp_debug >= 2)
623 v4l_i2c_print_ioctl(client, cmd); 623 v4l_i2c_print_ioctl(client, cmd);
624 624
625 switch (cmd) { 625 switch (cmd) {
@@ -666,7 +666,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
666 if (state->radio) 666 if (state->radio)
667 return 0; 667 return 0;
668 state->radio = 1; 668 state->radio = 1;
669 v4l_dbg(1, client, "switching to radio mode\n"); 669 v4l_dbg(1, msp_debug, client, "switching to radio mode\n");
670 state->watch_stereo = 0; 670 state->watch_stereo = 0;
671 switch (state->opmode) { 671 switch (state->opmode) {
672 case OPMODE_MANUAL: 672 case OPMODE_MANUAL:
@@ -937,7 +937,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
937 if (a->index < 0 || a->index > 2) 937 if (a->index < 0 || a->index > 2)
938 return -EINVAL; 938 return -EINVAL;
939 939
940 v4l_dbg(1, client, "Setting audio out on msp34xx to input %i\n", a->index); 940 v4l_dbg(1, msp_debug, client, "Setting audio out on msp34xx to input %i\n", a->index);
941 msp_set_scart(client, state->in_scart, a->index + 1); 941 msp_set_scart(client, state->in_scart, a->index + 1);
942 942
943 break; 943 break;
@@ -947,7 +947,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
947 { 947 {
948 u32 *a = (u32 *)arg; 948 u32 *a = (u32 *)arg;
949 949
950 v4l_dbg(1, client, "Setting I2S speed to %d\n", *a); 950 v4l_dbg(1, msp_debug, client, "Setting I2S speed to %d\n", *a);
951 951
952 switch (*a) { 952 switch (*a) {
953 case 1024000: 953 case 1024000:
@@ -1041,7 +1041,7 @@ static int msp_suspend(struct device * dev, pm_message_t state)
1041{ 1041{
1042 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1042 struct i2c_client *client = container_of(dev, struct i2c_client, dev);
1043 1043
1044 v4l_dbg(1, client, "suspend\n"); 1044 v4l_dbg(1, msp_debug, client, "suspend\n");
1045 msp_reset(client); 1045 msp_reset(client);
1046 return 0; 1046 return 0;
1047} 1047}
@@ -1050,7 +1050,7 @@ static int msp_resume(struct device * dev)
1050{ 1050{
1051 struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1051 struct i2c_client *client = container_of(dev, struct i2c_client, dev);
1052 1052
1053 v4l_dbg(1, client, "resume\n"); 1053 v4l_dbg(1, msp_debug, client, "resume\n");
1054 msp_wake_thread(client); 1054 msp_wake_thread(client);
1055 return 0; 1055 return 0;
1056} 1056}
@@ -1080,7 +1080,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
1080 snprintf(client->name, sizeof(client->name) - 1, "msp3400"); 1080 snprintf(client->name, sizeof(client->name) - 1, "msp3400");
1081 1081
1082 if (msp_reset(client) == -1) { 1082 if (msp_reset(client) == -1) {
1083 v4l_dbg(1, client, "msp3400 not found\n"); 1083 v4l_dbg(1, msp_debug, client, "msp3400 not found\n");
1084 kfree(client); 1084 kfree(client);
1085 return -1; 1085 return -1;
1086 } 1086 }
@@ -1107,9 +1107,9 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
1107 state->rev1 = msp_read_dsp(client, 0x1e); 1107 state->rev1 = msp_read_dsp(client, 0x1e);
1108 if (state->rev1 != -1) 1108 if (state->rev1 != -1)
1109 state->rev2 = msp_read_dsp(client, 0x1f); 1109 state->rev2 = msp_read_dsp(client, 0x1f);
1110 v4l_dbg(1, client, "rev1=0x%04x, rev2=0x%04x\n", state->rev1, state->rev2); 1110 v4l_dbg(1, msp_debug, client, "rev1=0x%04x, rev2=0x%04x\n", state->rev1, state->rev2);
1111 if (state->rev1 == -1 || (state->rev1 == 0 && state->rev2 == 0)) { 1111 if (state->rev1 == -1 || (state->rev1 == 0 && state->rev2 == 0)) {
1112 v4l_dbg(1, client, "not an msp3400 (cannot read chip version)\n"); 1112 v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n");
1113 kfree(state); 1113 kfree(state);
1114 kfree(client); 1114 kfree(client);
1115 return -1; 1115 return -1;