lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200210135252.GK7685@sirena.org.uk>
Date:   Mon, 10 Feb 2020 13:52:52 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Dan Murphy <dmurphy@...com>
Cc:     lgirdwood@...il.com, perex@...ex.cz, tiwai@...e.com,
        alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] ASoC: tlv320adcx140: Add the tlv320adcx140 codec
 driver family

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.

> +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?

> +	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?

> +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?

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