[alsa-devel] [PATCH v4 1/5] ASoC: add mt6351 codec driver

Mark Brown broonie at kernel.org
Wed Apr 25 19:19:34 CEST 2018


On Wed, Apr 25, 2018 at 03:25:18PM +0800, KaiChieh Chuang wrote:

This is almost ready, a few more things below that I just noticed as the
bigger issues have all been dealt with now.  Sorry, should've noticed
most of these sooner.

> +++ b/sound/soc/codecs/mt6351.c
> @@ -0,0 +1,1516 @@
> +/*
> + * mt6351.c  --  mt6351 ALSA SoC audio codec driver
> + *
> + * Copyright (c) 2018 MediaTek Inc.
> + * Author: KaiChieh Chuang <kaichieh.chuang at mediatek.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.

This should be a C++ comment with a SPDX header instead of the GPL
statement.

> +static unsigned int get_play_reg_val(struct snd_soc_codec *codec,
> +				     unsigned int rate)

The driver is using snd_soc_codec quite a bit but we are trying to
transition away from that to snd_soc_component - you can see a lot of
example transitions in mainline from Moritmoto-san, everything that
exists at the CODEC level has a pretty direct equivalent in the
component struct so it's mostly (but not quite entirely unfortunately)
search and replace.

> +static struct snd_soc_codec_driver mt6351_soc_codec_driver = {
> +	.probe = mt6351_codec_probe,
> +
> +	.component_driver = {
> +		.dapm_widgets = mt6351_dapm_widgets,
> +		.num_dapm_widgets = ARRAY_SIZE(mt6351_dapm_widgets),
> +		.dapm_routes = mt6351_dapm_routes,
> +		.num_dapm_routes = ARRAY_SIZE(mt6351_dapm_routes),
> +	},
> +};

You should be able to add the controls that you're manually registering
in probe here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20180425/194bf306/attachment-0001.sig>


More information about the Alsa-devel mailing list