Loading asoc/codecs/bolero/bolero-cdc.c +4 −4 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. */ #include <linux/of_platform.h> Loading Loading @@ -615,6 +615,9 @@ static int bolero_ssr_enable(struct device *dev, void *data) BOLERO_MACRO_EVT_WAIT_VA_CLK_RESET, 0x0); regcache_cache_only(priv->regmap, false); mutex_lock(&priv->clk_lock); priv->dev_up = true; mutex_unlock(&priv->clk_lock); /* call ssr event for supported macros */ for (macro_idx = START_MACRO; macro_idx < MAX_MACRO; macro_idx++) { if (!priv->macro_params[macro_idx].event_handler) Loading @@ -623,9 +626,6 @@ static int bolero_ssr_enable(struct device *dev, void *data) priv->component, BOLERO_MACRO_EVT_SSR_UP, 0x0); } mutex_lock(&priv->clk_lock); priv->dev_up = true; mutex_unlock(&priv->clk_lock); bolero_cdc_notifier_call(priv, BOLERO_WCD_EVT_SSR_UP); return 0; } Loading asoc/codecs/bolero/rx-macro.c +7 −1 Original line number Diff line number Diff line Loading @@ -344,6 +344,7 @@ struct rx_macro_priv { u16 prim_int_users[INTERP_MAX]; int rx_mclk_users; int swr_clk_users; bool dapm_mclk_enable; bool reset_swr; int clsh_users; int rx_mclk_cnt; Loading Loading @@ -1152,8 +1153,13 @@ static int rx_macro_mclk_event(struct snd_soc_dapm_widget *w, rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_CLK_FREQ, &mclk_freq); ret = rx_macro_mclk_enable(rx_priv, 1, true); if (ret) rx_priv->dapm_mclk_enable = false; else rx_priv->dapm_mclk_enable = true; break; case SND_SOC_DAPM_POST_PMD: if (rx_priv->dapm_mclk_enable) ret = rx_macro_mclk_enable(rx_priv, 0, true); break; default: Loading asoc/codecs/bolero/tx-macro.c +7 −1 Original line number Diff line number Diff line Loading @@ -127,6 +127,7 @@ struct tx_macro_priv { bool dec_active[NUM_DECIMATORS]; int tx_mclk_users; int swr_clk_users; bool dapm_mclk_enable; bool reset_swr; struct clk *tx_core_clk; struct clk *tx_npl_clk; Loading Loading @@ -260,8 +261,13 @@ static int tx_macro_mclk_event(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_PRE_PMU: ret = tx_macro_mclk_enable(tx_priv, 1); if (ret) tx_priv->dapm_mclk_enable = false; else tx_priv->dapm_mclk_enable = true; break; case SND_SOC_DAPM_POST_PMD: if (tx_priv->dapm_mclk_enable) ret = tx_macro_mclk_enable(tx_priv, 0); break; default: Loading asoc/codecs/bolero/wsa-macro.c +7 −1 Original line number Diff line number Diff line Loading @@ -192,6 +192,7 @@ struct wsa_macro_priv { u16 prim_int_users[WSA_MACRO_RX1 + 1]; u16 wsa_mclk_users; u16 swr_clk_users; bool dapm_mclk_enable; bool reset_swr; unsigned int vi_feed_value; struct mutex mclk_lock; Loading Loading @@ -870,8 +871,13 @@ static int wsa_macro_mclk_event(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_PRE_PMU: ret = wsa_macro_mclk_enable(wsa_priv, 1, true); if (ret) wsa_priv->dapm_mclk_enable = false; else wsa_priv->dapm_mclk_enable = true; break; case SND_SOC_DAPM_POST_PMD: if (wsa_priv->dapm_mclk_enable) wsa_macro_mclk_enable(wsa_priv, 0, true); break; default: Loading soc/swr-mstr-ctrl.c +21 −8 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ #include <linux/kthread.h> #include <linux/bitops.h> #include <linux/clk.h> #include <linux/gpio.h> #include <linux/of_gpio.h> #include <linux/pm_runtime.h> #include <linux/of.h> #include <linux/debugfs.h> Loading Loading @@ -2168,17 +2170,28 @@ static int swrm_device_down(struct device *dev) int swrm_register_wake_irq(struct swr_mstr_ctrl *swrm) { int ret = 0; int irq, dir_apps_irq; if (!swrm->ipc_wakeup) { swrm->wake_irq = platform_get_irq_byname(swrm->pdev, "swr_wake_irq"); irq = of_get_named_gpio(swrm->dev->of_node, "qcom,swr-wakeup-irq", 0); if (gpio_is_valid(irq)) { swrm->wake_irq = gpio_to_irq(irq); if (swrm->wake_irq < 0) { dev_err(swrm->dev, "%s() error getting wake irq handle: %d\n", __func__, swrm->wake_irq); "Unable to configure irq\n"); return swrm->wake_irq; } } else { dir_apps_irq = platform_get_irq_byname(swrm->pdev, "swr_wake_irq"); if (dir_apps_irq < 0) { dev_err(swrm->dev, "TLMM connect gpio not found\n"); return -EINVAL; } swrm->wake_irq = dir_apps_irq; } ret = request_threaded_irq(swrm->wake_irq, NULL, swrm_wakeup_interrupt, IRQF_TRIGGER_HIGH | IRQF_ONESHOT, Loading Loading
asoc/codecs/bolero/bolero-cdc.c +4 −4 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. */ #include <linux/of_platform.h> Loading Loading @@ -615,6 +615,9 @@ static int bolero_ssr_enable(struct device *dev, void *data) BOLERO_MACRO_EVT_WAIT_VA_CLK_RESET, 0x0); regcache_cache_only(priv->regmap, false); mutex_lock(&priv->clk_lock); priv->dev_up = true; mutex_unlock(&priv->clk_lock); /* call ssr event for supported macros */ for (macro_idx = START_MACRO; macro_idx < MAX_MACRO; macro_idx++) { if (!priv->macro_params[macro_idx].event_handler) Loading @@ -623,9 +626,6 @@ static int bolero_ssr_enable(struct device *dev, void *data) priv->component, BOLERO_MACRO_EVT_SSR_UP, 0x0); } mutex_lock(&priv->clk_lock); priv->dev_up = true; mutex_unlock(&priv->clk_lock); bolero_cdc_notifier_call(priv, BOLERO_WCD_EVT_SSR_UP); return 0; } Loading
asoc/codecs/bolero/rx-macro.c +7 −1 Original line number Diff line number Diff line Loading @@ -344,6 +344,7 @@ struct rx_macro_priv { u16 prim_int_users[INTERP_MAX]; int rx_mclk_users; int swr_clk_users; bool dapm_mclk_enable; bool reset_swr; int clsh_users; int rx_mclk_cnt; Loading Loading @@ -1152,8 +1153,13 @@ static int rx_macro_mclk_event(struct snd_soc_dapm_widget *w, rx_priv->swr_ctrl_data[0].rx_swr_pdev, SWR_CLK_FREQ, &mclk_freq); ret = rx_macro_mclk_enable(rx_priv, 1, true); if (ret) rx_priv->dapm_mclk_enable = false; else rx_priv->dapm_mclk_enable = true; break; case SND_SOC_DAPM_POST_PMD: if (rx_priv->dapm_mclk_enable) ret = rx_macro_mclk_enable(rx_priv, 0, true); break; default: Loading
asoc/codecs/bolero/tx-macro.c +7 −1 Original line number Diff line number Diff line Loading @@ -127,6 +127,7 @@ struct tx_macro_priv { bool dec_active[NUM_DECIMATORS]; int tx_mclk_users; int swr_clk_users; bool dapm_mclk_enable; bool reset_swr; struct clk *tx_core_clk; struct clk *tx_npl_clk; Loading Loading @@ -260,8 +261,13 @@ static int tx_macro_mclk_event(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_PRE_PMU: ret = tx_macro_mclk_enable(tx_priv, 1); if (ret) tx_priv->dapm_mclk_enable = false; else tx_priv->dapm_mclk_enable = true; break; case SND_SOC_DAPM_POST_PMD: if (tx_priv->dapm_mclk_enable) ret = tx_macro_mclk_enable(tx_priv, 0); break; default: Loading
asoc/codecs/bolero/wsa-macro.c +7 −1 Original line number Diff line number Diff line Loading @@ -192,6 +192,7 @@ struct wsa_macro_priv { u16 prim_int_users[WSA_MACRO_RX1 + 1]; u16 wsa_mclk_users; u16 swr_clk_users; bool dapm_mclk_enable; bool reset_swr; unsigned int vi_feed_value; struct mutex mclk_lock; Loading Loading @@ -870,8 +871,13 @@ static int wsa_macro_mclk_event(struct snd_soc_dapm_widget *w, switch (event) { case SND_SOC_DAPM_PRE_PMU: ret = wsa_macro_mclk_enable(wsa_priv, 1, true); if (ret) wsa_priv->dapm_mclk_enable = false; else wsa_priv->dapm_mclk_enable = true; break; case SND_SOC_DAPM_POST_PMD: if (wsa_priv->dapm_mclk_enable) wsa_macro_mclk_enable(wsa_priv, 0, true); break; default: Loading
soc/swr-mstr-ctrl.c +21 −8 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ #include <linux/kthread.h> #include <linux/bitops.h> #include <linux/clk.h> #include <linux/gpio.h> #include <linux/of_gpio.h> #include <linux/pm_runtime.h> #include <linux/of.h> #include <linux/debugfs.h> Loading Loading @@ -2168,17 +2170,28 @@ static int swrm_device_down(struct device *dev) int swrm_register_wake_irq(struct swr_mstr_ctrl *swrm) { int ret = 0; int irq, dir_apps_irq; if (!swrm->ipc_wakeup) { swrm->wake_irq = platform_get_irq_byname(swrm->pdev, "swr_wake_irq"); irq = of_get_named_gpio(swrm->dev->of_node, "qcom,swr-wakeup-irq", 0); if (gpio_is_valid(irq)) { swrm->wake_irq = gpio_to_irq(irq); if (swrm->wake_irq < 0) { dev_err(swrm->dev, "%s() error getting wake irq handle: %d\n", __func__, swrm->wake_irq); "Unable to configure irq\n"); return swrm->wake_irq; } } else { dir_apps_irq = platform_get_irq_byname(swrm->pdev, "swr_wake_irq"); if (dir_apps_irq < 0) { dev_err(swrm->dev, "TLMM connect gpio not found\n"); return -EINVAL; } swrm->wake_irq = dir_apps_irq; } ret = request_threaded_irq(swrm->wake_irq, NULL, swrm_wakeup_interrupt, IRQF_TRIGGER_HIGH | IRQF_ONESHOT, Loading