1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 10:50:37 +02:00

Merge branch 'master' of projects.qi-hardware.com:wernermisc

This commit is contained in:
Werner Almesberger 2012-03-21 00:09:00 -03:00
commit ec7994cabf
3 changed files with 77 additions and 3 deletions

View File

@ -0,0 +1,73 @@
Index: rtems/c/src/lib/libbsp/lm32/shared/milkymist_ac97/ac97.c
===================================================================
--- rtems.orig/c/src/lib/libbsp/lm32/shared/milkymist_ac97/ac97.c 2012-03-20 17:11:20.087160002 +0800
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_ac97/ac97.c 2012-03-20 17:12:23.731160001 +0800
@@ -372,6 +372,39 @@
return sc;
}
+static rtems_status_code ioctl_read_mic_boost(void *buf, unsigned int chan)
+{
+ unsigned int *val = (unsigned int *)buf;
+ int codec;
+
+ codec = read_cr(chan);
+ if (codec < 0)
+ return RTEMS_UNSATISFIED;
+
+ *val = (codec & (1 << 6)) >> 6;
+ return RTEMS_SUCCESSFUL;
+}
+
+static rtems_status_code ioctl_write_mic_boost(void *buf, unsigned int chan)
+{
+ unsigned int *val = (unsigned int *)buf;
+ int codec;
+
+ codec = read_cr(chan);
+ if (codec < 0)
+ return RTEMS_UNSATISFIED;
+
+ if (*val)
+ codec |= (1 << 6);
+ else
+ codec &= ~(1 << 6);
+
+ if (!write_cr(chan, codec))
+ return RTEMS_UNSATISFIED;
+
+ return RTEMS_SUCCESSFUL;
+}
+
rtems_device_driver ac97_control(
rtems_device_major_number major,
rtems_device_minor_number minor,
@@ -419,6 +452,16 @@
if(sc == RTEMS_SUCCESSFUL)
args->ioctl_return = 0;
return sc;
+ case SOUND_MIXER_READ(SOUND_MIXER_MIC_BOOST):
+ sc = ioctl_read_mic_boost(args->buffer, 0x0e);
+ if(sc == RTEMS_SUCCESSFUL)
+ args->ioctl_return = 0;
+ return sc;
+ case SOUND_MIXER_WRITE(SOUND_MIXER_MIC_BOOST):
+ sc = ioctl_write_mic_boost(args->buffer, 0x0e);
+ if(sc == RTEMS_SUCCESSFUL)
+ args->ioctl_return = 0;
+ return sc;
default:
return RTEMS_UNSATISFIED;
}
Index: rtems/c/src/lib/libbsp/lm32/shared/milkymist_ac97/milkymist_ac97.h
===================================================================
--- rtems.orig/c/src/lib/libbsp/lm32/shared/milkymist_ac97/milkymist_ac97.h 2012-03-20 17:11:23.791160002 +0800
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_ac97/milkymist_ac97.h 2012-03-20 17:12:23.731160001 +0800
@@ -21,6 +21,7 @@
/* Ioctls. 0x41 is 'A' */
#define SOUND_MIXER_MIC 0x0
#define SOUND_MIXER_LINE 0x1
+#define SOUND_MIXER_MIC_BOOST 0x2
#define SOUND_MIXER_READ(x) (0x4100+x)
#define SOUND_MIXER_WRITE(x) (0x4110+x)

View File

@ -24,3 +24,4 @@ export-shell-fns.patch # https://www.rtems.org/bugzilla/show_bug.cgi?id=2030
bootp-dhcp-cleanup.patch # https://www.rtems.org/bugzilla/show_bug.cgi?id=2031 bootp-dhcp-cleanup.patch # https://www.rtems.org/bugzilla/show_bug.cgi?id=2031
# usb-firmware-ioctl.patch - applied 2012-03-04 # usb-firmware-ioctl.patch - applied 2012-03-04
# fix-pmem-size.patch - applied 2012-03-06 # fix-pmem-size.patch - applied 2012-03-06
milkymist-audio-add-support-mic-boost.patch

