All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: nau8825: disable sinc filter for high THD of ADC
@ 2016-12-02  1:48 John Hsu
  2016-12-05 11:50 ` Mark Brown
  2016-12-06 14:35 ` Applied "ASoC: nau8825: disable sinc filter for high THD of ADC" to the asoc tree Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: John Hsu @ 2016-12-02  1:48 UTC (permalink / raw)
  To: broonie
  Cc: alsa-devel, anatol.pomozov, YHCHuang, WTLI, John Hsu, lgirdwood,
	benzh, CTLIN0, mhkuo, yong.zhi

This bit will enable 4th order SINC filter.  
=1, filter will enable;  but it consumes higher power.
=0, the sinc filter is disable, and it should always keep 0 value to
get high THD.

Therefor, disable the filter when codec initiation for better
performance when recording.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
---
 sound/soc/codecs/nau8825.c | 3 ++-
 sound/soc/codecs/nau8825.h | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index 2b89569..efe3a44 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -1846,7 +1846,8 @@ static void nau8825_init_regs(struct nau8825 *nau8825)
 	 * (audible hiss). Set it to something better.
 	 */
 	regmap_update_bits(regmap, NAU8825_REG_ADC_RATE,
-		NAU8825_ADC_SYNC_DOWN_MASK, NAU8825_ADC_SYNC_DOWN_64);
+		NAU8825_ADC_SYNC_DOWN_MASK | NAU8825_ADC_SINC4_EN,
+		NAU8825_ADC_SYNC_DOWN_64);
 	regmap_update_bits(regmap, NAU8825_REG_DAC_CTRL1,
 		NAU8825_DAC_OVERSAMPLE_MASK, NAU8825_DAC_OVERSAMPLE_64);
 	/* Disable DACR/L power */
diff --git a/sound/soc/codecs/nau8825.h b/sound/soc/codecs/nau8825.h
index 0672a25..5d1704e 100644
--- a/sound/soc/codecs/nau8825.h
+++ b/sound/soc/codecs/nau8825.h
@@ -269,6 +269,8 @@
 #define NAU8825_BIQ_PATH_DAC   (1 << NAU8825_BIQ_PATH_SFT)
 
 /* ADC_RATE (0x2b) */
+#define NAU8825_ADC_SINC4_SFT		4
+#define NAU8825_ADC_SINC4_EN		(1 << NAU8825_ADC_SINC4_SFT)
 #define NAU8825_ADC_SYNC_DOWN_SFT	0
 #define NAU8825_ADC_SYNC_DOWN_MASK	0x3
 #define NAU8825_ADC_SYNC_DOWN_32	0
-- 
2.6.4

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

* Re: [PATCH] ASoC: nau8825: disable sinc filter for high THD of ADC
  2016-12-02  1:48 [PATCH] ASoC: nau8825: disable sinc filter for high THD of ADC John Hsu
@ 2016-12-05 11:50 ` Mark Brown
  2016-12-06  2:07   ` John Hsu
  2016-12-06 14:35 ` Applied "ASoC: nau8825: disable sinc filter for high THD of ADC" to the asoc tree Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2016-12-05 11:50 UTC (permalink / raw)
  To: John Hsu
  Cc: alsa-devel, anatol.pomozov, YHCHuang, WTLI, lgirdwood, benzh,
	CTLIN0, mhkuo, yong.zhi


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

On Fri, Dec 02, 2016 at 09:48:58AM +0800, John Hsu wrote:

> This bit will enable 4th order SINC filter.  
> =1, filter will enable;  but it consumes higher power.
> =0, the sinc filter is disable, and it should always keep 0 value to
> get high THD.

> Therefor, disable the filter when codec initiation for better
> performance when recording.

This looks like something that users should be able to control at
runtime - while some users are going to prefer lower power there will
most likely also be some users who prefer the better performance (or
perhaps even users who switch depending on if they're running on battery
or something).

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

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



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

* Re: [PATCH] ASoC: nau8825: disable sinc filter for high THD of ADC
  2016-12-05 11:50 ` Mark Brown
