aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/linux/linux-2.6.20/nhk15/audio_codec_patch_base_v5.6.0.patch
blob: 1a7bd9e836dad7e24f2e9ba803e36d1b0c32f3c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
diff -Nauprw linux-2.6.20/drivers/media/nomadik_mm/saa/nomadik-saa.c ../new/linux-2.6.20/drivers/media/nomadik_mm/saa/nomadik-saa.c
--- linux-2.6.20/drivers/media/nomadik_mm/saa/nomadik-saa.c	2008-11-24 14:06:25.000000000 +0530
+++ ../new/linux-2.6.20/drivers/media/nomadik_mm/saa/nomadik-saa.c	2008-11-26 18:37:16.000000000 +0530
@@ -1292,12 +1292,14 @@ static int link_msp (struct instance_des
 	else
 	{
 		/*Configure Output sink for audiocodec*/
+		//Audiocodec driver will do this.
+		#if 0
 		acodec_error = nomadik_acodec_select_output(DEFAULT_OUTPUT_DEVICE, USER_SAA);
 		if (acodec_error != CODEC_OK) {
 			printk ("SAA_DRV ERROR : configuring audiocodec:%i\n", acodec_error);
 			return acodec_error;
 		}
-
+		#endif
 		down(&saa_desc->open_lock);
 		if(saa_desc->msp_out_flag != 0){
 			printk ("SAA_DRV ERROR : MSP OUT already used \n");
diff -Nauprw linux-2.6.20/sound/arm/nomadik_alsa.c ../new/linux-2.6.20/sound/arm/nomadik_alsa.c
--- linux-2.6.20/sound/arm/nomadik_alsa.c	2008-11-24 14:06:29.000000000 +0530
+++ ../new/linux-2.6.20/sound/arm/nomadik_alsa.c	2008-11-26 18:36:26.000000000 +0530
@@ -568,10 +568,14 @@ static int snd_nomadik_alsa_pcm_open(snd
 	if (stream_id == SNDRV_PCM_STREAM_PLAYBACK) {
 		runtime->hw = snd_nomadik_playback_hw;
 		/* configure the output sink for the acodec */
+		#if 0
+		if(codec_conf.codec_output != chip->output_device){			
 		if ((error = nomadik_acodec_select_output(chip->output_device, USER_ALSA))) {
 			printk("ALSA: ERROR: select output failed\n");
 			return error;
 		}
+		}
+		#endif
 	} else {
 		runtime->hw = snd_nomadik_capture_hw;
 		/* configure the input source for the acodec */
diff -Nauprw linux-2.6.20/sound/nomadik_stw5095.c ../new/linux-2.6.20/sound/nomadik_stw5095.c
--- linux-2.6.20/sound/nomadik_stw5095.c	2008-11-24 14:06:29.000000000 +0530
+++ ../new/linux-2.6.20/sound/nomadik_stw5095.c	2008-11-26 18:36:04.000000000 +0530
@@ -3237,6 +3237,7 @@ t_codec_error nomadik_acodec_setuser(t_a
 
 t_codec_error nomadik_acodec_unsetuser(t_acodec_user user)
 {
+	int err=0;
 	t_codec_error codec_error = CODEC_OK;
 
 	if(g_codec_system_context.cur_user != user){
@@ -3246,6 +3247,18 @@ t_codec_error nomadik_acodec_unsetuser(t
 	}
 	else {
 		g_codec_system_context.cur_user = NO_USER;
+		
+		err = STMPE2401_Install_Callback(STMPE0, EGPIO_PIN_7 ,NULL,(void*)user);
+		if (err != STMPE2401_OK)
+		{
+			printk("Couldn't setup codec callback\n");
+		}
+
+		err = STMPE2401_Install_Callback(STMPE0, EGPIO_PIN_6 ,NULL,(void*)user);
+		if (err != STMPE2401_OK)
+		{
+			printk("Couldn't setup codec callback\n");
+		}
                 nomadik_acodec_powerdown(0);
         }
 
@@ -3282,6 +3295,10 @@ static void codec_callback1(void *user)
 	uint8 byte_value;
 	t_acodec_user t;
 	t = (t_acodec_user) user;
+	//spurious interuupt protection
+	if((t != USER_ALSA) && (t != USER_SAA) )
+		return;
+
 	err = STMPE2401_GetGpioVal(STMPE0,EGPIO_PIN_7,&byte_value);
 	switch(byte_value)	{