Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1477267

Re: [PATCH] ASoC: sun4i-codec: Distinguish sun4i from sun7i

From Mark Brown <broonie@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] ASoC: sun4i-codec: Distinguish sun4i from sun7i
Date 2016-09-06 12:40 +0200
Message-ID <selXj-PI-17@gated-at.bofh.it> (permalink)
References <se7KF-83d-3@gated-at.bofh.it> <se7KF-83d-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, Sep 05, 2016 at 09:24:04PM +0200, Danny Milosavljevic wrote:

> -static const struct snd_kcontrol_new sun4i_codec_widgets[] = {
> -	SOC_SINGLE_TLV("Power Amplifier Volume", SUN4I_CODEC_DAC_ACTL,
> -		       SUN4I_CODEC_DAC_ACTL_PA_VOL, 0x3F, 0,
> -		       sun4i_codec_pa_volume_scale),
> +#define SUN4I_COMMON_CODEC_CONTROLS \
> +	SOC_SINGLE_TLV("Power Amplifier Volume", SUN4I_CODEC_DAC_ACTL,\
> +		       SUN4I_CODEC_DAC_ACTL_PA_VOL, 0x3F, 0,\
> +		       sun4i_codec_pa_volume_scale)
> +
> +static const struct snd_kcontrol_new sun4i_codec_controls[] = {
> +	SUN4I_COMMON_CODEC_CONTROLS,
> +};

No, please don't do this - macros like this just make the code harder to
work with.  Do what everything else that handles multiple devices in one
driver does and have several different tables of controls, registering
the ones that are appropriate for the current device at runtime.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] ASoC: sun4i-codec: Distinguish sun4i from sun7i Danny Milosavljevic <dannym@scratchpost.org> - 2016-09-05 21:30 +0200
  Re: [PATCH] ASoC: sun4i-codec: Distinguish sun4i from sun7i Chen-Yu Tsai <wens@csie.org> - 2016-09-06 05:40 +0200
  Re: [PATCH] ASoC: sun4i-codec: Distinguish sun4i from sun7i Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-09-06 08:40 +0200
  Re: [PATCH] ASoC: sun4i-codec: Distinguish sun4i from sun7i Mark Brown <broonie@kernel.org> - 2016-09-06 12:40 +0200

csiph-web