@whycan
在初始化的时候开启codec,后面不关,可以避免,估计功耗会高点,另外就是断电这个“啵”还是会有
diff --git a/sound/soc/sunxi/sun20iw1-codec.c b/sound/soc/sunxi/sun20iw1-codec.c
index 1dcccdafd..3591e5d17 100644
--- a/sound/soc/sunxi/sun20iw1-codec.c
+++ b/sound/soc/sunxi/sun20iw1-codec.c
@@ -679,8 +679,8 @@ static int sunxi_codec_headphone_event(struct snd_soc_dapm_widget *w,
(0x1 << HP_DRVEN), (0x1 << HP_DRVEN));
break;
case SND_SOC_DAPM_PRE_PMD:
snd_soc_component_update_bits(component, SUNXI_HP2_REG,
(0x1 << HP_DRVEN), (0x0 << HP_DRVEN));
+// snd_soc_component_update_bits(component, SUNXI_HP2_REG,
+// (0x1 << HP_DRVEN), (0x0 << HP_DRVEN));
/* A version of the chip cannot be disable HPLDO and RMC_EN */
if (sunxi_get_soc_ver() & 0x7) {
snd_soc_component_update_bits(component, SUNXI_POWER_REG,
@@ -693,10 +693,10 @@ static int sunxi_codec_headphone_event(struct snd_soc_dapm_widget *w,
snd_soc_component_update_bits(component, SUNXI_RAMP_REG,
(0x1 << RMC_EN), (0x1 << RMC_EN));
}
snd_soc_component_update_bits(component, SUNXI_HP2_REG,
(0x1 << HP_DRVOUTEN), (0x0 << HP_DRVOUTEN));
snd_soc_component_update_bits(component, SUNXI_HP2_REG,
(0x1 << RAMP_OUT_EN), (0x0 << RAMP_OUT_EN));
+// snd_soc_component_update_bits(component, SUNXI_HP2_REG,
+// (0x1 << HP_DRVOUTEN), (0x0 << HP_DRVOUTEN));
+// snd_soc_component_update_bits(component, SUNXI_HP2_REG,
+// (0x1 << RAMP_OUT_EN), (0x0 << RAMP_OUT_EN));
#ifdef SUNXI_CODEC_DAP_ENABLE
if (hw_cfg->dacdrc_cfg & DAP_HP_EN)
dacdrc_enable(component, 0);
@@ -1261,6 +1261,15 @@ static void sunxi_codec_init(struct snd_soc_component *component)
if (sunxi_codec->hw_config.dachpf_cfg)
dachpf_config(component);
#endif
+
snd_soc_component_update_bits(component, SUNXI_HP2_REG,
(0x1 << HP_DRVEN), (0x1 << HP_DRVEN));
snd_soc_component_update_bits(component, SUNXI_HP2_REG,
(0x1 << HP_DRVOUTEN), (0x1 << HP_DRVOUTEN));
snd_soc_component_update_bits(component, SUNXI_HP2_REG,
(0x1 << RAMP_OUT_EN), (0x1 << RAMP_OUT_EN));
}
static int sunxi_codec_startup(struct snd_pcm_substream *substream,