All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ryans Lee <RyanS.Lee@maximintegrated.com>
To: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: "lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"perex@perex.cz" <perex@perex.cz>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"kuninori.morimoto.gx@renesas.com"
	<kuninori.morimoto.gx@renesas.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"bardliao@realtek.com" <bardliao@realtek.com>,
	"nh6z@nh6z.net" <nh6z@nh6z.net>,
	"KCHSU0@nuvoton.com" <KCHSU0@nuvoton.com>,
	"axel.lin@ingics.com" <axel.lin@ingics.com>,
	"romain.perier@collabora.com" <romain.perier@collabora.com>,
	"petr@barix.com" <petr@barix.com>,
	"srinivas.kandagatla@linaro.org" <srinivas.kandagatla@linaro.org>,
	"oder_chiou@realtek.com" <oder_chiou@realtek.com>,
	"Paul.Handrigan@cirrus.com" <Paul.Handrigan@cirrus.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dgreid@google.com" <dgreid@google.com>,
	"ryan.lee.maxim@gmail.com" <ryan.lee.maxim@gmail.com>
Subject: RE: [alsa-devel] [PATCH] ASoC: Add support for Maxim Integrated MAX98927 Amplifier
Date: Mon, 27 Mar 2017 05:45:23 +0000	[thread overview]
Message-ID: <BY2PR11MB08379FE803113440DD984076E7330@BY2PR11MB0837.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20170320141407.GS6986@localhost.localdomain>

> -----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

WARNING: multiple messages have this Message-ID (diff)
From: Ryans Lee <RyanS.Lee-zxKO94PEStzToO697jQleEEOCMrvLtNR@public.gmane.org>
To: Charles Keepax
	<ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Cc: "lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"mark.rutland-5wv7dgnIgG8@public.gmane.org"
	<mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	"perex-/Fr2/VpizcU@public.gmane.org"
	<perex-/Fr2/VpizcU@public.gmane.org>,
	"tiwai-IBi9RG/b67k@public.gmane.org"
	<tiwai-IBi9RG/b67k@public.gmane.org>,
	"kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org"
	<kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
	"arnd-r2nGTMty4D4@public.gmane.org"
	<arnd-r2nGTMty4D4@public.gmane.org>,
	"lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org"
	<lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
	"bardliao-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org"
	<bardliao-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>,
	"nh6z-fFIq/eER6g8@public.gmane.org"
	<nh6z-fFIq/eER6g8@public.gmane.org>,
	"KCHSU0-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org"
	<KCHSU0-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org>,
	"axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org"
	<axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>,
	"romain.perier-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org"
	<romain.perier-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
	"petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org"
	<petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org>,
	"srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
	<srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"oder_chiou-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org"
	<oder_chiou-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
Subject: RE: [alsa-devel] [PATCH] ASoC: Add support for Maxim Integrated MAX98927 Amplifier
Date: Mon, 27 Mar 2017 05:45:23 +0000	[thread overview]
Message-ID: <BY2PR11MB08379FE803113440DD984076E7330@BY2PR11MB0837.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20170320141407.GS6986-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>

> -----Original Message-----
> From: Charles Keepax [mailto:ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org]
> Sent: Monday, March 20, 2017 7:14 AM
> To: Ryans Lee <RyanS.Lee-zxKO94PEStzToO697jQleEEOCMrvLtNR@public.gmane.org>
> Cc: lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org; robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org; 
> mark.rutland-5wv7dgnIgG8@public.gmane.org; perex-/Fr2/VpizcU@public.gmane.org; tiwai-IBi9RG/b67k@public.gmane.org; 
> kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org; arnd-r2nGTMty4D4@public.gmane.org; lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org; 
> bardliao-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org; nh6z-fFIq/eER6g8@public.gmane.org; KCHSU0-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org; 
> axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org; romain.perier-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org; petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org; 
> srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org; oder_chiou-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org; 
> Paul.Handrigan-jGc1dHjMKG3QT0dZR+AlfA@public.gmane.org; alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org; 
> devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; 
> dgreid-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org
> 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-zxKO94PEStzToO697jQleEEOCMrvLtNR@public.gmane.org>
>> ---
>> 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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-03-27  5:45 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 ` [alsa-devel] " Charles Keepax
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   ` Ryans Lee [this message]
2017-03-27  5:45     ` [alsa-devel] [PATCH] " 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=BY2PR11MB08379FE803113440DD984076E7330@BY2PR11MB0837.namprd11.prod.outlook.com \
    --to=ryans.lee@maximintegrated.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=ckeepax@opensource.wolfsonmicro.com \
    --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=ryan.lee.maxim@gmail.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.