Loading Documentation/devicetree/bindings/sound/qcom-audio-dev.txt +3 −0 Original line number Diff line number Diff line Loading @@ -526,6 +526,8 @@ Required properties: - qcom,msm-ext-pa : This property is used to inform machine driver about the connection of external PA over secondary MI2S interface, val 0 external PA is not there, Val 1 external PA is connected. - qcom,msm-mclk-freq : This property is used to inform machine driver about mclk frequency needs to be configured for internal and external PA. - qcom,msm-mbhc-hphl-swh: This property is used to distinguish headset HPHL switch type on target typically the switch type will be normally open or normally close, value for this property 0 for normally close and 1 for Loading Loading @@ -563,6 +565,7 @@ Example: qcom,msm-snd-card-id = <0>; qcom,msm-codec-type = "internal"; qcom,msm-ext-pa = <0>; qcom,msm-mclk-freq = <12288000>; qcom,msm-mbhc-hphl-swh = <0>; qcom,msm-mbhc-gnd-swh = <0>; qcom,msm-hs-micbias-type = "internal"; Loading arch/arm/boot/dts/qcom/msm8916-cdp.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,7 @@ qcom,msm-ext-pa = <0>; qcom,msm-mbhc-hphl-swh = <0>; qcom,msm-mbhc-gnd-swh = <0>; qcom,msm-mclk-freq = <9600000>; qcom,msm-hs-micbias-type = "internal"; qcom,audio-routing = "RX_BIAS", "MCLK", Loading arch/arm/boot/dts/qcom/msm8916-mtp.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,7 @@ qcom,msm-snd-card-id = <0>; qcom,msm-codec-type = "internal"; qcom,msm-ext-pa = <0>; qcom,msm-mclk-freq = <9600000>; qcom,msm-mbhc-hphl-swh = <0>; qcom,msm-mbhc-gnd-swh = <0>; qcom,msm-hs-micbias-type = "internal"; Loading sound/soc/codecs/msm8x16-wcd.c +11 −3 Original line number Diff line number Diff line Loading @@ -63,7 +63,6 @@ #define CODEC_DT_MAX_PROP_SIZE 40 #define MSM8X16_DIGITAL_CODEC_REG_SIZE 0x400 #define MAX_ON_DEMAND_SUPPLY_NAME_LENGTH 64 #define TOMBAK_MCLK_CLK_9P6MHZ 9600000 /* *50 Milliseconds sufficient for DSP bring up in the modem Loading Loading @@ -337,7 +336,7 @@ static int __msm8x16_wcd_reg_read(struct snd_soc_codec *codec, else if (MSM8X16_WCD_IS_DIGITAL_REG(reg)) { mutex_lock(&pdata->cdc_mclk_mutex); if (atomic_read(&pdata->dis_work_mclk) == false) { pdata->digital_cdc_clk.clk_val = 9600000; pdata->digital_cdc_clk.clk_val = pdata->mclk_freq; ret = afe_set_digital_codec_core_clock( AFE_PORT_ID_PRIMARY_MI2S_RX, &pdata->digital_cdc_clk); Loading Loading @@ -388,7 +387,7 @@ static int __msm8x16_wcd_reg_write(struct snd_soc_codec *codec, mutex_lock(&pdata->cdc_mclk_mutex); if (atomic_read(&pdata->dis_work_mclk) == false) { pr_debug("MCLK not enabled %s:\n", __func__); pdata->digital_cdc_clk.clk_val = 9600000; pdata->digital_cdc_clk.clk_val = pdata->mclk_freq; ret = afe_set_digital_codec_core_clock( AFE_PORT_ID_PRIMARY_MI2S_RX, &pdata->digital_cdc_clk); Loading Loading @@ -2324,6 +2323,9 @@ static void msm8x16_wcd_shutdown(struct snd_pcm_substream *substream, static int msm8x16_wcd_codec_enable_clock_block(struct snd_soc_codec *codec, int enable) { struct msm8916_asoc_mach_data *pdata = NULL; pdata = snd_soc_card_get_drvdata(codec->card); if (enable) { snd_soc_update_bits(codec, MSM8X16_WCD_A_CDC_CLK_MCLK_CTL, 0x01, 0x01); Loading @@ -2335,6 +2337,12 @@ static int msm8x16_wcd_codec_enable_clock_block(struct snd_soc_codec *codec, MSM8X16_WCD_A_DIGITAL_CDC_RST_CTL, 0x80, 0x80); snd_soc_update_bits(codec, MSM8X16_WCD_A_DIGITAL_CDC_TOP_CLK_CTL, 0x0C, 0x0C); if (pdata->mclk_freq == 12288000) snd_soc_update_bits(codec, MSM8X16_WCD_A_CDC_TOP_CTL, 0x01, 0x00); else if (pdata->mclk_freq == 9600000) snd_soc_update_bits(codec, MSM8X16_WCD_A_CDC_TOP_CTL, 0x01, 0x01); } else { snd_soc_update_bits(codec, MSM8X16_WCD_A_DIGITAL_CDC_TOP_CLK_CTL, 0x0C, 0x00); Loading sound/soc/codecs/msm8x16-wcd.h +1 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ struct msm8916_asoc_mach_data { int codec_type; int ext_pa; int us_euro_gpio; int mclk_freq; atomic_t mclk_rsc_ref; atomic_t dis_work_mclk; struct mutex cdc_mclk_mutex; Loading Loading
Documentation/devicetree/bindings/sound/qcom-audio-dev.txt +3 −0 Original line number Diff line number Diff line Loading @@ -526,6 +526,8 @@ Required properties: - qcom,msm-ext-pa : This property is used to inform machine driver about the connection of external PA over secondary MI2S interface, val 0 external PA is not there, Val 1 external PA is connected. - qcom,msm-mclk-freq : This property is used to inform machine driver about mclk frequency needs to be configured for internal and external PA. - qcom,msm-mbhc-hphl-swh: This property is used to distinguish headset HPHL switch type on target typically the switch type will be normally open or normally close, value for this property 0 for normally close and 1 for Loading Loading @@ -563,6 +565,7 @@ Example: qcom,msm-snd-card-id = <0>; qcom,msm-codec-type = "internal"; qcom,msm-ext-pa = <0>; qcom,msm-mclk-freq = <12288000>; qcom,msm-mbhc-hphl-swh = <0>; qcom,msm-mbhc-gnd-swh = <0>; qcom,msm-hs-micbias-type = "internal"; Loading
arch/arm/boot/dts/qcom/msm8916-cdp.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,7 @@ qcom,msm-ext-pa = <0>; qcom,msm-mbhc-hphl-swh = <0>; qcom,msm-mbhc-gnd-swh = <0>; qcom,msm-mclk-freq = <9600000>; qcom,msm-hs-micbias-type = "internal"; qcom,audio-routing = "RX_BIAS", "MCLK", Loading
arch/arm/boot/dts/qcom/msm8916-mtp.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,7 @@ qcom,msm-snd-card-id = <0>; qcom,msm-codec-type = "internal"; qcom,msm-ext-pa = <0>; qcom,msm-mclk-freq = <9600000>; qcom,msm-mbhc-hphl-swh = <0>; qcom,msm-mbhc-gnd-swh = <0>; qcom,msm-hs-micbias-type = "internal"; Loading
sound/soc/codecs/msm8x16-wcd.c +11 −3 Original line number Diff line number Diff line Loading @@ -63,7 +63,6 @@ #define CODEC_DT_MAX_PROP_SIZE 40 #define MSM8X16_DIGITAL_CODEC_REG_SIZE 0x400 #define MAX_ON_DEMAND_SUPPLY_NAME_LENGTH 64 #define TOMBAK_MCLK_CLK_9P6MHZ 9600000 /* *50 Milliseconds sufficient for DSP bring up in the modem Loading Loading @@ -337,7 +336,7 @@ static int __msm8x16_wcd_reg_read(struct snd_soc_codec *codec, else if (MSM8X16_WCD_IS_DIGITAL_REG(reg)) { mutex_lock(&pdata->cdc_mclk_mutex); if (atomic_read(&pdata->dis_work_mclk) == false) { pdata->digital_cdc_clk.clk_val = 9600000; pdata->digital_cdc_clk.clk_val = pdata->mclk_freq; ret = afe_set_digital_codec_core_clock( AFE_PORT_ID_PRIMARY_MI2S_RX, &pdata->digital_cdc_clk); Loading Loading @@ -388,7 +387,7 @@ static int __msm8x16_wcd_reg_write(struct snd_soc_codec *codec, mutex_lock(&pdata->cdc_mclk_mutex); if (atomic_read(&pdata->dis_work_mclk) == false) { pr_debug("MCLK not enabled %s:\n", __func__); pdata->digital_cdc_clk.clk_val = 9600000; pdata->digital_cdc_clk.clk_val = pdata->mclk_freq; ret = afe_set_digital_codec_core_clock( AFE_PORT_ID_PRIMARY_MI2S_RX, &pdata->digital_cdc_clk); Loading Loading @@ -2324,6 +2323,9 @@ static void msm8x16_wcd_shutdown(struct snd_pcm_substream *substream, static int msm8x16_wcd_codec_enable_clock_block(struct snd_soc_codec *codec, int enable) { struct msm8916_asoc_mach_data *pdata = NULL; pdata = snd_soc_card_get_drvdata(codec->card); if (enable) { snd_soc_update_bits(codec, MSM8X16_WCD_A_CDC_CLK_MCLK_CTL, 0x01, 0x01); Loading @@ -2335,6 +2337,12 @@ static int msm8x16_wcd_codec_enable_clock_block(struct snd_soc_codec *codec, MSM8X16_WCD_A_DIGITAL_CDC_RST_CTL, 0x80, 0x80); snd_soc_update_bits(codec, MSM8X16_WCD_A_DIGITAL_CDC_TOP_CLK_CTL, 0x0C, 0x0C); if (pdata->mclk_freq == 12288000) snd_soc_update_bits(codec, MSM8X16_WCD_A_CDC_TOP_CTL, 0x01, 0x00); else if (pdata->mclk_freq == 9600000) snd_soc_update_bits(codec, MSM8X16_WCD_A_CDC_TOP_CTL, 0x01, 0x01); } else { snd_soc_update_bits(codec, MSM8X16_WCD_A_DIGITAL_CDC_TOP_CLK_CTL, 0x0C, 0x00); Loading
sound/soc/codecs/msm8x16-wcd.h +1 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ struct msm8916_asoc_mach_data { int codec_type; int ext_pa; int us_euro_gpio; int mclk_freq; atomic_t mclk_rsc_ref; atomic_t dis_work_mclk; struct mutex cdc_mclk_mutex; Loading