[alsa-devel] [RFC][PATCH] ASoC: Add max98090 codec driver

Mark Brown broonie at opensource.wolfsonmicro.com
Tue Nov 20 12:14:42 CET 2012


On Tue, Nov 20, 2012 at 02:00:54AM -0800, Kuninori Morimoto wrote:

Overall this looks pretty good, a few issues below mostly to do with
updating to more current kernel APIs.

> +/* RESET / STATUS / INTERRUPT REGISTERS */
> +#define M98090_0x00_SW_RESET		0x00

The standard for Maxim drivers is to use MAX as the prefix rather than
M.

> +static const u8 max98090_reg[] = {
> +	0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, /* 0x00 - 0x07 */

Use regmap for register I/O please.

> +	snd_soc_write(codec, M98090_0x06_DAI_IF, val);

More idiomatic is snd_soc_update_bits() so we don't do the write if
there's no change (as is very common).

> +	ret = snd_soc_read(codec, M98090_0xFF_REV_ID);
> +	if (ret < 0) {
> +		dev_err(dev, "Failed to read device revision: %d\n", ret);
> +		return ret;
> +	}
> +	dev_info(dev, "revision 0x%02x\n", ret);

With regmap this should be moved to the I2C level probe.

> +	snd_soc_add_codec_controls(codec, max98090_snd_controls,
> +				   ARRAY_SIZE(max98090_snd_controls));

Initialise these from the snd_soc_codec_driver.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20121120/fe3a5aa5/attachment.sig>


More information about the Alsa-devel mailing list