From: Dan Murphy <dmurphy@ti.com>
To: Mark Brown <broonie@kernel.org>
Cc: <lgirdwood@gmail.com>, <perex@perex.cz>, <tiwai@suse.com>,
<alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family
Date: Tue, 11 Feb 2020 10:24:36 -0600 [thread overview]
Message-ID: <1148672d-4053-65cd-61dd-0039658d85a4@ti.com> (raw)
In-Reply-To: <20200210135252.GK7685@sirena.org.uk>
Mark
Thanks for the review
On 2/10/20 7:52 AM, Mark Brown wrote:
> On Fri, Feb 07, 2020 at 01:45:33PM -0600, Dan Murphy wrote:
>
>> + /* interface format */
>> + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
>> + case SND_SOC_DAIFMT_I2S:
>> + iface_reg1 |= ADCX140_I2S_MODE_BIT;
>> + break;
>> + case SND_SOC_DAIFMT_LEFT_J:
>> + iface_reg1 |= ADCX140_LEFT_JUST_BIT;
>> + break;
>> + case SND_SOC_DAIFMT_DSP_A:
>> + case SND_SOC_DAIFMT_DSP_B:
>> + break;
> _DSP_A and _DSP_B are two different format so I'd expect the device to
> be configured differently for them, or for only one to be supported.
Ack. I will need to adjust the TX offset for these. I will do add a
prepare call back and set the offset there. These can fall through
since TDM is default.
>
>> +static int adcx140_mute(struct snd_soc_dai *codec_dai, int mute)
>> +{
>> + struct snd_soc_component *component = codec_dai->component;
>> + int config_reg;
>> + int mic_enable;
>> + int i;
>> +
>> + /* There is not a single register to mute. Each enabled path has to be
>> + * muted individually. Read which path is enabled and mute it.
>> + */
>> + snd_soc_component_read(component, ADCX140_IN_CH_EN, &mic_enable);
>> + if (!mic_enable)
>> + return 0;
> You could also just offer this control to userspace, it's not
> *essential* to have this operation though it can help with glitching
> during stream startup.
>
>> +
>> + for (i = 0; i < ADCX140_MAX_CHANNELS; i++) {
>> + config_reg = ADCX140_CH8_CFG2 - (5 * i);
>> + if (!(mic_enable & BIT(i)))
>> + continue;
>> +
>> + if (mute)
>> + snd_soc_component_write(component, config_reg, 0);
>> + }
> How does the unmute work?
This is unmuted through volume control. I can remove this as the device
is muted when the volume register is set to 0. That will force the user
to have to set a volume.
>
>> + internal_reg = device_property_present(adcx140->dev,
>> + "ti,use-internal-areg");
>> +
>> + if (internal_reg)
>> + sleep_cfg_val |= ADCX140_AREG_INTERNAL;
> Does this actually need a specific property or could you support the
> regulator API and then use regulator_get_optional() to figure out if an
> external AVDD is attached?
Yes we could set internal AREG bit if no supply is given.
>
>> +static int adcx140_codec_probe(struct snd_soc_component *component)
>> +{
>> + struct adcx140_priv *adcx140 = snd_soc_component_get_drvdata(component);
>> +
>> + return adc5410_init(adcx140);
>> +}
> Does the separate init function buy us anything?
No that is an artifact of my development I can move everything to
codec_probe
Dan
prev parent reply other threads:[~2020-02-11 16:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-07 19:45 [PATCH 1/2] dt-bindings: sound: Add TLV320ADCx140 dt bindings Dan Murphy
2020-02-07 19:45 ` [PATCH 2/2] ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family Dan Murphy
2020-02-10 13:52 ` Mark Brown
2020-02-11 16:24 ` Dan Murphy [this message]
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=1148672d-4053-65cd-61dd-0039658d85a4@ti.com \
--to=dmurphy@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/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
all inboxes | Powered by JetHome®