aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/msp3400-driver.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-04-01 13:27:52 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-04-02 03:56:08 -0400
commit3bbe5a83996c0a669250d91421eef054f3a30595 (patch)
tree1405195a5c6a955f5a091ef3b1b3578be4e5c61e /drivers/media/video/msp3400-driver.c
parentc097b04520a3ab69a94f63f3f1d6716864c07300 (diff)
V4L/DVB (3697): More msp3400 and bttv fixes
- remove obsolete VIDIOC_S_INPUT i2c call in bttv - translate VIDIOCSFREQ to VIDIOC_S_FREQUENCY in i2c call - improve muting during carrier scan in msp3400 - don't start scan unless really needed. - no longer reset chip for msp3400c/d. - remove v4l2 check in tuner-core (radio stops after using the TV) - add missing VIDIOC_INT_ strings in v4l2-common.c Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/msp3400-driver.c')
-rw-r--r--drivers/media/video/msp3400-driver.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index 027c3d35eaa5..a82a26aa1e48 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -288,17 +288,19 @@ void msp_set_audio(struct i2c_client *client)
288 struct msp_state *state = i2c_get_clientdata(client); 288 struct msp_state *state = i2c_get_clientdata(client);
289 int bal = 0, bass, treble, loudness; 289 int bal = 0, bass, treble, loudness;
290 int val = 0; 290 int val = 0;
291 int reallymuted = state->muted | state->scan_in_progress;
291 292
292 if (!state->muted) 293 if (!reallymuted)
293 val = (state->volume * 0x7f / 65535) << 8; 294 val = (state->volume * 0x7f / 65535) << 8;
294 295
295 v4l_dbg(1, msp_debug, client, "mute=%s volume=%d\n", 296 v4l_dbg(1, msp_debug, client, "mute=%s scanning=%s volume=%d\n",
296 state->muted ? "on" : "off", state->volume); 297 state->muted ? "on" : "off", state->scan_in_progress ? "yes" : "no",
298 state->volume);
297 299
298 msp_write_dsp(client, 0x0000, val); 300 msp_write_dsp(client, 0x0000, val);
299 msp_write_dsp(client, 0x0007, state->muted ? 0x1 : (val | 0x1)); 301 msp_write_dsp(client, 0x0007, reallymuted ? 0x1 : (val | 0x1));
300 if (state->has_scart2_out_volume) 302 if (state->has_scart2_out_volume)
301 msp_write_dsp(client, 0x0040, state->muted ? 0x1 : (val | 0x1)); 303 msp_write_dsp(client, 0x0040, reallymuted ? 0x1 : (val | 0x1));
302 if (state->has_headphones) 304 if (state->has_headphones)
303 msp_write_dsp(client, 0x0006, val); 305 msp_write_dsp(client, 0x0006, val);
304 if (!state->has_sound_processing) 306 if (!state->has_sound_processing)
@@ -671,21 +673,23 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
671 int sc_in = rt->input & 0x7; 673 int sc_in = rt->input & 0x7;
672 int sc1_out = rt->output & 0xf; 674 int sc1_out = rt->output & 0xf;
673 int sc2_out = (rt->output >> 4) & 0xf; 675 int sc2_out = (rt->output >> 4) & 0xf;
674 u16 val; 676 u16 val, reg;
675 677
678 if (state->routing.input == rt->input &&
679 state->routing.output == rt->output)
680 break;
676 state->routing = *rt; 681 state->routing = *rt;
677 if (state->opmode == OPMODE_AUTOSELECT) {
678 val = msp_read_dem(client, 0x30) & ~0x100;
679 msp_write_dem(client, 0x30, val | (tuner ? 0x100 : 0));
680 } else {
681 val = msp_read_dem(client, 0xbb) & ~0x100;
682 msp_write_dem(client, 0xbb, val | (tuner ? 0x100 : 0));
683 }
684 msp_set_scart(client, sc_in, 0); 682 msp_set_scart(client, sc_in, 0);
685 msp_set_scart(client, sc1_out, 1); 683 msp_set_scart(client, sc1_out, 1);
686 msp_set_scart(client, sc2_out, 2); 684 msp_set_scart(client, sc2_out, 2);
687 msp_set_audmode(client); 685 msp_set_audmode(client);
688 msp_wake_thread(client); 686 reg = (state->opmode == OPMODE_AUTOSELECT) ? 0x30 : 0xbb;
687 val = msp_read_dem(client, reg);
688 if (tuner != ((val >> 8) & 1)) {
689 msp_write_dem(client, reg, (val & ~0x100) | (tuner << 8));
690 /* wake thread when a new tuner input is chosen */
691 msp_wake_thread(client);
692 }
689 break; 693 break;
690 } 694 }
691 695