Date:2012-03-28 05:23:53 (7 years 5 months ago)
Author:Xiangfu
Commit:56adfdeb4d5a6693ddd184aed817bbcbeb40c75b
Message:m1/patches/rtems: milkymist-audio-add-support-mic-boost.patch preserve the mic boost setting

Files: m1/patches/rtems/milkymist-audio-add-support-mic-boost.patch (3 diffs)

Change Details

m1/patches/rtems/milkymist-audio-add-support-mic-boost.patch
11Index: rtems/c/src/lib/libbsp/lm32/shared/milkymist_ac97/ac97.c
22===================================================================
3+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_ac97/ac97.c 2012-03-20 17:12:23.731160001 +0800
4@@ -372,6 +372,39 @@
3--- rtems.orig/c/src/lib/libbsp/lm32/shared/milkymist_ac97/ac97.c 2012-03-27 14:03:04.065264002 +0800
4@@ -47,6 +47,7 @@
5 static int play_produce;
6 static int play_consume;
7 static int play_level;
8+static int mic_boost;
9
10 /* buffers played, for application to collect */
11 static rtems_id play_q_done;
12@@ -347,7 +348,7 @@
13
14   left = *val & 0xff;
15   left = (left*32)/100 - 1;
16- if(left < 0)
17+ if (left < 0)
18     left = 0;
19
20   if (mono)
21@@ -355,7 +356,7 @@
22   else {
23     right = (*val >> 8) & 0xff;
24     right = (right*32)/100 - 1;
25- if(right < 0)
26+ if (right < 0)
27       right = 0;
28   }
29
30@@ -365,6 +366,13 @@
31   else
32     codec = (31-left) | ((31-right) << 8);
33
34+ if (mono) {
35+ if (mic_boost)
36+ codec |= (1 << 6);
37+ else
38+ codec &= ~(1 << 6);
39+ }
40+
41   if (!write_cr(chan, codec))
42     sc = RTEMS_UNSATISFIED;
43   else
44@@ -372,6 +380,41 @@
545   return sc;
646 }
747
...... 
3676+ if (!write_cr(chan, codec))
3777+ return RTEMS_UNSATISFIED;
3878+
79+ mic_boost = codec;
80+
3981+ return RTEMS_SUCCESSFUL;
4082+}
4183+
4284 rtems_device_driver ac97_control(
4385   rtems_device_major_number major,
4486   rtems_device_minor_number minor,
45@@ -419,6 +452,16 @@
87@@ -419,6 +462,16 @@
4688         if(sc == RTEMS_SUCCESSFUL)
4789           args->ioctl_return = 0;
4890         return sc;
...... 
61103     }
62104Index: rtems/c/src/lib/libbsp/lm32/shared/milkymist_ac97/milkymist_ac97.h
63105===================================================================
64+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_ac97/milkymist_ac97.h 2012-03-20 17:12:23.731160001 +0800
106--- rtems.orig/c/src/lib/libbsp/lm32/shared/milkymist_ac97/milkymist_ac97.h 2012-03-27 14:03:04.085264002 +0800
65107@@ -21,6 +21,7 @@
66108 /* Ioctls. 0x41 is 'A' */
67109 #define SOUND_MIXER_MIC 0x0

Archive Download the corresponding diff file

Branches:
master



interactive