diff options
-rw-r--r-- | drivers/media/video/bt832.c | 4 | ||||
-rw-r--r-- | drivers/media/video/cs53l32a.c | 4 | ||||
-rw-r--r-- | drivers/media/video/cx25840/cx25840-core.c | 12 | ||||
-rw-r--r-- | drivers/media/video/msp3400-driver.c | 64 | ||||
-rw-r--r-- | drivers/media/video/msp3400-kthreads.c | 124 | ||||
-rw-r--r-- | drivers/media/video/msp3400.h | 12 | ||||
-rw-r--r-- | drivers/media/video/saa7115.c | 38 | ||||
-rw-r--r-- | drivers/media/video/saa7127.c | 36 | ||||
-rw-r--r-- | drivers/media/video/tda7432.c | 12 | ||||
-rw-r--r-- | drivers/media/video/tvaudio.c | 52 | ||||
-rw-r--r-- | include/media/v4l2-common.h | 3 |
11 files changed, 180 insertions, 181 deletions
diff --git a/drivers/media/video/bt832.c b/drivers/media/video/bt832.c index 361a9b6ccce3..07c78f1f7a44 100644 --- a/drivers/media/video/bt832.c +++ b/drivers/media/video/bt832.c | |||
@@ -75,13 +75,13 @@ int bt832_hexdump(struct i2c_client *i2c_client_s, unsigned char *buf) | |||
75 | 75 | ||
76 | if(debug>1) { | 76 | if(debug>1) { |
77 | int i; | 77 | int i; |
78 | v4l_dbg(2,i2c_client_s,"hexdump:"); | 78 | v4l_dbg(2, debug,i2c_client_s,"hexdump:"); |
79 | for(i=1;i<65;i++) { | 79 | for(i=1;i<65;i++) { |
80 | if(i!=1) { | 80 | if(i!=1) { |
81 | if(((i-1)%8)==0) printk(" "); | 81 | if(((i-1)%8)==0) printk(" "); |
82 | if(((i-1)%16)==0) { | 82 | if(((i-1)%16)==0) { |
83 | printk("\n"); | 83 | printk("\n"); |
84 | v4l_dbg(2,i2c_client_s,"hexdump:"); | 84 | v4l_dbg(2, debug,i2c_client_s,"hexdump:"); |
85 | } | 85 | } |
86 | } | 86 | } |
87 | printk(" %02x",buf[i]); | 87 | printk(" %02x",buf[i]); |
diff --git a/drivers/media/video/cs53l32a.c b/drivers/media/video/cs53l32a.c index 9a66b5961d19..8739c64785ef 100644 --- a/drivers/media/video/cs53l32a.c +++ b/drivers/media/video/cs53l32a.c | |||
@@ -155,7 +155,7 @@ static int cs53l32a_attach(struct i2c_adapter *adapter, int address, int kind) | |||
155 | for (i = 1; i <= 7; i++) { | 155 | for (i = 1; i <= 7; i++) { |
156 | u8 v = cs53l32a_read(client, i); | 156 | u8 v = cs53l32a_read(client, i); |
157 | 157 | ||
158 | v4l_dbg(1, client, "Read Reg %d %02x\n", i, v); | 158 | v4l_dbg(1, debug, client, "Read Reg %d %02x\n", i, v); |
159 | } | 159 | } |
160 | 160 | ||
161 | /* Set cs53l32a internal register for Adaptec 2010/2410 setup */ | 161 | /* Set cs53l32a internal register for Adaptec 2010/2410 setup */ |
@@ -173,7 +173,7 @@ static int cs53l32a_attach(struct i2c_adapter *adapter, int address, int kind) | |||
173 | for (i = 1; i <= 7; i++) { | 173 | for (i = 1; i <= 7; i++) { |
174 | u8 v = cs53l32a_read(client, i); | 174 | u8 v = cs53l32a_read(client, i); |
175 | 175 | ||
176 | v4l_dbg(1, client, "Read Reg %d %02x\n", i, v); | 176 | v4l_dbg(1, debug, client, "Read Reg %d %02x\n", i, v); |
177 | } | 177 | } |
178 | 178 | ||
179 | i2c_attach_client(client); | 179 | i2c_attach_client(client); |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index c1734762436d..847b166d8b15 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -265,7 +265,7 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp | |||
265 | vid_input <= CX25840_COMPOSITE8); | 265 | vid_input <= CX25840_COMPOSITE8); |
266 | u8 reg; | 266 | u8 reg; |
267 | 267 | ||
268 | v4l_dbg(1, client, "decoder set video input %d, audio input %d\n", | 268 | v4l_dbg(1, debug, client, "decoder set video input %d, audio input %d\n", |
269 | vid_input, aud_input); | 269 | vid_input, aud_input); |
270 | 270 | ||
271 | if (is_composite) { | 271 | if (is_composite) { |
@@ -533,7 +533,7 @@ static int set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt) | |||
533 | else | 533 | else |
534 | filter = 3; | 534 | filter = 3; |
535 | 535 | ||
536 | v4l_dbg(1, client, "decoder set size %dx%d -> scale %ux%u\n", | 536 | v4l_dbg(1, debug, client, "decoder set size %dx%d -> scale %ux%u\n", |
537 | pix->width, pix->height, HSC, VSC); | 537 | pix->width, pix->height, HSC, VSC); |
538 | 538 | ||
539 | /* HSCALE=HSC */ | 539 | /* HSCALE=HSC */ |
@@ -687,13 +687,13 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd, | |||
687 | return cx25840_audio(client, cmd, arg); | 687 | return cx25840_audio(client, cmd, arg); |
688 | 688 | ||
689 | case VIDIOC_STREAMON: | 689 | case VIDIOC_STREAMON: |
690 | v4l_dbg(1, client, "enable output\n"); | 690 | v4l_dbg(1, debug, client, "enable output\n"); |
691 | cx25840_write(client, 0x115, 0x8c); | 691 | cx25840_write(client, 0x115, 0x8c); |
692 | cx25840_write(client, 0x116, 0x07); | 692 | cx25840_write(client, 0x116, 0x07); |
693 | break; | 693 | break; |
694 | 694 | ||
695 | case VIDIOC_STREAMOFF: | 695 | case VIDIOC_STREAMOFF: |
696 | v4l_dbg(1, client, "disable output\n"); | 696 | v4l_dbg(1, debug, client, "disable output\n"); |
697 | cx25840_write(client, 0x115, 0x00); | 697 | cx25840_write(client, 0x115, 0x00); |
698 | cx25840_write(client, 0x116, 0x00); | 698 | cx25840_write(client, 0x116, 0x00); |
699 | break; | 699 | break; |
@@ -871,7 +871,7 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address, | |||
871 | client->driver = &i2c_driver_cx25840; | 871 | client->driver = &i2c_driver_cx25840; |
872 | snprintf(client->name, sizeof(client->name) - 1, "cx25840"); | 872 | snprintf(client->name, sizeof(client->name) - 1, "cx25840"); |
873 | 873 | ||
874 | v4l_dbg(1, client, "detecting cx25840 client on address 0x%x\n", address << 1); | 874 | v4l_dbg(1, debug, client, "detecting cx25840 client on address 0x%x\n", address << 1); |
875 | 875 | ||
876 | device_id = cx25840_read(client, 0x101) << 8; | 876 | device_id = cx25840_read(client, 0x101) << 8; |
877 | device_id |= cx25840_read(client, 0x100); | 877 | device_id |= cx25840_read(client, 0x100); |
@@ -879,7 +879,7 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address, | |||
879 | /* The high byte of the device ID should be | 879 | /* The high byte of the device ID should be |
880 | * 0x84 if chip is present */ | 880 | * 0x84 if chip is present */ |
881 | if ((device_id & 0xff00) != 0x8400) { | 881 | if ((device_id & 0xff00) != 0x8400) { |
882 | v4l_dbg(1, client, "cx25840 not found\n"); | 882 | v4l_dbg(1, debug, client, "cx25840 not found\n"); |
883 | kfree(client); | 883 | kfree(client); |
884 | return 0; | 884 | return 0; |
885 | } | 885 | } |
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 */ |
68 | static int opmode = OPMODE_AUTO; | 68 | static int opmode = OPMODE_AUTO; |
69 | int debug = 0; /* debug output */ | 69 | int msp_debug = 0; /* msp_debug output */ |
70 | int once = 0; /* no continous stereo monitoring */ | 70 | int msp_once = 0; /* no continous stereo monitoring */ |
71 | int amsound = 0; /* hard-wire AM sound at 6.5 Hz (france), | 71 | int 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... */ |
73 | int standard = 1; /* Override auto detect of audio standard, if needed. */ | 73 | int msp_standard = 1; /* Override auto detect of audio msp_standard, if needed. */ |
74 | int dolby = 0; | 74 | int msp_dolby = 0; |
75 | 75 | ||
76 | int stereo_threshold = 0x190; /* a2 threshold for stereo/bilingual | 76 | int 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 */ |
80 | module_param(opmode, int, 0444); | 80 | module_param(opmode, int, 0444); |
81 | 81 | ||
82 | /* read-write */ | 82 | /* read-write */ |
83 | module_param(once, bool, 0644); | 83 | module_param_named(once,msp_once, bool, 0644); |
84 | module_param(debug, int, 0644); | 84 | module_param_named(debug,msp_debug, int, 0644); |
85 | module_param(stereo_threshold, int, 0644); | 85 | module_param_named(stereo_threshold,msp_stereo_thresh, int, 0644); |
86 | module_param(standard, int, 0644); | 86 | module_param_named(standard,msp_standard, int, 0644); |
87 | module_param(amsound, bool, 0644); | 87 | module_param_named(amsound,msp_amsound, bool, 0644); |
88 | module_param(dolby, bool, 0644); | 88 | module_param_named(dolby,msp_dolby, bool, 0644); |
89 | 89 | ||
90 | MODULE_PARM_DESC(opmode, "Forces a MSP3400 opmode. 0=Manual, 1=Autodetect, 2=Autodetect and autoselect"); | 90 | MODULE_PARM_DESC(opmode, "Forces a MSP3400 opmode. 0=Manual, 1=Autodetect, 2=Autodetect and autoselect"); |
91 | MODULE_PARM_DESC(once, "No continuous stereo monitoring"); | 91 | MODULE_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; |
diff --git a/drivers/media/video/msp3400-kthreads.c b/drivers/media/video/msp3400-kthreads.c index 2b59b6847535..2072c3efebb3 100644 --- a/drivers/media/video/msp3400-kthreads.c +++ b/drivers/media/video/msp3400-kthreads.c | |||
@@ -168,7 +168,7 @@ void msp3400c_setmode(struct i2c_client *client, int type) | |||
168 | struct msp_state *state = i2c_get_clientdata(client); | 168 | struct msp_state *state = i2c_get_clientdata(client); |
169 | int i; | 169 | int i; |
170 | 170 | ||
171 | v4l_dbg(1, client, "setmode: %d\n", type); | 171 | v4l_dbg(1, msp_debug, client, "setmode: %d\n", type); |
172 | state->mode = type; | 172 | state->mode = type; |
173 | state->audmode = V4L2_TUNER_MODE_MONO; | 173 | state->audmode = V4L2_TUNER_MODE_MONO; |
174 | state->rxsubchans = V4L2_TUNER_SUB_MONO; | 174 | state->rxsubchans = V4L2_TUNER_SUB_MONO; |
@@ -191,7 +191,7 @@ void msp3400c_setmode(struct i2c_client *client, int type) | |||
191 | 191 | ||
192 | msp_write_dem(client, 0x0056, 0); /*LOAD_REG_1/2*/ | 192 | msp_write_dem(client, 0x0056, 0); /*LOAD_REG_1/2*/ |
193 | 193 | ||
194 | if (dolby) { | 194 | if (msp_dolby) { |
195 | msp_write_dsp(client, 0x0008, 0x0520); /* I2S1 */ | 195 | msp_write_dsp(client, 0x0008, 0x0520); /* I2S1 */ |
196 | msp_write_dsp(client, 0x0009, 0x0620); /* I2S2 */ | 196 | msp_write_dsp(client, 0x0009, 0x0620); /* I2S2 */ |
197 | msp_write_dsp(client, 0x000b, msp3400c_init_data[type].dsp_src); | 197 | msp_write_dsp(client, 0x000b, msp3400c_init_data[type].dsp_src); |
@@ -221,7 +221,7 @@ void msp3400c_setstereo(struct i2c_client *client, int mode) | |||
221 | /* this method would break everything, let's make sure | 221 | /* this method would break everything, let's make sure |
222 | * it's never called | 222 | * it's never called |
223 | */ | 223 | */ |
224 | v4l_dbg(1, client, "setstereo called with mode=%d instead of set_source (ignored)\n", | 224 | v4l_dbg(1, msp_debug, client, "setstereo called with mode=%d instead of set_source (ignored)\n", |
225 | mode); | 225 | mode); |
226 | return; | 226 | return; |
227 | } | 227 | } |
@@ -229,7 +229,7 @@ void msp3400c_setstereo(struct i2c_client *client, int mode) | |||
229 | /* switch demodulator */ | 229 | /* switch demodulator */ |
230 | switch (state->mode) { | 230 | switch (state->mode) { |
231 | case MSP_MODE_FM_TERRA: | 231 | case MSP_MODE_FM_TERRA: |
232 | v4l_dbg(1, client, "FM setstereo: %s\n", strmode[mode]); | 232 | v4l_dbg(1, msp_debug, client, "FM setstereo: %s\n", strmode[mode]); |
233 | msp3400c_setcarrier(client, state->second, state->main); | 233 | msp3400c_setcarrier(client, state->second, state->main); |
234 | switch (mode) { | 234 | switch (mode) { |
235 | case V4L2_TUNER_MODE_STEREO: | 235 | case V4L2_TUNER_MODE_STEREO: |
@@ -243,7 +243,7 @@ void msp3400c_setstereo(struct i2c_client *client, int mode) | |||
243 | } | 243 | } |
244 | break; | 244 | break; |
245 | case MSP_MODE_FM_SAT: | 245 | case MSP_MODE_FM_SAT: |
246 | v4l_dbg(1, client, "SAT setstereo: %s\n", strmode[mode]); | 246 | v4l_dbg(1, msp_debug, client, "SAT setstereo: %s\n", strmode[mode]); |
247 | switch (mode) { | 247 | switch (mode) { |
248 | case V4L2_TUNER_MODE_MONO: | 248 | case V4L2_TUNER_MODE_MONO: |
249 | msp3400c_setcarrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5)); | 249 | msp3400c_setcarrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5)); |
@@ -262,24 +262,24 @@ void msp3400c_setstereo(struct i2c_client *client, int mode) | |||
262 | case MSP_MODE_FM_NICAM1: | 262 | case MSP_MODE_FM_NICAM1: |
263 | case MSP_MODE_FM_NICAM2: | 263 | case MSP_MODE_FM_NICAM2: |
264 | case MSP_MODE_AM_NICAM: | 264 | case MSP_MODE_AM_NICAM: |
265 | v4l_dbg(1, client, "NICAM setstereo: %s\n",strmode[mode]); | 265 | v4l_dbg(1, msp_debug, client, "NICAM setstereo: %s\n",strmode[mode]); |
266 | msp3400c_setcarrier(client,state->second,state->main); | 266 | msp3400c_setcarrier(client,state->second,state->main); |
267 | if (state->nicam_on) | 267 | if (state->nicam_on) |
268 | nicam=0x0100; | 268 | nicam=0x0100; |
269 | break; | 269 | break; |
270 | case MSP_MODE_BTSC: | 270 | case MSP_MODE_BTSC: |
271 | v4l_dbg(1, client, "BTSC setstereo: %s\n",strmode[mode]); | 271 | v4l_dbg(1, msp_debug, client, "BTSC setstereo: %s\n",strmode[mode]); |
272 | nicam=0x0300; | 272 | nicam=0x0300; |
273 | break; | 273 | break; |
274 | case MSP_MODE_EXTERN: | 274 | case MSP_MODE_EXTERN: |
275 | v4l_dbg(1, client, "extern setstereo: %s\n",strmode[mode]); | 275 | v4l_dbg(1, msp_debug, client, "extern setstereo: %s\n",strmode[mode]); |
276 | nicam = 0x0200; | 276 | nicam = 0x0200; |
277 | break; | 277 | break; |
278 | case MSP_MODE_FM_RADIO: | 278 | case MSP_MODE_FM_RADIO: |
279 | v4l_dbg(1, client, "FM-Radio setstereo: %s\n",strmode[mode]); | 279 | v4l_dbg(1, msp_debug, client, "FM-Radio setstereo: %s\n",strmode[mode]); |
280 | break; | 280 | break; |
281 | default: | 281 | default: |
282 | v4l_dbg(1, client, "mono setstereo\n"); | 282 | v4l_dbg(1, msp_debug, client, "mono setstereo\n"); |
283 | return; | 283 | return; |
284 | } | 284 | } |
285 | 285 | ||
@@ -290,7 +290,7 @@ void msp3400c_setstereo(struct i2c_client *client, int mode) | |||
290 | break; | 290 | break; |
291 | case V4L2_TUNER_MODE_MONO: | 291 | case V4L2_TUNER_MODE_MONO: |
292 | if (state->mode == MSP_MODE_AM_NICAM) { | 292 | if (state->mode == MSP_MODE_AM_NICAM) { |
293 | v4l_dbg(1, client, "switching to AM mono\n"); | 293 | v4l_dbg(1, msp_debug, client, "switching to AM mono\n"); |
294 | /* AM mono decoding is handled by tuner, not MSP chip */ | 294 | /* AM mono decoding is handled by tuner, not MSP chip */ |
295 | /* SCART switching control register */ | 295 | /* SCART switching control register */ |
296 | msp_set_scart(client, SCART_MONO, 0); | 296 | msp_set_scart(client, SCART_MONO, 0); |
@@ -304,9 +304,9 @@ void msp3400c_setstereo(struct i2c_client *client, int mode) | |||
304 | src = 0x0010 | nicam; | 304 | src = 0x0010 | nicam; |
305 | break; | 305 | break; |
306 | } | 306 | } |
307 | v4l_dbg(1, client, "setstereo final source/matrix = 0x%x\n", src); | 307 | v4l_dbg(1, msp_debug, client, "setstereo final source/matrix = 0x%x\n", src); |
308 | 308 | ||
309 | if (dolby) { | 309 | if (msp_dolby) { |
310 | msp_write_dsp(client, 0x0008, 0x0520); | 310 | msp_write_dsp(client, 0x0008, 0x0520); |
311 | msp_write_dsp(client, 0x0009, 0x0620); | 311 | msp_write_dsp(client, 0x0009, 0x0620); |
312 | msp_write_dsp(client, 0x000a, src); | 312 | msp_write_dsp(client, 0x000a, src); |
@@ -327,20 +327,20 @@ static void msp3400c_print_mode(struct i2c_client *client) | |||
327 | struct msp_state *state = i2c_get_clientdata(client); | 327 | struct msp_state *state = i2c_get_clientdata(client); |
328 | 328 | ||
329 | if (state->main == state->second) { | 329 | if (state->main == state->second) { |
330 | v4l_dbg(1, client, "mono sound carrier: %d.%03d MHz\n", | 330 | v4l_dbg(1, msp_debug, client, "mono sound carrier: %d.%03d MHz\n", |
331 | state->main / 910000, (state->main / 910) % 1000); | 331 | state->main / 910000, (state->main / 910) % 1000); |
332 | } else { | 332 | } else { |
333 | v4l_dbg(1, client, "main sound carrier: %d.%03d MHz\n", | 333 | v4l_dbg(1, msp_debug, client, "main sound carrier: %d.%03d MHz\n", |
334 | state->main / 910000, (state->main / 910) % 1000); | 334 | state->main / 910000, (state->main / 910) % 1000); |
335 | } | 335 | } |
336 | if (state->mode == MSP_MODE_FM_NICAM1 || state->mode == MSP_MODE_FM_NICAM2) | 336 | if (state->mode == MSP_MODE_FM_NICAM1 || state->mode == MSP_MODE_FM_NICAM2) |
337 | v4l_dbg(1, client, "NICAM/FM carrier : %d.%03d MHz\n", | 337 | v4l_dbg(1, msp_debug, client, "NICAM/FM carrier : %d.%03d MHz\n", |
338 | state->second / 910000, (state->second/910) % 1000); | 338 | state->second / 910000, (state->second/910) % 1000); |
339 | if (state->mode == MSP_MODE_AM_NICAM) | 339 | if (state->mode == MSP_MODE_AM_NICAM) |
340 | v4l_dbg(1, client, "NICAM/AM carrier : %d.%03d MHz\n", | 340 | v4l_dbg(1, msp_debug, client, "NICAM/AM carrier : %d.%03d MHz\n", |
341 | state->second / 910000, (state->second / 910) % 1000); | 341 | state->second / 910000, (state->second / 910) % 1000); |
342 | if (state->mode == MSP_MODE_FM_TERRA && state->main != state->second) { | 342 | if (state->mode == MSP_MODE_FM_TERRA && state->main != state->second) { |
343 | v4l_dbg(1, client, "FM-stereo carrier : %d.%03d MHz\n", | 343 | v4l_dbg(1, msp_debug, client, "FM-stereo carrier : %d.%03d MHz\n", |
344 | state->second / 910000, (state->second / 910) % 1000); | 344 | state->second / 910000, (state->second / 910) % 1000); |
345 | } | 345 | } |
346 | } | 346 | } |
@@ -360,7 +360,7 @@ int autodetect_stereo(struct i2c_client *client) | |||
360 | val = msp_read_dsp(client, 0x18); | 360 | val = msp_read_dsp(client, 0x18); |
361 | if (val > 32767) | 361 | if (val > 32767) |
362 | val -= 65536; | 362 | val -= 65536; |
363 | v4l_dbg(2, client, "stereo detect register: %d\n", val); | 363 | v4l_dbg(2, msp_debug, client, "stereo detect register: %d\n", val); |
364 | if (val > 4096) { | 364 | if (val > 4096) { |
365 | rxsubchans = V4L2_TUNER_SUB_STEREO | V4L2_TUNER_SUB_MONO; | 365 | rxsubchans = V4L2_TUNER_SUB_STEREO | V4L2_TUNER_SUB_MONO; |
366 | } else if (val < -4096) { | 366 | } else if (val < -4096) { |
@@ -374,7 +374,7 @@ int autodetect_stereo(struct i2c_client *client) | |||
374 | case MSP_MODE_FM_NICAM2: | 374 | case MSP_MODE_FM_NICAM2: |
375 | case MSP_MODE_AM_NICAM: | 375 | case MSP_MODE_AM_NICAM: |
376 | val = msp_read_dem(client, 0x23); | 376 | val = msp_read_dem(client, 0x23); |
377 | v4l_dbg(2, client, "nicam sync=%d, mode=%d\n", | 377 | v4l_dbg(2, msp_debug, client, "nicam sync=%d, mode=%d\n", |
378 | val & 1, (val & 0x1e) >> 1); | 378 | val & 1, (val & 0x1e) >> 1); |
379 | 379 | ||
380 | if (val & 1) { | 380 | if (val & 1) { |
@@ -407,7 +407,7 @@ int autodetect_stereo(struct i2c_client *client) | |||
407 | break; | 407 | break; |
408 | case MSP_MODE_BTSC: | 408 | case MSP_MODE_BTSC: |
409 | val = msp_read_dem(client, 0x200); | 409 | val = msp_read_dem(client, 0x200); |
410 | v4l_dbg(2, client, "status=0x%x (pri=%s, sec=%s, %s%s%s)\n", | 410 | v4l_dbg(2, msp_debug, client, "status=0x%x (pri=%s, sec=%s, %s%s%s)\n", |
411 | val, | 411 | val, |
412 | (val & 0x0002) ? "no" : "yes", | 412 | (val & 0x0002) ? "no" : "yes", |
413 | (val & 0x0004) ? "no" : "yes", | 413 | (val & 0x0004) ? "no" : "yes", |
@@ -421,13 +421,13 @@ int autodetect_stereo(struct i2c_client *client) | |||
421 | } | 421 | } |
422 | if (rxsubchans != state->rxsubchans) { | 422 | if (rxsubchans != state->rxsubchans) { |
423 | update = 1; | 423 | update = 1; |
424 | v4l_dbg(1, client, "watch: rxsubchans %d => %d\n", | 424 | v4l_dbg(1, msp_debug, client, "watch: rxsubchans %d => %d\n", |
425 | state->rxsubchans,rxsubchans); | 425 | state->rxsubchans,rxsubchans); |
426 | state->rxsubchans = rxsubchans; | 426 | state->rxsubchans = rxsubchans; |
427 | } | 427 | } |
428 | if (newnicam != state->nicam_on) { | 428 | if (newnicam != state->nicam_on) { |
429 | update = 1; | 429 | update = 1; |
430 | v4l_dbg(1, client, "watch: nicam %d => %d\n", | 430 | v4l_dbg(1, msp_debug, client, "watch: nicam %d => %d\n", |
431 | state->nicam_on,newnicam); | 431 | state->nicam_on,newnicam); |
432 | state->nicam_on = newnicam; | 432 | state->nicam_on = newnicam; |
433 | } | 433 | } |
@@ -452,7 +452,7 @@ static void watch_stereo(struct i2c_client *client) | |||
452 | msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO); | 452 | msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO); |
453 | } | 453 | } |
454 | 454 | ||
455 | if (once) | 455 | if (msp_once) |
456 | state->watch_stereo = 0; | 456 | state->watch_stereo = 0; |
457 | } | 457 | } |
458 | 458 | ||
@@ -464,21 +464,21 @@ int msp3400c_thread(void *data) | |||
464 | int count, max1,max2,val1,val2, val,this; | 464 | int count, max1,max2,val1,val2, val,this; |
465 | 465 | ||
466 | 466 | ||
467 | v4l_dbg(1, client, "msp3400 daemon started\n"); | 467 | v4l_dbg(1, msp_debug, client, "msp3400 daemon started\n"); |
468 | for (;;) { | 468 | for (;;) { |
469 | v4l_dbg(2, client, "msp3400 thread: sleep\n"); | 469 | v4l_dbg(2, msp_debug, client, "msp3400 thread: sleep\n"); |
470 | msp_sleep(state, -1); | 470 | msp_sleep(state, -1); |
471 | v4l_dbg(2, client, "msp3400 thread: wakeup\n"); | 471 | v4l_dbg(2, msp_debug, client, "msp3400 thread: wakeup\n"); |
472 | 472 | ||
473 | restart: | 473 | restart: |
474 | v4l_dbg(1, client, "thread: restart scan\n"); | 474 | v4l_dbg(1, msp_debug, client, "thread: restart scan\n"); |
475 | state->restart = 0; | 475 | state->restart = 0; |
476 | if (kthread_should_stop()) | 476 | if (kthread_should_stop()) |
477 | break; | 477 | break; |
478 | 478 | ||
479 | if (state->radio || MSP_MODE_EXTERN == state->mode) { | 479 | if (state->radio || MSP_MODE_EXTERN == state->mode) { |
480 | /* no carrier scan, just unmute */ | 480 | /* no carrier scan, just unmute */ |
481 | v4l_dbg(1, client, "thread: no carrier scan\n"); | 481 | v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n"); |
482 | msp_set_audio(client); | 482 | msp_set_audio(client); |
483 | continue; | 483 | continue; |
484 | } | 484 | } |
@@ -498,11 +498,11 @@ int msp3400c_thread(void *data) | |||
498 | cd = msp3400c_carrier_detect_main; | 498 | cd = msp3400c_carrier_detect_main; |
499 | count = ARRAY_SIZE(msp3400c_carrier_detect_main); | 499 | count = ARRAY_SIZE(msp3400c_carrier_detect_main); |
500 | 500 | ||
501 | if (amsound && (state->v4l2_std & V4L2_STD_SECAM)) { | 501 | if (msp_amsound && (state->v4l2_std & V4L2_STD_SECAM)) { |
502 | /* autodetect doesn't work well with AM ... */ | 502 | /* autodetect doesn't work well with AM ... */ |
503 | max1 = 3; | 503 | max1 = 3; |
504 | count = 0; | 504 | count = 0; |
505 | v4l_dbg(1, client, "AM sound override\n"); | 505 | v4l_dbg(1, msp_debug, client, "AM sound override\n"); |
506 | } | 506 | } |
507 | 507 | ||
508 | for (this = 0; this < count; this++) { | 508 | for (this = 0; this < count; this++) { |
@@ -514,7 +514,7 @@ int msp3400c_thread(void *data) | |||
514 | val -= 65536; | 514 | val -= 65536; |
515 | if (val1 < val) | 515 | if (val1 < val) |
516 | val1 = val, max1 = this; | 516 | val1 = val, max1 = this; |
517 | v4l_dbg(1, client, "carrier1 val: %5d / %s\n", val,cd[this].name); | 517 | v4l_dbg(1, msp_debug, client, "carrier1 val: %5d / %s\n", val,cd[this].name); |
518 | } | 518 | } |
519 | 519 | ||
520 | /* carrier detect pass #2 -- second (stereo) carrier */ | 520 | /* carrier detect pass #2 -- second (stereo) carrier */ |
@@ -535,7 +535,7 @@ int msp3400c_thread(void *data) | |||
535 | break; | 535 | break; |
536 | } | 536 | } |
537 | 537 | ||
538 | if (amsound && (state->v4l2_std & V4L2_STD_SECAM)) { | 538 | if (msp_amsound && (state->v4l2_std & V4L2_STD_SECAM)) { |
539 | /* autodetect doesn't work well with AM ... */ | 539 | /* autodetect doesn't work well with AM ... */ |
540 | cd = NULL; | 540 | cd = NULL; |
541 | count = 0; | 541 | count = 0; |
@@ -550,7 +550,7 @@ int msp3400c_thread(void *data) | |||
550 | val -= 65536; | 550 | val -= 65536; |
551 | if (val2 < val) | 551 | if (val2 < val) |
552 | val2 = val, max2 = this; | 552 | val2 = val, max2 = this; |
553 | v4l_dbg(1, client, "carrier2 val: %5d / %s\n", val,cd[this].name); | 553 | v4l_dbg(1, msp_debug, client, "carrier2 val: %5d / %s\n", val,cd[this].name); |
554 | } | 554 | } |
555 | 555 | ||
556 | /* program the msp3400 according to the results */ | 556 | /* program the msp3400 according to the results */ |
@@ -627,7 +627,7 @@ int msp3400c_thread(void *data) | |||
627 | /* unmute */ | 627 | /* unmute */ |
628 | msp_set_audio(client); | 628 | msp_set_audio(client); |
629 | 629 | ||
630 | if (debug) | 630 | if (msp_debug) |
631 | msp3400c_print_mode(client); | 631 | msp3400c_print_mode(client); |
632 | 632 | ||
633 | /* monitor tv audio mode */ | 633 | /* monitor tv audio mode */ |
@@ -637,7 +637,7 @@ int msp3400c_thread(void *data) | |||
637 | watch_stereo(client); | 637 | watch_stereo(client); |
638 | } | 638 | } |
639 | } | 639 | } |
640 | v4l_dbg(1, client, "thread: exit\n"); | 640 | v4l_dbg(1, msp_debug, client, "thread: exit\n"); |
641 | return 0; | 641 | return 0; |
642 | } | 642 | } |
643 | 643 | ||
@@ -648,22 +648,22 @@ int msp3410d_thread(void *data) | |||
648 | struct msp_state *state = i2c_get_clientdata(client); | 648 | struct msp_state *state = i2c_get_clientdata(client); |
649 | int val, i, std; | 649 | int val, i, std; |
650 | 650 | ||
651 | v4l_dbg(1, client, "msp3410 daemon started\n"); | 651 | v4l_dbg(1, msp_debug, client, "msp3410 daemon started\n"); |
652 | 652 | ||
653 | for (;;) { | 653 | for (;;) { |
654 | v4l_dbg(2, client, "msp3410 thread: sleep\n"); | 654 | v4l_dbg(2, msp_debug, client, "msp3410 thread: sleep\n"); |
655 | msp_sleep(state,-1); | 655 | msp_sleep(state,-1); |
656 | v4l_dbg(2, client, "msp3410 thread: wakeup\n"); | 656 | v4l_dbg(2, msp_debug, client, "msp3410 thread: wakeup\n"); |
657 | 657 | ||
658 | restart: | 658 | restart: |
659 | v4l_dbg(1, client, "thread: restart scan\n"); | 659 | v4l_dbg(1, msp_debug, client, "thread: restart scan\n"); |
660 | state->restart = 0; | 660 | state->restart = 0; |
661 | if (kthread_should_stop()) | 661 | if (kthread_should_stop()) |
662 | break; | 662 | break; |
663 | 663 | ||
664 | if (state->mode == MSP_MODE_EXTERN) { | 664 | if (state->mode == MSP_MODE_EXTERN) { |
665 | /* no carrier scan needed, just unmute */ | 665 | /* no carrier scan needed, just unmute */ |
666 | v4l_dbg(1, client, "thread: no carrier scan\n"); | 666 | v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n"); |
667 | msp_set_audio(client); | 667 | msp_set_audio(client); |
668 | continue; | 668 | continue; |
669 | } | 669 | } |
@@ -682,8 +682,8 @@ int msp3410d_thread(void *data) | |||
682 | std = (state->v4l2_std & V4L2_STD_NTSC) ? 0x20 : 1; | 682 | std = (state->v4l2_std & V4L2_STD_NTSC) ? 0x20 : 1; |
683 | state->watch_stereo = 0; | 683 | state->watch_stereo = 0; |
684 | 684 | ||
685 | if (debug) | 685 | if (msp_debug) |
686 | v4l_dbg(1, client, "setting standard: %s (0x%04x)\n", | 686 | v4l_dbg(1, msp_debug, client, "setting standard: %s (0x%04x)\n", |
687 | msp_standard_std_name(std), std); | 687 | msp_standard_std_name(std), std); |
688 | 688 | ||
689 | if (std != 1) { | 689 | if (std != 1) { |
@@ -700,22 +700,22 @@ int msp3410d_thread(void *data) | |||
700 | val = msp_read_dem(client, 0x7e); | 700 | val = msp_read_dem(client, 0x7e); |
701 | if (val < 0x07ff) | 701 | if (val < 0x07ff) |
702 | break; | 702 | break; |
703 | v4l_dbg(1, client, "detection still in progress\n"); | 703 | v4l_dbg(1, msp_debug, client, "detection still in progress\n"); |
704 | } | 704 | } |
705 | } | 705 | } |
706 | for (i = 0; msp_stdlist[i].name != NULL; i++) | 706 | for (i = 0; msp_stdlist[i].name != NULL; i++) |
707 | if (msp_stdlist[i].retval == val) | 707 | if (msp_stdlist[i].retval == val) |
708 | break; | 708 | break; |
709 | v4l_dbg(1, client, "current standard: %s (0x%04x)\n", | 709 | v4l_dbg(1, msp_debug, client, "current standard: %s (0x%04x)\n", |
710 | msp_standard_std_name(val), val); | 710 | msp_standard_std_name(val), val); |
711 | state->main = msp_stdlist[i].main; | 711 | state->main = msp_stdlist[i].main; |
712 | state->second = msp_stdlist[i].second; | 712 | state->second = msp_stdlist[i].second; |
713 | state->std = val; | 713 | state->std = val; |
714 | 714 | ||
715 | if (amsound && !state->radio && (state->v4l2_std & V4L2_STD_SECAM) && | 715 | if (msp_amsound && !state->radio && (state->v4l2_std & V4L2_STD_SECAM) && |
716 | (val != 0x0009)) { | 716 | (val != 0x0009)) { |
717 | /* autodetection has failed, let backup */ | 717 | /* autodetection has failed, let backup */ |
718 | v4l_dbg(1, client, "autodetection failed," | 718 | v4l_dbg(1, msp_debug, client, "autodetection failed," |
719 | " switching to backup standard: %s (0x%04x)\n", | 719 | " switching to backup standard: %s (0x%04x)\n", |
720 | msp_stdlist[8].name ? msp_stdlist[8].name : "unknown",val); | 720 | msp_stdlist[8].name ? msp_stdlist[8].name : "unknown",val); |
721 | val = 0x0009; | 721 | val = 0x0009; |
@@ -798,13 +798,13 @@ int msp3410d_thread(void *data) | |||
798 | watch_stereo(client); | 798 | watch_stereo(client); |
799 | } | 799 | } |
800 | } | 800 | } |
801 | v4l_dbg(1, client, "thread: exit\n"); | 801 | v4l_dbg(1, msp_debug, client, "thread: exit\n"); |
802 | return 0; | 802 | return 0; |
803 | } | 803 | } |
804 | 804 | ||
805 | /* ----------------------------------------------------------------------- */ | 805 | /* ----------------------------------------------------------------------- */ |
806 | 806 | ||
807 | /* msp34xxG + (autoselect no-thread) */ | 807 | /* msp34xxG + (autoselect no-thread) */ |
808 | /* this one uses both automatic standard detection and automatic sound */ | 808 | /* this one uses both automatic standard detection and automatic sound */ |
809 | /* select which are available in the newer G versions */ | 809 | /* select which are available in the newer G versions */ |
810 | /* struct msp: only norm, acb and source are really used in this mode */ | 810 | /* struct msp: only norm, acb and source are really used in this mode */ |
@@ -825,7 +825,7 @@ static void msp34xxg_set_source(struct i2c_client *client, int source) | |||
825 | */ | 825 | */ |
826 | int value = (source & 0x07) << 8 | (source == 0 ? 0x30 : 0x20); | 826 | int value = (source & 0x07) << 8 | (source == 0 ? 0x30 : 0x20); |
827 | 827 | ||
828 | v4l_dbg(1, client, "set source to %d (0x%x)\n", source, value); | 828 | v4l_dbg(1, msp_debug, client, "set source to %d (0x%x)\n", source, value); |
829 | /* Loudspeaker Output */ | 829 | /* Loudspeaker Output */ |
830 | msp_write_dsp(client, 0x08, value); | 830 | msp_write_dsp(client, 0x08, value); |
831 | /* SCART1 DA Output */ | 831 | /* SCART1 DA Output */ |
@@ -840,7 +840,7 @@ static void msp34xxg_set_source(struct i2c_client *client, int source) | |||
840 | * 0x7f0 = forced mono mode | 840 | * 0x7f0 = forced mono mode |
841 | */ | 841 | */ |
842 | /* a2 threshold for stereo/bilingual */ | 842 | /* a2 threshold for stereo/bilingual */ |
843 | msp_write_dem(client, 0x22, stereo_threshold); | 843 | msp_write_dem(client, 0x22, msp_stereo_thresh); |
844 | state->source = source; | 844 | state->source = source; |
845 | } | 845 | } |
846 | 846 | ||
@@ -897,28 +897,28 @@ int msp34xxg_thread(void *data) | |||
897 | struct msp_state *state = i2c_get_clientdata(client); | 897 | struct msp_state *state = i2c_get_clientdata(client); |
898 | int val, std, i; | 898 | int val, std, i; |
899 | 899 | ||
900 | v4l_dbg(1, client, "msp34xxg daemon started\n"); | 900 | v4l_dbg(1, msp_debug, client, "msp34xxg daemon started\n"); |
901 | 901 | ||
902 | state->source = 1; /* default */ | 902 | state->source = 1; /* default */ |
903 | for (;;) { | 903 | for (;;) { |
904 | v4l_dbg(2, client, "msp34xxg thread: sleep\n"); | 904 | v4l_dbg(2, msp_debug, client, "msp34xxg thread: sleep\n"); |
905 | msp_sleep(state, -1); | 905 | msp_sleep(state, -1); |
906 | v4l_dbg(2, client, "msp34xxg thread: wakeup\n"); | 906 | v4l_dbg(2, msp_debug, client, "msp34xxg thread: wakeup\n"); |
907 | 907 | ||
908 | restart: | 908 | restart: |
909 | v4l_dbg(1, client, "thread: restart scan\n"); | 909 | v4l_dbg(1, msp_debug, client, "thread: restart scan\n"); |
910 | state->restart = 0; | 910 | state->restart = 0; |
911 | if (kthread_should_stop()) | 911 | if (kthread_should_stop()) |
912 | break; | 912 | break; |
913 | 913 | ||
914 | /* setup the chip*/ | 914 | /* setup the chip*/ |
915 | msp34xxg_reset(client); | 915 | msp34xxg_reset(client); |
916 | std = standard; | 916 | std = msp_standard; |
917 | if (std != 0x01) | 917 | if (std != 0x01) |
918 | goto unmute; | 918 | goto unmute; |
919 | 919 | ||
920 | /* watch autodetect */ | 920 | /* watch autodetect */ |
921 | v4l_dbg(1, client, "triggered autodetect, waiting for result\n"); | 921 | v4l_dbg(1, msp_debug, client, "triggered autodetect, waiting for result\n"); |
922 | for (i = 0; i < 10; i++) { | 922 | for (i = 0; i < 10; i++) { |
923 | if (msp_sleep(state, 100)) | 923 | if (msp_sleep(state, 100)) |
924 | goto restart; | 924 | goto restart; |
@@ -929,16 +929,16 @@ int msp34xxg_thread(void *data) | |||
929 | std = val; | 929 | std = val; |
930 | break; | 930 | break; |
931 | } | 931 | } |
932 | v4l_dbg(2, client, "detection still in progress\n"); | 932 | v4l_dbg(2, msp_debug, client, "detection still in progress\n"); |
933 | } | 933 | } |
934 | if (std == 1) { | 934 | if (std == 1) { |
935 | v4l_dbg(1, client, "detection still in progress after 10 tries. giving up.\n"); | 935 | v4l_dbg(1, msp_debug, client, "detection still in progress after 10 tries. giving up.\n"); |
936 | continue; | 936 | continue; |
937 | } | 937 | } |
938 | 938 | ||
939 | unmute: | 939 | unmute: |
940 | state->std = std; | 940 | state->std = std; |
941 | v4l_dbg(1, client, "current standard: %s (0x%04x)\n", | 941 | v4l_dbg(1, msp_debug, client, "current standard: %s (0x%04x)\n", |
942 | msp_standard_std_name(std), std); | 942 | msp_standard_std_name(std), std); |
943 | 943 | ||
944 | /* unmute: dispatch sound to scart output, set scart volume */ | 944 | /* unmute: dispatch sound to scart output, set scart volume */ |
@@ -950,7 +950,7 @@ int msp34xxg_thread(void *data) | |||
950 | 950 | ||
951 | msp_write_dem(client, 0x40, state->i2s_mode); | 951 | msp_write_dem(client, 0x40, state->i2s_mode); |
952 | } | 952 | } |
953 | v4l_dbg(1, client, "thread: exit\n"); | 953 | v4l_dbg(1, msp_debug, client, "thread: exit\n"); |
954 | return 0; | 954 | return 0; |
955 | } | 955 | } |
956 | 956 | ||
@@ -976,7 +976,7 @@ void msp34xxg_detect_stereo(struct i2c_client *client) | |||
976 | * this is a problem, I'll handle SAP just like lang1/lang2. | 976 | * this is a problem, I'll handle SAP just like lang1/lang2. |
977 | */ | 977 | */ |
978 | } | 978 | } |
979 | v4l_dbg(1, client, "status=0x%x, stereo=%d, bilingual=%d -> rxsubchans=%d\n", | 979 | v4l_dbg(1, msp_debug, client, "status=0x%x, stereo=%d, bilingual=%d -> rxsubchans=%d\n", |
980 | status, is_stereo, is_bilingual, state->rxsubchans); | 980 | status, is_stereo, is_bilingual, state->rxsubchans); |
981 | } | 981 | } |
982 | 982 | ||
diff --git a/drivers/media/video/msp3400.h b/drivers/media/video/msp3400.h index 8a05cf500a8c..70a5ef8ba017 100644 --- a/drivers/media/video/msp3400.h +++ b/drivers/media/video/msp3400.h | |||
@@ -48,12 +48,12 @@ struct msp_matrix { | |||
48 | #define OPMODE_AUTOSELECT 2 /* use autodetect & autoselect (>= msp34xxG) */ | 48 | #define OPMODE_AUTOSELECT 2 /* use autodetect & autoselect (>= msp34xxG) */ |
49 | 49 | ||
50 | /* module parameters */ | 50 | /* module parameters */ |
51 | extern int debug; | 51 | extern int msp_debug; |
52 | extern int once; | 52 | extern int msp_once; |
53 | extern int amsound; | 53 | extern int msp_amsound; |
54 | extern int standard; | 54 | extern int msp_standard; |
55 | extern int dolby; | 55 | extern int msp_dolby; |
56 | extern int stereo_threshold; | 56 | extern int msp_stereo_thresh; |
57 | 57 | ||
58 | struct msp_state { | 58 | struct msp_state { |
59 | int rev1, rev2; | 59 | int rev1, rev2; |
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index ab8b4bcb5dd6..048d000941c7 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -549,7 +549,7 @@ static int saa7115_set_audio_clock_freq(struct i2c_client *client, u32 freq) | |||
549 | u32 hz; | 549 | u32 hz; |
550 | u64 f; | 550 | u64 f; |
551 | 551 | ||
552 | v4l_dbg(1, client, "set audio clock freq: %d\n", freq); | 552 | v4l_dbg(1, debug, client, "set audio clock freq: %d\n", freq); |
553 | 553 | ||
554 | /* sanity check */ | 554 | /* sanity check */ |
555 | if (freq < 32000 || freq > 48000) | 555 | if (freq < 32000 || freq > 48000) |
@@ -670,10 +670,10 @@ static void saa7115_set_v4lstd(struct i2c_client *client, v4l2_std_id std) | |||
670 | 670 | ||
671 | // This works for NTSC-M, SECAM-L and the 50Hz PAL variants. | 671 | // This works for NTSC-M, SECAM-L and the 50Hz PAL variants. |
672 | if (std & V4L2_STD_525_60) { | 672 | if (std & V4L2_STD_525_60) { |
673 | v4l_dbg(1, client, "decoder set standard 60 Hz\n"); | 673 | v4l_dbg(1, debug, client, "decoder set standard 60 Hz\n"); |
674 | saa7115_writeregs(client, saa7115_cfg_60hz_video); | 674 | saa7115_writeregs(client, saa7115_cfg_60hz_video); |
675 | } else { | 675 | } else { |
676 | v4l_dbg(1, client, "decoder set standard 50 Hz\n"); | 676 | v4l_dbg(1, debug, client, "decoder set standard 50 Hz\n"); |
677 | saa7115_writeregs(client, saa7115_cfg_50hz_video); | 677 | saa7115_writeregs(client, saa7115_cfg_50hz_video); |
678 | } | 678 | } |
679 | 679 | ||
@@ -863,7 +863,7 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt | |||
863 | 863 | ||
864 | pix = &(fmt->fmt.pix); | 864 | pix = &(fmt->fmt.pix); |
865 | 865 | ||
866 | v4l_dbg(1, client, "decoder set size\n"); | 866 | v4l_dbg(1, debug, client, "decoder set size\n"); |
867 | 867 | ||
868 | /* FIXME need better bounds checking here */ | 868 | /* FIXME need better bounds checking here */ |
869 | if ((pix->width < 1) || (pix->width > 1440)) | 869 | if ((pix->width < 1) || (pix->width > 1440)) |
@@ -889,7 +889,7 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt | |||
889 | HPSC = HPSC ? HPSC : 1; | 889 | HPSC = HPSC ? HPSC : 1; |
890 | HFSC = (int)((1024 * 720) / (HPSC * pix->width)); | 890 | HFSC = (int)((1024 * 720) / (HPSC * pix->width)); |
891 | 891 | ||
892 | v4l_dbg(1, client, "Hpsc: 0x%05x, Hfsc: 0x%05x\n", HPSC, HFSC); | 892 | v4l_dbg(1, debug, client, "Hpsc: 0x%05x, Hfsc: 0x%05x\n", HPSC, HFSC); |
893 | /* FIXME hardcodes to "Task B" | 893 | /* FIXME hardcodes to "Task B" |
894 | * write H prescaler integer */ | 894 | * write H prescaler integer */ |
895 | saa7115_write(client, 0xd0, (u8) (HPSC & 0x3f)); | 895 | saa7115_write(client, 0xd0, (u8) (HPSC & 0x3f)); |
@@ -903,10 +903,10 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt | |||
903 | saa7115_write(client, 0xDD, (u8) ((HFSC >> 9) & 0xff)); | 903 | saa7115_write(client, 0xDD, (u8) ((HFSC >> 9) & 0xff)); |
904 | } else { | 904 | } else { |
905 | if (is_50hz) { | 905 | if (is_50hz) { |
906 | v4l_dbg(1, client, "Setting full 50hz width\n"); | 906 | v4l_dbg(1, debug, client, "Setting full 50hz width\n"); |
907 | saa7115_writeregs(client, saa7115_cfg_50hz_fullres_x); | 907 | saa7115_writeregs(client, saa7115_cfg_50hz_fullres_x); |
908 | } else { | 908 | } else { |
909 | v4l_dbg(1, client, "Setting full 60hz width\n"); | 909 | v4l_dbg(1, debug, client, "Setting full 60hz width\n"); |
910 | saa7115_writeregs(client, saa7115_cfg_60hz_fullres_x); | 910 | saa7115_writeregs(client, saa7115_cfg_60hz_fullres_x); |
911 | } | 911 | } |
912 | } | 912 | } |
@@ -915,7 +915,7 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt | |||
915 | 915 | ||
916 | if (pix->height != Vsrc) { | 916 | if (pix->height != Vsrc) { |
917 | VSCY = (int)((1024 * Vsrc) / pix->height); | 917 | VSCY = (int)((1024 * Vsrc) / pix->height); |
918 | v4l_dbg(1, client, "Vsrc: %d, Vscy: 0x%05x\n", Vsrc, VSCY); | 918 | v4l_dbg(1, debug, client, "Vsrc: %d, Vscy: 0x%05x\n", Vsrc, VSCY); |
919 | 919 | ||
920 | /* Correct Contrast and Luminance */ | 920 | /* Correct Contrast and Luminance */ |
921 | saa7115_write(client, 0xd5, (u8) (64 * 1024 / VSCY)); | 921 | saa7115_write(client, 0xd5, (u8) (64 * 1024 / VSCY)); |
@@ -929,10 +929,10 @@ static int saa7115_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt | |||
929 | saa7115_write(client, 0xe3, (u8) ((VSCY >> 8) & 0xff)); | 929 | saa7115_write(client, 0xe3, (u8) ((VSCY >> 8) & 0xff)); |
930 | } else { | 930 | } else { |
931 | if (is_50hz) { | 931 | if (is_50hz) { |
932 | v4l_dbg(1, client, "Setting full 50Hz height\n"); | 932 | v4l_dbg(1, debug, client, "Setting full 50Hz height\n"); |
933 | saa7115_writeregs(client, saa7115_cfg_50hz_fullres_y); | 933 | saa7115_writeregs(client, saa7115_cfg_50hz_fullres_y); |
934 | } else { | 934 | } else { |
935 | v4l_dbg(1, client, "Setting full 60hz height\n"); | 935 | v4l_dbg(1, debug, client, "Setting full 60hz height\n"); |
936 | saa7115_writeregs(client, saa7115_cfg_60hz_fullres_y); | 936 | saa7115_writeregs(client, saa7115_cfg_60hz_fullres_y); |
937 | } | 937 | } |
938 | } | 938 | } |
@@ -1079,7 +1079,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar | |||
1079 | break; | 1079 | break; |
1080 | status = saa7115_read(client, 0x1f); | 1080 | status = saa7115_read(client, 0x1f); |
1081 | 1081 | ||
1082 | v4l_dbg(1, client, "status: 0x%02x\n", status); | 1082 | v4l_dbg(1, debug, client, "status: 0x%02x\n", status); |
1083 | vt->signal = ((status & (1 << 6)) == 0) ? 0xffff : 0x0; | 1083 | vt->signal = ((status & (1 << 6)) == 0) ? 0xffff : 0x0; |
1084 | break; | 1084 | break; |
1085 | } | 1085 | } |
@@ -1125,7 +1125,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar | |||
1125 | break; | 1125 | break; |
1126 | 1126 | ||
1127 | case VIDIOC_S_INPUT: | 1127 | case VIDIOC_S_INPUT: |
1128 | v4l_dbg(1, client, "decoder set input %d\n", *iarg); | 1128 | v4l_dbg(1, debug, client, "decoder set input %d\n", *iarg); |
1129 | /* inputs from 0-9 are available */ | 1129 | /* inputs from 0-9 are available */ |
1130 | if (*iarg < 0 || *iarg > 9) { | 1130 | if (*iarg < 0 || *iarg > 9) { |
1131 | return -EINVAL; | 1131 | return -EINVAL; |
@@ -1133,7 +1133,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar | |||
1133 | 1133 | ||
1134 | if (state->input == *iarg) | 1134 | if (state->input == *iarg) |
1135 | break; | 1135 | break; |
1136 | v4l_dbg(1, client, "now setting %s input\n", | 1136 | v4l_dbg(1, debug, client, "now setting %s input\n", |
1137 | *iarg >= 6 ? "S-Video" : "Composite"); | 1137 | *iarg >= 6 ? "S-Video" : "Composite"); |
1138 | state->input = *iarg; | 1138 | state->input = *iarg; |
1139 | 1139 | ||
@@ -1150,7 +1150,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar | |||
1150 | 1150 | ||
1151 | case VIDIOC_STREAMON: | 1151 | case VIDIOC_STREAMON: |
1152 | case VIDIOC_STREAMOFF: | 1152 | case VIDIOC_STREAMOFF: |
1153 | v4l_dbg(1, client, "%s output\n", | 1153 | v4l_dbg(1, debug, client, "%s output\n", |
1154 | (cmd == VIDIOC_STREAMON) ? "enable" : "disable"); | 1154 | (cmd == VIDIOC_STREAMON) ? "enable" : "disable"); |
1155 | 1155 | ||
1156 | if (state->enable != (cmd == VIDIOC_STREAMON)) { | 1156 | if (state->enable != (cmd == VIDIOC_STREAMON)) { |
@@ -1164,7 +1164,7 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar | |||
1164 | break; | 1164 | break; |
1165 | 1165 | ||
1166 | case VIDIOC_INT_RESET: | 1166 | case VIDIOC_INT_RESET: |
1167 | v4l_dbg(1, client, "decoder RESET\n"); | 1167 | v4l_dbg(1, debug, client, "decoder RESET\n"); |
1168 | saa7115_writeregs(client, saa7115_cfg_reset_scaler); | 1168 | saa7115_writeregs(client, saa7115_cfg_reset_scaler); |
1169 | break; | 1169 | break; |
1170 | 1170 | ||
@@ -1257,12 +1257,12 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1257 | client->driver = &i2c_driver_saa7115; | 1257 | client->driver = &i2c_driver_saa7115; |
1258 | snprintf(client->name, sizeof(client->name) - 1, "saa7115"); | 1258 | snprintf(client->name, sizeof(client->name) - 1, "saa7115"); |
1259 | 1259 | ||
1260 | v4l_dbg(1, client, "detecting saa7115 client on address 0x%x\n", address << 1); | 1260 | v4l_dbg(1, debug, client, "detecting saa7115 client on address 0x%x\n", address << 1); |
1261 | 1261 | ||
1262 | saa7115_write(client, 0, 5); | 1262 | saa7115_write(client, 0, 5); |
1263 | chip_id = saa7115_read(client, 0) & 0x0f; | 1263 | chip_id = saa7115_read(client, 0) & 0x0f; |
1264 | if (chip_id != 4 && chip_id != 5) { | 1264 | if (chip_id != 4 && chip_id != 5) { |
1265 | v4l_dbg(1, client, "saa7115 not found\n"); | 1265 | v4l_dbg(1, debug, client, "saa7115 not found\n"); |
1266 | kfree(client); | 1266 | kfree(client); |
1267 | return 0; | 1267 | return 0; |
1268 | } | 1268 | } |
@@ -1288,7 +1288,7 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1288 | state->ident = (chip_id == 4) ? V4L2_IDENT_SAA7114 : V4L2_IDENT_SAA7115; | 1288 | state->ident = (chip_id == 4) ? V4L2_IDENT_SAA7114 : V4L2_IDENT_SAA7115; |
1289 | state->audclk_freq = 48000; | 1289 | state->audclk_freq = 48000; |
1290 | 1290 | ||
1291 | v4l_dbg(1, client, "writing init values\n"); | 1291 | v4l_dbg(1, debug, client, "writing init values\n"); |
1292 | 1292 | ||
1293 | /* init to 60hz/48khz */ | 1293 | /* init to 60hz/48khz */ |
1294 | saa7115_writeregs(client, saa7115_init_auto_input); | 1294 | saa7115_writeregs(client, saa7115_init_auto_input); |
@@ -1301,7 +1301,7 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1301 | 1301 | ||
1302 | i2c_attach_client(client); | 1302 | i2c_attach_client(client); |
1303 | 1303 | ||
1304 | v4l_dbg(1, client, "status: (1E) 0x%02x, (1F) 0x%02x\n", | 1304 | v4l_dbg(1, debug, client, "status: (1E) 0x%02x, (1F) 0x%02x\n", |
1305 | saa7115_read(client, 0x1e), saa7115_read(client, 0x1f)); | 1305 | saa7115_read(client, 0x1e), saa7115_read(client, 0x1f)); |
1306 | 1306 | ||
1307 | return 0; | 1307 | return 0; |
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index d14eb3e5c962..992c71774f30 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c | |||
@@ -338,7 +338,7 @@ static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_dat | |||
338 | if (enable && (data->field != 0 || data->line != 16)) | 338 | if (enable && (data->field != 0 || data->line != 16)) |
339 | return -EINVAL; | 339 | return -EINVAL; |
340 | if (state->vps_enable != enable) { | 340 | if (state->vps_enable != enable) { |
341 | v4l_dbg(1, client, "Turn VPS Signal %s\n", enable ? "on" : "off"); | 341 | v4l_dbg(1, debug, client, "Turn VPS Signal %s\n", enable ? "on" : "off"); |
342 | saa7127_write(client, 0x54, enable << 7); | 342 | saa7127_write(client, 0x54, enable << 7); |
343 | state->vps_enable = enable; | 343 | state->vps_enable = enable; |
344 | } | 344 | } |
@@ -350,7 +350,7 @@ static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_dat | |||
350 | state->vps_data[2] = data->data[11]; | 350 | state->vps_data[2] = data->data[11]; |
351 | state->vps_data[3] = data->data[12]; | 351 | state->vps_data[3] = data->data[12]; |
352 | state->vps_data[4] = data->data[13]; | 352 | state->vps_data[4] = data->data[13]; |
353 | v4l_dbg(1, client, "Set VPS data %02x %02x %02x %02x %02x\n", | 353 | v4l_dbg(1, debug, client, "Set VPS data %02x %02x %02x %02x %02x\n", |
354 | state->vps_data[0], state->vps_data[1], | 354 | state->vps_data[0], state->vps_data[1], |
355 | state->vps_data[2], state->vps_data[3], | 355 | state->vps_data[2], state->vps_data[3], |
356 | state->vps_data[4]); | 356 | state->vps_data[4]); |
@@ -373,7 +373,7 @@ static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data | |||
373 | if (enable && (data->field != 0 || data->line != 21)) | 373 | if (enable && (data->field != 0 || data->line != 21)) |
374 | return -EINVAL; | 374 | return -EINVAL; |
375 | if (state->cc_enable != enable) { | 375 | if (state->cc_enable != enable) { |
376 | v4l_dbg(1, client, "Turn CC %s\n", enable ? "on" : "off"); | 376 | v4l_dbg(1, debug, client, "Turn CC %s\n", enable ? "on" : "off"); |
377 | saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, | 377 | saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, |
378 | (state->xds_enable << 7) | (enable << 6) | 0x11); | 378 | (state->xds_enable << 7) | (enable << 6) | 0x11); |
379 | state->cc_enable = enable; | 379 | state->cc_enable = enable; |
@@ -381,7 +381,7 @@ static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data | |||
381 | if (!enable) | 381 | if (!enable) |
382 | return 0; | 382 | return 0; |
383 | 383 | ||
384 | v4l_dbg(2, client, "CC data: %04x\n", cc); | 384 | v4l_dbg(2, debug, client, "CC data: %04x\n", cc); |
385 | saa7127_write(client, SAA7127_REG_LINE_21_ODD_0, cc & 0xff); | 385 | saa7127_write(client, SAA7127_REG_LINE_21_ODD_0, cc & 0xff); |
386 | saa7127_write(client, SAA7127_REG_LINE_21_ODD_1, cc >> 8); | 386 | saa7127_write(client, SAA7127_REG_LINE_21_ODD_1, cc >> 8); |
387 | state->cc_data = cc; | 387 | state->cc_data = cc; |
@@ -399,7 +399,7 @@ static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_dat | |||
399 | if (enable && (data->field != 1 || data->line != 21)) | 399 | if (enable && (data->field != 1 || data->line != 21)) |
400 | return -EINVAL; | 400 | return -EINVAL; |
401 | if (state->xds_enable != enable) { | 401 | if (state->xds_enable != enable) { |
402 | v4l_dbg(1, client, "Turn XDS %s\n", enable ? "on" : "off"); | 402 | v4l_dbg(1, debug, client, "Turn XDS %s\n", enable ? "on" : "off"); |
403 | saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, | 403 | saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, |
404 | (enable << 7) | (state->cc_enable << 6) | 0x11); | 404 | (enable << 7) | (state->cc_enable << 6) | 0x11); |
405 | state->xds_enable = enable; | 405 | state->xds_enable = enable; |
@@ -407,7 +407,7 @@ static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_dat | |||
407 | if (!enable) | 407 | if (!enable) |
408 | return 0; | 408 | return 0; |
409 | 409 | ||
410 | v4l_dbg(2, client, "XDS data: %04x\n", xds); | 410 | v4l_dbg(2, debug, client, "XDS data: %04x\n", xds); |
411 | saa7127_write(client, SAA7127_REG_LINE_21_EVEN_0, xds & 0xff); | 411 | saa7127_write(client, SAA7127_REG_LINE_21_EVEN_0, xds & 0xff); |
412 | saa7127_write(client, SAA7127_REG_LINE_21_EVEN_1, xds >> 8); | 412 | saa7127_write(client, SAA7127_REG_LINE_21_EVEN_1, xds >> 8); |
413 | state->xds_data = xds; | 413 | state->xds_data = xds; |
@@ -424,7 +424,7 @@ static int saa7127_set_wss(struct i2c_client *client, struct v4l2_sliced_vbi_dat | |||
424 | if (enable && (data->field != 0 || data->line != 23)) | 424 | if (enable && (data->field != 0 || data->line != 23)) |
425 | return -EINVAL; | 425 | return -EINVAL; |
426 | if (state->wss_enable != enable) { | 426 | if (state->wss_enable != enable) { |
427 | v4l_dbg(1, client, "Turn WSS %s\n", enable ? "on" : "off"); | 427 | v4l_dbg(1, debug, client, "Turn WSS %s\n", enable ? "on" : "off"); |
428 | saa7127_write(client, 0x27, enable << 7); | 428 | saa7127_write(client, 0x27, enable << 7); |
429 | state->wss_enable = enable; | 429 | state->wss_enable = enable; |
430 | } | 430 | } |
@@ -433,7 +433,7 @@ static int saa7127_set_wss(struct i2c_client *client, struct v4l2_sliced_vbi_dat | |||
433 | 433 | ||
434 | saa7127_write(client, 0x26, data->data[0]); | 434 | saa7127_write(client, 0x26, data->data[0]); |
435 | saa7127_write(client, 0x27, 0x80 | (data->data[1] & 0x3f)); | 435 | saa7127_write(client, 0x27, 0x80 | (data->data[1] & 0x3f)); |
436 | v4l_dbg(1, client, "WSS mode: %s\n", wss_strs[data->data[0] & 0xf]); | 436 | v4l_dbg(1, debug, client, "WSS mode: %s\n", wss_strs[data->data[0] & 0xf]); |
437 | state->wss_mode = (data->data[1] & 0x3f) << 8 | data->data[0]; | 437 | state->wss_mode = (data->data[1] & 0x3f) << 8 | data->data[0]; |
438 | return 0; | 438 | return 0; |
439 | } | 439 | } |
@@ -445,11 +445,11 @@ static int saa7127_set_video_enable(struct i2c_client *client, int enable) | |||
445 | struct saa7127_state *state = i2c_get_clientdata(client); | 445 | struct saa7127_state *state = i2c_get_clientdata(client); |
446 | 446 | ||
447 | if (enable) { | 447 | if (enable) { |
448 | v4l_dbg(1, client, "Enable Video Output\n"); | 448 | v4l_dbg(1, debug, client, "Enable Video Output\n"); |
449 | saa7127_write(client, 0x2d, state->reg_2d); | 449 | saa7127_write(client, 0x2d, state->reg_2d); |
450 | saa7127_write(client, 0x61, state->reg_61); | 450 | saa7127_write(client, 0x61, state->reg_61); |
451 | } else { | 451 | } else { |
452 | v4l_dbg(1, client, "Disable Video Output\n"); | 452 | v4l_dbg(1, debug, client, "Disable Video Output\n"); |
453 | saa7127_write(client, 0x2d, (state->reg_2d & 0xf0)); | 453 | saa7127_write(client, 0x2d, (state->reg_2d & 0xf0)); |
454 | saa7127_write(client, 0x61, (state->reg_61 | 0xc0)); | 454 | saa7127_write(client, 0x61, (state->reg_61 | 0xc0)); |
455 | } | 455 | } |
@@ -465,11 +465,11 @@ static int saa7127_set_std(struct i2c_client *client, v4l2_std_id std) | |||
465 | const struct i2c_reg_value *inittab; | 465 | const struct i2c_reg_value *inittab; |
466 | 466 | ||
467 | if (std & V4L2_STD_525_60) { | 467 | if (std & V4L2_STD_525_60) { |
468 | v4l_dbg(1, client, "Selecting 60 Hz video Standard\n"); | 468 | v4l_dbg(1, debug, client, "Selecting 60 Hz video Standard\n"); |
469 | inittab = saa7127_init_config_60hz; | 469 | inittab = saa7127_init_config_60hz; |
470 | state->reg_61 = SAA7127_60HZ_DAC_CONTROL; | 470 | state->reg_61 = SAA7127_60HZ_DAC_CONTROL; |
471 | } else { | 471 | } else { |
472 | v4l_dbg(1, client, "Selecting 50 Hz video Standard\n"); | 472 | v4l_dbg(1, debug, client, "Selecting 50 Hz video Standard\n"); |
473 | inittab = saa7127_init_config_50hz; | 473 | inittab = saa7127_init_config_50hz; |
474 | state->reg_61 = SAA7127_50HZ_DAC_CONTROL; | 474 | state->reg_61 = SAA7127_50HZ_DAC_CONTROL; |
475 | } | 475 | } |
@@ -520,7 +520,7 @@ static int saa7127_set_output_type(struct i2c_client *client, int output) | |||
520 | default: | 520 | default: |
521 | return -EINVAL; | 521 | return -EINVAL; |
522 | } | 522 | } |
523 | v4l_dbg(1, client, "Selecting %s output type\n", output_strs[output]); | 523 | v4l_dbg(1, debug, client, "Selecting %s output type\n", output_strs[output]); |
524 | 524 | ||
525 | /* Configure Encoder */ | 525 | /* Configure Encoder */ |
526 | saa7127_write(client, 0x2d, state->reg_2d); | 526 | saa7127_write(client, 0x2d, state->reg_2d); |
@@ -537,12 +537,12 @@ static int saa7127_set_input_type(struct i2c_client *client, int input) | |||
537 | 537 | ||
538 | switch (input) { | 538 | switch (input) { |
539 | case SAA7127_INPUT_TYPE_NORMAL: /* avia */ | 539 | case SAA7127_INPUT_TYPE_NORMAL: /* avia */ |
540 | v4l_dbg(1, client, "Selecting Normal Encoder Input\n"); | 540 | v4l_dbg(1, debug, client, "Selecting Normal Encoder Input\n"); |
541 | state->reg_3a_cb = 0; | 541 | state->reg_3a_cb = 0; |
542 | break; | 542 | break; |
543 | 543 | ||
544 | case SAA7127_INPUT_TYPE_TEST_IMAGE: /* color bar */ | 544 | case SAA7127_INPUT_TYPE_TEST_IMAGE: /* color bar */ |
545 | v4l_dbg(1, client, "Selecting Color Bar generator\n"); | 545 | v4l_dbg(1, debug, client, "Selecting Color Bar generator\n"); |
546 | state->reg_3a_cb = 0x80; | 546 | state->reg_3a_cb = 0x80; |
547 | break; | 547 | break; |
548 | 548 | ||
@@ -698,7 +698,7 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) | |||
698 | client->driver = &i2c_driver_saa7127; | 698 | client->driver = &i2c_driver_saa7127; |
699 | snprintf(client->name, sizeof(client->name) - 1, "saa7127"); | 699 | snprintf(client->name, sizeof(client->name) - 1, "saa7127"); |
700 | 700 | ||
701 | v4l_dbg(1, client, "detecting saa7127 client on address 0x%x\n", address << 1); | 701 | v4l_dbg(1, debug, client, "detecting saa7127 client on address 0x%x\n", address << 1); |
702 | 702 | ||
703 | /* First test register 0: Bits 5-7 are a version ID (should be 0), | 703 | /* First test register 0: Bits 5-7 are a version ID (should be 0), |
704 | and bit 2 should also be 0. | 704 | and bit 2 should also be 0. |
@@ -707,7 +707,7 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) | |||
707 | 0x1d after a reset and not expected to ever change. */ | 707 | 0x1d after a reset and not expected to ever change. */ |
708 | if ((saa7127_read(client, 0) & 0xe4) != 0 || | 708 | if ((saa7127_read(client, 0) & 0xe4) != 0 || |
709 | (saa7127_read(client, 0x29) & 0x3f) != 0x1d) { | 709 | (saa7127_read(client, 0x29) & 0x3f) != 0x1d) { |
710 | v4l_dbg(1, client, "saa7127 not found\n"); | 710 | v4l_dbg(1, debug, client, "saa7127 not found\n"); |
711 | kfree(client); | 711 | kfree(client); |
712 | return 0; | 712 | return 0; |
713 | } | 713 | } |
@@ -722,7 +722,7 @@ static int saa7127_attach(struct i2c_adapter *adapter, int address, int kind) | |||
722 | 722 | ||
723 | /* Configure Encoder */ | 723 | /* Configure Encoder */ |
724 | 724 | ||
725 | v4l_dbg(1, client, "Configuring encoder\n"); | 725 | v4l_dbg(1, debug, client, "Configuring encoder\n"); |
726 | saa7127_write_inittab(client, saa7127_init_config_common); | 726 | saa7127_write_inittab(client, saa7127_init_config_common); |
727 | saa7127_set_std(client, V4L2_STD_NTSC); | 727 | saa7127_set_std(client, V4L2_STD_NTSC); |
728 | saa7127_set_output_type(client, SAA7127_OUTPUT_TYPE_BOTH); | 728 | saa7127_set_output_type(client, SAA7127_OUTPUT_TYPE_BOTH); |
diff --git a/drivers/media/video/tda7432.c b/drivers/media/video/tda7432.c index 873796bedec8..fc3d5824efff 100644 --- a/drivers/media/video/tda7432.c +++ b/drivers/media/video/tda7432.c | |||
@@ -227,8 +227,8 @@ static struct i2c_client client_template; | |||
227 | static int tda7432_write(struct i2c_client *client, int subaddr, int val) | 227 | static int tda7432_write(struct i2c_client *client, int subaddr, int val) |
228 | { | 228 | { |
229 | unsigned char buffer[2]; | 229 | unsigned char buffer[2]; |
230 | v4l_dbg(2,client,"In tda7432_write\n"); | 230 | v4l_dbg(2, debug,client,"In tda7432_write\n"); |
231 | v4l_dbg(1,client,"Writing %d 0x%x\n", subaddr, val); | 231 | v4l_dbg(1, debug,client,"Writing %d 0x%x\n", subaddr, val); |
232 | buffer[0] = subaddr; | 232 | buffer[0] = subaddr; |
233 | buffer[1] = val; | 233 | buffer[1] = val; |
234 | if (2 != i2c_master_send(client,buffer,2)) { | 234 | if (2 != i2c_master_send(client,buffer,2)) { |
@@ -245,9 +245,9 @@ static int tda7432_set(struct i2c_client *client) | |||
245 | { | 245 | { |
246 | struct tda7432 *t = i2c_get_clientdata(client); | 246 | struct tda7432 *t = i2c_get_clientdata(client); |
247 | unsigned char buf[16]; | 247 | unsigned char buf[16]; |
248 | v4l_dbg(2,client,"In tda7432_set\n"); | 248 | v4l_dbg(2, debug,client,"In tda7432_set\n"); |
249 | 249 | ||
250 | v4l_dbg(1,client, | 250 | v4l_dbg(1, debug,client, |
251 | "tda7432: 7432_set(0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x)\n", | 251 | "tda7432: 7432_set(0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x)\n", |
252 | t->input,t->volume,t->bass,t->treble,t->lf,t->lr,t->rf,t->rr,t->loud); | 252 | t->input,t->volume,t->bass,t->treble,t->lf,t->lr,t->rf,t->rr,t->loud); |
253 | buf[0] = TDA7432_IN; | 253 | buf[0] = TDA7432_IN; |
@@ -271,7 +271,7 @@ static int tda7432_set(struct i2c_client *client) | |||
271 | static void do_tda7432_init(struct i2c_client *client) | 271 | static void do_tda7432_init(struct i2c_client *client) |
272 | { | 272 | { |
273 | struct tda7432 *t = i2c_get_clientdata(client); | 273 | struct tda7432 *t = i2c_get_clientdata(client); |
274 | v4l_dbg(2,client,"In tda7432_init\n"); | 274 | v4l_dbg(2, debug,client,"In tda7432_init\n"); |
275 | 275 | ||
276 | t->input = TDA7432_STEREO_IN | /* Main (stereo) input */ | 276 | t->input = TDA7432_STEREO_IN | /* Main (stereo) input */ |
277 | TDA7432_BASS_SYM | /* Symmetric bass cut */ | 277 | TDA7432_BASS_SYM | /* Symmetric bass cut */ |
@@ -339,7 +339,7 @@ static int tda7432_command(struct i2c_client *client, | |||
339 | unsigned int cmd, void *arg) | 339 | unsigned int cmd, void *arg) |
340 | { | 340 | { |
341 | struct tda7432 *t = i2c_get_clientdata(client); | 341 | struct tda7432 *t = i2c_get_clientdata(client); |
342 | v4l_dbg(2,client,"In tda7432_command\n"); | 342 | v4l_dbg(2, debug,client,"In tda7432_command\n"); |
343 | if (debug>1) | 343 | if (debug>1) |
344 | v4l_i2c_print_ioctl(client,cmd); | 344 | v4l_i2c_print_ioctl(client,cmd); |
345 | 345 | ||
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c index 9baa6392e9b5..6d03b9b05c6e 100644 --- a/drivers/media/video/tvaudio.c +++ b/drivers/media/video/tvaudio.c | |||
@@ -159,7 +159,7 @@ static int chip_write(struct CHIPSTATE *chip, int subaddr, int val) | |||
159 | unsigned char buffer[2]; | 159 | unsigned char buffer[2]; |
160 | 160 | ||
161 | if (-1 == subaddr) { | 161 | if (-1 == subaddr) { |
162 | v4l_dbg(1, &chip->c, "%s: chip_write: 0x%x\n", | 162 | v4l_dbg(1, debug, &chip->c, "%s: chip_write: 0x%x\n", |
163 | chip->c.name, val); | 163 | chip->c.name, val); |
164 | chip->shadow.bytes[1] = val; | 164 | chip->shadow.bytes[1] = val; |
165 | buffer[0] = val; | 165 | buffer[0] = val; |
@@ -169,7 +169,7 @@ static int chip_write(struct CHIPSTATE *chip, int subaddr, int val) | |||
169 | return -1; | 169 | return -1; |
170 | } | 170 | } |
171 | } else { | 171 | } else { |
172 | v4l_dbg(1, &chip->c, "%s: chip_write: reg%d=0x%x\n", | 172 | v4l_dbg(1, debug, &chip->c, "%s: chip_write: reg%d=0x%x\n", |
173 | chip->c.name, subaddr, val); | 173 | chip->c.name, subaddr, val); |
174 | chip->shadow.bytes[subaddr+1] = val; | 174 | chip->shadow.bytes[subaddr+1] = val; |
175 | buffer[0] = subaddr; | 175 | buffer[0] = subaddr; |
@@ -204,7 +204,7 @@ static int chip_read(struct CHIPSTATE *chip) | |||
204 | chip->c.name); | 204 | chip->c.name); |
205 | return -1; | 205 | return -1; |
206 | } | 206 | } |
207 | v4l_dbg(1, &chip->c, "%s: chip_read: 0x%x\n",chip->c.name, buffer); | 207 | v4l_dbg(1, debug, &chip->c, "%s: chip_read: 0x%x\n",chip->c.name, buffer); |
208 | return buffer; | 208 | return buffer; |
209 | } | 209 | } |
210 | 210 | ||
@@ -222,7 +222,7 @@ static int chip_read2(struct CHIPSTATE *chip, int subaddr) | |||
222 | v4l_warn(&chip->c, "%s: I/O error (read2)\n", chip->c.name); | 222 | v4l_warn(&chip->c, "%s: I/O error (read2)\n", chip->c.name); |
223 | return -1; | 223 | return -1; |
224 | } | 224 | } |
225 | v4l_dbg(1, &chip->c, "%s: chip_read2: reg%d=0x%x\n", | 225 | v4l_dbg(1, debug, &chip->c, "%s: chip_read2: reg%d=0x%x\n", |
226 | chip->c.name, subaddr,read[0]); | 226 | chip->c.name, subaddr,read[0]); |
227 | return read[0]; | 227 | return read[0]; |
228 | } | 228 | } |
@@ -235,7 +235,7 @@ static int chip_cmd(struct CHIPSTATE *chip, char *name, audiocmd *cmd) | |||
235 | return 0; | 235 | return 0; |
236 | 236 | ||
237 | /* update our shadow register set; print bytes if (debug > 0) */ | 237 | /* update our shadow register set; print bytes if (debug > 0) */ |
238 | v4l_dbg(1, &chip->c, "%s: chip_cmd(%s): reg=%d, data:", | 238 | v4l_dbg(1, debug, &chip->c, "%s: chip_cmd(%s): reg=%d, data:", |
239 | chip->c.name, name,cmd->bytes[0]); | 239 | chip->c.name, name,cmd->bytes[0]); |
240 | for (i = 1; i < cmd->count; i++) { | 240 | for (i = 1; i < cmd->count; i++) { |
241 | if (debug) | 241 | if (debug) |
@@ -274,7 +274,7 @@ static int chip_thread(void *data) | |||
274 | 274 | ||
275 | daemonize("%s", chip->c.name); | 275 | daemonize("%s", chip->c.name); |
276 | allow_signal(SIGTERM); | 276 | allow_signal(SIGTERM); |
277 | v4l_dbg(1, &chip->c, "%s: thread started\n", chip->c.name); | 277 | v4l_dbg(1, debug, &chip->c, "%s: thread started\n", chip->c.name); |
278 | 278 | ||
279 | for (;;) { | 279 | for (;;) { |
280 | add_wait_queue(&chip->wq, &wait); | 280 | add_wait_queue(&chip->wq, &wait); |
@@ -286,7 +286,7 @@ static int chip_thread(void *data) | |||
286 | try_to_freeze(); | 286 | try_to_freeze(); |
287 | if (chip->done || signal_pending(current)) | 287 | if (chip->done || signal_pending(current)) |
288 | break; | 288 | break; |
289 | v4l_dbg(1, &chip->c, "%s: thread wakeup\n", chip->c.name); | 289 | v4l_dbg(1, debug, &chip->c, "%s: thread wakeup\n", chip->c.name); |
290 | 290 | ||
291 | /* don't do anything for radio or if mode != auto */ | 291 | /* don't do anything for radio or if mode != auto */ |
292 | if (chip->radio || chip->mode != 0) | 292 | if (chip->radio || chip->mode != 0) |
@@ -299,7 +299,7 @@ static int chip_thread(void *data) | |||
299 | mod_timer(&chip->wt, jiffies+2*HZ); | 299 | mod_timer(&chip->wt, jiffies+2*HZ); |
300 | } | 300 | } |
301 | 301 | ||
302 | v4l_dbg(1, &chip->c, "%s: thread exiting\n", chip->c.name); | 302 | v4l_dbg(1, debug, &chip->c, "%s: thread exiting\n", chip->c.name); |
303 | complete_and_exit(&chip->texit, 0); | 303 | complete_and_exit(&chip->texit, 0); |
304 | return 0; | 304 | return 0; |
305 | } | 305 | } |
@@ -312,7 +312,7 @@ static void generic_checkmode(struct CHIPSTATE *chip) | |||
312 | if (mode == chip->prevmode) | 312 | if (mode == chip->prevmode) |
313 | return; | 313 | return; |
314 | 314 | ||
315 | v4l_dbg(1, &chip->c, "%s: thread checkmode\n", chip->c.name); | 315 | v4l_dbg(1, debug, &chip->c, "%s: thread checkmode\n", chip->c.name); |
316 | chip->prevmode = mode; | 316 | chip->prevmode = mode; |
317 | 317 | ||
318 | if (mode & VIDEO_SOUND_STEREO) | 318 | if (mode & VIDEO_SOUND_STEREO) |
@@ -359,7 +359,7 @@ static int tda9840_getmode(struct CHIPSTATE *chip) | |||
359 | if (val & TDA9840_ST_STEREO) | 359 | if (val & TDA9840_ST_STEREO) |
360 | mode |= VIDEO_SOUND_STEREO; | 360 | mode |= VIDEO_SOUND_STEREO; |
361 | 361 | ||
362 | v4l_dbg(1, &chip->c, "tda9840_getmode(): raw chip read: %d, return: %d\n", | 362 | v4l_dbg(1, debug, &chip->c, "tda9840_getmode(): raw chip read: %d, return: %d\n", |
363 | val, mode); | 363 | val, mode); |
364 | return mode; | 364 | return mode; |
365 | } | 365 | } |
@@ -655,7 +655,7 @@ static int tda9873_getmode(struct CHIPSTATE *chip) | |||
655 | mode |= VIDEO_SOUND_STEREO; | 655 | mode |= VIDEO_SOUND_STEREO; |
656 | if (val & TDA9873_DUAL) | 656 | if (val & TDA9873_DUAL) |
657 | mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 657 | mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; |
658 | v4l_dbg(1, &chip->c, "tda9873_getmode(): raw chip read: %d, return: %d\n", | 658 | v4l_dbg(1, debug, &chip->c, "tda9873_getmode(): raw chip read: %d, return: %d\n", |
659 | val, mode); | 659 | val, mode); |
660 | return mode; | 660 | return mode; |
661 | } | 661 | } |
@@ -666,12 +666,12 @@ static void tda9873_setmode(struct CHIPSTATE *chip, int mode) | |||
666 | /* int adj_data = chip->shadow.bytes[TDA9873_AD+1] ; */ | 666 | /* int adj_data = chip->shadow.bytes[TDA9873_AD+1] ; */ |
667 | 667 | ||
668 | if ((sw_data & TDA9873_INP_MASK) != TDA9873_INTERNAL) { | 668 | if ((sw_data & TDA9873_INP_MASK) != TDA9873_INTERNAL) { |
669 | v4l_dbg(1, &chip->c, "tda9873_setmode(): external input\n"); | 669 | v4l_dbg(1, debug, &chip->c, "tda9873_setmode(): external input\n"); |
670 | return; | 670 | return; |
671 | } | 671 | } |
672 | 672 | ||
673 | v4l_dbg(1, &chip->c, "tda9873_setmode(): chip->shadow.bytes[%d] = %d\n", TDA9873_SW+1, chip->shadow.bytes[TDA9873_SW+1]); | 673 | v4l_dbg(1, debug, &chip->c, "tda9873_setmode(): chip->shadow.bytes[%d] = %d\n", TDA9873_SW+1, chip->shadow.bytes[TDA9873_SW+1]); |
674 | v4l_dbg(1, &chip->c, "tda9873_setmode(): sw_data = %d\n", sw_data); | 674 | v4l_dbg(1, debug, &chip->c, "tda9873_setmode(): sw_data = %d\n", sw_data); |
675 | 675 | ||
676 | switch (mode) { | 676 | switch (mode) { |
677 | case VIDEO_SOUND_MONO: | 677 | case VIDEO_SOUND_MONO: |
@@ -692,7 +692,7 @@ static void tda9873_setmode(struct CHIPSTATE *chip, int mode) | |||
692 | } | 692 | } |
693 | 693 | ||
694 | chip_write(chip, TDA9873_SW, sw_data); | 694 | chip_write(chip, TDA9873_SW, sw_data); |
695 | v4l_dbg(1, &chip->c, "tda9873_setmode(): req. mode %d; chip_write: %d\n", | 695 | v4l_dbg(1, debug, &chip->c, "tda9873_setmode(): req. mode %d; chip_write: %d\n", |
696 | mode, sw_data); | 696 | mode, sw_data); |
697 | } | 697 | } |
698 | 698 | ||
@@ -831,7 +831,7 @@ static int tda9874a_setup(struct CHIPSTATE *chip) | |||
831 | chip_write(chip, TDA9874A_SDACOSR, (tda9874a_mode) ? 0x81:0x80); | 831 | chip_write(chip, TDA9874A_SDACOSR, (tda9874a_mode) ? 0x81:0x80); |
832 | chip_write(chip, TDA9874A_AOSR, 0x00); /* or 0x10 */ | 832 | chip_write(chip, TDA9874A_AOSR, 0x00); /* or 0x10 */ |
833 | } | 833 | } |
834 | v4l_dbg(1, &chip->c, "tda9874a_setup(): %s [0x%02X].\n", | 834 | v4l_dbg(1, debug, &chip->c, "tda9874a_setup(): %s [0x%02X].\n", |
835 | tda9874a_modelist[tda9874a_STD].name,tda9874a_STD); | 835 | tda9874a_modelist[tda9874a_STD].name,tda9874a_STD); |
836 | return 1; | 836 | return 1; |
837 | } | 837 | } |
@@ -874,7 +874,7 @@ static int tda9874a_getmode(struct CHIPSTATE *chip) | |||
874 | mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; | 874 | mode |= VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2; |
875 | } | 875 | } |
876 | 876 | ||
877 | v4l_dbg(1, &chip->c, "tda9874a_getmode(): DSR=0x%X, NSR=0x%X, NECR=0x%X, return: %d.\n", | 877 | v4l_dbg(1, debug, &chip->c, "tda9874a_getmode(): DSR=0x%X, NSR=0x%X, NECR=0x%X, return: %d.\n", |
878 | dsr, nsr, necr, mode); | 878 | dsr, nsr, necr, mode); |
879 | return mode; | 879 | return mode; |
880 | } | 880 | } |
@@ -920,7 +920,7 @@ static void tda9874a_setmode(struct CHIPSTATE *chip, int mode) | |||
920 | chip_write(chip, TDA9874A_AOSR, aosr); | 920 | chip_write(chip, TDA9874A_AOSR, aosr); |
921 | chip_write(chip, TDA9874A_MDACOSR, mdacosr); | 921 | chip_write(chip, TDA9874A_MDACOSR, mdacosr); |
922 | 922 | ||
923 | v4l_dbg(1, &chip->c, "tda9874a_setmode(): req. mode %d; AOSR=0x%X, MDACOSR=0x%X.\n", | 923 | v4l_dbg(1, debug, &chip->c, "tda9874a_setmode(): req. mode %d; AOSR=0x%X, MDACOSR=0x%X.\n", |
924 | mode, aosr, mdacosr); | 924 | mode, aosr, mdacosr); |
925 | 925 | ||
926 | } else { /* dic == 0x07 */ | 926 | } else { /* dic == 0x07 */ |
@@ -955,7 +955,7 @@ static void tda9874a_setmode(struct CHIPSTATE *chip, int mode) | |||
955 | chip_write(chip, TDA9874A_FMMR, fmmr); | 955 | chip_write(chip, TDA9874A_FMMR, fmmr); |
956 | chip_write(chip, TDA9874A_AOSR, aosr); | 956 | chip_write(chip, TDA9874A_AOSR, aosr); |
957 | 957 | ||
958 | v4l_dbg(1, &chip->c, "tda9874a_setmode(): req. mode %d; FMMR=0x%X, AOSR=0x%X.\n", | 958 | v4l_dbg(1, debug, &chip->c, "tda9874a_setmode(): req. mode %d; FMMR=0x%X, AOSR=0x%X.\n", |
959 | mode, fmmr, aosr); | 959 | mode, fmmr, aosr); |
960 | } | 960 | } |
961 | } | 961 | } |
@@ -969,7 +969,7 @@ static int tda9874a_checkit(struct CHIPSTATE *chip) | |||
969 | if(-1 == (sic = chip_read2(chip,TDA9874A_SIC))) | 969 | if(-1 == (sic = chip_read2(chip,TDA9874A_SIC))) |
970 | return 0; | 970 | return 0; |
971 | 971 | ||
972 | v4l_dbg(1, &chip->c, "tda9874a_checkit(): DIC=0x%X, SIC=0x%X.\n", dic, sic); | 972 | v4l_dbg(1, debug, &chip->c, "tda9874a_checkit(): DIC=0x%X, SIC=0x%X.\n", dic, sic); |
973 | 973 | ||
974 | if((dic == 0x11)||(dic == 0x07)) { | 974 | if((dic == 0x11)||(dic == 0x07)) { |
975 | v4l_info(&chip->c, "found tda9874%s.\n", (dic == 0x11) ? "a":"h"); | 975 | v4l_info(&chip->c, "found tda9874%s.\n", (dic == 0x11) ? "a":"h"); |
@@ -1184,7 +1184,7 @@ static int ta8874z_getmode(struct CHIPSTATE *chip) | |||
1184 | }else if (!(val & TA8874Z_B0)){ | 1184 | }else if (!(val & TA8874Z_B0)){ |
1185 | mode |= VIDEO_SOUND_STEREO; | 1185 | mode |= VIDEO_SOUND_STEREO; |
1186 | } | 1186 | } |
1187 | /* v4l_dbg(1, &chip->c, "ta8874z_getmode(): raw chip read: 0x%02x, return: 0x%02x\n", val, mode); */ | 1187 | /* v4l_dbg(1, debug, &chip->c, "ta8874z_getmode(): raw chip read: 0x%02x, return: 0x%02x\n", val, mode); */ |
1188 | return mode; | 1188 | return mode; |
1189 | } | 1189 | } |
1190 | 1190 | ||
@@ -1197,7 +1197,7 @@ static void ta8874z_setmode(struct CHIPSTATE *chip, int mode) | |||
1197 | { | 1197 | { |
1198 | int update = 1; | 1198 | int update = 1; |
1199 | audiocmd *t = NULL; | 1199 | audiocmd *t = NULL; |
1200 | v4l_dbg(1, &chip->c, "ta8874z_setmode(): mode: 0x%02x\n", mode); | 1200 | v4l_dbg(1, debug, &chip->c, "ta8874z_setmode(): mode: 0x%02x\n", mode); |
1201 | 1201 | ||
1202 | switch(mode){ | 1202 | switch(mode){ |
1203 | case VIDEO_SOUND_MONO: | 1203 | case VIDEO_SOUND_MONO: |
@@ -1477,7 +1477,7 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind) | |||
1477 | i2c_set_clientdata(&chip->c, chip); | 1477 | i2c_set_clientdata(&chip->c, chip); |
1478 | 1478 | ||
1479 | /* find description for the chip */ | 1479 | /* find description for the chip */ |
1480 | v4l_dbg(1, &chip->c, "chip found @ 0x%x\n", addr<<1); | 1480 | v4l_dbg(1, debug, &chip->c, "chip found @ 0x%x\n", addr<<1); |
1481 | for (desc = chiplist; desc->name != NULL; desc++) { | 1481 | for (desc = chiplist; desc->name != NULL; desc++) { |
1482 | if (0 == *(desc->insmodopt)) | 1482 | if (0 == *(desc->insmodopt)) |
1483 | continue; | 1483 | continue; |
@@ -1489,12 +1489,12 @@ static int chip_attach(struct i2c_adapter *adap, int addr, int kind) | |||
1489 | break; | 1489 | break; |
1490 | } | 1490 | } |
1491 | if (desc->name == NULL) { | 1491 | if (desc->name == NULL) { |
1492 | v4l_dbg(1, &chip->c, "no matching chip description found\n"); | 1492 | v4l_dbg(1, debug, &chip->c, "no matching chip description found\n"); |
1493 | return -EIO; | 1493 | return -EIO; |
1494 | } | 1494 | } |
1495 | v4l_info(&chip->c, "%s found @ 0x%x (%s)\n", desc->name, addr<<1, adap->name); | 1495 | v4l_info(&chip->c, "%s found @ 0x%x (%s)\n", desc->name, addr<<1, adap->name); |
1496 | if (desc->flags) { | 1496 | if (desc->flags) { |
1497 | v4l_dbg(1, &chip->c, "matches:%s%s%s.\n", | 1497 | v4l_dbg(1, debug, &chip->c, "matches:%s%s%s.\n", |
1498 | (desc->flags & CHIP_HAS_VOLUME) ? " volume" : "", | 1498 | (desc->flags & CHIP_HAS_VOLUME) ? " volume" : "", |
1499 | (desc->flags & CHIP_HAS_BASSTREBLE) ? " bass/treble" : "", | 1499 | (desc->flags & CHIP_HAS_BASSTREBLE) ? " bass/treble" : "", |
1500 | (desc->flags & CHIP_HAS_INPUTSEL) ? " audiomux" : ""); | 1500 | (desc->flags & CHIP_HAS_INPUTSEL) ? " audiomux" : ""); |
@@ -1582,7 +1582,7 @@ static int chip_command(struct i2c_client *client, | |||
1582 | struct CHIPSTATE *chip = i2c_get_clientdata(client); | 1582 | struct CHIPSTATE *chip = i2c_get_clientdata(client); |
1583 | struct CHIPDESC *desc = chiplist + chip->type; | 1583 | struct CHIPDESC *desc = chiplist + chip->type; |
1584 | 1584 | ||
1585 | v4l_dbg(1, &chip->c, "%s: chip_command 0x%x\n", chip->c.name, cmd); | 1585 | v4l_dbg(1, debug, &chip->c, "%s: chip_command 0x%x\n", chip->c.name, cmd); |
1586 | 1586 | ||
1587 | switch (cmd) { | 1587 | switch (cmd) { |
1588 | case AUDC_SET_INPUT: | 1588 | case AUDC_SET_INPUT: |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 3cc3132f391e..c74052abb189 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -49,9 +49,8 @@ | |||
49 | 49 | ||
50 | /* These three macros assume that the debug level is set with a module | 50 | /* These three macros assume that the debug level is set with a module |
51 | parameter called 'debug'. */ | 51 | parameter called 'debug'. */ |
52 | #define v4l_dbg(level, client, fmt, arg...) \ | 52 | #define v4l_dbg(level, debug, client, fmt, arg...) \ |
53 | do { \ | 53 | do { \ |
54 | extern int debug; \ | ||
55 | if (debug >= (level)) \ | 54 | if (debug >= (level)) \ |
56 | v4l_client_printk(KERN_DEBUG, client, fmt , ## arg); \ | 55 | v4l_client_printk(KERN_DEBUG, client, fmt , ## arg); \ |
57 | } while (0) | 56 | } while (0) |