All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Ryan 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
Date: Mon, 20 Mar 2017 14:14:07 +0000	[thread overview]
Message-ID: <20170320141407.GS6986@localhost.localdomain> (raw)
In-Reply-To: <1489970423-29353-1-git-send-email-ryans.lee@maximintegrated.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Ryan Lee <ryans.lee@maximintegrated.com>
Cc: mark.rutland@arm.com, alsa-devel@alsa-project.org,
	kuninori.morimoto.gx@renesas.com, lgirdwood@gmail.com,
	tiwai@suse.com, srinivas.kandagatla@linaro.org,
	romain.perier@collabora.com, bardliao@realtek.com,
	lars@metafoo.de, axel.lin@ingics.com, Paul.Handrigan@cirrus.com,
	devicetree@vger.kernel.org, arnd@arndb.de, nh6z@nh6z.net,
	robh+dt@kernel.org, dgreid@google.com, oder_chiou@realtek.com,
	KCHSU0@nuvoton.com, linux-kernel@vger.kernel.org, petr@barix.com,
	broonie@kernel.org
Subject: Re: [PATCH] ASoC: Add support for Maxim Integrated MAX98927 Amplifier
Date: Mon, 20 Mar 2017 14:14:07 +0000	[thread overview]
Message-ID: <20170320141407.GS6986@localhost.localdomain> (raw)
In-Reply-To: <1489970423-29353-1-git-send-email-ryans.lee@maximintegrated.com>

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

  reply	other threads:[~2017-03-20 14:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20  0:40 [PATCH] ASoC: Add support for Maxim Integrated MAX98927 Amplifier Ryan Lee
2017-03-20  0:40 ` Ryan Lee
2017-03-20 14:14 ` Charles Keepax [this message]
2017-03-20 14:14   ` Charles Keepax
2017-03-27  5:32   ` [PATCH v2] " Ryan Lee
2017-03-27  5:32     ` Ryan Lee
2017-03-27 18:46     ` Rob Herring
2017-03-27 18:46       ` Rob Herring
2017-03-27  5:45   ` [alsa-devel] [PATCH] " Ryans Lee
2017-03-27  5:45     ` Ryans Lee
2017-03-24 15:26 ` Rob Herring
2017-03-24 15:26   ` Rob Herring
2017-03-28 15:32   ` [PATCH v3] " Ryan Lee
2017-03-28 15:32     ` Ryan Lee
2017-03-28 16:39     ` Mark Brown
2017-03-28 16:39       ` Mark Brown
2017-03-29  0:49       ` Ryan Lee
2017-03-29  0:49         ` Ryan Lee
2017-03-28 15:36   ` [PATCH] " Ryans Lee
2017-03-28 15:36     ` Ryans Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170320141407.GS6986@localhost.localdomain \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=KCHSU0@nuvoton.com \
    --cc=Paul.Handrigan@cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnd@arndb.de \
    --cc=axel.lin@ingics.com \
    --cc=bardliao@realtek.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dgreid@google.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=nh6z@nh6z.net \
    --cc=oder_chiou@realtek.com \
    --cc=perex@perex.cz \
    --cc=petr@barix.com \
    --cc=robh+dt@kernel.org \
    --cc=romain.perier@collabora.com \
    --cc=ryans.lee@maximintegrated.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.