aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840
diff options
context:
space:
mode:
authorSteven Toth <stoth@kernellabs.com>2011-10-10 10:09:55 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-10-14 16:15:37 -0400
commit2ccdd9a59b3a1ff3bd1be6390c4b1989a008e61c (patch)
tree4a3f6319e7db9034cf84c9bd704b32beb75b38e0 /drivers/media/video/cx25840
parentd9368da71804053a6f84d170c63c6cb86c8318b2 (diff)
[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: Steven Toth <stoth@kernellabs.com> Signed-off-by: Igor M. Liplianin <liplianin@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx25840')
-rw-r--r--drivers/media/video/cx25840/cx25840-audio.c10
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c11
2 files changed, 20 insertions, 1 deletions
diff --git a/drivers/media/video/cx25840/cx25840-audio.c b/drivers/media/video/cx25840/cx25840-audio.c
index 34b96c7cfd6..005f1109364 100644
--- a/drivers/media/video/cx25840/cx25840-audio.c
+++ b/drivers/media/video/cx25840/cx25840-audio.c
@@ -480,6 +480,7 @@ void cx25840_audio_set_path(struct i2c_client *client)
480 480
481static void set_volume(struct i2c_client *client, int volume) 481static void set_volume(struct i2c_client *client, int volume)
482{ 482{
483 struct cx25840_state *state = to_state(i2c_get_clientdata(client));
483 int vol; 484 int vol;
484 485
485 /* Convert the volume to msp3400 values (0-127) */ 486 /* Convert the volume to msp3400 values (0-127) */
@@ -495,7 +496,14 @@ static void set_volume(struct i2c_client *client, int volume)
495 } 496 }
496 497
497 /* PATH1_VOLUME */ 498 /* PATH1_VOLUME */
498 cx25840_write(client, 0x8d4, 228 - (vol * 2)); 499 if (is_cx2388x(state)) {
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));
499} 507}
500 508
501static void set_balance(struct i2c_client *client, int balance) 509static void set_balance(struct i2c_client *client, int balance)
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 8896999ea6c..0316e41b55c 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -1074,6 +1074,17 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp
1074 cx25840_write(client, 0x919, 0x01); 1074 cx25840_write(client, 0x919, 0x01);
1075 } 1075 }
1076 1076
1077 if (is_cx2388x(state) && (aud_input == CX25840_AUDIO7)) {
1078 /* Configure audio from LR1 or LR2 input */
1079 cx25840_write4(client, 0x910, 0);
1080 cx25840_write4(client, 0x8d0, 0x63073);
1081 } else
1082 if (is_cx2388x(state) && (aud_input == CX25840_AUDIO8)) {
1083 /* Configure audio from tuner/sif input */
1084 cx25840_write4(client, 0x910, 0x12b000c9);
1085 cx25840_write4(client, 0x8d0, 0x1f063870);
1086 }
1087
1077 return 0; 1088 return 0;
1078} 1089}
1079 1090