diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-11-09 00:37:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:16 -0500 |
commit | 6df840f20d1ff63fd13ed1bb3e186395ee800794 (patch) | |
tree | 92d390225b24eaf04e2d4eba49869ad65990f5e1 | |
parent | 4eb0c14465a9221f040551a91238b57af301c145 (diff) |
[PATCH] v4l: 758: some improvements at msp3400 c from ivtv code
- Some improvements at msp3400.c from ivtv code.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/media/video/msp3400.c | 440 |
1 files changed, 245 insertions, 195 deletions
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index 88cc793c0bc9..4689dee882f3 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c | |||
@@ -73,13 +73,22 @@ static int dolby = 0; | |||
73 | 73 | ||
74 | static int stereo_threshold = 0x190; /* a2 threshold for stereo/bilingual | 74 | static int stereo_threshold = 0x190; /* a2 threshold for stereo/bilingual |
75 | (msp34xxg only) 0x00a0-0x03c0 */ | 75 | (msp34xxg only) 0x00a0-0x03c0 */ |
76 | #define DFP_COUNT 0x41 | ||
77 | static const int bl_dfp[] = { | ||
78 | 0x00, 0x01, 0x02, 0x03, 0x06, 0x08, 0x09, 0x0a, | ||
79 | 0x0b, 0x0d, 0x0e, 0x10 | ||
80 | }; | ||
81 | |||
82 | #define IS_MSP34XX_G(msp) ((msp)->opmode==2) | ||
76 | 83 | ||
77 | struct msp3400c { | 84 | struct msp3400c { |
78 | int rev1,rev2; | 85 | int rev1,rev2; |
79 | 86 | ||
80 | int opmode; | 87 | int opmode; |
88 | int nicam; | ||
81 | int mode; | 89 | int mode; |
82 | int norm; | 90 | int norm; |
91 | int stereo; | ||
83 | int nicam_on; | 92 | int nicam_on; |
84 | int acb; | 93 | int acb; |
85 | int main, second; /* sound carrier */ | 94 | int main, second; /* sound carrier */ |
@@ -91,9 +100,12 @@ struct msp3400c { | |||
91 | int rxsubchans; | 100 | int rxsubchans; |
92 | 101 | ||
93 | int muted; | 102 | int muted; |
94 | int volume, balance; | 103 | int left, right; /* volume */ |
95 | int bass, treble; | 104 | int bass, treble; |
96 | 105 | ||
106 | /* shadow register set */ | ||
107 | int dfp_regs[DFP_COUNT]; | ||
108 | |||
97 | /* thread */ | 109 | /* thread */ |
98 | struct task_struct *kthread; | 110 | struct task_struct *kthread; |
99 | wait_queue_head_t wq; | 111 | wait_queue_head_t wq; |
@@ -101,6 +113,8 @@ struct msp3400c { | |||
101 | int watch_stereo:1; | 113 | int watch_stereo:1; |
102 | }; | 114 | }; |
103 | 115 | ||
116 | #define MIN(a,b) (((a)>(b))?(b):(a)) | ||
117 | #define MAX(a,b) (((a)>(b))?(a):(b)) | ||
104 | #define HAVE_NICAM(msp) (((msp->rev2>>8) & 0xff) != 00) | 118 | #define HAVE_NICAM(msp) (((msp->rev2>>8) & 0xff) != 00) |
105 | #define HAVE_SIMPLE(msp) ((msp->rev1 & 0xff) >= 'D'-'@') | 119 | #define HAVE_SIMPLE(msp) ((msp->rev1 & 0xff) >= 'D'-'@') |
106 | #define HAVE_SIMPLER(msp) ((msp->rev1 & 0xff) >= 'G'-'@') | 120 | #define HAVE_SIMPLER(msp) ((msp->rev1 & 0xff) >= 'G'-'@') |
@@ -112,6 +126,7 @@ struct msp3400c { | |||
112 | 126 | ||
113 | #define dprintk if (debug >= 1) printk | 127 | #define dprintk if (debug >= 1) printk |
114 | #define d2printk if (debug >= 2) printk | 128 | #define d2printk if (debug >= 2) printk |
129 | #define dprintk_trace if (debug>=16) printk | ||
115 | 130 | ||
116 | /* read-only */ | 131 | /* read-only */ |
117 | module_param(opmode, int, 0444); | 132 | module_param(opmode, int, 0444); |
@@ -132,11 +147,6 @@ MODULE_PARM_DESC(standard, "Specify audio standard: 32 = NTSC, 64 = radio, Defau | |||
132 | MODULE_PARM_DESC(amsound, "Hardwire AM sound at 6.5Hz (France), FM can autoscan"); | 147 | MODULE_PARM_DESC(amsound, "Hardwire AM sound at 6.5Hz (France), FM can autoscan"); |
133 | MODULE_PARM_DESC(dolby, "Activates Dolby processsing"); | 148 | MODULE_PARM_DESC(dolby, "Activates Dolby processsing"); |
134 | 149 | ||
135 | |||
136 | MODULE_DESCRIPTION("device driver for msp34xx TV sound processor"); | ||
137 | MODULE_AUTHOR("Gerd Knorr"); | ||
138 | MODULE_LICENSE("Dual BSD/GPL"); /* FreeBSD uses this too */ | ||
139 | |||
140 | /* ---------------------------------------------------------------------- */ | 150 | /* ---------------------------------------------------------------------- */ |
141 | 151 | ||
142 | #define I2C_MSP3400C 0x80 | 152 | #define I2C_MSP3400C 0x80 |
@@ -153,6 +163,10 @@ static unsigned short normal_i2c[] = { | |||
153 | }; | 163 | }; |
154 | I2C_CLIENT_INSMOD; | 164 | I2C_CLIENT_INSMOD; |
155 | 165 | ||
166 | MODULE_DESCRIPTION("device driver for msp34xx TV sound processor"); | ||
167 | MODULE_AUTHOR("Gerd Knorr"); | ||
168 | MODULE_LICENSE("GPL"); | ||
169 | |||
156 | /* ----------------------------------------------------------------------- */ | 170 | /* ----------------------------------------------------------------------- */ |
157 | /* functions for talking to the MSP3400C Sound processor */ | 171 | /* functions for talking to the MSP3400C Sound processor */ |
158 | 172 | ||
@@ -172,6 +186,7 @@ static int msp3400c_reset(struct i2c_client *client) | |||
172 | { client->addr, I2C_M_RD, 2, read }, | 186 | { client->addr, I2C_M_RD, 2, read }, |
173 | }; | 187 | }; |
174 | 188 | ||
189 | dprintk_trace("trace: msp3400c_reset\n"); | ||
175 | if ( (1 != i2c_transfer(client->adapter,&reset[0],1)) || | 190 | if ( (1 != i2c_transfer(client->adapter,&reset[0],1)) || |
176 | (1 != i2c_transfer(client->adapter,&reset[1],1)) || | 191 | (1 != i2c_transfer(client->adapter,&reset[1],1)) || |
177 | (2 != i2c_transfer(client->adapter,test,2)) ) { | 192 | (2 != i2c_transfer(client->adapter,test,2)) ) { |
@@ -181,10 +196,9 @@ static int msp3400c_reset(struct i2c_client *client) | |||
181 | return 0; | 196 | return 0; |
182 | } | 197 | } |
183 | 198 | ||
184 | static int | 199 | static int msp3400c_read(struct i2c_client *client, int dev, int addr) |
185 | msp3400c_read(struct i2c_client *client, int dev, int addr) | ||
186 | { | 200 | { |
187 | int err; | 201 | int err,retval; |
188 | 202 | ||
189 | unsigned char write[3]; | 203 | unsigned char write[3]; |
190 | unsigned char read[2]; | 204 | unsigned char read[2]; |
@@ -192,6 +206,7 @@ msp3400c_read(struct i2c_client *client, int dev, int addr) | |||
192 | { client->addr, 0, 3, write }, | 206 | { client->addr, 0, 3, write }, |
193 | { client->addr, I2C_M_RD, 2, read } | 207 | { client->addr, I2C_M_RD, 2, read } |
194 | }; | 208 | }; |
209 | |||
195 | write[0] = dev+1; | 210 | write[0] = dev+1; |
196 | write[1] = addr >> 8; | 211 | write[1] = addr >> 8; |
197 | write[2] = addr & 0xff; | 212 | write[2] = addr & 0xff; |
@@ -200,20 +215,25 @@ msp3400c_read(struct i2c_client *client, int dev, int addr) | |||
200 | if (2 == i2c_transfer(client->adapter,msgs,2)) | 215 | if (2 == i2c_transfer(client->adapter,msgs,2)) |
201 | break; | 216 | break; |
202 | err++; | 217 | err++; |
203 | printk(KERN_WARNING "msp34xx: I/O error #%d (read 0x%02x/0x%02x)\n", | 218 | printk(KERN_WARNING |
204 | err, dev, addr); | 219 | "msp34xx: I/O error #%d (read 0x%02x/0x%02x)\n", err, |
205 | msleep(10); | 220 | dev, addr); |
221 | current->state = TASK_INTERRUPTIBLE; | ||
222 | schedule_timeout(msecs_to_jiffies(10)); | ||
206 | } | 223 | } |
207 | if (3 == err) { | 224 | if (3 == err) { |
208 | printk(KERN_WARNING "msp34xx: giving up, reseting chip. Sound will go off, sorry folks :-|\n"); | 225 | printk(KERN_WARNING |
226 | "msp34xx: giving up, reseting chip. Sound will go off, sorry folks :-|\n"); | ||
209 | msp3400c_reset(client); | 227 | msp3400c_reset(client); |
210 | return -1; | 228 | return -1; |
211 | } | 229 | } |
212 | return read[0] << 8 | read[1]; | 230 | retval = read[0] << 8 | read[1]; |
231 | dprintk_trace("trace: msp3400c_read(0x%x, 0x%x): 0x%x\n", dev, addr, | ||
232 | retval); | ||
233 | return retval; | ||
213 | } | 234 | } |
214 | 235 | ||
215 | static int | 236 | static int msp3400c_write(struct i2c_client *client, int dev, int addr, int val) |
216 | msp3400c_write(struct i2c_client *client, int dev, int addr, int val) | ||
217 | { | 237 | { |
218 | int err; | 238 | int err; |
219 | unsigned char buffer[5]; | 239 | unsigned char buffer[5]; |
@@ -224,16 +244,21 @@ msp3400c_write(struct i2c_client *client, int dev, int addr, int val) | |||
224 | buffer[3] = val >> 8; | 244 | buffer[3] = val >> 8; |
225 | buffer[4] = val & 0xff; | 245 | buffer[4] = val & 0xff; |
226 | 246 | ||
247 | dprintk_trace("trace: msp3400c_write(0x%x, 0x%x, 0x%x)\n", dev, addr, | ||
248 | val); | ||
227 | for (err = 0; err < 3;) { | 249 | for (err = 0; err < 3;) { |
228 | if (5 == i2c_master_send(client, buffer, 5)) | 250 | if (5 == i2c_master_send(client, buffer, 5)) |
229 | break; | 251 | break; |
230 | err++; | 252 | err++; |
231 | printk(KERN_WARNING "msp34xx: I/O error #%d (write 0x%02x/0x%02x)\n", | 253 | printk(KERN_WARNING |
232 | err, dev, addr); | 254 | "msp34xx: I/O error #%d (write 0x%02x/0x%02x)\n", err, |
233 | msleep(10); | 255 | dev, addr); |
256 | current->state = TASK_INTERRUPTIBLE; | ||
257 | schedule_timeout(msecs_to_jiffies(10)); | ||
234 | } | 258 | } |
235 | if (3 == err) { | 259 | if (3 == err) { |
236 | printk(KERN_WARNING "msp34xx: giving up, reseting chip. Sound will go off, sorry folks :-|\n"); | 260 | printk(KERN_WARNING |
261 | "msp34xx: giving up, reseting chip. Sound will go off, sorry folks :-|\n"); | ||
237 | msp3400c_reset(client); | 262 | msp3400c_reset(client); |
238 | return -1; | 263 | return -1; |
239 | } | 264 | } |
@@ -266,45 +291,47 @@ static struct MSP_INIT_DATA_DEM { | |||
266 | int dfp_src; | 291 | int dfp_src; |
267 | int dfp_matrix; | 292 | int dfp_matrix; |
268 | } msp_init_data[] = { | 293 | } msp_init_data[] = { |
269 | /* AM (for carrier detect / msp3400) */ | 294 | { /* AM (for carrier detect / msp3400) */ |
270 | { { 75, 19, 36, 35, 39, 40 }, { 75, 19, 36, 35, 39, 40 }, | 295 | {75, 19, 36, 35, 39, 40}, |
271 | MSP_CARRIER(5.5), MSP_CARRIER(5.5), | 296 | {75, 19, 36, 35, 39, 40}, |
272 | 0x00d0, 0x0500, 0x0020, 0x3000}, | 297 | MSP_CARRIER(5.5), MSP_CARRIER(5.5), |
273 | 298 | 0x00d0, 0x0500, 0x0020, 0x3000 | |
274 | /* AM (for carrier detect / msp3410) */ | 299 | },{ /* AM (for carrier detect / msp3410) */ |
275 | { { -1, -1, -8, 2, 59, 126 }, { -1, -1, -8, 2, 59, 126 }, | 300 | {-1, -1, -8, 2, 59, 126}, |
276 | MSP_CARRIER(5.5), MSP_CARRIER(5.5), | 301 | {-1, -1, -8, 2, 59, 126}, |
277 | 0x00d0, 0x0100, 0x0020, 0x3000}, | 302 | MSP_CARRIER(5.5), MSP_CARRIER(5.5), |
278 | 303 | 0x00d0, 0x0100, 0x0020, 0x3000 | |
279 | /* FM Radio */ | 304 | },{ /* FM Radio */ |
280 | { { -8, -8, 4, 6, 78, 107 }, { -8, -8, 4, 6, 78, 107 }, | 305 | {-8, -8, 4, 6, 78, 107}, |
281 | MSP_CARRIER(10.7), MSP_CARRIER(10.7), | 306 | {-8, -8, 4, 6, 78, 107}, |
282 | 0x00d0, 0x0480, 0x0020, 0x3000 }, | 307 | MSP_CARRIER(10.7), MSP_CARRIER(10.7), |
283 | 308 | 0x00d0, 0x0480, 0x0020, 0x3000 | |
284 | /* Terrestial FM-mono + FM-stereo */ | 309 | },{ /* Terrestial FM-mono + FM-stereo */ |
285 | { { 3, 18, 27, 48, 66, 72 }, { 3, 18, 27, 48, 66, 72 }, | 310 | {3, 18, 27, 48, 66, 72}, |
286 | MSP_CARRIER(5.5), MSP_CARRIER(5.5), | 311 | {3, 18, 27, 48, 66, 72}, |
287 | 0x00d0, 0x0480, 0x0030, 0x3000}, | 312 | MSP_CARRIER(5.5), MSP_CARRIER(5.5), |
288 | 313 | 0x00d0, 0x0480, 0x0030, 0x3000 | |
289 | /* Sat FM-mono */ | 314 | },{ /* Sat FM-mono */ |
290 | { { 1, 9, 14, 24, 33, 37 }, { 3, 18, 27, 48, 66, 72 }, | 315 | { 1, 9, 14, 24, 33, 37}, |
291 | MSP_CARRIER(6.5), MSP_CARRIER(6.5), | 316 | { 3, 18, 27, 48, 66, 72}, |
292 | 0x00c6, 0x0480, 0x0000, 0x3000}, | 317 | MSP_CARRIER(6.5), MSP_CARRIER(6.5), |
293 | 318 | 0x00c6, 0x0480, 0x0000, 0x3000 | |
294 | /* NICAM/FM -- B/G (5.5/5.85), D/K (6.5/5.85) */ | 319 | },{ /* NICAM/FM -- B/G (5.5/5.85), D/K (6.5/5.85) */ |
295 | { { -2, -8, -10, 10, 50, 86 }, { 3, 18, 27, 48, 66, 72 }, | 320 | {-2, -8, -10, 10, 50, 86}, |
296 | MSP_CARRIER(5.5), MSP_CARRIER(5.5), | 321 | {3, 18, 27, 48, 66, 72}, |
297 | 0x00d0, 0x0040, 0x0120, 0x3000}, | 322 | MSP_CARRIER(5.5), MSP_CARRIER(5.5), |
298 | 323 | 0x00d0, 0x0040, 0x0120, 0x3000 | |
299 | /* NICAM/FM -- I (6.0/6.552) */ | 324 | },{ /* NICAM/FM -- I (6.0/6.552) */ |
300 | { { 2, 4, -6, -4, 40, 94 }, { 3, 18, 27, 48, 66, 72 }, | 325 | {2, 4, -6, -4, 40, 94}, |
301 | MSP_CARRIER(6.0), MSP_CARRIER(6.0), | 326 | {3, 18, 27, 48, 66, 72}, |
302 | 0x00d0, 0x0040, 0x0120, 0x3000}, | 327 | MSP_CARRIER(6.0), MSP_CARRIER(6.0), |
303 | 328 | 0x00d0, 0x0040, 0x0120, 0x3000 | |
304 | /* NICAM/AM -- L (6.5/5.85) */ | 329 | },{ /* NICAM/AM -- L (6.5/5.85) */ |
305 | { { -2, -8, -10, 10, 50, 86 }, { -4, -12, -9, 23, 79, 126 }, | 330 | {-2, -8, -10, 10, 50, 86}, |
306 | MSP_CARRIER(6.5), MSP_CARRIER(6.5), | 331 | {-4, -12, -9, 23, 79, 126}, |
307 | 0x00c6, 0x0140, 0x0120, 0x7c03}, | 332 | MSP_CARRIER(6.5), MSP_CARRIER(6.5), |
333 | 0x00c6, 0x0140, 0x0120, 0x7c03 | ||
334 | }, | ||
308 | }; | 335 | }; |
309 | 336 | ||
310 | struct CARRIER_DETECT { | 337 | struct CARRIER_DETECT { |
@@ -341,26 +368,24 @@ static struct CARRIER_DETECT carrier_detect_65[] = { | |||
341 | /* ----------------------------------------------------------------------- */ | 368 | /* ----------------------------------------------------------------------- */ |
342 | 369 | ||
343 | static int scarts[3][9] = { | 370 | static int scarts[3][9] = { |
344 | /* MASK IN1 IN2 IN1_DA IN2_DA IN3 IN4 MONO MUTE */ | 371 | /* MASK IN1 IN2 IN1_DA IN2_DA IN3 IN4 MONO MUTE */ |
345 | { 0x0320, 0x0000, 0x0200, -1, -1, 0x0300, 0x0020, 0x0100, 0x0320 }, | 372 | { 0x0320, 0x0000, 0x0200, -1, -1, 0x0300, 0x0020, 0x0100, 0x0320 }, |
346 | { 0x0c40, 0x0440, 0x0400, 0x0c00, 0x0040, 0x0000, 0x0840, 0x0800, 0x0c40 }, | 373 | { 0x0c40, 0x0440, 0x0400, 0x0c00, 0x0040, 0x0000, 0x0840, 0x0800, 0x0c40 }, |
347 | { 0x3080, 0x1000, 0x1080, 0x0000, 0x0080, 0x2080, 0x3080, 0x2000, 0x3000 }, | 374 | { 0x3080, 0x1000, 0x1080, 0x0000, 0x0080, 0x2080, 0x3080, 0x2000, 0x3000 }, |
348 | }; | 375 | }; |
349 | 376 | ||
350 | static char *scart_names[] = { | 377 | static char *scart_names[] = { |
351 | "mask", "in1", "in2", "in1 da", "in2 da", "in3", "in4", "mono", "mute" | 378 | "mask", "in1", "in2", "in1 da", "in2 da", "in3", "in4", "mono", "mute" |
352 | }; | 379 | }; |
353 | 380 | ||
354 | static void | 381 | static void msp3400c_set_scart(struct i2c_client *client, int in, int out) |
355 | msp3400c_set_scart(struct i2c_client *client, int in, int out) | ||
356 | { | 382 | { |
357 | struct msp3400c *msp = i2c_get_clientdata(client); | 383 | struct msp3400c *msp = i2c_get_clientdata(client); |
358 | 384 | ||
359 | if (-1 == scarts[out][in]) | 385 | if (-1 == scarts[out][in]) |
360 | return; | 386 | return; |
361 | 387 | ||
362 | dprintk(KERN_DEBUG | 388 | dprintk("msp34xx: scart switch: %s => %d\n", scart_names[in], out); |
363 | "msp34xx: scart switch: %s => %d\n",scart_names[in],out); | ||
364 | msp->acb &= ~scarts[out][SCART_MASK]; | 389 | msp->acb &= ~scarts[out][SCART_MASK]; |
365 | msp->acb |= scarts[out][in]; | 390 | msp->acb |= scarts[out][in]; |
366 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0013, msp->acb); | 391 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0013, msp->acb); |
@@ -378,34 +403,34 @@ static void msp3400c_setcarrier(struct i2c_client *client, int cdo1, int cdo2) | |||
378 | } | 403 | } |
379 | 404 | ||
380 | static void msp3400c_setvolume(struct i2c_client *client, | 405 | static void msp3400c_setvolume(struct i2c_client *client, |
381 | int muted, int volume, int balance) | 406 | int muted, int left, int right) |
382 | { | 407 | { |
383 | int val = 0, bal = 0; | 408 | int vol = 0, val = 0, balance = 0; |
384 | 409 | ||
385 | muted=0; | ||
386 | if (!muted) { | 410 | if (!muted) { |
387 | /* 0x7f instead if 0x73 here has sound quality issues, | 411 | /* 0x7f instead if 0x73 here has sound quality issues, |
388 | * probably due to overmodulation + clipping ... */ | 412 | * probably due to overmodulation + clipping ... */ |
389 | val = (volume * 0x73 / 65535) << 8; | 413 | vol = (left > right) ? left : right; |
414 | val = (vol * 0x73 / 65535) << 8; | ||
390 | } | 415 | } |
391 | if (val) { | 416 | if (vol > 0) { |
392 | bal = (balance / 256) - 128; | 417 | balance = ((right - left) * 127) / vol; |
393 | } | 418 | } |
394 | dprintk(KERN_DEBUG | 419 | |
395 | "msp34xx: setvolume: mute=%s %d:%d v=0x%02x b=0x%02x\n", | 420 | dprintk("msp34xx: setvolume: mute=%s %d:%d v=0x%02x b=0x%02x\n", |
396 | muted ? "on" : "off", volume, balance, val>>8, bal); | 421 | muted ? "on" : "off", left, right, val >> 8, balance); |
397 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0000, val); /* loudspeaker */ | 422 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0000, val); /* loudspeaker */ |
398 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0006, val); /* headphones */ | 423 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0006, val); /* headphones */ |
399 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0007, | 424 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0007, |
400 | muted ? 0x01 : (val | 0x01)); | 425 | muted ? 0x1 : (val | 0x1)); |
401 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0001, bal << 8); | 426 | msp3400c_write(client, I2C_MSP3400C_DFP, 0x0001, balance << 8); |
402 | } | 427 | } |
403 | 428 | ||
404 | static void msp3400c_setbass(struct i2c_client *client, int bass) | 429 | static void msp3400c_setbass(struct i2c_client *client, int bass) |
405 | { | 430 | { |
406 | int val = ((bass-32768) * 0x60 / 65535) << 8; | 431 | int val = ((bass-32768) * 0x60 / 65535) << 8; |
407 | 432 | ||
408 | dprintk(KERN_DEBUG "msp34xx: setbass: %d 0x%02x\n",bass, val>>8); | 433 | dprintk("msp34xx: setbass: %d 0x%02x\n", bass, val >> 8); |
409 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0002, val); /* loudspeaker */ | 434 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0002, val); /* loudspeaker */ |
410 | } | 435 | } |
411 | 436 | ||
@@ -413,7 +438,7 @@ static void msp3400c_settreble(struct i2c_client *client, int treble) | |||
413 | { | 438 | { |
414 | int val = ((treble-32768) * 0x60 / 65535) << 8; | 439 | int val = ((treble-32768) * 0x60 / 65535) << 8; |
415 | 440 | ||
416 | dprintk(KERN_DEBUG "msp34xx: settreble: %d 0x%02x\n",treble, val>>8); | 441 | dprintk("msp34xx: settreble: %d 0x%02x\n",treble, val>>8); |
417 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0003, val); /* loudspeaker */ | 442 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0003, val); /* loudspeaker */ |
418 | } | 443 | } |
419 | 444 | ||
@@ -422,7 +447,7 @@ static void msp3400c_setmode(struct i2c_client *client, int type) | |||
422 | struct msp3400c *msp = i2c_get_clientdata(client); | 447 | struct msp3400c *msp = i2c_get_clientdata(client); |
423 | int i; | 448 | int i; |
424 | 449 | ||
425 | dprintk(KERN_DEBUG "msp3400: setmode: %d\n",type); | 450 | dprintk("msp3400: setmode: %d\n",type); |
426 | msp->mode = type; | 451 | msp->mode = type; |
427 | msp->audmode = V4L2_TUNER_MODE_MONO; | 452 | msp->audmode = V4L2_TUNER_MODE_MONO; |
428 | msp->rxsubchans = V4L2_TUNER_SUB_MONO; | 453 | msp->rxsubchans = V4L2_TUNER_SUB_MONO; |
@@ -475,7 +500,8 @@ static void msp3400c_setmode(struct i2c_client *client, int type) | |||
475 | } | 500 | } |
476 | } | 501 | } |
477 | 502 | ||
478 | static int best_audio_mode(int rxsubchans) | 503 | /* given a bitmask of VIDEO_SOUND_XXX returns the "best" in the bitmask */ |
504 | static int best_video_sound(int rxsubchans) | ||
479 | { | 505 | { |
480 | if (rxsubchans & V4L2_TUNER_SUB_STEREO) | 506 | if (rxsubchans & V4L2_TUNER_SUB_STEREO) |
481 | return V4L2_TUNER_MODE_STEREO; | 507 | return V4L2_TUNER_MODE_STEREO; |
@@ -487,31 +513,32 @@ static int best_audio_mode(int rxsubchans) | |||
487 | } | 513 | } |
488 | 514 | ||
489 | /* turn on/off nicam + stereo */ | 515 | /* turn on/off nicam + stereo */ |
490 | static void msp3400c_set_audmode(struct i2c_client *client, int audmode) | 516 | static void msp3400c_setstereo(struct i2c_client *client, int mode) |
491 | { | 517 | { |
492 | static char *strmode[16] = { | 518 | static char *strmode[] = { "0", "mono", "stereo", "3", |
493 | #if __GNUC__ >= 3 | 519 | "lang1", "5", "6", "7", "lang2" |
494 | [ 0 ... 15 ] = "invalid", | ||
495 | #endif | ||
496 | [ V4L2_TUNER_MODE_MONO ] = "mono", | ||
497 | [ V4L2_TUNER_MODE_STEREO ] = "stereo", | ||
498 | [ V4L2_TUNER_MODE_LANG1 ] = "lang1", | ||
499 | [ V4L2_TUNER_MODE_LANG2 ] = "lang2", | ||
500 | }; | 520 | }; |
501 | struct msp3400c *msp = i2c_get_clientdata(client); | 521 | struct msp3400c *msp = i2c_get_clientdata(client); |
502 | int nicam=0; /* channel source: FM/AM or nicam */ | 522 | int nicam = 0; /* channel source: FM/AM or nicam */ |
503 | int src=0; | 523 | int src = 0; |
504 | 524 | ||
505 | BUG_ON(msp->opmode == OPMODE_SIMPLER); | 525 | if (IS_MSP34XX_G(msp)) { |
506 | msp->audmode = audmode; | 526 | /* this method would break everything, let's make sure |
527 | * it's never called | ||
528 | */ | ||
529 | dprintk | ||
530 | ("msp34xxg: DEBUG WARNING setstereo called with mode=%d instead of set_source (ignored)\n", | ||
531 | mode); | ||
532 | return; | ||
533 | } | ||
507 | 534 | ||
508 | /* switch demodulator */ | 535 | /* switch demodulator */ |
509 | switch (msp->mode) { | 536 | switch (msp->mode) { |
510 | case MSP_MODE_FM_TERRA: | 537 | case MSP_MODE_FM_TERRA: |
511 | dprintk(KERN_DEBUG "msp3400: FM setstereo: %s\n", | 538 | dprintk("msp3400: FM setstereo: %s\n", |
512 | strmode[audmode]); | 539 | strmode[mode]); |
513 | msp3400c_setcarrier(client,msp->second,msp->main); | 540 | msp3400c_setcarrier(client,msp->second,msp->main); |
514 | switch (audmode) { | 541 | switch (mode) { |
515 | case V4L2_TUNER_MODE_STEREO: | 542 | case V4L2_TUNER_MODE_STEREO: |
516 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x000e, 0x3001); | 543 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x000e, 0x3001); |
517 | break; | 544 | break; |
@@ -523,9 +550,8 @@ static void msp3400c_set_audmode(struct i2c_client *client, int audmode) | |||
523 | } | 550 | } |
524 | break; | 551 | break; |
525 | case MSP_MODE_FM_SAT: | 552 | case MSP_MODE_FM_SAT: |
526 | dprintk(KERN_DEBUG "msp3400: SAT setstereo: %s\n", | 553 | dprintk("msp3400: SAT setstereo: %s\n", strmode[mode]); |
527 | strmode[audmode]); | 554 | switch (mode) { |
528 | switch (audmode) { | ||
529 | case V4L2_TUNER_MODE_MONO: | 555 | case V4L2_TUNER_MODE_MONO: |
530 | msp3400c_setcarrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5)); | 556 | msp3400c_setcarrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5)); |
531 | break; | 557 | break; |
@@ -543,33 +569,29 @@ static void msp3400c_set_audmode(struct i2c_client *client, int audmode) | |||
543 | case MSP_MODE_FM_NICAM1: | 569 | case MSP_MODE_FM_NICAM1: |
544 | case MSP_MODE_FM_NICAM2: | 570 | case MSP_MODE_FM_NICAM2: |
545 | case MSP_MODE_AM_NICAM: | 571 | case MSP_MODE_AM_NICAM: |
546 | dprintk(KERN_DEBUG "msp3400: NICAM setstereo: %s\n", | 572 | dprintk("msp3400: NICAM setstereo: %s\n",strmode[mode]); |
547 | strmode[audmode]); | ||
548 | msp3400c_setcarrier(client,msp->second,msp->main); | 573 | msp3400c_setcarrier(client,msp->second,msp->main); |
549 | if (msp->nicam_on) | 574 | if (msp->nicam_on) |
550 | nicam=0x0100; | 575 | nicam=0x0100; |
551 | break; | 576 | break; |
552 | case MSP_MODE_BTSC: | 577 | case MSP_MODE_BTSC: |
553 | dprintk(KERN_DEBUG "msp3400: BTSC setstereo: %s\n", | 578 | dprintk("msp3400: BTSC setstereo: %s\n",strmode[mode]); |
554 | strmode[audmode]); | ||
555 | nicam=0x0300; | 579 | nicam=0x0300; |
556 | break; | 580 | break; |
557 | case MSP_MODE_EXTERN: | 581 | case MSP_MODE_EXTERN: |
558 | dprintk(KERN_DEBUG "msp3400: extern setstereo: %s\n", | 582 | dprintk("msp3400: extern setstereo: %s\n",strmode[mode]); |
559 | strmode[audmode]); | ||
560 | nicam = 0x0200; | 583 | nicam = 0x0200; |
561 | break; | 584 | break; |
562 | case MSP_MODE_FM_RADIO: | 585 | case MSP_MODE_FM_RADIO: |
563 | dprintk(KERN_DEBUG "msp3400: FM-Radio setstereo: %s\n", | 586 | dprintk("msp3400: FM-Radio setstereo: %s\n",strmode[mode]); |
564 | strmode[audmode]); | ||
565 | break; | 587 | break; |
566 | default: | 588 | default: |
567 | dprintk(KERN_DEBUG "msp3400: mono setstereo\n"); | 589 | dprintk("msp3400: mono setstereo\n"); |
568 | return; | 590 | return; |
569 | } | 591 | } |
570 | 592 | ||
571 | /* switch audio */ | 593 | /* switch audio */ |
572 | switch (audmode) { | 594 | switch (best_video_sound(mode)) { |
573 | case V4L2_TUNER_MODE_STEREO: | 595 | case V4L2_TUNER_MODE_STEREO: |
574 | src = 0x0020 | nicam; | 596 | src = 0x0020 | nicam; |
575 | break; | 597 | break; |
@@ -589,8 +611,7 @@ static void msp3400c_set_audmode(struct i2c_client *client, int audmode) | |||
589 | src = 0x0010 | nicam; | 611 | src = 0x0010 | nicam; |
590 | break; | 612 | break; |
591 | } | 613 | } |
592 | dprintk(KERN_DEBUG | 614 | dprintk("msp3400: setstereo final source/matrix = 0x%x\n", src); |
593 | "msp3400: setstereo final source/matrix = 0x%x\n", src); | ||
594 | 615 | ||
595 | if (dolby) { | 616 | if (dolby) { |
596 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0008,0x0520); | 617 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x0008,0x0520); |
@@ -609,26 +630,26 @@ static void | |||
609 | msp3400c_print_mode(struct msp3400c *msp) | 630 | msp3400c_print_mode(struct msp3400c *msp) |
610 | { | 631 | { |
611 | if (msp->main == msp->second) { | 632 | if (msp->main == msp->second) { |
612 | printk(KERN_DEBUG "msp3400: mono sound carrier: %d.%03d MHz\n", | 633 | dprintk("msp3400: mono sound carrier: %d.%03d MHz\n", |
613 | msp->main/910000,(msp->main/910)%1000); | 634 | msp->main/910000,(msp->main/910)%1000); |
614 | } else { | 635 | } else { |
615 | printk(KERN_DEBUG "msp3400: main sound carrier: %d.%03d MHz\n", | 636 | dprintk("msp3400: main sound carrier: %d.%03d MHz\n", |
616 | msp->main/910000,(msp->main/910)%1000); | 637 | msp->main/910000,(msp->main/910)%1000); |
617 | } | 638 | } |
618 | if (msp->mode == MSP_MODE_FM_NICAM1 || | 639 | if (msp->mode == MSP_MODE_FM_NICAM1 || msp->mode == MSP_MODE_FM_NICAM2) |
619 | msp->mode == MSP_MODE_FM_NICAM2) | 640 | dprintk("msp3400: NICAM/FM carrier : %d.%03d MHz\n", |
620 | printk(KERN_DEBUG "msp3400: NICAM/FM carrier : %d.%03d MHz\n", | ||
621 | msp->second/910000,(msp->second/910)%1000); | 641 | msp->second/910000,(msp->second/910)%1000); |
622 | if (msp->mode == MSP_MODE_AM_NICAM) | 642 | if (msp->mode == MSP_MODE_AM_NICAM) |
623 | printk(KERN_DEBUG "msp3400: NICAM/AM carrier : %d.%03d MHz\n", | 643 | dprintk("msp3400: NICAM/AM carrier : %d.%03d MHz\n", |
624 | msp->second/910000,(msp->second/910)%1000); | 644 | msp->second/910000,(msp->second/910)%1000); |
625 | if (msp->mode == MSP_MODE_FM_TERRA && | 645 | if (msp->mode == MSP_MODE_FM_TERRA && |
626 | msp->main != msp->second) { | 646 | msp->main != msp->second) { |
627 | printk(KERN_DEBUG "msp3400: FM-stereo carrier : %d.%03d MHz\n", | 647 | dprintk("msp3400: FM-stereo carrier : %d.%03d MHz\n", |
628 | msp->second/910000,(msp->second/910)%1000); | 648 | msp->second/910000,(msp->second/910)%1000); |
629 | } | 649 | } |
630 | } | 650 | } |
631 | 651 | ||
652 | |||
632 | /* ----------------------------------------------------------------------- */ | 653 | /* ----------------------------------------------------------------------- */ |
633 | 654 | ||
634 | struct REGISTER_DUMP { | 655 | struct REGISTER_DUMP { |
@@ -636,8 +657,15 @@ struct REGISTER_DUMP { | |||
636 | char *name; | 657 | char *name; |
637 | }; | 658 | }; |
638 | 659 | ||
639 | static int | 660 | struct REGISTER_DUMP d1[] = { |
640 | autodetect_stereo(struct i2c_client *client) | 661 | {0x007e, "autodetect"}, |
662 | {0x0023, "C_AD_BITS "}, | ||
663 | {0x0038, "ADD_BITS "}, | ||
664 | {0x003e, "CIB_BITS "}, | ||
665 | {0x0057, "ERROR_RATE"}, | ||
666 | }; | ||
667 | |||
668 | static int autodetect_stereo(struct i2c_client *client) | ||
641 | { | 669 | { |
642 | struct msp3400c *msp = i2c_get_clientdata(client); | 670 | struct msp3400c *msp = i2c_get_clientdata(client); |
643 | int val; | 671 | int val; |
@@ -650,8 +678,7 @@ autodetect_stereo(struct i2c_client *client) | |||
650 | val = msp3400c_read(client, I2C_MSP3400C_DFP, 0x18); | 678 | val = msp3400c_read(client, I2C_MSP3400C_DFP, 0x18); |
651 | if (val > 32767) | 679 | if (val > 32767) |
652 | val -= 65536; | 680 | val -= 65536; |
653 | dprintk(KERN_DEBUG | 681 | dprintk("msp34xx: stereo detect register: %d\n",val); |
654 | "msp34xx: stereo detect register: %d\n",val); | ||
655 | if (val > 4096) { | 682 | if (val > 4096) { |
656 | rxsubchans = V4L2_TUNER_SUB_STEREO | V4L2_TUNER_SUB_MONO; | 683 | rxsubchans = V4L2_TUNER_SUB_STEREO | V4L2_TUNER_SUB_MONO; |
657 | } else if (val < -4096) { | 684 | } else if (val < -4096) { |
@@ -665,8 +692,7 @@ autodetect_stereo(struct i2c_client *client) | |||
665 | case MSP_MODE_FM_NICAM2: | 692 | case MSP_MODE_FM_NICAM2: |
666 | case MSP_MODE_AM_NICAM: | 693 | case MSP_MODE_AM_NICAM: |
667 | val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x23); | 694 | val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x23); |
668 | dprintk(KERN_DEBUG | 695 | dprintk("msp34xx: nicam sync=%d, mode=%d\n", |
669 | "msp34xx: nicam sync=%d, mode=%d\n", | ||
670 | val & 1, (val & 0x1e) >> 1); | 696 | val & 1, (val & 0x1e) >> 1); |
671 | 697 | ||
672 | if (val & 1) { | 698 | if (val & 1) { |
@@ -699,8 +725,7 @@ autodetect_stereo(struct i2c_client *client) | |||
699 | break; | 725 | break; |
700 | case MSP_MODE_BTSC: | 726 | case MSP_MODE_BTSC: |
701 | val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x200); | 727 | val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x200); |
702 | dprintk(KERN_DEBUG | 728 | dprintk("msp3410: status=0x%x (pri=%s, sec=%s, %s%s%s)\n", |
703 | "msp3410: status=0x%x (pri=%s, sec=%s, %s%s%s)\n", | ||
704 | val, | 729 | val, |
705 | (val & 0x0002) ? "no" : "yes", | 730 | (val & 0x0002) ? "no" : "yes", |
706 | (val & 0x0004) ? "no" : "yes", | 731 | (val & 0x0004) ? "no" : "yes", |
@@ -714,13 +739,13 @@ autodetect_stereo(struct i2c_client *client) | |||
714 | } | 739 | } |
715 | if (rxsubchans != msp->rxsubchans) { | 740 | if (rxsubchans != msp->rxsubchans) { |
716 | update = 1; | 741 | update = 1; |
717 | dprintk(KERN_DEBUG "msp34xx: watch: rxsubchans %d => %d\n", | 742 | dprintk("msp34xx: watch: rxsubchans %d => %d\n", |
718 | msp->rxsubchans,rxsubchans); | 743 | msp->rxsubchans,rxsubchans); |
719 | msp->rxsubchans = rxsubchans; | 744 | msp->rxsubchans = rxsubchans; |
720 | } | 745 | } |
721 | if (newnicam != msp->nicam_on) { | 746 | if (newnicam != msp->nicam_on) { |
722 | update = 1; | 747 | update = 1; |
723 | dprintk(KERN_DEBUG "msp34xx: watch: nicam %d => %d\n", | 748 | dprintk("msp34xx: watch: nicam %d => %d\n", |
724 | msp->nicam_on,newnicam); | 749 | msp->nicam_on,newnicam); |
725 | msp->nicam_on = newnicam; | 750 | msp->nicam_on = newnicam; |
726 | } | 751 | } |
@@ -757,8 +782,15 @@ static void watch_stereo(struct i2c_client *client) | |||
757 | { | 782 | { |
758 | struct msp3400c *msp = i2c_get_clientdata(client); | 783 | struct msp3400c *msp = i2c_get_clientdata(client); |
759 | 784 | ||
760 | if (autodetect_stereo(client)) | 785 | if (autodetect_stereo(client)) { |
761 | msp3400c_set_audmode(client,best_audio_mode(msp->rxsubchans)); | 786 | if (msp->stereo & V4L2_TUNER_MODE_STEREO) |
787 | msp3400c_setstereo(client, V4L2_TUNER_MODE_STEREO); | ||
788 | else if (msp->stereo & VIDEO_SOUND_LANG1) | ||
789 | msp3400c_setstereo(client, V4L2_TUNER_MODE_LANG1); | ||
790 | else | ||
791 | msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO); | ||
792 | } | ||
793 | |||
762 | if (once) | 794 | if (once) |
763 | msp->watch_stereo = 0; | 795 | msp->watch_stereo = 0; |
764 | } | 796 | } |
@@ -786,8 +818,7 @@ static int msp3400c_thread(void *data) | |||
786 | MSP_MODE_EXTERN == msp->mode) { | 818 | MSP_MODE_EXTERN == msp->mode) { |
787 | /* no carrier scan, just unmute */ | 819 | /* no carrier scan, just unmute */ |
788 | printk("msp3400: thread: no carrier scan\n"); | 820 | printk("msp3400: thread: no carrier scan\n"); |
789 | msp3400c_setvolume(client, msp->muted, | 821 | msp3400c_setvolume(client, msp->muted, msp->left, msp->right); |
790 | msp->volume, msp->balance); | ||
791 | continue; | 822 | continue; |
792 | } | 823 | } |
793 | 824 | ||
@@ -866,7 +897,7 @@ static int msp3400c_thread(void *data) | |||
866 | msp->second = carrier_detect_55[max2].cdo; | 897 | msp->second = carrier_detect_55[max2].cdo; |
867 | msp3400c_setmode(client, MSP_MODE_FM_TERRA); | 898 | msp3400c_setmode(client, MSP_MODE_FM_TERRA); |
868 | msp->nicam_on = 0; | 899 | msp->nicam_on = 0; |
869 | msp3400c_set_audmode(client, V4L2_TUNER_MODE_MONO); | 900 | msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO); |
870 | msp->watch_stereo = 1; | 901 | msp->watch_stereo = 1; |
871 | } else if (max2 == 1 && HAVE_NICAM(msp)) { | 902 | } else if (max2 == 1 && HAVE_NICAM(msp)) { |
872 | /* B/G NICAM */ | 903 | /* B/G NICAM */ |
@@ -893,7 +924,7 @@ static int msp3400c_thread(void *data) | |||
893 | msp->second = carrier_detect_65[max2].cdo; | 924 | msp->second = carrier_detect_65[max2].cdo; |
894 | msp3400c_setmode(client, MSP_MODE_FM_TERRA); | 925 | msp3400c_setmode(client, MSP_MODE_FM_TERRA); |
895 | msp->nicam_on = 0; | 926 | msp->nicam_on = 0; |
896 | msp3400c_set_audmode(client, V4L2_TUNER_MODE_MONO); | 927 | msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO); |
897 | msp->watch_stereo = 1; | 928 | msp->watch_stereo = 1; |
898 | } else if (max2 == 0 && | 929 | } else if (max2 == 0 && |
899 | msp->norm == VIDEO_MODE_SECAM) { | 930 | msp->norm == VIDEO_MODE_SECAM) { |
@@ -901,7 +932,7 @@ static int msp3400c_thread(void *data) | |||
901 | msp->second = carrier_detect_65[max2].cdo; | 932 | msp->second = carrier_detect_65[max2].cdo; |
902 | msp3400c_setmode(client, MSP_MODE_AM_NICAM); | 933 | msp3400c_setmode(client, MSP_MODE_AM_NICAM); |
903 | msp->nicam_on = 0; | 934 | msp->nicam_on = 0; |
904 | msp3400c_set_audmode(client, V4L2_TUNER_MODE_MONO); | 935 | msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO); |
905 | msp3400c_setcarrier(client, msp->second, msp->main); | 936 | msp3400c_setcarrier(client, msp->second, msp->main); |
906 | /* volume prescale for SCART (AM mono input) */ | 937 | /* volume prescale for SCART (AM mono input) */ |
907 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x000d, 0x1900); | 938 | msp3400c_write(client,I2C_MSP3400C_DFP, 0x000d, 0x1900); |
@@ -925,13 +956,12 @@ static int msp3400c_thread(void *data) | |||
925 | msp->nicam_on = 0; | 956 | msp->nicam_on = 0; |
926 | msp3400c_setcarrier(client, msp->second, msp->main); | 957 | msp3400c_setcarrier(client, msp->second, msp->main); |
927 | msp->rxsubchans = V4L2_TUNER_SUB_MONO; | 958 | msp->rxsubchans = V4L2_TUNER_SUB_MONO; |
928 | msp3400c_set_audmode(client, V4L2_TUNER_MODE_MONO); | 959 | msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO); |
929 | break; | 960 | break; |
930 | } | 961 | } |
931 | 962 | ||
932 | /* unmute */ | 963 | /* unmute */ |
933 | msp3400c_setvolume(client, msp->muted, | 964 | msp3400c_setvolume(client, msp->muted, msp->left, msp->right); |
934 | msp->volume, msp->balance); | ||
935 | if (debug) | 965 | if (debug) |
936 | msp3400c_print_mode(msp); | 966 | msp3400c_print_mode(msp); |
937 | 967 | ||
@@ -942,7 +972,7 @@ static int msp3400c_thread(void *data) | |||
942 | watch_stereo(client); | 972 | watch_stereo(client); |
943 | } | 973 | } |
944 | } | 974 | } |
945 | dprintk(KERN_DEBUG "msp3400: thread: exit\n"); | 975 | dprintk("msp3400: thread: exit\n"); |
946 | return 0; | 976 | return 0; |
947 | } | 977 | } |
948 | 978 | ||
@@ -990,7 +1020,7 @@ static int msp34xx_modus(int norm) | |||
990 | { | 1020 | { |
991 | switch (norm) { | 1021 | switch (norm) { |
992 | case VIDEO_MODE_PAL: | 1022 | case VIDEO_MODE_PAL: |
993 | dprintk(KERN_DEBUG "msp34xx: video mode selected to PAL\n"); | 1023 | dprintk("msp34xx: video mode selected to PAL\n"); |
994 | 1024 | ||
995 | #if 1 | 1025 | #if 1 |
996 | /* experimental: not sure this works with all chip versions */ | 1026 | /* experimental: not sure this works with all chip versions */ |
@@ -1000,16 +1030,16 @@ static int msp34xx_modus(int norm) | |||
1000 | return 0x1003; | 1030 | return 0x1003; |
1001 | #endif | 1031 | #endif |
1002 | case VIDEO_MODE_NTSC: /* BTSC */ | 1032 | case VIDEO_MODE_NTSC: /* BTSC */ |
1003 | dprintk(KERN_DEBUG "msp34xx: video mode selected to NTSC\n"); | 1033 | dprintk("msp34xx: video mode selected to NTSC\n"); |
1004 | return 0x2003; | 1034 | return 0x2003; |
1005 | case VIDEO_MODE_SECAM: | 1035 | case VIDEO_MODE_SECAM: |
1006 | dprintk(KERN_DEBUG "msp34xx: video mode selected to SECAM\n"); | 1036 | dprintk("msp34xx: video mode selected to SECAM\n"); |
1007 | return 0x0003; | 1037 | return 0x0003; |
1008 | case VIDEO_MODE_RADIO: | 1038 | case VIDEO_MODE_RADIO: |
1009 | dprintk(KERN_DEBUG "msp34xx: video mode selected to Radio\n"); | 1039 | dprintk("msp34xx: video mode selected to Radio\n"); |
1010 | return 0x0003; | 1040 | return 0x0003; |
1011 | case VIDEO_MODE_AUTO: | 1041 | case VIDEO_MODE_AUTO: |
1012 | dprintk(KERN_DEBUG "msp34xx: video mode selected to Auto\n"); | 1042 | dprintk("msp34xx: video mode selected to Auto\n"); |
1013 | return 0x2003; | 1043 | return 0x2003; |
1014 | default: | 1044 | default: |
1015 | return 0x0003; | 1045 | return 0x0003; |
@@ -1040,9 +1070,9 @@ static int msp3410d_thread(void *data) | |||
1040 | 1070 | ||
1041 | printk("msp3410: daemon started\n"); | 1071 | printk("msp3410: daemon started\n"); |
1042 | for (;;) { | 1072 | for (;;) { |
1043 | d2printk(KERN_DEBUG "msp3410: thread: sleep\n"); | 1073 | d2printk("msp3410: thread: sleep\n"); |
1044 | msp34xx_sleep(msp,-1); | 1074 | msp34xx_sleep(msp,-1); |
1045 | d2printk(KERN_DEBUG "msp3410: thread: wakeup\n"); | 1075 | d2printk("msp3410: thread: wakeup\n"); |
1046 | 1076 | ||
1047 | restart: | 1077 | restart: |
1048 | dprintk("msp3410: thread: restart scan\n"); | 1078 | dprintk("msp3410: thread: restart scan\n"); |
@@ -1052,9 +1082,8 @@ static int msp3410d_thread(void *data) | |||
1052 | 1082 | ||
1053 | if (msp->mode == MSP_MODE_EXTERN) { | 1083 | if (msp->mode == MSP_MODE_EXTERN) { |
1054 | /* no carrier scan needed, just unmute */ | 1084 | /* no carrier scan needed, just unmute */ |
1055 | dprintk(KERN_DEBUG "msp3410: thread: no carrier scan\n"); | 1085 | dprintk("msp3410: thread: no carrier scan\n"); |
1056 | msp3400c_setvolume(client, msp->muted, | 1086 | msp3400c_setvolume(client, msp->muted, msp->left, msp->right); |
1057 | msp->volume, msp->balance); | ||
1058 | continue; | 1087 | continue; |
1059 | } | 1088 | } |
1060 | 1089 | ||
@@ -1073,7 +1102,7 @@ static int msp3410d_thread(void *data) | |||
1073 | msp->watch_stereo = 0; | 1102 | msp->watch_stereo = 0; |
1074 | 1103 | ||
1075 | if (debug) | 1104 | if (debug) |
1076 | printk(KERN_DEBUG "msp3410: setting mode: %s (0x%04x)\n", | 1105 | dprintk("msp3410: setting mode: %s (0x%04x)\n", |
1077 | msp34xx_standard_mode_name(std) ,std); | 1106 | msp34xx_standard_mode_name(std) ,std); |
1078 | 1107 | ||
1079 | if (std != 1) { | 1108 | if (std != 1) { |
@@ -1089,13 +1118,13 @@ static int msp3410d_thread(void *data) | |||
1089 | val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x7e); | 1118 | val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x7e); |
1090 | if (val < 0x07ff) | 1119 | if (val < 0x07ff) |
1091 | break; | 1120 | break; |
1092 | dprintk(KERN_DEBUG "msp3410: detection still in progress\n"); | 1121 | dprintk("msp3410: detection still in progress\n"); |
1093 | } | 1122 | } |
1094 | } | 1123 | } |
1095 | for (i = 0; modelist[i].name != NULL; i++) | 1124 | for (i = 0; modelist[i].name != NULL; i++) |
1096 | if (modelist[i].retval == val) | 1125 | if (modelist[i].retval == val) |
1097 | break; | 1126 | break; |
1098 | dprintk(KERN_DEBUG "msp3410: current mode: %s (0x%04x)\n", | 1127 | dprintk("msp3410: current mode: %s (0x%04x)\n", |
1099 | modelist[i].name ? modelist[i].name : "unknown", | 1128 | modelist[i].name ? modelist[i].name : "unknown", |
1100 | val); | 1129 | val); |
1101 | msp->main = modelist[i].main; | 1130 | msp->main = modelist[i].main; |
@@ -1103,7 +1132,7 @@ static int msp3410d_thread(void *data) | |||
1103 | 1132 | ||
1104 | if (amsound && (msp->norm == VIDEO_MODE_SECAM) && (val != 0x0009)) { | 1133 | if (amsound && (msp->norm == VIDEO_MODE_SECAM) && (val != 0x0009)) { |
1105 | /* autodetection has failed, let backup */ | 1134 | /* autodetection has failed, let backup */ |
1106 | dprintk(KERN_DEBUG "msp3410: autodetection failed," | 1135 | dprintk("msp3410: autodetection failed," |
1107 | " switching to backup mode: %s (0x%04x)\n", | 1136 | " switching to backup mode: %s (0x%04x)\n", |
1108 | modelist[8].name ? modelist[8].name : "unknown",val); | 1137 | modelist[8].name ? modelist[8].name : "unknown",val); |
1109 | val = 0x0009; | 1138 | val = 0x0009; |
@@ -1127,13 +1156,13 @@ static int msp3410d_thread(void *data) | |||
1127 | msp->rxsubchans = V4L2_TUNER_SUB_STEREO; | 1156 | msp->rxsubchans = V4L2_TUNER_SUB_STEREO; |
1128 | msp->nicam_on = 1; | 1157 | msp->nicam_on = 1; |
1129 | msp->watch_stereo = 1; | 1158 | msp->watch_stereo = 1; |
1130 | msp3400c_set_audmode(client,V4L2_TUNER_MODE_STEREO); | 1159 | msp3400c_setstereo(client,V4L2_TUNER_MODE_STEREO); |
1131 | break; | 1160 | break; |
1132 | case 0x0009: | 1161 | case 0x0009: |
1133 | msp->mode = MSP_MODE_AM_NICAM; | 1162 | msp->mode = MSP_MODE_AM_NICAM; |
1134 | msp->rxsubchans = V4L2_TUNER_SUB_MONO; | 1163 | msp->rxsubchans = V4L2_TUNER_SUB_MONO; |
1135 | msp->nicam_on = 1; | 1164 | msp->nicam_on = 1; |
1136 | msp3400c_set_audmode(client,V4L2_TUNER_MODE_MONO); | 1165 | msp3400c_setstereo(client,V4L2_TUNER_MODE_MONO); |
1137 | msp->watch_stereo = 1; | 1166 | msp->watch_stereo = 1; |
1138 | break; | 1167 | break; |
1139 | case 0x0020: /* BTSC */ | 1168 | case 0x0020: /* BTSC */ |
@@ -1142,7 +1171,7 @@ static int msp3410d_thread(void *data) | |||
1142 | msp->rxsubchans = V4L2_TUNER_SUB_STEREO; | 1171 | msp->rxsubchans = V4L2_TUNER_SUB_STEREO; |
1143 | msp->nicam_on = 0; | 1172 | msp->nicam_on = 0; |
1144 | msp->watch_stereo = 1; | 1173 | msp->watch_stereo = 1; |
1145 | msp3400c_set_audmode(client,V4L2_TUNER_MODE_STEREO); | 1174 | msp3400c_setstereo(client,V4L2_TUNER_MODE_STEREO); |
1146 | break; | 1175 | break; |
1147 | case 0x0040: /* FM radio */ | 1176 | case 0x0040: /* FM radio */ |
1148 | msp->mode = MSP_MODE_FM_RADIO; | 1177 | msp->mode = MSP_MODE_FM_RADIO; |
@@ -1176,8 +1205,7 @@ static int msp3410d_thread(void *data) | |||
1176 | /* unmute, restore misc registers */ | 1205 | /* unmute, restore misc registers */ |
1177 | msp3400c_setbass(client, msp->bass); | 1206 | msp3400c_setbass(client, msp->bass); |
1178 | msp3400c_settreble(client, msp->treble); | 1207 | msp3400c_settreble(client, msp->treble); |
1179 | msp3400c_setvolume(client, msp->muted, | 1208 | msp3400c_setvolume(client, msp->muted, msp->left, msp->right); |
1180 | msp->volume, msp->balance); | ||
1181 | msp3400c_write(client, I2C_MSP3400C_DFP, 0x0013, msp->acb); | 1209 | msp3400c_write(client, I2C_MSP3400C_DFP, 0x0013, msp->acb); |
1182 | 1210 | ||
1183 | /* monitor tv audio mode */ | 1211 | /* monitor tv audio mode */ |
@@ -1187,7 +1215,7 @@ static int msp3410d_thread(void *data) | |||
1187 | watch_stereo(client); | 1215 | watch_stereo(client); |
1188 | } | 1216 | } |
1189 | } | 1217 | } |
1190 | dprintk(KERN_DEBUG "msp3410: thread: exit\n"); | 1218 | dprintk("msp3410: thread: exit\n"); |
1191 | return 0; | 1219 | return 0; |
1192 | } | 1220 | } |
1193 | 1221 | ||
@@ -1264,9 +1292,9 @@ static int msp34xxg_thread(void *data) | |||
1264 | printk("msp34xxg: daemon started\n"); | 1292 | printk("msp34xxg: daemon started\n"); |
1265 | msp->source = 1; /* default */ | 1293 | msp->source = 1; /* default */ |
1266 | for (;;) { | 1294 | for (;;) { |
1267 | d2printk(KERN_DEBUG "msp34xxg: thread: sleep\n"); | 1295 | d2printk("msp34xxg: thread: sleep\n"); |
1268 | msp34xx_sleep(msp,-1); | 1296 | msp34xx_sleep(msp,-1); |
1269 | d2printk(KERN_DEBUG "msp34xxg: thread: wakeup\n"); | 1297 | d2printk("msp34xxg: thread: wakeup\n"); |
1270 | 1298 | ||
1271 | restart: | 1299 | restart: |
1272 | dprintk("msp34xxg: thread: restart scan\n"); | 1300 | dprintk("msp34xxg: thread: restart scan\n"); |
@@ -1308,7 +1336,7 @@ static int msp34xxg_thread(void *data) | |||
1308 | 1336 | ||
1309 | msp3400c_setbass(client, msp->bass); | 1337 | msp3400c_setbass(client, msp->bass); |
1310 | msp3400c_settreble(client, msp->treble); | 1338 | msp3400c_settreble(client, msp->treble); |
1311 | msp3400c_setvolume(client, msp->muted, msp->volume, msp->balance); | 1339 | msp3400c_setvolume(client, msp->muted, msp->left, msp->right); |
1312 | 1340 | ||
1313 | /* restore ACB */ | 1341 | /* restore ACB */ |
1314 | if (msp3400c_write(client, | 1342 | if (msp3400c_write(client, |
@@ -1317,7 +1345,7 @@ static int msp34xxg_thread(void *data) | |||
1317 | msp->acb)) | 1345 | msp->acb)) |
1318 | return -1; | 1346 | return -1; |
1319 | } | 1347 | } |
1320 | dprintk(KERN_DEBUG "msp34xxg: thread: exit\n"); | 1348 | dprintk("msp34xxg: thread: exit\n"); |
1321 | return 0; | 1349 | return 0; |
1322 | } | 1350 | } |
1323 | 1351 | ||
@@ -1476,12 +1504,12 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind) | |||
1476 | } | 1504 | } |
1477 | 1505 | ||
1478 | memset(msp,0,sizeof(struct msp3400c)); | 1506 | memset(msp,0,sizeof(struct msp3400c)); |
1479 | msp->volume = 58880; /* 0db gain */ | 1507 | msp->left = 58880; /* 0db gain */ |
1480 | msp->balance = 32768; | 1508 | msp->right = 58880; /* 0db gain */ |
1481 | msp->bass = 32768; | 1509 | msp->bass = 32768; |
1482 | msp->treble = 32768; | 1510 | msp->treble = 32768; |
1483 | msp->input = -1; | 1511 | msp->input = -1; |
1484 | msp->muted = 1; | 1512 | msp->muted = 0; |
1485 | 1513 | ||
1486 | i2c_set_clientdata(c, msp); | 1514 | i2c_set_clientdata(c, msp); |
1487 | init_waitqueue_head(&msp->wq); | 1515 | init_waitqueue_head(&msp->wq); |
@@ -1504,7 +1532,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind) | |||
1504 | } | 1532 | } |
1505 | printk(KERN_INFO "msp34xx: rev1=0x%04x, rev2=0x%04x\n", msp->rev1, msp->rev2); | 1533 | printk(KERN_INFO "msp34xx: rev1=0x%04x, rev2=0x%04x\n", msp->rev1, msp->rev2); |
1506 | 1534 | ||
1507 | msp3400c_setvolume(c, msp->muted, msp->volume, msp->balance); | 1535 | msp3400c_setvolume(c, msp->muted, msp->left, msp->right); |
1508 | 1536 | ||
1509 | snprintf(c->name, sizeof(c->name), "MSP34%02d%c-%c%d", | 1537 | snprintf(c->name, sizeof(c->name), "MSP34%02d%c-%c%d", |
1510 | (msp->rev2>>8)&0xff, (msp->rev1&0xff)+'@', | 1538 | (msp->rev2>>8)&0xff, (msp->rev1&0xff)+'@', |
@@ -1558,6 +1586,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind) | |||
1558 | 1586 | ||
1559 | /* done */ | 1587 | /* done */ |
1560 | i2c_attach_client(c); | 1588 | i2c_attach_client(c); |
1589 | |||
1561 | return 0; | 1590 | return 0; |
1562 | } | 1591 | } |
1563 | 1592 | ||
@@ -1648,7 +1677,7 @@ static void msp_any_set_audmode(struct i2c_client *client, int audmode) | |||
1648 | case OPMODE_MANUAL: | 1677 | case OPMODE_MANUAL: |
1649 | case OPMODE_SIMPLE: | 1678 | case OPMODE_SIMPLE: |
1650 | msp->watch_stereo = 0; | 1679 | msp->watch_stereo = 0; |
1651 | msp3400c_set_audmode(client, audmode); | 1680 | msp3400c_setstereo(client, audmode); |
1652 | break; | 1681 | break; |
1653 | case OPMODE_SIMPLER: | 1682 | case OPMODE_SIMPLER: |
1654 | msp34xxg_set_audmode(client, audmode); | 1683 | msp34xxg_set_audmode(client, audmode); |
@@ -1665,7 +1694,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1665 | switch (cmd) { | 1694 | switch (cmd) { |
1666 | 1695 | ||
1667 | case AUDC_SET_INPUT: | 1696 | case AUDC_SET_INPUT: |
1668 | dprintk(KERN_DEBUG "msp34xx: AUDC_SET_INPUT(%d)\n",*sarg); | 1697 | dprintk("msp34xx: AUDC_SET_INPUT(%d)\n",*sarg); |
1669 | if (*sarg == msp->input) | 1698 | if (*sarg == msp->input) |
1670 | break; | 1699 | break; |
1671 | msp->input = *sarg; | 1700 | msp->input = *sarg; |
@@ -1699,15 +1728,15 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1699 | msp3400c_set_scart(client,scart,0); | 1728 | msp3400c_set_scart(client,scart,0); |
1700 | msp3400c_write(client,I2C_MSP3400C_DFP,0x000d,0x1900); | 1729 | msp3400c_write(client,I2C_MSP3400C_DFP,0x000d,0x1900); |
1701 | if (msp->opmode != OPMODE_SIMPLER) | 1730 | if (msp->opmode != OPMODE_SIMPLER) |
1702 | msp3400c_set_audmode(client, msp->audmode); | 1731 | msp3400c_setstereo(client, msp->audmode); |
1703 | } | 1732 | } |
1704 | msp_wake_thread(client); | 1733 | msp_wake_thread(client); |
1705 | break; | 1734 | break; |
1706 | 1735 | ||
1707 | case AUDC_SET_RADIO: | 1736 | case AUDC_SET_RADIO: |
1708 | dprintk(KERN_DEBUG "msp34xx: AUDC_SET_RADIO\n"); | 1737 | dprintk("msp34xx: AUDC_SET_RADIO\n"); |
1709 | msp->norm = VIDEO_MODE_RADIO; | 1738 | msp->norm = VIDEO_MODE_RADIO; |
1710 | dprintk(KERN_DEBUG "msp34xx: switching to radio mode\n"); | 1739 | dprintk("msp34xx: switching to radio mode\n"); |
1711 | msp->watch_stereo = 0; | 1740 | msp->watch_stereo = 0; |
1712 | switch (msp->opmode) { | 1741 | switch (msp->opmode) { |
1713 | case OPMODE_MANUAL: | 1742 | case OPMODE_MANUAL: |
@@ -1715,8 +1744,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1715 | msp3400c_setmode(client,MSP_MODE_FM_RADIO); | 1744 | msp3400c_setmode(client,MSP_MODE_FM_RADIO); |
1716 | msp3400c_setcarrier(client, MSP_CARRIER(10.7), | 1745 | msp3400c_setcarrier(client, MSP_CARRIER(10.7), |
1717 | MSP_CARRIER(10.7)); | 1746 | MSP_CARRIER(10.7)); |
1718 | msp3400c_setvolume(client, msp->muted, | 1747 | msp3400c_setvolume(client, msp->muted, msp->left, msp->right); |
1719 | msp->volume, msp->balance); | ||
1720 | break; | 1748 | break; |
1721 | case OPMODE_SIMPLE: | 1749 | case OPMODE_SIMPLE: |
1722 | case OPMODE_SIMPLER: | 1750 | case OPMODE_SIMPLER: |
@@ -1733,7 +1761,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1733 | { | 1761 | { |
1734 | struct video_audio *va = arg; | 1762 | struct video_audio *va = arg; |
1735 | 1763 | ||
1736 | dprintk(KERN_DEBUG "msp34xx: VIDIOCGAUDIO\n"); | 1764 | dprintk("msp34xx: VIDIOCGAUDIO\n"); |
1737 | va->flags |= VIDEO_AUDIO_VOLUME | | 1765 | va->flags |= VIDEO_AUDIO_VOLUME | |
1738 | VIDEO_AUDIO_BASS | | 1766 | VIDEO_AUDIO_BASS | |
1739 | VIDEO_AUDIO_TREBLE | | 1767 | VIDEO_AUDIO_TREBLE | |
@@ -1741,8 +1769,15 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1741 | if (msp->muted) | 1769 | if (msp->muted) |
1742 | va->flags |= VIDEO_AUDIO_MUTE; | 1770 | va->flags |= VIDEO_AUDIO_MUTE; |
1743 | 1771 | ||
1744 | va->volume = msp->volume; | 1772 | if (msp->muted) |
1745 | va->balance = (va->volume) ? msp->balance : 32768; | 1773 | va->flags |= VIDEO_AUDIO_MUTE; |
1774 | va->volume = MAX(msp->left, msp->right); | ||
1775 | va->balance = (32768 * MIN(msp->left, msp->right)) / | ||
1776 | (va->volume ? va->volume : 1); | ||
1777 | va->balance = (msp->left < msp->right) ? | ||
1778 | (65535 - va->balance) : va->balance; | ||
1779 | if (0 == va->volume) | ||
1780 | va->balance = 32768; | ||
1746 | va->bass = msp->bass; | 1781 | va->bass = msp->bass; |
1747 | va->treble = msp->treble; | 1782 | va->treble = msp->treble; |
1748 | 1783 | ||
@@ -1754,17 +1789,32 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1754 | { | 1789 | { |
1755 | struct video_audio *va = arg; | 1790 | struct video_audio *va = arg; |
1756 | 1791 | ||
1757 | dprintk(KERN_DEBUG "msp34xx: VIDIOCSAUDIO\n"); | 1792 | dprintk("msp34xx: VIDIOCSAUDIO\n"); |
1758 | msp->muted = (va->flags & VIDEO_AUDIO_MUTE); | 1793 | msp->muted = (va->flags & VIDEO_AUDIO_MUTE); |
1759 | msp->volume = va->volume; | 1794 | msp->left = (MIN(65536 - va->balance, 32768) * |
1760 | msp->balance = va->balance; | 1795 | va->volume) / 32768; |
1796 | msp->right = (MIN(va->balance, 32768) * va->volume) / 32768; | ||
1761 | msp->bass = va->bass; | 1797 | msp->bass = va->bass; |
1762 | msp->treble = va->treble; | 1798 | msp->treble = va->treble; |
1763 | 1799 | dprintk("msp34xx: VIDIOCSAUDIO setting va->volume to %d\n", | |
1764 | msp3400c_setvolume(client, msp->muted, | 1800 | va->volume); |
1765 | msp->volume, msp->balance); | 1801 | dprintk("msp34xx: VIDIOCSAUDIO setting va->balance to %d\n", |
1766 | msp3400c_setbass(client,msp->bass); | 1802 | va->balance); |
1767 | msp3400c_settreble(client,msp->treble); | 1803 | dprintk("msp34xx: VIDIOCSAUDIO setting va->flags to %d\n", |
1804 | va->flags); | ||
1805 | dprintk("msp34xx: VIDIOCSAUDIO setting msp->left to %d\n", | ||
1806 | msp->left); | ||
1807 | dprintk("msp34xx: VIDIOCSAUDIO setting msp->right to %d\n", | ||
1808 | msp->right); | ||
1809 | dprintk("msp34xx: VIDIOCSAUDIO setting msp->bass to %d\n", | ||
1810 | msp->bass); | ||
1811 | dprintk("msp34xx: VIDIOCSAUDIO setting msp->treble to %d\n", | ||
1812 | msp->treble); | ||
1813 | dprintk("msp34xx: VIDIOCSAUDIO setting msp->mode to %d\n", | ||
1814 | msp->mode); | ||
1815 | msp3400c_setvolume(client, msp->muted, msp->left, msp->right); | ||
1816 | msp3400c_setbass(client, msp->bass); | ||
1817 | msp3400c_settreble(client, msp->treble); | ||
1768 | 1818 | ||
1769 | if (va->mode != 0 && msp->norm != VIDEO_MODE_RADIO) | 1819 | if (va->mode != 0 && msp->norm != VIDEO_MODE_RADIO) |
1770 | msp_any_set_audmode(client,mode_v4l1_to_v4l2(va->mode)); | 1820 | msp_any_set_audmode(client,mode_v4l1_to_v4l2(va->mode)); |
@@ -1775,7 +1825,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1775 | { | 1825 | { |
1776 | struct video_channel *vc = arg; | 1826 | struct video_channel *vc = arg; |
1777 | 1827 | ||
1778 | dprintk(KERN_DEBUG "msp34xx: VIDIOCSCHAN (norm=%d)\n",vc->norm); | 1828 | dprintk("msp34xx: VIDIOCSCHAN (norm=%d)\n",vc->norm); |
1779 | msp->norm = vc->norm; | 1829 | msp->norm = vc->norm; |
1780 | msp_wake_thread(client); | 1830 | msp_wake_thread(client); |
1781 | break; | 1831 | break; |
@@ -1785,7 +1835,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1785 | case VIDIOC_S_FREQUENCY: | 1835 | case VIDIOC_S_FREQUENCY: |
1786 | { | 1836 | { |
1787 | /* new channel -- kick audio carrier scan */ | 1837 | /* new channel -- kick audio carrier scan */ |
1788 | dprintk(KERN_DEBUG "msp34xx: VIDIOCSFREQ\n"); | 1838 | dprintk("msp34xx: VIDIOCSFREQ\n"); |
1789 | msp_wake_thread(client); | 1839 | msp_wake_thread(client); |
1790 | break; | 1840 | break; |
1791 | } | 1841 | } |
@@ -1904,7 +1954,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1904 | { | 1954 | { |
1905 | struct msp_matrix *mspm = arg; | 1955 | struct msp_matrix *mspm = arg; |
1906 | 1956 | ||
1907 | dprintk(KERN_DEBUG "msp34xx: MSP_SET_MATRIX\n"); | 1957 | dprintk("msp34xx: MSP_SET_MATRIX\n"); |
1908 | msp3400c_set_scart(client, mspm->input, mspm->output); | 1958 | msp3400c_set_scart(client, mspm->input, mspm->output); |
1909 | break; | 1959 | break; |
1910 | } | 1960 | } |