Loading include/linux/mfd/wcd9xxx/core.h +1 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,7 @@ struct wcd9xxx_codec_dai_data { u16 grph; /* slimbus group handle */ unsigned long ch_mask; wait_queue_head_t dai_wait; bool bus_down_in_recovery; }; #define WCD9XXX_CH(xport, xshift) \ Loading sound/soc/codecs/wcd9306.c +12 −2 Original line number Diff line number Diff line Loading @@ -4197,6 +4197,7 @@ static int tapan_codec_enable_slimrx(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_POST_PMU: dai->bus_down_in_recovery = false; (void) tapan_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_rx(core, &dai->wcd9xxx_ch_list, dai->rate, dai->bit_width, Loading @@ -4205,6 +4206,7 @@ static int tapan_codec_enable_slimrx(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMD: ret = wcd9xxx_close_slim_sch_rx(core, &dai->wcd9xxx_ch_list, dai->grph); if (!dai->bus_down_in_recovery) ret = tapan_codec_enable_slim_chmask(dai, false); if (ret < 0) { ret = wcd9xxx_disconnect_port(core, Loading @@ -4220,6 +4222,7 @@ static int tapan_codec_enable_slimrx(struct snd_soc_dapm_widget *w, pm_runtime_put(core->dev->parent); dev_dbg(codec->dev, "%s: unvote requested", __func__); } dai->bus_down_in_recovery = false; break; } return ret; Loading Loading @@ -4251,6 +4254,7 @@ static int tapan_codec_enable_slimtx(struct snd_soc_dapm_widget *w, dai = &tapan_p->dai[w->shift]; switch (event) { case SND_SOC_DAPM_POST_PMU: dai->bus_down_in_recovery = false; (void) tapan_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_tx(core, &dai->wcd9xxx_ch_list, dai->rate, dai->bit_width, Loading @@ -4259,6 +4263,7 @@ static int tapan_codec_enable_slimtx(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMD: ret = wcd9xxx_close_slim_sch_tx(core, &dai->wcd9xxx_ch_list, dai->grph); if (!dai->bus_down_in_recovery) ret = tapan_codec_enable_slim_chmask(dai, false); if (ret < 0) { ret = wcd9xxx_disconnect_port(core, Loading @@ -4274,6 +4279,7 @@ static int tapan_codec_enable_slimtx(struct snd_soc_dapm_widget *w, pm_runtime_put(core->dev->parent); dev_dbg(codec->dev, "%s: unvote requested", __func__); } dai->bus_down_in_recovery = false; break; } return ret; Loading Loading @@ -5775,6 +5781,7 @@ static int tapan_post_reset_cb(struct wcd9xxx *wcd9xxx) int rco_clk_rate; struct snd_soc_codec *codec; struct tapan_priv *tapan; int count; codec = (struct snd_soc_codec *)(wcd9xxx->ssr_priv); tapan = snd_soc_codec_get_drvdata(codec); Loading Loading @@ -5831,6 +5838,9 @@ static int tapan_post_reset_cb(struct wcd9xxx *wcd9xxx) tapan->machine_codec_event_cb(codec, WCD9XXX_CODEC_EVENT_CODEC_UP); for (count = 0; count < NUM_CODEC_DAIS; count++) tapan->dai[count].bus_down_in_recovery = true; mutex_unlock(&codec->mutex); return ret; } Loading sound/soc/codecs/wcd9320.c +19 −2 Original line number Diff line number Diff line Loading @@ -5283,6 +5283,7 @@ static int taiko_codec_enable_slimrx(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_POST_PMU: dai->bus_down_in_recovery = false; taiko_codec_enable_int_port(dai, codec); (void) taiko_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_rx(core, &dai->wcd9xxx_ch_list, Loading @@ -5292,7 +5293,9 @@ static int taiko_codec_enable_slimrx(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMD: ret = wcd9xxx_close_slim_sch_rx(core, &dai->wcd9xxx_ch_list, dai->grph); if (!dai->bus_down_in_recovery) ret = taiko_codec_enable_slim_chmask(dai, false); if (ret < 0) { ret = wcd9xxx_disconnect_port(core, &dai->wcd9xxx_ch_list, Loading @@ -5300,6 +5303,7 @@ static int taiko_codec_enable_slimrx(struct snd_soc_dapm_widget *w, pr_debug("%s: Disconnect RX port, ret = %d\n", __func__, ret); } dai->bus_down_in_recovery = false; break; } return ret; Loading Loading @@ -5349,6 +5353,7 @@ static int taiko_codec_enable_slimvi_feedback(struct snd_soc_dapm_widget *w, snd_soc_update_bits(codec, TAIKO_A_CDC_CLK_TX_CLK_EN_B2_CTL, 0xC, 0xC); taiko_codec_enable_int_port(dai, codec); dai->bus_down_in_recovery = false; (void) taiko_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_tx(core, &dai->wcd9xxx_ch_list, dai->rate, dai->bit_width, Loading @@ -5374,6 +5379,8 @@ static int taiko_codec_enable_slimvi_feedback(struct snd_soc_dapm_widget *w, /*Disable V&I sensing*/ snd_soc_update_bits(codec, TAIKO_A_SPKR_PROT_EN, 0x88, 0x00); dai->bus_down_in_recovery = false; break; } out_vi: Loading Loading @@ -5403,9 +5410,11 @@ static int taiko_codec_enable_slimtx(struct snd_soc_dapm_widget *w, __func__, w->name, event, w->shift); dai = &taiko_p->dai[w->shift]; switch (event) { case SND_SOC_DAPM_POST_PMU: taiko_codec_enable_int_port(dai, codec); dai->bus_down_in_recovery = false; (void) taiko_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_tx(core, &dai->wcd9xxx_ch_list, dai->rate, dai->bit_width, Loading @@ -5414,7 +5423,9 @@ static int taiko_codec_enable_slimtx(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMD: ret = wcd9xxx_close_slim_sch_tx(core, &dai->wcd9xxx_ch_list, dai->grph); if (!dai->bus_down_in_recovery) ret = taiko_codec_enable_slim_chmask(dai, false); if (ret < 0) { ret = wcd9xxx_disconnect_port(core, &dai->wcd9xxx_ch_list, Loading @@ -5422,6 +5433,8 @@ static int taiko_codec_enable_slimtx(struct snd_soc_dapm_widget *w, pr_debug("%s: Disconnect RX port, ret = %d\n", __func__, ret); } dai->bus_down_in_recovery = false; break; } return ret; Loading Loading @@ -6963,6 +6976,7 @@ static int taiko_post_reset_cb(struct wcd9xxx *wcd9xxx) struct snd_soc_codec *codec; struct taiko_priv *taiko; int rco_clk_rate; int count; codec = (struct snd_soc_codec *)(wcd9xxx->ssr_priv); taiko = snd_soc_codec_get_drvdata(codec); Loading Loading @@ -7019,6 +7033,9 @@ static int taiko_post_reset_cb(struct wcd9xxx *wcd9xxx) if (ret) pr_err("%s: Failed to setup irq: %d\n", __func__, ret); for (count = 0; count < NUM_CODEC_DAIS; count++) taiko->dai[count].bus_down_in_recovery = true; mutex_unlock(&codec->mutex); return ret; } Loading sound/soc/codecs/wcd9330.c +17 −2 Original line number Diff line number Diff line Loading @@ -5347,6 +5347,7 @@ static int tomtom_codec_enable_slimrx(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_POST_PMU: dai->bus_down_in_recovery = false; tomtom_codec_enable_int_port(dai, codec); (void) tomtom_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_rx(core, &dai->wcd9xxx_ch_list, Loading @@ -5356,6 +5357,7 @@ static int tomtom_codec_enable_slimrx(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMD: ret = wcd9xxx_close_slim_sch_rx(core, &dai->wcd9xxx_ch_list, dai->grph); if (!dai->bus_down_in_recovery) ret = tomtom_codec_enable_slim_chmask(dai, false); if (ret < 0) { ret = wcd9xxx_disconnect_port(core, Loading @@ -5364,6 +5366,8 @@ static int tomtom_codec_enable_slimrx(struct snd_soc_dapm_widget *w, pr_debug("%s: Disconnect RX port, ret = %d\n", __func__, ret); } dai->bus_down_in_recovery = false; break; } return ret; Loading Loading @@ -5412,6 +5416,7 @@ static int tomtom_codec_enable_slimvi_feedback(struct snd_soc_dapm_widget *w, /*Enable spkr VI clocks*/ snd_soc_update_bits(codec, TOMTOM_A_CDC_CLK_TX_CLK_EN_B2_CTL, 0xC, 0xC); dai->bus_down_in_recovery = false; tomtom_codec_enable_int_port(dai, codec); (void) tomtom_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_tx(core, &dai->wcd9xxx_ch_list, Loading @@ -5429,6 +5434,8 @@ static int tomtom_codec_enable_slimvi_feedback(struct snd_soc_dapm_widget *w, /*Disable V&I sensing*/ snd_soc_update_bits(codec, TOMTOM_A_SPKR1_PROT_EN, 0x88, 0x00); dai->bus_down_in_recovery = false; break; } out_vi: Loading Loading @@ -5460,6 +5467,7 @@ static int tomtom_codec_enable_slimtx(struct snd_soc_dapm_widget *w, dai = &tomtom_p->dai[w->shift]; switch (event) { case SND_SOC_DAPM_POST_PMU: dai->bus_down_in_recovery = false; tomtom_codec_enable_int_port(dai, codec); (void) tomtom_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_tx(core, &dai->wcd9xxx_ch_list, Loading @@ -5469,6 +5477,7 @@ static int tomtom_codec_enable_slimtx(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMD: ret = wcd9xxx_close_slim_sch_tx(core, &dai->wcd9xxx_ch_list, dai->grph); if (!dai->bus_down_in_recovery) ret = tomtom_codec_enable_slim_chmask(dai, false); if (ret < 0) { ret = wcd9xxx_disconnect_port(core, Loading @@ -5477,6 +5486,8 @@ static int tomtom_codec_enable_slimtx(struct snd_soc_dapm_widget *w, pr_debug("%s: Disconnect RX port, ret = %d\n", __func__, ret); } dai->bus_down_in_recovery = false; break; } return ret; Loading Loading @@ -7013,6 +7024,7 @@ static int tomtom_post_reset_cb(struct wcd9xxx *wcd9xxx) struct snd_soc_codec *codec; struct tomtom_priv *tomtom; int rco_clk_rate; int count; codec = (struct snd_soc_codec *)(wcd9xxx->ssr_priv); tomtom = snd_soc_codec_get_drvdata(codec); Loading Loading @@ -7063,6 +7075,9 @@ static int tomtom_post_reset_cb(struct wcd9xxx *wcd9xxx) if (ret) pr_err("%s: Failed to setup irq: %d\n", __func__, ret); for (count = 0; count < NUM_CODEC_DAIS; count++) tomtom->dai[count].bus_down_in_recovery = true; mutex_unlock(&codec->mutex); return ret; } Loading Loading
include/linux/mfd/wcd9xxx/core.h +1 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,7 @@ struct wcd9xxx_codec_dai_data { u16 grph; /* slimbus group handle */ unsigned long ch_mask; wait_queue_head_t dai_wait; bool bus_down_in_recovery; }; #define WCD9XXX_CH(xport, xshift) \ Loading
sound/soc/codecs/wcd9306.c +12 −2 Original line number Diff line number Diff line Loading @@ -4197,6 +4197,7 @@ static int tapan_codec_enable_slimrx(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_POST_PMU: dai->bus_down_in_recovery = false; (void) tapan_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_rx(core, &dai->wcd9xxx_ch_list, dai->rate, dai->bit_width, Loading @@ -4205,6 +4206,7 @@ static int tapan_codec_enable_slimrx(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMD: ret = wcd9xxx_close_slim_sch_rx(core, &dai->wcd9xxx_ch_list, dai->grph); if (!dai->bus_down_in_recovery) ret = tapan_codec_enable_slim_chmask(dai, false); if (ret < 0) { ret = wcd9xxx_disconnect_port(core, Loading @@ -4220,6 +4222,7 @@ static int tapan_codec_enable_slimrx(struct snd_soc_dapm_widget *w, pm_runtime_put(core->dev->parent); dev_dbg(codec->dev, "%s: unvote requested", __func__); } dai->bus_down_in_recovery = false; break; } return ret; Loading Loading @@ -4251,6 +4254,7 @@ static int tapan_codec_enable_slimtx(struct snd_soc_dapm_widget *w, dai = &tapan_p->dai[w->shift]; switch (event) { case SND_SOC_DAPM_POST_PMU: dai->bus_down_in_recovery = false; (void) tapan_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_tx(core, &dai->wcd9xxx_ch_list, dai->rate, dai->bit_width, Loading @@ -4259,6 +4263,7 @@ static int tapan_codec_enable_slimtx(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMD: ret = wcd9xxx_close_slim_sch_tx(core, &dai->wcd9xxx_ch_list, dai->grph); if (!dai->bus_down_in_recovery) ret = tapan_codec_enable_slim_chmask(dai, false); if (ret < 0) { ret = wcd9xxx_disconnect_port(core, Loading @@ -4274,6 +4279,7 @@ static int tapan_codec_enable_slimtx(struct snd_soc_dapm_widget *w, pm_runtime_put(core->dev->parent); dev_dbg(codec->dev, "%s: unvote requested", __func__); } dai->bus_down_in_recovery = false; break; } return ret; Loading Loading @@ -5775,6 +5781,7 @@ static int tapan_post_reset_cb(struct wcd9xxx *wcd9xxx) int rco_clk_rate; struct snd_soc_codec *codec; struct tapan_priv *tapan; int count; codec = (struct snd_soc_codec *)(wcd9xxx->ssr_priv); tapan = snd_soc_codec_get_drvdata(codec); Loading Loading @@ -5831,6 +5838,9 @@ static int tapan_post_reset_cb(struct wcd9xxx *wcd9xxx) tapan->machine_codec_event_cb(codec, WCD9XXX_CODEC_EVENT_CODEC_UP); for (count = 0; count < NUM_CODEC_DAIS; count++) tapan->dai[count].bus_down_in_recovery = true; mutex_unlock(&codec->mutex); return ret; } Loading
sound/soc/codecs/wcd9320.c +19 −2 Original line number Diff line number Diff line Loading @@ -5283,6 +5283,7 @@ static int taiko_codec_enable_slimrx(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_POST_PMU: dai->bus_down_in_recovery = false; taiko_codec_enable_int_port(dai, codec); (void) taiko_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_rx(core, &dai->wcd9xxx_ch_list, Loading @@ -5292,7 +5293,9 @@ static int taiko_codec_enable_slimrx(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMD: ret = wcd9xxx_close_slim_sch_rx(core, &dai->wcd9xxx_ch_list, dai->grph); if (!dai->bus_down_in_recovery) ret = taiko_codec_enable_slim_chmask(dai, false); if (ret < 0) { ret = wcd9xxx_disconnect_port(core, &dai->wcd9xxx_ch_list, Loading @@ -5300,6 +5303,7 @@ static int taiko_codec_enable_slimrx(struct snd_soc_dapm_widget *w, pr_debug("%s: Disconnect RX port, ret = %d\n", __func__, ret); } dai->bus_down_in_recovery = false; break; } return ret; Loading Loading @@ -5349,6 +5353,7 @@ static int taiko_codec_enable_slimvi_feedback(struct snd_soc_dapm_widget *w, snd_soc_update_bits(codec, TAIKO_A_CDC_CLK_TX_CLK_EN_B2_CTL, 0xC, 0xC); taiko_codec_enable_int_port(dai, codec); dai->bus_down_in_recovery = false; (void) taiko_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_tx(core, &dai->wcd9xxx_ch_list, dai->rate, dai->bit_width, Loading @@ -5374,6 +5379,8 @@ static int taiko_codec_enable_slimvi_feedback(struct snd_soc_dapm_widget *w, /*Disable V&I sensing*/ snd_soc_update_bits(codec, TAIKO_A_SPKR_PROT_EN, 0x88, 0x00); dai->bus_down_in_recovery = false; break; } out_vi: Loading Loading @@ -5403,9 +5410,11 @@ static int taiko_codec_enable_slimtx(struct snd_soc_dapm_widget *w, __func__, w->name, event, w->shift); dai = &taiko_p->dai[w->shift]; switch (event) { case SND_SOC_DAPM_POST_PMU: taiko_codec_enable_int_port(dai, codec); dai->bus_down_in_recovery = false; (void) taiko_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_tx(core, &dai->wcd9xxx_ch_list, dai->rate, dai->bit_width, Loading @@ -5414,7 +5423,9 @@ static int taiko_codec_enable_slimtx(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMD: ret = wcd9xxx_close_slim_sch_tx(core, &dai->wcd9xxx_ch_list, dai->grph); if (!dai->bus_down_in_recovery) ret = taiko_codec_enable_slim_chmask(dai, false); if (ret < 0) { ret = wcd9xxx_disconnect_port(core, &dai->wcd9xxx_ch_list, Loading @@ -5422,6 +5433,8 @@ static int taiko_codec_enable_slimtx(struct snd_soc_dapm_widget *w, pr_debug("%s: Disconnect RX port, ret = %d\n", __func__, ret); } dai->bus_down_in_recovery = false; break; } return ret; Loading Loading @@ -6963,6 +6976,7 @@ static int taiko_post_reset_cb(struct wcd9xxx *wcd9xxx) struct snd_soc_codec *codec; struct taiko_priv *taiko; int rco_clk_rate; int count; codec = (struct snd_soc_codec *)(wcd9xxx->ssr_priv); taiko = snd_soc_codec_get_drvdata(codec); Loading Loading @@ -7019,6 +7033,9 @@ static int taiko_post_reset_cb(struct wcd9xxx *wcd9xxx) if (ret) pr_err("%s: Failed to setup irq: %d\n", __func__, ret); for (count = 0; count < NUM_CODEC_DAIS; count++) taiko->dai[count].bus_down_in_recovery = true; mutex_unlock(&codec->mutex); return ret; } Loading
sound/soc/codecs/wcd9330.c +17 −2 Original line number Diff line number Diff line Loading @@ -5347,6 +5347,7 @@ static int tomtom_codec_enable_slimrx(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_POST_PMU: dai->bus_down_in_recovery = false; tomtom_codec_enable_int_port(dai, codec); (void) tomtom_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_rx(core, &dai->wcd9xxx_ch_list, Loading @@ -5356,6 +5357,7 @@ static int tomtom_codec_enable_slimrx(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMD: ret = wcd9xxx_close_slim_sch_rx(core, &dai->wcd9xxx_ch_list, dai->grph); if (!dai->bus_down_in_recovery) ret = tomtom_codec_enable_slim_chmask(dai, false); if (ret < 0) { ret = wcd9xxx_disconnect_port(core, Loading @@ -5364,6 +5366,8 @@ static int tomtom_codec_enable_slimrx(struct snd_soc_dapm_widget *w, pr_debug("%s: Disconnect RX port, ret = %d\n", __func__, ret); } dai->bus_down_in_recovery = false; break; } return ret; Loading Loading @@ -5412,6 +5416,7 @@ static int tomtom_codec_enable_slimvi_feedback(struct snd_soc_dapm_widget *w, /*Enable spkr VI clocks*/ snd_soc_update_bits(codec, TOMTOM_A_CDC_CLK_TX_CLK_EN_B2_CTL, 0xC, 0xC); dai->bus_down_in_recovery = false; tomtom_codec_enable_int_port(dai, codec); (void) tomtom_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_tx(core, &dai->wcd9xxx_ch_list, Loading @@ -5429,6 +5434,8 @@ static int tomtom_codec_enable_slimvi_feedback(struct snd_soc_dapm_widget *w, /*Disable V&I sensing*/ snd_soc_update_bits(codec, TOMTOM_A_SPKR1_PROT_EN, 0x88, 0x00); dai->bus_down_in_recovery = false; break; } out_vi: Loading Loading @@ -5460,6 +5467,7 @@ static int tomtom_codec_enable_slimtx(struct snd_soc_dapm_widget *w, dai = &tomtom_p->dai[w->shift]; switch (event) { case SND_SOC_DAPM_POST_PMU: dai->bus_down_in_recovery = false; tomtom_codec_enable_int_port(dai, codec); (void) tomtom_codec_enable_slim_chmask(dai, true); ret = wcd9xxx_cfg_slim_sch_tx(core, &dai->wcd9xxx_ch_list, Loading @@ -5469,6 +5477,7 @@ static int tomtom_codec_enable_slimtx(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMD: ret = wcd9xxx_close_slim_sch_tx(core, &dai->wcd9xxx_ch_list, dai->grph); if (!dai->bus_down_in_recovery) ret = tomtom_codec_enable_slim_chmask(dai, false); if (ret < 0) { ret = wcd9xxx_disconnect_port(core, Loading @@ -5477,6 +5486,8 @@ static int tomtom_codec_enable_slimtx(struct snd_soc_dapm_widget *w, pr_debug("%s: Disconnect RX port, ret = %d\n", __func__, ret); } dai->bus_down_in_recovery = false; break; } return ret; Loading Loading @@ -7013,6 +7024,7 @@ static int tomtom_post_reset_cb(struct wcd9xxx *wcd9xxx) struct snd_soc_codec *codec; struct tomtom_priv *tomtom; int rco_clk_rate; int count; codec = (struct snd_soc_codec *)(wcd9xxx->ssr_priv); tomtom = snd_soc_codec_get_drvdata(codec); Loading Loading @@ -7063,6 +7075,9 @@ static int tomtom_post_reset_cb(struct wcd9xxx *wcd9xxx) if (ret) pr_err("%s: Failed to setup irq: %d\n", __func__, ret); for (count = 0; count < NUM_CODEC_DAIS; count++) tomtom->dai[count].bus_down_in_recovery = true; mutex_unlock(&codec->mutex); return ret; } Loading