* [PATCH v2] ASoC: wm8741: Set OSR mode in hw_params()
@ 2019-02-10 15:29 Sergej Sawazki
2019-02-11 16:03 ` Charles Keepax
2019-02-12 14:21 ` Applied "ASoC: wm8741: Set OSR mode in hw_params()" to the asoc tree Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Sergej Sawazki @ 2019-02-10 15:29 UTC (permalink / raw)
To: broonie, lgirdwood, ckeepax; +Cc: ce3a, patches, alsa-devel, Sergej Sawazki
For correct operation of the digital filtering and other processing on the
WM8741, the user must ensure the correct value of OSR[1:0] is set at all
times.[1] Hence, depending the selected sampling rate, set the OSR (over-
sampling rate) mode in hw_params().
References:
[1] "WM8741 Data Sheet"
Signed-off-by: Sergej Sawazki <sergej@taudac.com>
---
Changes in v2:
* Using update_bits() rather than write().
sound/soc/codecs/wm8741.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
index fdda83b..a4b8c45 100644
--- a/sound/soc/codecs/wm8741.c
+++ b/sound/soc/codecs/wm8741.c
@@ -196,7 +196,7 @@ static int wm8741_hw_params(struct snd_pcm_substream *substream,
{
struct snd_soc_component *component = dai->component;
struct wm8741_priv *wm8741 = snd_soc_component_get_drvdata(component);
- unsigned int iface;
+ unsigned int iface, mode;
int i;
/* The set of sample rates that can be supported depends on the
@@ -240,11 +240,21 @@ static int wm8741_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
+ /* oversampling rate */
+ if (params_rate(params) > 96000)
+ mode = 0x40;
+ else if (params_rate(params) > 48000)
+ mode = 0x20;
+ else
+ mode = 0x00;
+
dev_dbg(component->dev, "wm8741_hw_params: bit size param = %d, rate param = %d",
params_width(params), params_rate(params));
snd_soc_component_update_bits(component, WM8741_FORMAT_CONTROL, WM8741_IWL_MASK,
iface);
+ snd_soc_component_update_bits(component, WM8741_MODE_CONTROL_1, WM8741_OSR_MASK,
+ mode);
return 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] ASoC: wm8741: Set OSR mode in hw_params()
2019-02-10 15:29 [PATCH v2] ASoC: wm8741: Set OSR mode in hw_params() Sergej Sawazki
@ 2019-02-11 16:03 ` Charles Keepax
2019-02-12 14:21 ` Applied "ASoC: wm8741: Set OSR mode in hw_params()" to the asoc tree Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2019-02-11 16:03 UTC (permalink / raw)
To: Sergej Sawazki; +Cc: ce3a, patches, alsa-devel, broonie, lgirdwood
On Sun, Feb 10, 2019 at 04:29:29PM +0100, Sergej Sawazki wrote:
> For correct operation of the digital filtering and other processing on the
> WM8741, the user must ensure the correct value of OSR[1:0] is set at all
> times.[1] Hence, depending the selected sampling rate, set the OSR (over-
> sampling rate) mode in hw_params().
>
> References:
> [1] "WM8741 Data Sheet"
>
> Signed-off-by: Sergej Sawazki <sergej@taudac.com>
> ---
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Applied "ASoC: wm8741: Set OSR mode in hw_params()" to the asoc tree
2019-02-10 15:29 [PATCH v2] ASoC: wm8741: Set OSR mode in hw_params() Sergej Sawazki
2019-02-11 16:03 ` Charles Keepax
@ 2019-02-12 14:21 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2019-02-12 14:21 UTC (permalink / raw)
To: Sergej Sawazki; +Cc: alsa-devel, ckeepax, patches, lgirdwood, broonie, ce3a
The patch
ASoC: wm8741: Set OSR mode in hw_params()
has been applied to the asoc tree at
https://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 e9418629e2fcf7374c19750f3afa7f3a7ff0afa2 Mon Sep 17 00:00:00 2001
From: Sergej Sawazki <sergej@taudac.com>
Date: Sun, 10 Feb 2019 16:29:29 +0100
Subject: [PATCH] ASoC: wm8741: Set OSR mode in hw_params()
For correct operation of the digital filtering and other processing on the
WM8741, the user must ensure the correct value of OSR[1:0] is set at all
times.[1] Hence, depending the selected sampling rate, set the OSR (over-
sampling rate) mode in hw_params().
References:
[1] "WM8741 Data Sheet"
Signed-off-by: Sergej Sawazki <sergej@taudac.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/codecs/wm8741.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
index fdda83b7ca82..a4b8c459ea57 100644
--- a/sound/soc/codecs/wm8741.c
+++ b/sound/soc/codecs/wm8741.c
@@ -196,7 +196,7 @@ static int wm8741_hw_params(struct snd_pcm_substream *substream,
{
struct snd_soc_component *component = dai->component;
struct wm8741_priv *wm8741 = snd_soc_component_get_drvdata(component);
- unsigned int iface;
+ unsigned int iface, mode;
int i;
/* The set of sample rates that can be supported depends on the
@@ -240,11 +240,21 @@ static int wm8741_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
+ /* oversampling rate */
+ if (params_rate(params) > 96000)
+ mode = 0x40;
+ else if (params_rate(params) > 48000)
+ mode = 0x20;
+ else
+ mode = 0x00;
+
dev_dbg(component->dev, "wm8741_hw_params: bit size param = %d, rate param = %d",
params_width(params), params_rate(params));
snd_soc_component_update_bits(component, WM8741_FORMAT_CONTROL, WM8741_IWL_MASK,
iface);
+ snd_soc_component_update_bits(component, WM8741_MODE_CONTROL_1, WM8741_OSR_MASK,
+ mode);
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-12 14:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-10 15:29 [PATCH v2] ASoC: wm8741: Set OSR mode in hw_params() Sergej Sawazki
2019-02-11 16:03 ` Charles Keepax
2019-02-12 14:21 ` Applied "ASoC: wm8741: Set OSR mode in hw_params()" 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.