From: <Codrin.Ciubotariu@microchip.com>
To: <lars@metafoo.de>, <lgirdwood@gmail.com>, <broonie@kernel.org>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
<Codrin.Ciubotariu@microchip.com>
Subject: [PATCH 4/5] ASoC: codecs: ad193x: Add runtime support for DSP_A and I2S modes
Date: Mon, 18 Feb 2019 16:10:34 +0000 [thread overview]
Message-ID: <20190218160954.13929-5-codrin.ciubotariu@microchip.com> (raw)
In-Reply-To: <20190218160954.13929-1-codrin.ciubotariu@microchip.com>
From: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
The driver only supports DPS_A for DAC, which is configured at probe.
This patch adds support for DSP_A and I2S modes by using the set_fmt()
callback.
A trivial break is also removed from a case's default branch.
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
sound/soc/codecs/ad193x.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c
index 315ec9775118..f8cf182518a3 100644
--- a/sound/soc/codecs/ad193x.c
+++ b/sound/soc/codecs/ad193x.c
@@ -188,23 +188,26 @@ static int ad193x_set_dai_fmt(struct snd_soc_dai *codec_dai,
{
struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(codec_dai->component);
unsigned int adc_serfmt = 0;
+ unsigned int dac_serfmt = 0;
unsigned int adc_fmt = 0;
unsigned int dac_fmt = 0;
/* At present, the driver only support AUX ADC mode(SND_SOC_DAIFMT_I2S
- * with TDM) and ADC&DAC TDM mode(SND_SOC_DAIFMT_DSP_A)
+ * with TDM), ADC&DAC TDM mode(SND_SOC_DAIFMT_DSP_A) and DAC I2S mode
+ * (SND_SOC_DAIFMT_I2S)
*/
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S:
adc_serfmt |= AD193X_ADC_SERFMT_TDM;
+ dac_serfmt |= AD193X_DAC_SERFMT_STEREO;
break;
case SND_SOC_DAIFMT_DSP_A:
adc_serfmt |= AD193X_ADC_SERFMT_AUX;
+ dac_serfmt |= AD193X_DAC_SERFMT_TDM;
break;
default:
if (ad193x_has_adc(ad193x))
return -EINVAL;
- break;
}
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
@@ -261,6 +264,8 @@ static int ad193x_set_dai_fmt(struct snd_soc_dai *codec_dai,
regmap_update_bits(ad193x->regmap, AD193X_ADC_CTRL2,
AD193X_ADC_FMT_MASK, adc_fmt);
}
+ regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL0,
+ AD193X_DAC_SERFMT_MASK, dac_serfmt);
regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL1,
AD193X_DAC_FMT_MASK, dac_fmt);
--
2.17.1
next prev parent reply other threads:[~2019-02-18 16:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-18 16:10 [PATCH 0/5] ASoC: codecs: ad193x: Several fixes and imprevements Codrin.Ciubotariu
2019-02-18 16:10 ` [PATCH 1/5] ASoC: codecs: ad193x: Remove capture support for codecs without ADC Codrin.Ciubotariu
2019-02-18 18:49 ` Applied "ASoC: codecs: ad193x: Remove capture support for codecs without ADC" to the asoc tree Mark Brown
2019-02-18 16:10 ` [PATCH 2/5] ASoC: codecs: ad193x: Set constraint to always have 32 sample bits Codrin.Ciubotariu
2019-02-18 18:49 ` Applied "ASoC: codecs: ad193x: Set constraint to always have 32 sample bits" to the asoc tree Mark Brown
2019-02-18 16:10 ` [PATCH 3/5] ASoC: codecs: ad193x: Fix frame polarity for DSP_A format Codrin.Ciubotariu
2019-02-18 18:49 ` Applied "ASoC: codecs: ad193x: Fix frame polarity for DSP_A format" to the asoc tree Mark Brown
2019-02-18 16:10 ` Codrin.Ciubotariu [this message]
2019-02-18 18:49 ` Applied "ASoC: codecs: ad193x: Add runtime support for DSP_A and I2S modes" " Mark Brown
2019-02-18 16:10 ` [PATCH 5/5] ASoC: codecs: ad193x: Add support to disable on-chip PLL Codrin.Ciubotariu
2019-02-18 18:49 ` Applied "ASoC: codecs: ad193x: Add support to disable on-chip PLL" to the asoc tree Mark Brown
2019-02-18 16:57 ` [PATCH 0/5] ASoC: codecs: ad193x: Several fixes and imprevements Codrin.Ciubotariu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190218160954.13929-5-codrin.ciubotariu@microchip.com \
--to=codrin.ciubotariu@microchip.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).