summaryrefslogtreecommitdiff
path: root/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/mediatek/mt8195/mt8195-afe-pcm.c')
-rw-r--r--sound/soc/mediatek/mt8195/mt8195-afe-pcm.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
index e425f868476a..72b2c6d629b9 100644
--- a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
+++ b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
@@ -16,6 +16,7 @@
#include <linux/of_platform.h>
#include <linux/of_reserved_mem.h>
#include <linux/pm_runtime.h>
+#include <linux/reset.h>
#include "mt8195-afe-common.h"
#include "mt8195-afe-clk.h"
#include "mt8195-reg.h"
@@ -2583,8 +2584,6 @@ static bool mt8195_is_volatile_reg(struct device *dev, unsigned int reg)
case AFE_IRQ3_CON_MON:
case AFE_IRQ_MCU_MON2:
case ADSP_IRQ_STATUS:
- case AFE_APLL_TUNER_CFG:
- case AFE_APLL_TUNER_CFG1:
case AUDIO_TOP_STA0:
case AUDIO_TOP_STA1:
case AFE_GAIN1_CUR:
@@ -2623,7 +2622,6 @@ static bool mt8195_is_volatile_reg(struct device *dev, unsigned int reg)
case SPDIFIN_USERCODE10:
case SPDIFIN_USERCODE11:
case SPDIFIN_USERCODE12:
- case AFE_SPDIFIN_APLL_TUNER_CFG:
case AFE_LINEIN_APLL_TUNER_MON:
case AFE_EARC_APLL_TUNER_MON:
case AFE_CM0_MON:
@@ -3059,6 +3057,7 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
struct mtk_base_afe *afe;
struct mt8195_afe_private *afe_priv;
struct device *dev = &pdev->dev;
+ struct reset_control *rstc;
int i, irq_id, ret;
struct snd_soc_component *component;
@@ -3095,6 +3094,20 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
return ret;
}
+ /* reset controller to reset audio regs before regmap cache */
+ rstc = devm_reset_control_get_exclusive(dev, "audiosys");
+ if (IS_ERR(rstc)) {
+ ret = PTR_ERR(rstc);
+ dev_err(dev, "could not get audiosys reset:%d\n", ret);
+ return ret;
+ }
+
+ ret = reset_control_reset(rstc);
+ if (ret) {
+ dev_err(dev, "failed to trigger audio reset:%d\n", ret);
+ return ret;
+ }
+
spin_lock_init(&afe_priv->afe_ctrl_lock);
mutex_init(&afe->irq_alloc_lock);
@@ -3125,10 +3138,8 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
/* request irq */
irq_id = platform_get_irq(pdev, 0);
- if (irq_id < 0) {
- dev_err(dev, "%s no irq found\n", dev->of_node->name);
+ if (irq_id < 0)
return -ENXIO;
- }
ret = devm_request_irq(dev, irq_id, mt8195_afe_irq_handler,
IRQF_TRIGGER_NONE, "asys-isr", (void *)afe);