Revert "soc: mstr-ctrl: Retain Audio_HM voting until suspend"
This reverts commitd02c7efb35
. and commit61f235e5bd
to avoid AOP related issues. Change-Id: I0b8b44bc5cca6bef6bc18c228f08a9c585c79c1c Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
This commit is contained in:
@@ -1094,7 +1094,7 @@ EXPORT_SYMBOL(bolero_tx_mclk_enable);
|
|||||||
* Returns 0 on success or -EINVAL on error.
|
* Returns 0 on success or -EINVAL on error.
|
||||||
*/
|
*/
|
||||||
int bolero_register_event_listener(struct snd_soc_component *component,
|
int bolero_register_event_listener(struct snd_soc_component *component,
|
||||||
bool enable, bool is_dmic_sva)
|
bool enable)
|
||||||
{
|
{
|
||||||
struct bolero_priv *priv = NULL;
|
struct bolero_priv *priv = NULL;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@@ -1113,8 +1113,7 @@ int bolero_register_event_listener(struct snd_soc_component *component,
|
|||||||
|
|
||||||
if (priv->macro_params[TX_MACRO].reg_evt_listener)
|
if (priv->macro_params[TX_MACRO].reg_evt_listener)
|
||||||
ret = priv->macro_params[TX_MACRO].reg_evt_listener(component,
|
ret = priv->macro_params[TX_MACRO].reg_evt_listener(component,
|
||||||
enable,
|
enable);
|
||||||
is_dmic_sva);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@@ -77,8 +77,7 @@ struct macro_ops {
|
|||||||
u32 size, void *data);
|
u32 size, void *data);
|
||||||
int (*clk_div_get)(struct snd_soc_component *component);
|
int (*clk_div_get)(struct snd_soc_component *component);
|
||||||
int (*clk_switch)(struct snd_soc_component *component, int clk_src);
|
int (*clk_switch)(struct snd_soc_component *component, int clk_src);
|
||||||
int (*reg_evt_listener)(struct snd_soc_component *component,
|
int (*reg_evt_listener)(struct snd_soc_component *component, bool en);
|
||||||
bool en, bool is_dmic_sva);
|
|
||||||
int (*clk_enable)(struct snd_soc_component *c, bool en);
|
int (*clk_enable)(struct snd_soc_component *c, bool en);
|
||||||
char __iomem *io_base;
|
char __iomem *io_base;
|
||||||
u16 clk_id_req;
|
u16 clk_id_req;
|
||||||
@@ -105,7 +104,7 @@ int bolero_runtime_suspend(struct device *dev);
|
|||||||
int bolero_set_port_map(struct snd_soc_component *component, u32 size, void *data);
|
int bolero_set_port_map(struct snd_soc_component *component, u32 size, void *data);
|
||||||
int bolero_tx_clk_switch(struct snd_soc_component *component, int clk_src);
|
int bolero_tx_clk_switch(struct snd_soc_component *component, int clk_src);
|
||||||
int bolero_register_event_listener(struct snd_soc_component *component,
|
int bolero_register_event_listener(struct snd_soc_component *component,
|
||||||
bool enable, bool is_dmic_sva);
|
bool enable);
|
||||||
void bolero_wsa_pa_on(struct device *dev);
|
void bolero_wsa_pa_on(struct device *dev);
|
||||||
bool bolero_check_core_votes(struct device *dev);
|
bool bolero_check_core_votes(struct device *dev);
|
||||||
int bolero_tx_mclk_enable(struct snd_soc_component *c, bool enable);
|
int bolero_tx_mclk_enable(struct snd_soc_component *c, bool enable);
|
||||||
@@ -179,7 +178,7 @@ static inline int bolero_tx_clk_switch(struct snd_soc_component *component,
|
|||||||
|
|
||||||
static inline int bolero_register_event_listener(
|
static inline int bolero_register_event_listener(
|
||||||
struct snd_soc_component *component,
|
struct snd_soc_component *component,
|
||||||
bool enable, bool is_dmic_sva)
|
bool enable)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -378,7 +378,6 @@ struct rx_swr_ctrl_platform_data {
|
|||||||
void *data),
|
void *data),
|
||||||
void *swrm_handle,
|
void *swrm_handle,
|
||||||
int action);
|
int action);
|
||||||
int (*pinctrl_setup)(void *handle, bool enable);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@@ -4105,7 +4104,6 @@ static int rx_macro_probe(struct platform_device *pdev)
|
|||||||
rx_priv->swr_plat_data.clk = rx_swrm_clock;
|
rx_priv->swr_plat_data.clk = rx_swrm_clock;
|
||||||
rx_priv->swr_plat_data.core_vote = rx_macro_core_vote;
|
rx_priv->swr_plat_data.core_vote = rx_macro_core_vote;
|
||||||
rx_priv->swr_plat_data.handle_irq = NULL;
|
rx_priv->swr_plat_data.handle_irq = NULL;
|
||||||
rx_priv->swr_plat_data.pinctrl_setup = NULL;
|
|
||||||
|
|
||||||
ret = of_property_read_u8_array(pdev->dev.of_node,
|
ret = of_property_read_u8_array(pdev->dev.of_node,
|
||||||
"qcom,rx-bcl-pmic-params", bcl_pmic_params,
|
"qcom,rx-bcl-pmic-params", bcl_pmic_params,
|
||||||
|
@@ -81,7 +81,6 @@ struct tx_macro_swr_ctrl_platform_data {
|
|||||||
void *data),
|
void *data),
|
||||||
void *swrm_handle,
|
void *swrm_handle,
|
||||||
int action);
|
int action);
|
||||||
int (*pinctrl_setup)(void *handle, bool enable);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@@ -2497,30 +2496,12 @@ static const struct snd_kcontrol_new tx_macro_snd_controls[] = {
|
|||||||
tx_macro_get_bcs, tx_macro_set_bcs),
|
tx_macro_get_bcs, tx_macro_set_bcs),
|
||||||
};
|
};
|
||||||
|
|
||||||
static int tx_macro_pinctrl_setup(void *handle, bool enable)
|
|
||||||
{
|
|
||||||
struct tx_macro_priv *tx_priv = (struct tx_macro_priv *) handle;
|
|
||||||
|
|
||||||
if (tx_priv == NULL) {
|
|
||||||
pr_err("%s: tx priv data is NULL\n", __func__);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
if (enable)
|
|
||||||
msm_cdc_pinctrl_set_wakeup_capable(
|
|
||||||
tx_priv->tx_swr_gpio_p, true);
|
|
||||||
else
|
|
||||||
msm_cdc_pinctrl_set_wakeup_capable(
|
|
||||||
tx_priv->tx_swr_gpio_p, false);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int tx_macro_register_event_listener(struct snd_soc_component *component,
|
static int tx_macro_register_event_listener(struct snd_soc_component *component,
|
||||||
bool enable, bool is_dmic_sva)
|
bool enable)
|
||||||
{
|
{
|
||||||
struct device *tx_dev = NULL;
|
struct device *tx_dev = NULL;
|
||||||
struct tx_macro_priv *tx_priv = NULL;
|
struct tx_macro_priv *tx_priv = NULL;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
u32 dmic_sva = is_dmic_sva;
|
|
||||||
|
|
||||||
if (!component)
|
if (!component)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -2542,17 +2523,15 @@ static int tx_macro_register_event_listener(struct snd_soc_component *component,
|
|||||||
if (enable) {
|
if (enable) {
|
||||||
ret = swrm_wcd_notify(
|
ret = swrm_wcd_notify(
|
||||||
tx_priv->swr_ctrl_data[0].tx_swr_pdev,
|
tx_priv->swr_ctrl_data[0].tx_swr_pdev,
|
||||||
SWR_REGISTER_WAKEUP, &dmic_sva);
|
SWR_REGISTER_WAKEUP, NULL);
|
||||||
msm_cdc_pinctrl_set_wakeup_capable(
|
msm_cdc_pinctrl_set_wakeup_capable(
|
||||||
tx_priv->tx_swr_gpio_p, false);
|
tx_priv->tx_swr_gpio_p, false);
|
||||||
} else {
|
} else {
|
||||||
/* while teardown we can reset the flag */
|
|
||||||
dmic_sva = 0;
|
|
||||||
msm_cdc_pinctrl_set_wakeup_capable(
|
msm_cdc_pinctrl_set_wakeup_capable(
|
||||||
tx_priv->tx_swr_gpio_p, true);
|
tx_priv->tx_swr_gpio_p, true);
|
||||||
ret = swrm_wcd_notify(
|
ret = swrm_wcd_notify(
|
||||||
tx_priv->swr_ctrl_data[0].tx_swr_pdev,
|
tx_priv->swr_ctrl_data[0].tx_swr_pdev,
|
||||||
SWR_DEREGISTER_WAKEUP, &dmic_sva);
|
SWR_DEREGISTER_WAKEUP, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3343,7 +3322,6 @@ static int tx_macro_probe(struct platform_device *pdev)
|
|||||||
tx_priv->swr_plat_data.clk = tx_macro_swrm_clock;
|
tx_priv->swr_plat_data.clk = tx_macro_swrm_clock;
|
||||||
tx_priv->swr_plat_data.core_vote = tx_macro_core_vote;
|
tx_priv->swr_plat_data.core_vote = tx_macro_core_vote;
|
||||||
tx_priv->swr_plat_data.handle_irq = NULL;
|
tx_priv->swr_plat_data.handle_irq = NULL;
|
||||||
tx_priv->swr_plat_data.pinctrl_setup = tx_macro_pinctrl_setup;
|
|
||||||
mutex_init(&tx_priv->swr_clk_lock);
|
mutex_init(&tx_priv->swr_clk_lock);
|
||||||
}
|
}
|
||||||
tx_priv->is_used_tx_swr_gpio = is_used_tx_swr_gpio;
|
tx_priv->is_used_tx_swr_gpio = is_used_tx_swr_gpio;
|
||||||
|
@@ -130,7 +130,6 @@ struct va_macro_swr_ctrl_platform_data {
|
|||||||
void *data),
|
void *data),
|
||||||
void *swrm_handle,
|
void *swrm_handle,
|
||||||
int action);
|
int action);
|
||||||
int (*pinctrl_setup)(void *handle, bool enable);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct va_macro_priv {
|
struct va_macro_priv {
|
||||||
@@ -460,14 +459,14 @@ static int va_macro_swr_pwr_event(struct snd_soc_dapm_widget *w,
|
|||||||
dev_dbg(va_dev, "%s: clock switch failed\n",
|
dev_dbg(va_dev, "%s: clock switch failed\n",
|
||||||
__func__);
|
__func__);
|
||||||
if (va_priv->lpi_enable) {
|
if (va_priv->lpi_enable) {
|
||||||
bolero_register_event_listener(component, true, false);
|
bolero_register_event_listener(component, true);
|
||||||
va_priv->register_event_listener = true;
|
va_priv->register_event_listener = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SND_SOC_DAPM_POST_PMD:
|
case SND_SOC_DAPM_POST_PMD:
|
||||||
if (va_priv->register_event_listener) {
|
if (va_priv->register_event_listener) {
|
||||||
va_priv->register_event_listener = false;
|
va_priv->register_event_listener = false;
|
||||||
bolero_register_event_listener(component, false, false);
|
bolero_register_event_listener(component, false);
|
||||||
}
|
}
|
||||||
if (bolero_tx_clk_switch(component, CLK_SRC_TX_RCG))
|
if (bolero_tx_clk_switch(component, CLK_SRC_TX_RCG))
|
||||||
dev_dbg(va_dev, "%s: clock switch failed\n",__func__);
|
dev_dbg(va_dev, "%s: clock switch failed\n",__func__);
|
||||||
@@ -483,45 +482,6 @@ static int va_macro_swr_pwr_event(struct snd_soc_dapm_widget *w,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int va_macro_swr_intr_event(struct snd_soc_dapm_widget *w,
|
|
||||||
struct snd_kcontrol *kcontrol, int event)
|
|
||||||
{
|
|
||||||
struct snd_soc_component *component =
|
|
||||||
snd_soc_dapm_to_component(w->dapm);
|
|
||||||
int ret = 0;
|
|
||||||
struct device *va_dev = NULL;
|
|
||||||
struct va_macro_priv *va_priv = NULL;
|
|
||||||
|
|
||||||
if (!va_macro_get_data(component, &va_dev, &va_priv, __func__))
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
dev_dbg(va_dev, "%s: event = %d, lpi_enable = %d\n",
|
|
||||||
__func__, event, va_priv->lpi_enable);
|
|
||||||
|
|
||||||
if (!va_priv->lpi_enable)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case SND_SOC_DAPM_PRE_PMU:
|
|
||||||
if (va_priv->lpi_enable) {
|
|
||||||
bolero_register_event_listener(component, true, true);
|
|
||||||
va_priv->register_event_listener = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SND_SOC_DAPM_POST_PMD:
|
|
||||||
if (va_priv->register_event_listener) {
|
|
||||||
va_priv->register_event_listener = false;
|
|
||||||
bolero_register_event_listener(component, false, true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
dev_err(va_priv->dev,
|
|
||||||
"%s: invalid DAPM event %d\n", __func__, event);
|
|
||||||
ret = -EINVAL;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int va_macro_tx_swr_clk_event_v2(struct snd_soc_dapm_widget *w,
|
static int va_macro_tx_swr_clk_event_v2(struct snd_soc_dapm_widget *w,
|
||||||
struct snd_kcontrol *kcontrol, int event)
|
struct snd_kcontrol *kcontrol, int event)
|
||||||
{
|
{
|
||||||
@@ -2029,10 +1989,6 @@ static const struct snd_soc_dapm_widget va_macro_dapm_widgets_v3[] = {
|
|||||||
SND_SOC_DAPM_SUPPLY_S("VA_SWR_PWR", -1, SND_SOC_NOPM, 0, 0,
|
SND_SOC_DAPM_SUPPLY_S("VA_SWR_PWR", -1, SND_SOC_NOPM, 0, 0,
|
||||||
va_macro_swr_pwr_event,
|
va_macro_swr_pwr_event,
|
||||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
|
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
|
||||||
|
|
||||||
SND_SOC_DAPM_SUPPLY_S("VA_SWR_INTR", 0, SND_SOC_NOPM, 0, 0,
|
|
||||||
va_macro_swr_intr_event,
|
|
||||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_soc_dapm_widget va_macro_dapm_widgets[] = {
|
static const struct snd_soc_dapm_widget va_macro_dapm_widgets[] = {
|
||||||
@@ -2177,10 +2133,6 @@ static const struct snd_soc_dapm_widget va_macro_dapm_widgets[] = {
|
|||||||
SND_SOC_DAPM_SUPPLY_S("VA_MCLK", -1, SND_SOC_NOPM, 0, 0,
|
SND_SOC_DAPM_SUPPLY_S("VA_MCLK", -1, SND_SOC_NOPM, 0, 0,
|
||||||
va_macro_mclk_event,
|
va_macro_mclk_event,
|
||||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
|
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
|
||||||
|
|
||||||
SND_SOC_DAPM_SUPPLY_S("VA_SWR_INTR", 0, SND_SOC_NOPM, 0, 0,
|
|
||||||
va_macro_swr_intr_event,
|
|
||||||
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_soc_dapm_widget va_macro_wod_dapm_widgets[] = {
|
static const struct snd_soc_dapm_widget va_macro_wod_dapm_widgets[] = {
|
||||||
@@ -2327,15 +2279,6 @@ static const struct snd_soc_dapm_route va_audio_map_v3[] = {
|
|||||||
{"VA SMIC MUX3", "SWR_MIC9", "VA SWR_INPUT"},
|
{"VA SMIC MUX3", "SWR_MIC9", "VA SWR_INPUT"},
|
||||||
{"VA SMIC MUX3", "SWR_MIC10", "VA SWR_INPUT"},
|
{"VA SMIC MUX3", "SWR_MIC10", "VA SWR_INPUT"},
|
||||||
{"VA SMIC MUX3", "SWR_MIC11", "VA SWR_INPUT"},
|
{"VA SMIC MUX3", "SWR_MIC11", "VA SWR_INPUT"},
|
||||||
|
|
||||||
{"VA DMIC0", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC1", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC2", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC3", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC4", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC5", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC6", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC7", NULL, "VA_SWR_INTR"},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct snd_soc_dapm_route va_audio_map_v2[] = {
|
static const struct snd_soc_dapm_route va_audio_map_v2[] = {
|
||||||
@@ -2572,15 +2515,6 @@ static const struct snd_soc_dapm_route va_audio_map[] = {
|
|||||||
{"VA SMIC MUX7", "SWR_DMIC6", "VA SWR_MIC6"},
|
{"VA SMIC MUX7", "SWR_DMIC6", "VA SWR_MIC6"},
|
||||||
{"VA SMIC MUX7", "SWR_DMIC7", "VA SWR_MIC7"},
|
{"VA SMIC MUX7", "SWR_DMIC7", "VA SWR_MIC7"},
|
||||||
|
|
||||||
{"VA DMIC0", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC1", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC2", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC3", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC4", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC5", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC6", NULL, "VA_SWR_INTR"},
|
|
||||||
{"VA DMIC7", NULL, "VA_SWR_INTR"},
|
|
||||||
|
|
||||||
{"VA SWR_ADC0", NULL, "VA_SWR_PWR"},
|
{"VA SWR_ADC0", NULL, "VA_SWR_PWR"},
|
||||||
{"VA SWR_ADC1", NULL, "VA_SWR_PWR"},
|
{"VA SWR_ADC1", NULL, "VA_SWR_PWR"},
|
||||||
{"VA SWR_ADC2", NULL, "VA_SWR_PWR"},
|
{"VA SWR_ADC2", NULL, "VA_SWR_PWR"},
|
||||||
@@ -3230,7 +3164,6 @@ static int va_macro_probe(struct platform_device *pdev)
|
|||||||
va_priv->swr_plat_data.clk = va_macro_swrm_clock;
|
va_priv->swr_plat_data.clk = va_macro_swrm_clock;
|
||||||
va_priv->swr_plat_data.core_vote = va_macro_core_vote;
|
va_priv->swr_plat_data.core_vote = va_macro_core_vote;
|
||||||
va_priv->swr_plat_data.handle_irq = NULL;
|
va_priv->swr_plat_data.handle_irq = NULL;
|
||||||
va_priv->swr_plat_data.pinctrl_setup = NULL;
|
|
||||||
mutex_init(&va_priv->swr_clk_lock);
|
mutex_init(&va_priv->swr_clk_lock);
|
||||||
}
|
}
|
||||||
va_priv->is_used_va_swr_gpio = is_used_va_swr_gpio;
|
va_priv->is_used_va_swr_gpio = is_used_va_swr_gpio;
|
||||||
|
@@ -166,7 +166,6 @@ struct wsa_macro_swr_ctrl_platform_data {
|
|||||||
void *data),
|
void *data),
|
||||||
void *swrm_handle,
|
void *swrm_handle,
|
||||||
int action);
|
int action);
|
||||||
int (*pinctrl_setup)(void *handle, bool enable);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wsa_macro_bcl_pmic_params {
|
struct wsa_macro_bcl_pmic_params {
|
||||||
@@ -3197,7 +3196,6 @@ static int wsa_macro_probe(struct platform_device *pdev)
|
|||||||
wsa_priv->swr_plat_data.clk = wsa_swrm_clock;
|
wsa_priv->swr_plat_data.clk = wsa_swrm_clock;
|
||||||
wsa_priv->swr_plat_data.core_vote = wsa_macro_core_vote;
|
wsa_priv->swr_plat_data.core_vote = wsa_macro_core_vote;
|
||||||
wsa_priv->swr_plat_data.handle_irq = NULL;
|
wsa_priv->swr_plat_data.handle_irq = NULL;
|
||||||
wsa_priv->swr_plat_data.pinctrl_setup = NULL;
|
|
||||||
|
|
||||||
ret = of_property_read_u32(pdev->dev.of_node, "qcom,default-clk-id",
|
ret = of_property_read_u32(pdev->dev.of_node, "qcom,default-clk-id",
|
||||||
&default_clk_id);
|
&default_clk_id);
|
||||||
|
@@ -2481,8 +2481,6 @@ static int swrm_probe(struct platform_device *pdev)
|
|||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto err_pdata_fail;
|
goto err_pdata_fail;
|
||||||
}
|
}
|
||||||
swrm->pinctrl_setup = pdata->pinctrl_setup;
|
|
||||||
|
|
||||||
if (of_property_read_u32(pdev->dev.of_node,
|
if (of_property_read_u32(pdev->dev.of_node,
|
||||||
"qcom,swr-clock-stop-mode0",
|
"qcom,swr-clock-stop-mode0",
|
||||||
&swrm->clk_stop_mode0_supp)) {
|
&swrm->clk_stop_mode0_supp)) {
|
||||||
@@ -2815,6 +2813,7 @@ static int swrm_runtime_resume(struct device *dev)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
bool swrm_clk_req_err = false;
|
bool swrm_clk_req_err = false;
|
||||||
bool hw_core_err = false;
|
bool hw_core_err = false;
|
||||||
|
bool aud_core_err = false;
|
||||||
struct swr_master *mstr = &swrm->master;
|
struct swr_master *mstr = &swrm->master;
|
||||||
struct swr_device *swr_dev;
|
struct swr_device *swr_dev;
|
||||||
u32 temp = 0;
|
u32 temp = 0;
|
||||||
@@ -2833,7 +2832,7 @@ static int swrm_runtime_resume(struct device *dev)
|
|||||||
if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true)) {
|
if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true)) {
|
||||||
dev_err(dev, "%s:lpass audio hw enable failed\n",
|
dev_err(dev, "%s:lpass audio hw enable failed\n",
|
||||||
__func__);
|
__func__);
|
||||||
swrm->aud_core_err = true;
|
aud_core_err = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((swrm->state == SWR_MSTR_DOWN) ||
|
if ((swrm->state == SWR_MSTR_DOWN) ||
|
||||||
@@ -2852,9 +2851,6 @@ static int swrm_runtime_resume(struct device *dev)
|
|||||||
irq_get_irq_data(swrm->wake_irq)))
|
irq_get_irq_data(swrm->wake_irq)))
|
||||||
disable_irq_nosync(swrm->wake_irq);
|
disable_irq_nosync(swrm->wake_irq);
|
||||||
mutex_unlock(&swrm->irq_lock);
|
mutex_unlock(&swrm->irq_lock);
|
||||||
if (swrm->dmic_sva && swrm->pinctrl_setup)
|
|
||||||
swrm->pinctrl_setup(swrm->handle,
|
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
if (swrm->ipc_wakeup)
|
if (swrm->ipc_wakeup)
|
||||||
msm_aud_evt_blocking_notifier_call_chain(
|
msm_aud_evt_blocking_notifier_call_chain(
|
||||||
@@ -2928,7 +2924,7 @@ static int swrm_runtime_resume(struct device *dev)
|
|||||||
swrm->state = SWR_MSTR_UP;
|
swrm->state = SWR_MSTR_UP;
|
||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
if (ret && !swrm->aud_core_err)
|
if (!aud_core_err)
|
||||||
swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, false);
|
swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, false);
|
||||||
if (!hw_core_err)
|
if (!hw_core_err)
|
||||||
swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
|
swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
|
||||||
@@ -2953,6 +2949,7 @@ static int swrm_runtime_suspend(struct device *dev)
|
|||||||
struct swr_mstr_ctrl *swrm = platform_get_drvdata(pdev);
|
struct swr_mstr_ctrl *swrm = platform_get_drvdata(pdev);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
bool hw_core_err = false;
|
bool hw_core_err = false;
|
||||||
|
bool aud_core_err = false;
|
||||||
struct swr_master *mstr = &swrm->master;
|
struct swr_master *mstr = &swrm->master;
|
||||||
struct swr_device *swr_dev;
|
struct swr_device *swr_dev;
|
||||||
int current_state = 0;
|
int current_state = 0;
|
||||||
@@ -2971,6 +2968,11 @@ static int swrm_runtime_suspend(struct device *dev)
|
|||||||
__func__);
|
__func__);
|
||||||
hw_core_err = true;
|
hw_core_err = true;
|
||||||
}
|
}
|
||||||
|
if (swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, true)) {
|
||||||
|
dev_err(dev, "%s:lpass audio hw enable failed\n",
|
||||||
|
__func__);
|
||||||
|
aud_core_err = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ((current_state == SWR_MSTR_UP) ||
|
if ((current_state == SWR_MSTR_UP) ||
|
||||||
(current_state == SWR_MSTR_SSR)) {
|
(current_state == SWR_MSTR_SSR)) {
|
||||||
@@ -3039,8 +3041,6 @@ static int swrm_runtime_suspend(struct device *dev)
|
|||||||
|
|
||||||
if (swrm->clk_stop_mode0_supp) {
|
if (swrm->clk_stop_mode0_supp) {
|
||||||
if (swrm->wake_irq > 0) {
|
if (swrm->wake_irq > 0) {
|
||||||
if (swrm->dmic_sva && swrm->pinctrl_setup)
|
|
||||||
swrm->pinctrl_setup(swrm->handle, true);
|
|
||||||
enable_irq(swrm->wake_irq);
|
enable_irq(swrm->wake_irq);
|
||||||
} else if (swrm->ipc_wakeup) {
|
} else if (swrm->ipc_wakeup) {
|
||||||
msm_aud_evt_blocking_notifier_call_chain(
|
msm_aud_evt_blocking_notifier_call_chain(
|
||||||
@@ -3054,11 +3054,10 @@ static int swrm_runtime_suspend(struct device *dev)
|
|||||||
if (current_state != SWR_MSTR_SSR)
|
if (current_state != SWR_MSTR_SSR)
|
||||||
swrm->state = SWR_MSTR_DOWN;
|
swrm->state = SWR_MSTR_DOWN;
|
||||||
exit:
|
exit:
|
||||||
if (!swrm->aud_core_err)
|
if (!aud_core_err)
|
||||||
swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, false);
|
swrm_request_hw_vote(swrm, LPASS_AUDIO_CORE, false);
|
||||||
if (!hw_core_err)
|
if (!hw_core_err)
|
||||||
swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
|
swrm_request_hw_vote(swrm, LPASS_HW_CORE, false);
|
||||||
swrm->aud_core_err = false;
|
|
||||||
mutex_unlock(&swrm->reslock);
|
mutex_unlock(&swrm->reslock);
|
||||||
trace_printk("%s: pm_runtime: suspend done state: %d\n",
|
trace_printk("%s: pm_runtime: suspend done state: %d\n",
|
||||||
__func__, swrm->state);
|
__func__, swrm->state);
|
||||||
@@ -3394,12 +3393,10 @@ int swrm_wcd_notify(struct platform_device *pdev, u32 id, void *data)
|
|||||||
case SWR_REGISTER_WAKEUP:
|
case SWR_REGISTER_WAKEUP:
|
||||||
msm_aud_evt_blocking_notifier_call_chain(
|
msm_aud_evt_blocking_notifier_call_chain(
|
||||||
SWR_WAKE_IRQ_REGISTER, (void *)swrm);
|
SWR_WAKE_IRQ_REGISTER, (void *)swrm);
|
||||||
swrm->dmic_sva = *(u32 *)data;
|
|
||||||
break;
|
break;
|
||||||
case SWR_DEREGISTER_WAKEUP:
|
case SWR_DEREGISTER_WAKEUP:
|
||||||
msm_aud_evt_blocking_notifier_call_chain(
|
msm_aud_evt_blocking_notifier_call_chain(
|
||||||
SWR_WAKE_IRQ_DEREGISTER, (void *)swrm);
|
SWR_WAKE_IRQ_DEREGISTER, (void *)swrm);
|
||||||
swrm->dmic_sva = 0;
|
|
||||||
break;
|
break;
|
||||||
case SWR_SET_PORT_MAP:
|
case SWR_SET_PORT_MAP:
|
||||||
if (!data) {
|
if (!data) {
|
||||||
|
@@ -115,7 +115,6 @@ struct swr_ctrl_platform_data {
|
|||||||
int (*core_vote)(void *handle, bool enable);
|
int (*core_vote)(void *handle, bool enable);
|
||||||
int (*reg_irq)(void *handle, irqreturn_t(*irq_handler)(int irq,
|
int (*reg_irq)(void *handle, irqreturn_t(*irq_handler)(int irq,
|
||||||
void *data), void *swr_handle, int type);
|
void *data), void *swr_handle, int type);
|
||||||
int (*pinctrl_setup)(void *handle, bool enable);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct swr_mstr_ctrl {
|
struct swr_mstr_ctrl {
|
||||||
@@ -149,7 +148,6 @@ struct swr_mstr_ctrl {
|
|||||||
int (*core_vote)(void *handle, bool enable);
|
int (*core_vote)(void *handle, bool enable);
|
||||||
int (*reg_irq)(void *handle, irqreturn_t(*irq_handler)(int irq,
|
int (*reg_irq)(void *handle, irqreturn_t(*irq_handler)(int irq,
|
||||||
void *data), void *swr_handle, int type);
|
void *data), void *swr_handle, int type);
|
||||||
int (*pinctrl_setup)(void *handle, bool enable);
|
|
||||||
int irq;
|
int irq;
|
||||||
int wake_irq;
|
int wake_irq;
|
||||||
int version;
|
int version;
|
||||||
@@ -175,10 +173,8 @@ struct swr_mstr_ctrl {
|
|||||||
u32 clk_stop_mode0_supp;
|
u32 clk_stop_mode0_supp;
|
||||||
struct work_struct wakeup_work;
|
struct work_struct wakeup_work;
|
||||||
u32 ipc_wakeup;
|
u32 ipc_wakeup;
|
||||||
u32 dmic_sva;
|
|
||||||
bool dev_up;
|
bool dev_up;
|
||||||
bool ipc_wakeup_triggered;
|
bool ipc_wakeup_triggered;
|
||||||
bool aud_core_err;
|
|
||||||
bool req_clk_switch;
|
bool req_clk_switch;
|
||||||
struct pm_qos_request pm_qos_req;
|
struct pm_qos_request pm_qos_req;
|
||||||
enum swrm_pm_state pm_state;
|
enum swrm_pm_state pm_state;
|
||||||
|
Reference in New Issue
Block a user