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


Groups > linux.kernel > #1604617 > unrolled thread

Re: [alsa-devel] [PATCH] ASoC: Add support for Maxim Integrated MAX98927 Amplifier

Started byCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
First post2017-03-20 15:20 +0100
Last post2017-03-27 20:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [alsa-devel] [PATCH] ASoC: Add support for Maxim Integrated  MAX98927 Amplifier Charles Keepax <ckeepax@opensource.wolfsonmicro.com> - 2017-03-20 15:20 +0100
    RE: [alsa-devel] [PATCH] ASoC: Add support for Maxim Integrated  MAX98927 Amplifier Ryans Lee <RyanS.Lee@maximintegrated.com> - 2017-03-27 07:50 +0200
    Re: [PATCH v2] ASoC: Add support for Maxim Integrated MAX98927 Amplifier Rob Herring <robh+dt@kernel.org> - 2017-03-27 20:50 +0200

#1604617 — Re: [alsa-devel] [PATCH] ASoC: Add support for Maxim Integrated MAX98927 Amplifier

FromCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Date2017-03-20 15:20 +0100
SubjectRe: [alsa-devel] [PATCH] ASoC: Add support for Maxim Integrated MAX98927 Amplifier
Message-ID<tn6kb-5SK-27@gated-at.bofh.it>
On Mon, Mar 20, 2017 at 09:40:23AM +0900, Ryan Lee wrote:
> Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
> ---
> Resubmit the intial version of MAX98927 driver. Added all fixes into the initial patch.
<snip>
> +static int max98927_reg_get(struct snd_kcontrol *kcontrol,
> +	struct snd_ctl_elem_value *ucontrol, unsigned int reg,
> +	unsigned int mask, unsigned int shift)
> +{
> +	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
> +	struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec);
> +	int data;
> +
> +	regmap_read(max98927->regmap, reg, &data);
> +	ucontrol->value.integer.value[0] = (data & mask) >> shift;
> +	return 0;
> +}
> +
> +static int max98927_reg_put(struct snd_kcontrol *kcontrol,
> +	struct snd_ctl_elem_value *ucontrol, unsigned int reg,
> +	unsigned int mask, unsigned int shift)
> +{
> +	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
> +	struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec);
> +	unsigned int sel = ucontrol->value.integer.value[0];
> +
> +	regmap_update_bits(max98927->regmap, reg, mask, sel << shift);
> +	dev_dbg(codec->dev, "%s: register 0x%02X, value 0x%02X\n",
> +		__func__, reg, sel);
> +	return 0;
> +}

These functions look a lot like they duplicate things the ASoC
core does?

<snip>
> +static int max98927_boost_voltage_get(struct snd_kcontrol *kcontrol,
> +	struct snd_ctl_elem_value *ucontrol)
> +{
> +	return max98927_reg_get(kcontrol, ucontrol,
> +		MAX98927_R0040_BOOST_CTRL0,
> +		MAX98927_BOOST_CTRL0_VOUT_MASK, 0);
> +}
> +

And can't these just be specified in the normal way with the
register information attached to the control? There doesn't seem
to be any special behaviour being added here. Apologies if I am
missing something here.

Thanks,
Charles

[toc] | [next] | [standalone]


#1609461

FromRyans Lee <RyanS.Lee@maximintegrated.com>
Date2017-03-27 07:50 +0200
Message-ID<tpvHr-36t-3@gated-at.bofh.it>
In reply to#1604617
> -----Original Message-----
> From: Charles Keepax [mailto:ckeepax@opensource.wolfsonmicro.com]
> Sent: Monday, March 20, 2017 7:14 AM
> To: Ryans Lee <RyanS.Lee@maximintegrated.com>
> Cc: lgirdwood@gmail.com; broonie@kernel.org; robh+dt@kernel.org; 
> mark.rutland@arm.com; perex@perex.cz; tiwai@suse.com; 
> kuninori.morimoto.gx@renesas.com; arnd@arndb.de; lars@metafoo.de; 
> bardliao@realtek.com; nh6z@nh6z.net; KCHSU0@nuvoton.com; 
> axel.lin@ingics.com; romain.perier@collabora.com; petr@barix.com; 
> srinivas.kandagatla@linaro.org; oder_chiou@realtek.com; 
> Paul.Handrigan@cirrus.com; alsa-devel@alsa-project.org; 
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; 
> dgreid@google.com
> Subject: Re: [alsa-devel] [PATCH] ASoC: Add support for Maxim 
> Integrated MAX98927 Amplifier
>
> EXTERNAL EMAIL
>
>
>
> On Mon, Mar 20, 2017 at 09:40:23AM +0900, Ryan Lee wrote:
>> Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
>> ---
>> Resubmit the intial version of MAX98927 driver. Added all fixes into the initial patch.
> <snip>
>> +static int max98927_reg_get(struct snd_kcontrol *kcontrol,
>> +     struct snd_ctl_elem_value *ucontrol, unsigned int reg,
>> +     unsigned int mask, unsigned int shift) {
>> +     struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
>> +     struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec);
>> +     int data;
>> +
>> +     regmap_read(max98927->regmap, reg, &data);
>> +     ucontrol->value.integer.value[0] = (data & mask) >> shift;
>> +     return 0;
>> +}
>> +
>> +static int max98927_reg_put(struct snd_kcontrol *kcontrol,
>> +     struct snd_ctl_elem_value *ucontrol, unsigned int reg,
>> +     unsigned int mask, unsigned int shift) {
>> +     struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
>> +     struct max98927_priv *max98927 = snd_soc_codec_get_drvdata(codec);
>> +     unsigned int sel = ucontrol->value.integer.value[0];
>> +
>> +     regmap_update_bits(max98927->regmap, reg, mask, sel << shift);
>> +     dev_dbg(codec->dev, "%s: register 0x%02X, value 0x%02X\n",
>> +             __func__, reg, sel);
>> +     return 0;
>> +}
>
> These functions look a lot like they duplicate things the ASoC core does?

You're right. I removed 'max98927_reg_get' and 'max98927_reg_put' function to avoid duplication.

>
> <snip>
>> +static int max98927_boost_voltage_get(struct snd_kcontrol *kcontrol,
>> +     struct snd_ctl_elem_value *ucontrol) {
>> +     return max98927_reg_get(kcontrol, ucontrol,
>> +             MAX98927_R0040_BOOST_CTRL0,
>> +             MAX98927_BOOST_CTRL0_VOUT_MASK, 0); }
>> +
>
> And can't these just be specified in the normal way with the register information attached to the control? There doesn't seem to be any special behaviour being added here. Apologies if I am missing something here.

Thank you for your feedback. Now SOC_ENUM_EXT was replaced by SOC_ENUM. SOC_SINGLE_EXT was also replaced by SOC_SINGLE. Above function is no longer being used.

>
> Thanks,
> Charles

[toc] | [prev] | [next] | [standalone]


#1610067 — Re: [PATCH v2] ASoC: Add support for Maxim Integrated MAX98927 Amplifier

FromRob Herring <robh+dt@kernel.org>
Date2017-03-27 20:50 +0200
SubjectRe: [PATCH v2] ASoC: Add support for Maxim Integrated MAX98927 Amplifier
Message-ID<tpHSh-42B-5@gated-at.bofh.it>
In reply to#1604617
On Mon, Mar 27, 2017 at 12:32 AM, Ryan Lee
<ryans.lee@maximintegrated.com> wrote:
> Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
> ---
> v2: Removed local register read/write function to avoid duplication of ASoC core function.

And what about my comments in v1?

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web