forked from luck/tmp_suning_uos_patched
[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>
This commit is contained in:
parent
c81c0060ac
commit
4c3764d150
|
@ -253,9 +253,9 @@ static struct cx23885_ctrl cx23885_ctls[] = {
|
||||||
.id = V4L2_CID_AUDIO_VOLUME,
|
.id = V4L2_CID_AUDIO_VOLUME,
|
||||||
.name = "Volume",
|
.name = "Volume",
|
||||||
.minimum = 0,
|
.minimum = 0,
|
||||||
.maximum = 0x3f,
|
.maximum = 65535,
|
||||||
.step = 1,
|
.step = 65535 / 100,
|
||||||
.default_value = 0x3f,
|
.default_value = 65535,
|
||||||
.type = V4L2_CTRL_TYPE_INTEGER,
|
.type = V4L2_CTRL_TYPE_INTEGER,
|
||||||
},
|
},
|
||||||
.reg = PATH1_VOL_CTL,
|
.reg = PATH1_VOL_CTL,
|
||||||
|
|
|
@ -480,7 +480,6 @@ void cx25840_audio_set_path(struct i2c_client *client)
|
||||||
|
|
||||||
static void set_volume(struct i2c_client *client, int volume)
|
static void set_volume(struct i2c_client *client, int volume)
|
||||||
{
|
{
|
||||||
struct cx25840_state *state = to_state(i2c_get_clientdata(client));
|
|
||||||
int vol;
|
int vol;
|
||||||
|
|
||||||
/* Convert the volume to msp3400 values (0-127) */
|
/* Convert the volume to msp3400 values (0-127) */
|
||||||
|
@ -496,14 +495,7 @@ static void set_volume(struct i2c_client *client, int volume)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PATH1_VOLUME */
|
/* PATH1_VOLUME */
|
||||||
if (is_cx2388x(state)) {
|
cx25840_write(client, 0x8d4, 228 - (vol * 2));
|
||||||
/* for cx23885 volume doesn't work,
|
|
||||||
* the calculation always results in
|
|
||||||
* e4 regardless.
|
|
||||||
*/
|
|
||||||
cx25840_write(client, 0x8d4, volume);
|
|
||||||
} else
|
|
||||||
cx25840_write(client, 0x8d4, 228 - (vol * 2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_balance(struct i2c_client *client, int balance)
|
static void set_balance(struct i2c_client *client, int balance)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user