View File

@ -42,7 +42,7 @@
41,"C28, C29, C225, C226",4,"CC0402JRNPO9BN330","http://www.yageo.com/documents/recent/UPY-GP_NP0_16V-to-50V_8.pdf","YAGEO","MLCC, NPO, 50V, 33pF, 5%, SMD","0402",,0.003,0.012,,,"N-A","WL137" 41,"C28, C29, C225, C226",4,"CC0402JRNPO9BN330","http://www.yageo.com/documents/recent/UPY-GP_NP0_16V-to-50V_8.pdf","YAGEO","MLCC, NPO, 50V, 33pF, 5%, SMD","0402",,0.003,0.012,,,"N-A","WL137"
42,"C51, C52, C53, C54, C55, C56, C70, C71, C72, C73, C83, C84, C86, C87, C88, C99, C100, C101, C102, C104, C105, C106",22,"C2012X5R0J475KT","http://www.mouser.com/catalog/specsheets/cseries.pdf","TDK","MLCC, X5R, 6.3V, 4.7uF, 10%, SMD","0805",,0.018,0.396,,,"N-A","WL344" 42,"C51, C52, C53, C54, C55, C56, C70, C71, C72, C73, C83, C84, C86, C87, C88, C99, C100, C101, C102, C104, C105, C106",22,"C2012X5R0J475KT","http://www.mouser.com/catalog/specsheets/cseries.pdf","TDK","MLCC, X5R, 6.3V, 4.7uF, 10%, SMD","0805",,0.018,0.396,,,"N-A","WL344"
43,"C57, C58, C59, C60, C61, C62, C63, C64, C65, C66, C67, C68, C74, C75, C76, C77, C78, C79, C80, C81, C89, C90, C91, C92, C93, C94, C95, C96, C97, C107, C108, C109, C110, C111, C112, C113, C114, C115, C116, C117, C118, C119, C126, C173, C176, C263, C272, C280, C283",49,"CC0402KRX5R5BB474","http://www.yageo.com/documents/recent/UPY-GPHC_X5R_4V-to-50V_12.pdf","YAGEO","MLCC, Capacitor, X5R, 6.3V, 470nF, 10%, SMD","0402",,0.005,0.242,,,"N-A","WL345" 43,"C57, C58, C59, C60, C61, C62, C63, C64, C65, C66, C67, C68, C74, C75, C76, C77, C78, C79, C80, C81, C89, C90, C91, C92, C93, C94, C95, C96, C97, C107, C108, C109, C110, C111, C112, C113, C114, C115, C116, C117, C118, C119, C126, C173, C176, C263, C272, C280, C283",49,"CC0402KRX5R5BB474","http://www.yageo.com/documents/recent/UPY-GPHC_X5R_4V-to-50V_12.pdf","YAGEO","MLCC, Capacitor, X5R, 6.3V, 470nF, 10%, SMD","0402",,0.005,0.242,,,"N-A","WL345"
44,"C259, C260, C267, C269",4,"RFS0J121MCN1GS","http://nichicon-us.com/english/products/pdf/2009fpcap_catalog_fs.pdf","Nichicon","CAP ALUM 120UF 6.3V 20% SMD ESR=24.0 mOhm Height - Seated (Max)=5.70mm Dia=5.00mm","5.30mm x 5.30mm",,1,4.000,,,"NOT START", 44,"C259, C260, C267, C269",4,"T520B157M006ATE070","http://www.kemet.com/kemet/web/homepage/kechome.nsf/vapubfiles/KEM_TC102_LOWESR.pdf/$file/KEM_TC102_LOWESR.pdf","Kemet","CAP TANT 150UF 6.3V 20% 1411 SMD ESR=70.0 mOhm Height - Seated (Max)=2.10mm 3.50mm x 2.80mm","3.50mm x 2.80mm",,1.35,5.400,,,"NOT START",
45,"C133, C138, C139, C148",4,"C3225X5R0J476MT000N","http://www.tdk.co.jp/tefe02/e412_c.pdf","TDK","MLCC, X5R, 6.3V, 47uF, 20%, SMD","1210",,0.231,0.926,,,"N-A","WL346" 45,"C133, C138, C139, C148",4,"C3225X5R0J476MT000N","http://www.tdk.co.jp/tefe02/e412_c.pdf","TDK","MLCC, X5R, 6.3V, 47uF, 20%, SMD","1210",,0.231,0.926,,,"N-A","WL346"
46,"C255",1,"CC0402KRX5R7BB473","http://www.yageo.com/documents/recent/UPY-GPHC_X5R_4V-to-50V_12.pdf","YAGEO","MLCC, X5R, 16V, 47nF, 10%, SMD","0402",,0.003,0.003,,,"N-A","WL352" 46,"C255",1,"CC0402KRX5R7BB473","http://www.yageo.com/documents/recent/UPY-GPHC_X5R_4V-to-50V_12.pdf","YAGEO","MLCC, X5R, 16V, 47nF, 10%, SMD","0402",,0.003,0.003,,,"N-A","WL352"
47,"C224",1,"0402X823K100CT","http://www.passivecomponent.com/lh/High_Capacitance_DS.pdf","WALSIN","MLCC, X5R, 10V, 82nF, 10%, SMD","0402",,0.001,0.001,,,"N-A","WL96" 47,"C224",1,"0402X823K100CT","http://www.passivecomponent.com/lh/High_Capacitance_DS.pdf","WALSIN","MLCC, X5R, 10V, 82nF, 10%, SMD","0402",,0.001,0.001,,,"N-A","WL96"
@ -61,7 +61,7 @@
60,"R70, R92, R113, R134, R135, R141, R162, R163, R174, R175, R176, R177, R178(DNP)",12,"RC0402FR-071KL","http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf","YAGEO","Resistor, 1K, 0402, 1%","0402",,0.001,0.011,,,"N-A","WL347" 60,"R70, R92, R113, R134, R135, R141, R162, R163, R174, R175, R176, R177, R178(DNP)",12,"RC0402FR-071KL","http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf","YAGEO","Resistor, 1K, 0402, 1%","0402",,0.001,0.011,,,"N-A","WL347"
61,"R28(DNP), R154, R229",2,"RC0402FR-071ML ","http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf","YAGEO","Resistor, 1M, 0402, 1%","0402",,0.001,0.002,,,"N-A","WL154" 61,"R28(DNP), R154, R229",2,"RC0402FR-071ML ","http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf","YAGEO","Resistor, 1M, 0402, 1%","0402",,0.001,0.002,,,"N-A","WL154"
62,"R13",1,"RC0402FR-072K2L","http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf","YAGEO","Resistor, 2.2K, 0402, 1%","0402",,0.001,0.001,,,"N-A","WL155" 62,"R13",1,"RC0402FR-072K2L","http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf","YAGEO","Resistor, 2.2K, 0402, 1%","0402",,0.001,0.001,,,"N-A","WL155"
63,"R62",1,"RC0603FR-072K32L","http://www.yageo.com/documents/recent/PYu-RC0603_51_RoHS_L_4.pdf","YAGEO","Resistor, 2.32K, 0603, 1%","0402",,0.014,0.014,,,"NOT START", 63,"R62",1,"RC0603FR-072K32L","http://www.yageo.com/documents/recent/PYu-RC0603_51_RoHS_L_4.pdf","YAGEO","Resistor, 2.32K, 0603, 1%","0603",,0.014,0.014,,,"NOT START",
64,"R36, R38, R55, R56, R57",5,"RC0402FR-07220RL","http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf","YAGEO","Resistor, 220, 0402, 1%","0402",,0.001,0.004,,,"N-A","WL157" 64,"R36, R38, R55, R56, R57",5,"RC0402FR-07220RL","http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf","YAGEO","Resistor, 220, 0402, 1%","0402",,0.001,0.004,,,"N-A","WL157"
65,"R136, R137, R138, R140, R188, R189, R190, R191",8,"RC0402FR-0724RL","http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf","YAGEO","Resistor, 24, 0402, 1%","0402",,0.001,0.007,,,"N-A","WL158" 65,"R136, R137, R138, R140, R188, R189, R190, R191",8,"RC0402FR-0724RL","http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf","YAGEO","Resistor, 24, 0402, 1%","0402",,0.001,0.007,,,"N-A","WL158"
66,"R37, R47, R65, R66, R68, R69, R139, R156, R234",9,"RC1206JR-071ML","http://www.yageo.com/documents/recent/PYu-RC1206_51_RoHS_L_4.pdf","YAGEO","Resistor, 200V, 1M, 1206, 5%","1206",,0.001,0.008,,,"N-A","WL159" 66,"R37, R47, R65, R66, R68, R69, R139, R156, R234",9,"RC1206JR-071ML","http://www.yageo.com/documents/recent/PYu-RC1206_51_RoHS_L_4.pdf","YAGEO","Resistor, 200V, 1M, 1206, 5%","1206",,0.001,0.008,,,"N-A","WL159"
@ -108,4 +108,4 @@
107,"-",1,"SMT/DIP",,,"MOUNTING PARTS",,,,,,,"NOT START", 107,"-",1,"SMT/DIP",,,"MOUNTING PARTS",,,,,,,"NOT START",
108,"-",5,"HTS306","http://www.kss.com.tw/e4k/e4-11/C1111-1.asp","KSS","Plastic Hexagonal Threaded Space, M3 * 0.6",,,0.040,0.200,,,"NOT START", 108,"-",5,"HTS306","http://www.kss.com.tw/e4k/e4-11/C1111-1.asp","KSS","Plastic Hexagonal Threaded Space, M3 * 0.6",,,0.040,0.200,,,"NOT START",
109,"-",5,"PN3","http://www.kss.com.tw/e4k/e4-12/C1401-1.asp","KSS","Plastic Fastener",,,0.028,0.142,,,"NOT START", 109,"-",5,"PN3","http://www.kss.com.tw/e4k/e4-12/C1401-1.asp","KSS","Plastic Fastener",,,0.028,0.142,,,"NOT START",
,,,,,,,,,"TOTAL",211.02,,,, ,,,,,,,,,"TOTAL",212.42,,,,

