diff options
author | Steven Toth <stoth@kernellabs.com> | 2012-01-04 08:47:57 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-04 17:47:11 -0500 |
commit | 4c3764d15050f91a76cede6f24402cd2701e73ef (patch) | |
tree | 696a18baf12601a03f9555c1c6b8f7eeb0c1debe /drivers/media/video | |
parent | c81c0060acff726dc582185da303b3057d780af7 (diff) |
[media] cx25840 / cx23885: Fixing audio/volume regression
Since the conversion to subdev in Oct 2010 the audio controls have
not functioned correctly in the cx23885 driver. Passing values of
0-3f did not translate into meaningfull register writes. I've
converted the cx23885 driver to match the cx25840 volume control
definition and now audio is working reliably again.
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-video.c | 6 | ||||
-rw-r--r-- | drivers/media/video/cx25840/cx25840-audio.c | 10 |
2 files changed, 4 insertions, 12 deletions
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index 7415524e8777..7f3b973081a0 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
@@ -253,9 +253,9 @@ static struct cx23885_ctrl cx23885_ctls[] = { | |||
253 | .id = V4L2_CID_AUDIO_VOLUME, | 253 | .id = V4L2_CID_AUDIO_VOLUME, |
254 | .name = "Volume", | 254 | .name = "Volume", |
255 | .minimum = 0, | 255 | .minimum = 0, |
256 | .maximum = 0x3f, | 256 | .maximum = 65535, |
257 | .step = 1, | 257 | .step = 65535 / 100, |
258 | .default_value = 0x3f, | 258 | .default_value = 65535, |
259 | .type = V4L2_CTRL_TYPE_INTEGER, | 259 | .type = V4L2_CTRL_TYPE_INTEGER, |
260 | }, | 260 | }, |
261 | .reg = PATH1_VOL_CTL, | 261 | .reg = PATH1_VOL_CTL, |
diff --git a/drivers/media/video/cx25840/cx25840-audio.c b/drivers/media/video/cx25840/cx25840-audio.c index 005f11093642..34b96c7cfd62 100644 --- a/drivers/media/video/cx25840/cx25840-audio.c +++ b/drivers/media/video/cx25840/cx25840-audio.c | |||
@@ -480,7 +480,6 @@ void cx25840_audio_set_path(struct i2c_client *client) | |||
480 | 480 | ||
481 | static void set_volume(struct i2c_client *client, int volume) | 481 | static void set_volume(struct i2c_client *client, int volume) |
482 | { | 482 | { |
483 | struct cx25840_state *state = to_state(i2c_get_clientdata(client)); | ||
484 | int vol; | 483 | int vol; |
485 | 484 | ||
486 | /* Convert the volume to msp3400 values (0-127) */ | 485 | /* Convert the volume to msp3400 values (0-127) */ |
@@ -496,14 +495,7 @@ static void set_volume(struct i2c_client *client, int volume) | |||
496 | } | 495 | } |
497 | 496 | ||
498 | /* PATH1_VOLUME */ | 497 | /* PATH1_VOLUME */ |
499 | if (is_cx2388x(state)) { | 498 | cx25840_write(client, 0x8d4, 228 - (vol * 2)); |
500 | /* for cx23885 volume doesn't work, | ||
501 | * the calculation always results in | ||
502 | * e4 regardless. | ||
503 | */ | ||
504 | cx25840_write(client, 0x8d4, volume); | ||
505 | } else | ||
506 | cx25840_write(client, 0x8d4, 228 - (vol * 2)); | ||
507 | } | 499 | } |
508 | 500 | ||
509 | static void set_balance(struct i2c_client *client, int balance) | 501 | static void set_balance(struct i2c_client *client, int balance) |