Loading asoc/bengal.c +17 −14 Original line number Diff line number Diff line Loading @@ -2098,7 +2098,8 @@ static int msm_mi2s_set_sclk(struct snd_pcm_substream *substream, bool enable) struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int port_id = 0; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; port_id = msm_get_port_id(rtd->dai_link->id); if (port_id < 0) { Loading Loading @@ -3931,7 +3932,8 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; unsigned int fmt = SND_SOC_DAIFMT_CBS_CFS; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); Loading @@ -3955,11 +3957,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) */ mutex_lock(&mi2s_intf_conf[index].lock); if (++mi2s_intf_conf[index].ref_cnt == 1) { /* Check if msm needs to provide the clock to the interface */ if (!mi2s_intf_conf[index].msm_is_mi2s_master) { mi2s_clk[index].clk_id = mi2s_ebit_clk[index]; fmt = SND_SOC_DAIFMT_CBM_CFM; } ret = msm_mi2s_set_sclk(substream, true); if (ret < 0) { dev_err(rtd->card->dev, Loading @@ -3968,12 +3965,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) goto clean_up; } ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) { pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n", __func__, index, ret); goto clk_off; } if (pdata->mi2s_gpio_p[index]) { if (atomic_read(&(pdata->mi2s_gpio_ref_count[index])) == 0) { Loading @@ -3988,6 +3979,17 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) atomic_inc(&(pdata->mi2s_gpio_ref_count[index])); } } /* Check if msm needs to provide the clock to the interface */ if (!mi2s_intf_conf[index].msm_is_mi2s_master) { mi2s_clk[index].clk_id = mi2s_ebit_clk[index]; fmt = SND_SOC_DAIFMT_CBM_CFM; } ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) { pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n", __func__, index, ret); goto clk_off; } clk_off: if (ret < 0) msm_mi2s_set_sclk(substream, false); Loading @@ -4003,7 +4005,8 @@ static void msm_mi2s_snd_shutdown(struct snd_pcm_substream *substream) { int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; int index = rtd->cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (rtd->cpu_dai->id) / 2; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); Loading asoc/codecs/wcd937x/wcd937x.c +15 −1 Original line number Diff line number Diff line Loading @@ -150,8 +150,18 @@ static int wcd937x_handle_post_irq(void *data) static int wcd937x_init_reg(struct snd_soc_component *component) { u32 val =0; val = snd_soc_component_read32(component, WCD937X_DIGITAL_EFUSE_REG_29) & 0x0F; if (snd_soc_component_read32(component, WCD937X_DIGITAL_EFUSE_REG_16) == 0x02 || snd_soc_component_read32(component, WCD937X_DIGITAL_EFUSE_REG_17) > 0x09) { snd_soc_component_update_bits(component, WCD937X_SLEEP_CTL, 0x0E, val); } else { snd_soc_component_update_bits(component, WCD937X_SLEEP_CTL, 0x0E, 0x0E); } snd_soc_component_update_bits(component, WCD937X_SLEEP_CTL, 0x80, 0x80); usleep_range(1000, 1010); Loading Loading @@ -189,6 +199,10 @@ static int wcd937x_init_reg(struct snd_soc_component *component) WCD937X_HPH_NEW_INT_RDAC_HD2_CTL_L, 0x1F, 0x04); snd_soc_component_update_bits(component, WCD937X_HPH_NEW_INT_RDAC_HD2_CTL_R, 0x1F, 0x04); snd_soc_component_update_bits(component, WCD937X_BIAS_VBG_FINE_ADJ, 0xF0, 0xB0); snd_soc_component_update_bits(component, WCD937X_RX_BIAS_HPH_LOWPOWER, 0xF0, 0x90); } return 0; } Loading asoc/codecs/wsa883x/wsa883x.c +5 −12 Original line number Diff line number Diff line Loading @@ -1076,7 +1076,6 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w, struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); struct wsa883x_priv *wsa883x = snd_soc_component_get_drvdata(component); struct irq_data *irq_data = NULL; dev_dbg(component->dev, "%s: %s %d\n", __func__, w->name, event); switch (event) { Loading Loading @@ -1140,12 +1139,9 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w, WSA883X_PA_FSM_CTL, 0x01, 0x01); break; case SND_SOC_DAPM_PRE_PMD: if (!test_bit(SPKR_ADIE_LB, &wsa883x->status_mask)) { irq_data = irq_get_irq_data(WSA883X_IRQ_INT_PDM_WD); if (irq_data && !irqd_irq_disabled(irq_data)) if (!test_bit(SPKR_ADIE_LB, &wsa883x->status_mask)) wcd_disable_irq(&wsa883x->irq_info, WSA883X_IRQ_INT_PDM_WD); } snd_soc_component_update_bits(component, WSA883X_VBAT_ADC_FLT_CTL, 0x01, 0x00); Loading Loading @@ -1517,7 +1513,6 @@ static int wsa883x_event_notify(struct notifier_block *nb, u16 event = (val & 0xffff); struct wsa883x_priv *wsa883x = container_of(nb, struct wsa883x_priv, parent_nblock); struct irq_data *irq_data = NULL; if (!wsa883x) return -EINVAL; Loading Loading @@ -1546,8 +1541,6 @@ static int wsa883x_event_notify(struct notifier_block *nb, snd_soc_component_update_bits(wsa883x->component, WSA883X_PA_FSM_CTL, 0x01, 0x01); irq_data = irq_get_irq_data(WSA883X_IRQ_INT_PDM_WD); if (irq_data && irqd_irq_disabled(irq_data)) wcd_enable_irq(&wsa883x->irq_info, WSA883X_IRQ_INT_PDM_WD); /* Added delay as per HW sequence */ Loading asoc/holi.c +20 −16 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ #include <linux/clk.h> Loading Loading @@ -2432,7 +2432,8 @@ static int msm_mi2s_set_sclk(struct snd_pcm_substream *substream, bool enable) struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int port_id = 0; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; port_id = msm_get_port_id(rtd->dai_link->id); if (port_id < 0) { Loading Loading @@ -4369,7 +4370,8 @@ void mi2s_disable_audio_vote(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); int sample_rate = 0; Loading Loading @@ -4403,7 +4405,8 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; unsigned int fmt = SND_SOC_DAIFMT_CBS_CFS; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); Loading Loading @@ -4456,11 +4459,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) } if (++mi2s_intf_conf[index].ref_cnt == 1) { /* Check if msm needs to provide the clock to the interface */ if (!mi2s_intf_conf[index].msm_is_mi2s_master) { mi2s_clk[index].clk_id = mi2s_ebit_clk[index]; fmt = SND_SOC_DAIFMT_CBM_CFM; } ret = msm_mi2s_set_sclk(substream, true); if (ret < 0) { dev_err(rtd->card->dev, Loading @@ -4469,12 +4467,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) goto clean_up; } ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) { pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n", __func__, index, ret); goto clk_off; } if (pdata->mi2s_gpio_p[index]) { if (atomic_read(&(pdata->mi2s_gpio_ref_count[index])) == 0) { Loading @@ -4489,6 +4481,17 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) atomic_inc(&(pdata->mi2s_gpio_ref_count[index])); } } /* Check if msm needs to provide the clock to the interface */ if (!mi2s_intf_conf[index].msm_is_mi2s_master) { mi2s_clk[index].clk_id = mi2s_ebit_clk[index]; fmt = SND_SOC_DAIFMT_CBM_CFM; } ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) { pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n", __func__, index, ret); goto clk_off; } clk_off: if (ret < 0) msm_mi2s_set_sclk(substream, false); Loading @@ -4507,7 +4510,8 @@ static void msm_mi2s_snd_shutdown(struct snd_pcm_substream *substream) { int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; int index = rtd->cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (rtd->cpu_dai->id) / 2; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); Loading asoc/kona.c +20 −16 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ #include <linux/clk.h> Loading Loading @@ -2750,7 +2750,8 @@ static int msm_mi2s_set_sclk(struct snd_pcm_substream *substream, bool enable) struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int port_id = 0; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; port_id = msm_get_port_id(rtd->dai_link->id); if (port_id < 0) { Loading Loading @@ -5010,7 +5011,8 @@ void mi2s_disable_audio_vote(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); int sample_rate = 0; Loading Loading @@ -5044,7 +5046,8 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; unsigned int fmt = SND_SOC_DAIFMT_CBS_CFS; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); Loading Loading @@ -5097,11 +5100,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) } if (++mi2s_intf_conf[index].ref_cnt == 1) { /* Check if msm needs to provide the clock to the interface */ if (!mi2s_intf_conf[index].msm_is_mi2s_master) { mi2s_clk[index].clk_id = mi2s_ebit_clk[index]; fmt = SND_SOC_DAIFMT_CBM_CFM; } ret = msm_mi2s_set_sclk(substream, true); if (ret < 0) { dev_err(rtd->card->dev, Loading @@ -5110,12 +5108,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) goto clean_up; } ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) { pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n", __func__, index, ret); goto clk_off; } if (pdata->mi2s_gpio_p[index]) { if (atomic_read(&(pdata->mi2s_gpio_ref_count[index])) == 0) { Loading @@ -5130,6 +5122,17 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) atomic_inc(&(pdata->mi2s_gpio_ref_count[index])); } } /* Check if msm needs to provide the clock to the interface */ if (!mi2s_intf_conf[index].msm_is_mi2s_master) { mi2s_clk[index].clk_id = mi2s_ebit_clk[index]; fmt = SND_SOC_DAIFMT_CBM_CFM; } ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) { pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n", __func__, index, ret); goto clk_off; } clk_off: if (ret < 0) msm_mi2s_set_sclk(substream, false); Loading @@ -5148,7 +5151,8 @@ static void msm_mi2s_snd_shutdown(struct snd_pcm_substream *substream) { int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; int index = rtd->cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (rtd->cpu_dai->id) / 2; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); Loading Loading
asoc/bengal.c +17 −14 Original line number Diff line number Diff line Loading @@ -2098,7 +2098,8 @@ static int msm_mi2s_set_sclk(struct snd_pcm_substream *substream, bool enable) struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int port_id = 0; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; port_id = msm_get_port_id(rtd->dai_link->id); if (port_id < 0) { Loading Loading @@ -3931,7 +3932,8 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; unsigned int fmt = SND_SOC_DAIFMT_CBS_CFS; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); Loading @@ -3955,11 +3957,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) */ mutex_lock(&mi2s_intf_conf[index].lock); if (++mi2s_intf_conf[index].ref_cnt == 1) { /* Check if msm needs to provide the clock to the interface */ if (!mi2s_intf_conf[index].msm_is_mi2s_master) { mi2s_clk[index].clk_id = mi2s_ebit_clk[index]; fmt = SND_SOC_DAIFMT_CBM_CFM; } ret = msm_mi2s_set_sclk(substream, true); if (ret < 0) { dev_err(rtd->card->dev, Loading @@ -3968,12 +3965,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) goto clean_up; } ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) { pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n", __func__, index, ret); goto clk_off; } if (pdata->mi2s_gpio_p[index]) { if (atomic_read(&(pdata->mi2s_gpio_ref_count[index])) == 0) { Loading @@ -3988,6 +3979,17 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) atomic_inc(&(pdata->mi2s_gpio_ref_count[index])); } } /* Check if msm needs to provide the clock to the interface */ if (!mi2s_intf_conf[index].msm_is_mi2s_master) { mi2s_clk[index].clk_id = mi2s_ebit_clk[index]; fmt = SND_SOC_DAIFMT_CBM_CFM; } ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) { pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n", __func__, index, ret); goto clk_off; } clk_off: if (ret < 0) msm_mi2s_set_sclk(substream, false); Loading @@ -4003,7 +4005,8 @@ static void msm_mi2s_snd_shutdown(struct snd_pcm_substream *substream) { int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; int index = rtd->cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (rtd->cpu_dai->id) / 2; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); Loading
asoc/codecs/wcd937x/wcd937x.c +15 −1 Original line number Diff line number Diff line Loading @@ -150,8 +150,18 @@ static int wcd937x_handle_post_irq(void *data) static int wcd937x_init_reg(struct snd_soc_component *component) { u32 val =0; val = snd_soc_component_read32(component, WCD937X_DIGITAL_EFUSE_REG_29) & 0x0F; if (snd_soc_component_read32(component, WCD937X_DIGITAL_EFUSE_REG_16) == 0x02 || snd_soc_component_read32(component, WCD937X_DIGITAL_EFUSE_REG_17) > 0x09) { snd_soc_component_update_bits(component, WCD937X_SLEEP_CTL, 0x0E, val); } else { snd_soc_component_update_bits(component, WCD937X_SLEEP_CTL, 0x0E, 0x0E); } snd_soc_component_update_bits(component, WCD937X_SLEEP_CTL, 0x80, 0x80); usleep_range(1000, 1010); Loading Loading @@ -189,6 +199,10 @@ static int wcd937x_init_reg(struct snd_soc_component *component) WCD937X_HPH_NEW_INT_RDAC_HD2_CTL_L, 0x1F, 0x04); snd_soc_component_update_bits(component, WCD937X_HPH_NEW_INT_RDAC_HD2_CTL_R, 0x1F, 0x04); snd_soc_component_update_bits(component, WCD937X_BIAS_VBG_FINE_ADJ, 0xF0, 0xB0); snd_soc_component_update_bits(component, WCD937X_RX_BIAS_HPH_LOWPOWER, 0xF0, 0x90); } return 0; } Loading
asoc/codecs/wsa883x/wsa883x.c +5 −12 Original line number Diff line number Diff line Loading @@ -1076,7 +1076,6 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w, struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); struct wsa883x_priv *wsa883x = snd_soc_component_get_drvdata(component); struct irq_data *irq_data = NULL; dev_dbg(component->dev, "%s: %s %d\n", __func__, w->name, event); switch (event) { Loading Loading @@ -1140,12 +1139,9 @@ static int wsa883x_spkr_event(struct snd_soc_dapm_widget *w, WSA883X_PA_FSM_CTL, 0x01, 0x01); break; case SND_SOC_DAPM_PRE_PMD: if (!test_bit(SPKR_ADIE_LB, &wsa883x->status_mask)) { irq_data = irq_get_irq_data(WSA883X_IRQ_INT_PDM_WD); if (irq_data && !irqd_irq_disabled(irq_data)) if (!test_bit(SPKR_ADIE_LB, &wsa883x->status_mask)) wcd_disable_irq(&wsa883x->irq_info, WSA883X_IRQ_INT_PDM_WD); } snd_soc_component_update_bits(component, WSA883X_VBAT_ADC_FLT_CTL, 0x01, 0x00); Loading Loading @@ -1517,7 +1513,6 @@ static int wsa883x_event_notify(struct notifier_block *nb, u16 event = (val & 0xffff); struct wsa883x_priv *wsa883x = container_of(nb, struct wsa883x_priv, parent_nblock); struct irq_data *irq_data = NULL; if (!wsa883x) return -EINVAL; Loading Loading @@ -1546,8 +1541,6 @@ static int wsa883x_event_notify(struct notifier_block *nb, snd_soc_component_update_bits(wsa883x->component, WSA883X_PA_FSM_CTL, 0x01, 0x01); irq_data = irq_get_irq_data(WSA883X_IRQ_INT_PDM_WD); if (irq_data && irqd_irq_disabled(irq_data)) wcd_enable_irq(&wsa883x->irq_info, WSA883X_IRQ_INT_PDM_WD); /* Added delay as per HW sequence */ Loading
asoc/holi.c +20 −16 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ #include <linux/clk.h> Loading Loading @@ -2432,7 +2432,8 @@ static int msm_mi2s_set_sclk(struct snd_pcm_substream *substream, bool enable) struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int port_id = 0; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; port_id = msm_get_port_id(rtd->dai_link->id); if (port_id < 0) { Loading Loading @@ -4369,7 +4370,8 @@ void mi2s_disable_audio_vote(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); int sample_rate = 0; Loading Loading @@ -4403,7 +4405,8 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; unsigned int fmt = SND_SOC_DAIFMT_CBS_CFS; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); Loading Loading @@ -4456,11 +4459,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) } if (++mi2s_intf_conf[index].ref_cnt == 1) { /* Check if msm needs to provide the clock to the interface */ if (!mi2s_intf_conf[index].msm_is_mi2s_master) { mi2s_clk[index].clk_id = mi2s_ebit_clk[index]; fmt = SND_SOC_DAIFMT_CBM_CFM; } ret = msm_mi2s_set_sclk(substream, true); if (ret < 0) { dev_err(rtd->card->dev, Loading @@ -4469,12 +4467,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) goto clean_up; } ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) { pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n", __func__, index, ret); goto clk_off; } if (pdata->mi2s_gpio_p[index]) { if (atomic_read(&(pdata->mi2s_gpio_ref_count[index])) == 0) { Loading @@ -4489,6 +4481,17 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) atomic_inc(&(pdata->mi2s_gpio_ref_count[index])); } } /* Check if msm needs to provide the clock to the interface */ if (!mi2s_intf_conf[index].msm_is_mi2s_master) { mi2s_clk[index].clk_id = mi2s_ebit_clk[index]; fmt = SND_SOC_DAIFMT_CBM_CFM; } ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) { pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n", __func__, index, ret); goto clk_off; } clk_off: if (ret < 0) msm_mi2s_set_sclk(substream, false); Loading @@ -4507,7 +4510,8 @@ static void msm_mi2s_snd_shutdown(struct snd_pcm_substream *substream) { int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; int index = rtd->cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (rtd->cpu_dai->id) / 2; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); Loading
asoc/kona.c +20 −16 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ #include <linux/clk.h> Loading Loading @@ -2750,7 +2750,8 @@ static int msm_mi2s_set_sclk(struct snd_pcm_substream *substream, bool enable) struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int port_id = 0; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; port_id = msm_get_port_id(rtd->dai_link->id); if (port_id < 0) { Loading Loading @@ -5010,7 +5011,8 @@ void mi2s_disable_audio_vote(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); int sample_rate = 0; Loading Loading @@ -5044,7 +5046,8 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int index = cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (cpu_dai->id) / 2; unsigned int fmt = SND_SOC_DAIFMT_CBS_CFS; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); Loading Loading @@ -5097,11 +5100,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) } if (++mi2s_intf_conf[index].ref_cnt == 1) { /* Check if msm needs to provide the clock to the interface */ if (!mi2s_intf_conf[index].msm_is_mi2s_master) { mi2s_clk[index].clk_id = mi2s_ebit_clk[index]; fmt = SND_SOC_DAIFMT_CBM_CFM; } ret = msm_mi2s_set_sclk(substream, true); if (ret < 0) { dev_err(rtd->card->dev, Loading @@ -5110,12 +5108,6 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) goto clean_up; } ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) { pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n", __func__, index, ret); goto clk_off; } if (pdata->mi2s_gpio_p[index]) { if (atomic_read(&(pdata->mi2s_gpio_ref_count[index])) == 0) { Loading @@ -5130,6 +5122,17 @@ static int msm_mi2s_snd_startup(struct snd_pcm_substream *substream) atomic_inc(&(pdata->mi2s_gpio_ref_count[index])); } } /* Check if msm needs to provide the clock to the interface */ if (!mi2s_intf_conf[index].msm_is_mi2s_master) { mi2s_clk[index].clk_id = mi2s_ebit_clk[index]; fmt = SND_SOC_DAIFMT_CBM_CFM; } ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) { pr_err("%s: set fmt cpu dai failed for MI2S (%d), err:%d\n", __func__, index, ret); goto clk_off; } clk_off: if (ret < 0) msm_mi2s_set_sclk(substream, false); Loading @@ -5148,7 +5151,8 @@ static void msm_mi2s_snd_shutdown(struct snd_pcm_substream *substream) { int ret = 0; struct snd_soc_pcm_runtime *rtd = substream->private_data; int index = rtd->cpu_dai->id; /* Rx and Tx DAIs should use same clk index */ int index = (rtd->cpu_dai->id) / 2; struct snd_soc_card *card = rtd->card; struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card); Loading