1 ITEM REFERENCE QUANTITY MANUFACTURER P/N DATASHEET LINK MANUFACTURER DESCRIPTION PACKAGE COMMENT UNIT PRICE USAGE PRICE SUBSTITUTION P/N SUBSTITUTION LINK SOURCING STATUS NOTE
42 41 C28, C29, C225, C226 4 CC0402JRNPO9BN330 http://www.yageo.com/documents/recent/UPY-GP_NP0_16V-to-50V_8.pdf YAGEO MLCC, NPO, 50V, 33pF, 5%, SMD 0402 0.003 0.012 N-A WL137
43 42 C51, C52, C53, C54, C55, C56, C70, C71, C72, C73, C83, C84, C86, C87, C88, C99, C100, C101, C102, C104, C105, C106 22 C2012X5R0J475KT http://www.mouser.com/catalog/specsheets/cseries.pdf TDK MLCC, X5R, 6.3V, 4.7uF, 10%, SMD 0805 0.018 0.396 N-A WL344
44 43 C57, C58, C59, C60, C61, C62, C63, C64, C65, C66, C67, C68, C74, C75, C76, C77, C78, C79, C80, C81, C89, C90, C91, C92, C93, C94, C95, C96, C97, C107, C108, C109, C110, C111, C112, C113, C114, C115, C116, C117, C118, C119, C126, C173, C176, C263, C272, C280, C283 49 CC0402KRX5R5BB474 http://www.yageo.com/documents/recent/UPY-GPHC_X5R_4V-to-50V_12.pdf YAGEO MLCC, Capacitor, X5R, 6.3V, 470nF, 10%, SMD 0402 0.005 0.242 N-A WL345
45 44 C259, C260, C267, C269 4 RFS0J121MCN1GS T520B157M006ATE070 http://nichicon-us.com/english/products/pdf/2009fpcap_catalog_fs.pdf http://www.kemet.com/kemet/web/homepage/kechome.nsf/vapubfiles/KEM_TC102_LOWESR.pdf/$file/KEM_TC102_LOWESR.pdf Nichicon Kemet CAP ALUM 120UF 6.3V 20% SMD ESR=24.0 mOhm Height - Seated (Max)=5.70mm Dia=5.00mm CAP TANT 150UF 6.3V 20% 1411 SMD ESR=70.0 mOhm Height - Seated (Max)=2.10mm 3.50mm x 2.80mm 5.30mm x 5.30mm 3.50mm x 2.80mm 1 1.35 4.000 5.400 NOT START
46 45 C133, C138, C139, C148 4 C3225X5R0J476MT000N http://www.tdk.co.jp/tefe02/e412_c.pdf TDK MLCC, X5R, 6.3V, 47uF, 20%, SMD 1210 0.231 0.926 N-A WL346
47 46 C255 1 CC0402KRX5R7BB473 http://www.yageo.com/documents/recent/UPY-GPHC_X5R_4V-to-50V_12.pdf YAGEO MLCC, X5R, 16V, 47nF, 10%, SMD 0402 0.003 0.003 N-A WL352
48 47 C224 1 0402X823K100CT http://www.passivecomponent.com/lh/High_Capacitance_DS.pdf WALSIN MLCC, X5R, 10V, 82nF, 10%, SMD 0402 0.001 0.001 N-A WL96
61 60 R70, R92, R113, R134, R135, R141, R162, R163, R174, R175, R176, R177, R178(DNP) 12 RC0402FR-071KL http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf YAGEO Resistor, 1K, 0402, 1% 0402 0.001 0.011 N-A WL347
62 61 R28(DNP), R154, R229 2 RC0402FR-071ML http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf YAGEO Resistor, 1M, 0402, 1% 0402 0.001 0.002 N-A WL154
63 62 R13 1 RC0402FR-072K2L http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf YAGEO Resistor, 2.2K, 0402, 1% 0402 0.001 0.001 N-A WL155
64 63 R62 1 RC0603FR-072K32L http://www.yageo.com/documents/recent/PYu-RC0603_51_RoHS_L_4.pdf YAGEO Resistor, 2.32K, 0603, 1% 0402 0603 0.014 0.014 NOT START
65 64 R36, R38, R55, R56, R57 5 RC0402FR-07220RL http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf YAGEO Resistor, 220, 0402, 1% 0402 0.001 0.004 N-A WL157
66 65 R136, R137, R138, R140, R188, R189, R190, R191 8 RC0402FR-0724RL http://www.yageo.com/documents/recent/PYu-RC0402_51_RoHS_L_6.pdf YAGEO Resistor, 24, 0402, 1% 0402 0.001 0.007 N-A WL158
67 66 R37, R47, R65, R66, R68, R69, R139, R156, R234 9 RC1206JR-071ML http://www.yageo.com/documents/recent/PYu-RC1206_51_RoHS_L_4.pdf YAGEO Resistor, 200V, 1M, 1206, 5% 1206 0.001 0.008 N-A WL159
108 107 - 1 SMT/DIP MOUNTING PARTS NOT START
109 108 - 5 HTS306 http://www.kss.com.tw/e4k/e4-11/C1111-1.asp KSS Plastic Hexagonal Threaded Space, M3 * 0.6 0.040 0.200 NOT START
110 109 - 5 PN3 http://www.kss.com.tw/e4k/e4-12/C1401-1.asp KSS Plastic Fastener 0.028 0.142 NOT START
111 TOTAL 211.02 212.42