All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Mediatek: MT8183: enable IIR filter
@ 2019-05-16 10:15 Shunli Wang
       [not found] ` <20190516101515.4127-1-shunli.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Shunli Wang @ 2019-05-16 10:15 UTC (permalink / raw)
  To: broonie-DgEjT+Ai2ygdnm+yROfE0A
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	srv_heupstream-NuS5LvNUpcJWk0Htik3J/w,
	garlic.tseng-NuS5LvNUpcJWk0Htik3J/w,
	jiaxin.yu-NuS5LvNUpcJWk0Htik3J/w, tzungbi-hpIqsD4AKlfQT0dZR+AlfA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	shunli.wang-NuS5LvNUpcJWk0Htik3J/w,
	kaichieh.chuang-NuS5LvNUpcJWk0Htik3J/w

This patch is to enable IIR filter when DMIC of PMIC
is enabled.

Signed-off-by: Shunli Wang <shunli.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
 sound/soc/mediatek/mt8183/mt8183-dai-adda.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/sound/soc/mediatek/mt8183/mt8183-dai-adda.c b/sound/soc/mediatek/mt8183/mt8183-dai-adda.c
index 017d7d1d9148..2b758a18c2ea 100644
--- a/sound/soc/mediatek/mt8183/mt8183-dai-adda.c
+++ b/sound/soc/mediatek/mt8183/mt8183-dai-adda.c
@@ -176,9 +176,6 @@ static int mtk_adda_ul_event(struct snd_soc_dapm_widget *w,
 	case SND_SOC_DAPM_POST_PMD:
 		/* should delayed 1/fs(smallest is 8k) = 125us before afe off */
 		usleep_range(125, 135);
-
-		/* reset dmic */
-		afe_priv->mtkaif_dmic = 0;
 		break;
 	default:
 		break;
@@ -426,6 +423,17 @@ static int mtk_dai_adda_hw_params(struct snd_pcm_substream *substream,
 
 		ul_src_con0 |= (voice_mode << 17) & (0x7 << 17);
 
+		/* enable iir */
+		ul_src_con0 |= (1 << UL_IIR_ON_TMP_CTL_SFT) &
+			       UL_IIR_ON_TMP_CTL_MASK_SFT;
+
+		/* 35Hz @ 48k */
+		regmap_write(afe->regmap, AFE_ADDA_IIR_COEF_02_01, 0x00000000);
+		regmap_write(afe->regmap, AFE_ADDA_IIR_COEF_04_03, 0x00003FB8);
+		regmap_write(afe->regmap, AFE_ADDA_IIR_COEF_06_05, 0x3FB80000);
+		regmap_write(afe->regmap, AFE_ADDA_IIR_COEF_08_07, 0x3FB80000);
+		regmap_write(afe->regmap, AFE_ADDA_IIR_COEF_10_09, 0x0000C048);
+
 		regmap_write(afe->regmap, AFE_ADDA_UL_SRC_CON0, ul_src_con0);
 
 		/* mtkaif_rxif_data_mode = 0, amic */
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: Mediatek: MT8183: enable IIR filter
       [not found] ` <20190516101515.4127-1-shunli.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
@ 2019-05-16 10:16   ` Mark Brown
  2019-05-20  7:50     ` Jiaxin Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2019-05-16 10:16 UTC (permalink / raw)
  To: Shunli Wang
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	srv_heupstream-NuS5LvNUpcJWk0Htik3J/w,
	garlic.tseng-NuS5LvNUpcJWk0Htik3J/w,
	jiaxin.yu-NuS5LvNUpcJWk0Htik3J/w, tzungbi-hpIqsD4AKlfQT0dZR+AlfA,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	kaichieh.chuang-NuS5LvNUpcJWk0Htik3J/w


[-- Attachment #1.1: Type: text/plain, Size: 227 bytes --]

On Thu, May 16, 2019 at 06:15:15PM +0800, Shunli Wang wrote:
> This patch is to enable IIR filter when DMIC of PMIC
> is enabled.

Should this not have a user control in case the user wants to avoid the
filter for some reason?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 200 bytes --]

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: Mediatek: MT8183: enable IIR filter
  2019-05-16 10:16   ` Mark Brown
@ 2019-05-20  7:50     ` Jiaxin Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Jiaxin Yu @ 2019-05-20  7:50 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, srv_heupstream, garlic.tseng, tzungbi,
	linux-mediatek, Shunli Wang, kaichieh.chuang

On Thu, 2019-05-16 at 11:16 +0100, Mark Brown wrote:
> On Thu, May 16, 2019 at 06:15:15PM +0800, Shunli Wang wrote:
> > This patch is to enable IIR filter when DMIC of PMIC
> > is enabled.
> 
> Should this not have a user control in case the user wants to avoid the
> filter for some reason?

The last commit message is incorrect,IIR filter is always required to
open for DMIC and AMIC of PMIC.So we will send V2 which correct the
commit message again.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-20  7:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 10:15 [PATCH] ASoC: Mediatek: MT8183: enable IIR filter Shunli Wang
     [not found] ` <20190516101515.4127-1-shunli.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2019-05-16 10:16   ` Mark Brown
2019-05-20  7:50     ` Jiaxin Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.