Commit 2ccdd9a5 authored by Steven Toth's avatar Steven Toth Committed by Mauro Carvalho Chehab
Browse files

[media] cx25840: Enable support for non-tuner LR1/LR2 audio inputs



The change effects cx23885 boards only and preserves support for existing
boards. Essentially, if we're using baseband audio into the cx23885 AV
core then we have to patch registers. The cx23885 driver will call
with either CX25840_AUDIO8 to signify tuner audio or AUDIO7 to
signify baseband audio. If/When we become more comfortable with this change
across a series of products then we may decide to relax the cx23885 only
restriction.

[liplianin@netup.ru: fix missing state declaration]

Signed-off-by: default avatarSteven Toth <stoth@kernellabs.com>
Signed-off-by: default avatarIgor M. Liplianin <liplianin@netup.ru>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d9368da7
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -480,6 +480,7 @@ void cx25840_audio_set_path(struct i2c_client *client)

static void set_volume(struct i2c_client *client, int volume)
{
	struct cx25840_state *state = to_state(i2c_get_clientdata(client));
	int vol;

	/* Convert the volume to msp3400 values (0-127) */
@@ -495,6 +496,13 @@ static void set_volume(struct i2c_client *client, int volume)
	}

	/* PATH1_VOLUME */
	if (is_cx2388x(state)) {
		/* 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));
}

+11 −0
Original line number Diff line number Diff line
@@ -1074,6 +1074,17 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp
		cx25840_write(client, 0x919, 0x01);
	}

	if (is_cx2388x(state) && (aud_input == CX25840_AUDIO7)) {
		/* Configure audio from LR1 or LR2 input */
		cx25840_write4(client, 0x910, 0);
		cx25840_write4(client, 0x8d0, 0x63073);
	} else
	if (is_cx2388x(state) && (aud_input == CX25840_AUDIO8)) {
		/* Configure audio from tuner/sif input */
		cx25840_write4(client, 0x910, 0x12b000c9);
		cx25840_write4(client, 0x8d0, 0x1f063870);
	}

	return 0;
}