diff src/cs/drivers/drv_core/armio/armio.c @ 610:0cbe7438f974

armio.c: GPIO config for GTM900 and long-standing GPIO 1 fix
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 17 Jun 2019 21:48:54 +0000
parents 92dbfa906f66
children 3231dd9b38c1
line wrap: on
line diff
--- a/src/cs/drivers/drv_core/armio/armio.c	Mon Jun 17 21:25:46 2019 +0000
+++ b/src/cs/drivers/drv_core/armio/armio.c	Mon Jun 17 21:48:54 2019 +0000
@@ -263,18 +263,23 @@
     // On D-Sample GPIO 1 must be set to high to enable the audio amplifier,
     // but on Openmoko's modem it is the interrupt to the AP.
     // On the FCDEV3B it also controls the audio amplifier.
-    // For now we initialize it to low on all targets.
-#if 1
+    // On the GTM900 GPIOs 0 and 1 are RI and DSR outputs, respectively.
+    // For targets other than GTM900, we enable the audio amplifier
+    // if we are in an MMI!=0 build - for ACI builds use the AT@SPKR command.
+#ifdef CONFIG_TARGET_GTM900
+      *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F01;
+#elif (MMI != 0)
+      *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F02;
+#else
       *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F00;
-#else
-      *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F02;
 #endif
 
     // ARMIO_CNTL_REG register configuration :
     // set IOs 1,2,5,7,9,14 and 15 as ouputs.
     // bits conditionalized on CONFIG_TARGET_GTAMODEM or CONFIG_TARGET_FCFAM
     // are FreeCalypso additions
-    #if defined(CONFIG_TARGET_GTAMODEM) || defined(CONFIG_TARGET_FCFAM)
+    #if defined(CONFIG_TARGET_GTAMODEM) || defined(CONFIG_TARGET_FCFAM) || \
+        defined(CONFIG_TARGET_GTM900)
       AI_ConfigBitAsOutput(0);
     #endif
     AI_ConfigBitAsOutput(1);