@ 2016-12-06  2:07   ` John Hsu
  0 siblings, 0 replies; 4+ messages in thread
From: John Hsu @ 2016-12-06  2:07 UTC (permalink / raw)
  To: Mark Brown
  Cc: AP MS30 Linux ALSA, anatol.pomozov@gmail.com, AC30 YHChuang,
	AC30 WTLi, lgirdwood@gmail.com, benzh@chromium.org, AC30 CTLin0,
	MS40 MHKuo, yong.zhi@intel.com

Hi,
On 12/5/2016 7:50 PM, Mark Brown wrote:
> On Fri, Dec 02, 2016 at 09:48:58AM +0800, John Hsu wrote:
>
>   
>> This bit will enable 4th order SINC filter.  
>> =1, filter will enable;  but it consumes higher power.
>> =0, the sinc filter is disable, and it should always keep 0 value to
>> get high THD.
>>     
>
>   
>> Therefor, disable the filter when codec initiation for better
>> performance when recording.
>>     
>
> This looks like something that users should be able to control at
> runtime - while some users are going to prefer lower power there will
> most likely also be some users who prefer the better performance (or
> perhaps even users who switch depending on if they're running on battery
> or something).
>   

The function is not suitable for the voice application and easy to
make distortion. Therefore, we want to disalbe it as default to
get a high signal to distortion ratio. Yes, I agree it that users
maybe want to eanble it sometimes. I can add a kcontrol for the
function as well.

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

* Applied "ASoC: nau8825: disable sinc filter for high THD of ADC" to the asoc tree
  2016-12-02  1:48 [PATCH] ASoC: nau8825: disable sinc filter for high THD of ADC John Hsu
  2016-12-05 11:50 ` Mark Brown
@ 2016-12-06 14:35 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2016-12-06 14:35 UTC (permalink / raw)
  To: John Hsu
  Cc: alsa-devel, anatol.pomozov, benzh, WTLI, lgirdwood, YHCHuang,
	broonie, CTLIN0, yong.zhi, mhkuo

The patch

   ASoC: nau8825: disable sinc filter for high THD of ADC

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 5f1516d52f9287a94dc3b9d57c370ed01802a911 Mon Sep 17 00:00:00 2001
From: John Hsu <KCHSU0@nuvoton.com>
Date: Fri, 2 Dec 2016 09:48:58 +0800
Subject: [PATCH] ASoC: nau8825: disable sinc filter for high THD of ADC

This bit will enable 4th order SINC filter.
=1, filter will enable;  but it consumes higher power.
=0, the sinc filter is disable, and it should always keep 0 value to
get high THD.

Therefor, disable the filter when codec initiation for better
performance when recording.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/nau8825.c | 3 ++-
 sound/soc/codecs/nau8825.h | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index 2b89569333a1..efe3a44658d5 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -1846,7 +1846,8 @@ static void nau8825_init_regs(struct nau8825 *nau8825)
 	 * (audible hiss). Set it to something better.
 	 */
 	regmap_update_bits(regmap, NAU8825_REG_ADC_RATE,
-		NAU8825_ADC_SYNC_DOWN_MASK, NAU8825_ADC_SYNC_DOWN_64);
+		NAU8825_ADC_SYNC_DOWN_MASK | NAU8825_ADC_SINC4_EN,
+		NAU8825_ADC_SYNC_DOWN_64);
 	regmap_update_bits(regmap, NAU8825_REG_DAC_CTRL1,
 		NAU8825_DAC_OVERSAMPLE_MASK, NAU8825_DAC_OVERSAMPLE_64);
 	/* Disable DACR/L power */
diff --git a/sound/soc/codecs/nau8825.h b/sound/soc/codecs/nau8825.h
index 0672a25617b9..5d1704e73241 100644
--- a/sound/soc/codecs/nau8825.h
+++ b/sound/soc/codecs/nau8825.h
@@ -269,6 +269,8 @@
 #define NAU8825_BIQ_PATH_DAC   (1 << NAU8825_BIQ_PATH_SFT)
 
 /* ADC_RATE (0x2b) */
+#define NAU8825_ADC_SINC4_SFT		4
+#define NAU8825_ADC_SINC4_EN		(1 << NAU8825_ADC_SINC4_SFT)
 #define NAU8825_ADC_SYNC_DOWN_SFT	0
 #define NAU8825_ADC_SYNC_DOWN_MASK	0x3
 #define NAU8825_ADC_SYNC_DOWN_32	0
-- 
2.10.2

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

end of thread, other threads:[~2016-12-06 14:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-02  1:48 [PATCH] ASoC: nau8825: disable sinc filter for high THD of ADC John Hsu
2016-12-05 11:50 ` Mark Brown
2016-12-06  2:07   ` John Hsu
2016-12-06 14:35 ` Applied "ASoC: nau8825: disable sinc filter for high THD of ADC" to the asoc tree Mark Brown

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.