speaker

   外置D类音频功放


diff --git a/device/along/alongk80_bsp/ProjectConfig.mk b/device/along/alongk80_bsp/ProjectConfig.mk
index c13804c..095113a 100755
--- a/device/along/alongk80_bsp/ProjectConfig.mk
+++ b/device/along/alongk80_bsp/ProjectConfig.mk
@@ -157,7 +157,7 @@ MTK_AUDIO_MIC_INVERSE = no
 MTK_AUDIO_NUMBER_OF_MIC = 1
 MTK_AUDIO_NUMBER_OF_SPEAKER = 1
 MTK_AUDIO_RAW_SUPPORT = yes
-MTK_AUDIO_SPEAKER_PATH = int_spk_amp
+MTK_AUDIO_SPEAKER_PATH = int_hp_buf
 MTK_AUDIO_TUNNELING_SUPPORT = no
 MTK_AUIDO_MIC_INVERSE = no
 MTK_AURISYS_FRAMEWORK_SUPPORT = no
diff --git a/kernel-3.18/sound/soc/mediatek/mt6580/mt_soc_codec_63xx.c b/kernel-3.18/sound/soc/mediatek/mt6580/mt_soc_codec_63xx.c
index 02dde39..26a8fc2 100644
--- a/kernel-3.18/sound/soc/mediatek/mt6580/mt_soc_codec_63xx.c
+++ b/kernel-3.18/sound/soc/mediatek/mt6580/mt_soc_codec_63xx.c
@@ -1702,7 +1702,7 @@ static unsigned int pin_extspkamp;
 static unsigned int pin_mode_extspkamp;
 /* static unsigned int pin_vowclk, pin_audmiso;*/
 /* static unsigned int pin_mode_vowclk, pin_mode_audmiso; */
-
+extern int AudDrv_GPIO_EXTAMP_Select(int bEnable);
 #ifdef CONFIG_OF
 
 #define GAP (2) /* unit: us */
@@ -1737,7 +1737,7 @@ static void Ext_Speaker_Amp_Change(bool enable)
 #endif
  if (enable) {
  pr_debug("Ext_Speaker_Amp_Change ON+\n");
-#ifndef CONFIG_MTK_SPEAKER
+#ifdef CONFIG_MTK_SPEAKER
 #ifdef CONFIG_MTK_LEGACY
 
  ret = GetGPIO_Info(10, &pin_extspkamp_2, &pin_mode_extspkamp_2);
@@ -1753,12 +1753,12 @@ static void Ext_Speaker_Amp_Change(bool enable)
  mt_set_gpio_out(pin_extspkamp_2, GPIO_OUT_ZERO); /* low disable */
  }
 #else
- AudDrv_GPIO_EXTAMP_Select(false);
- AudDrv_GPIO_EXTAMP2_Select(false);
+ //AudDrv_GPIO_EXTAMP_Select(0);
+ //AudDrv_GPIO_EXTAMP2_Select(false);
 #endif /*CONFIG_MTK_LEGACY*/
 
  /*udelay(1000);*/
- usleep_range(1*1000, 20*1000);
+ //usleep_range(1*1000, 20*1000);
 #ifdef CONFIG_MTK_LEGACY
  mt_set_gpio_dir(pin_extspkamp, GPIO_DIR_OUT); /* output */
  if (pin_extspkamp_2 != NULL_PIN_DEFINITION)
@@ -1772,15 +1772,20 @@ static void Ext_Speaker_Amp_Change(bool enable)
  if (pin_extspkamp_2 != NULL_PIN_DEFINITION)
  mt_set_gpio_out(pin_extspkamp_2, GPIO_OUT_ONE); /* high enable */
 #else
- AudDrv_GPIO_EXTAMP_Select(true);
- AudDrv_GPIO_EXTAMP2_Select(true);
+
+                
+     // AudDrv_GPIO_EXTAMP_Select(1);
+             // usleep_range(1*1000, 20*1000);
+             
+               AudDrv_GPIO_EXTAMP_Select(1);
+ // AudDrv_GPIO_EXTAMP2_Select(true);
 #endif /*CONFIG_MTK_LEGACY*/
  mdelay(SPK_WARM_UP_TIME);
 #endif
  pr_debug("Ext_Speaker_Amp_Change ON-\n");
  } else {
  pr_debug("Ext_Speaker_Amp_Change OFF+\n");
-#ifndef CONFIG_MTK_SPEAKER
+#ifdef CONFIG_MTK_SPEAKER
 #ifdef CONFIG_MTK_LEGACY
  ret = GetGPIO_Info(10, &pin_extspkamp_2, &pin_mode_extspkamp_2);
  /* mt_set_gpio_mode(pin_extspkamp, GPIO_MODE_00); //GPIO117: DPI_D3, mode 0 */
@@ -1791,8 +1796,8 @@ static void Ext_Speaker_Amp_Change(bool enable)
  mt_set_gpio_out(pin_extspkamp_2, GPIO_OUT_ZERO); /* low disbale */
  }
 #else
- AudDrv_GPIO_EXTAMP_Select(false);
- AudDrv_GPIO_EXTAMP2_Select(false);
+ AudDrv_GPIO_EXTAMP_Select(0);
+ //AudDrv_GPIO_EXTAMP2_Select(false);
 #endif
  udelay(500);
 #endif

你可能感兴趣的:(speaker)