[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BY2PR11MB08379FE803113440DD984076E7330@BY2PR11MB0837.namprd11.prod.outlook.com>
Date: Mon, 27 Mar 2017 05:45:23 +0000
From: Ryans Lee <RyanS.Lee@...imintegrated.com>
To: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
CC: "lgirdwood@...il.com" <lgirdwood@...il.com>,
"broonie@...nel.org" <broonie@...nel.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"mark.rutland@....com" <mark.rutland@....com>,
"perex@...ex.cz" <perex@...ex.cz>,
"tiwai@...e.com" <tiwai@...e.com>,
"kuninori.morimoto.gx@...esas.com" <kuninori.morimoto.gx@...esas.com>,
"arnd@...db.de" <arnd@...db.de>,
"lars@...afoo.de" <lars@...afoo.de>,
"bardliao@...ltek.com" <bardliao@...ltek.com>,
"nh6z@...z.net" <nh6z@...z.net>,
"KCHSU0@...oton.com" <KCHSU0@...oton.com>,
"axel.lin@...ics.com" <axel.lin@...ics.com>,
"romain.perier@...labora.com" <romain.perier@...labora.com>,
"petr@...ix.com" <petr@...ix.com>,
"srinivas.kandagatla@...aro.org" <srinivas.kandagatla@...aro.org>,
"oder_chiou@...ltek.com" <oder_chiou@...ltek.com>,
"Paul.Handrigan@...rus.com" <Paul.Handrigan@...rus.com>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"dgreid@...gle.com" <dgreid@...gle.com>,
"ryan.lee.maxim@...il.com" <ryan.lee.maxim@...il.com>
Subject: RE: [alsa-devel] [PATCH] ASoC: Add support for Maxim Integrated
MAX98927 Amplifier
> -----Original Message-----
> From: Charles Keepax [mailto:ckeepax@...nsource.wolfsonmicro.com]
> Sent: Monday, March 20, 2017 7:14 AM
> To: Ryans Lee <RyanS.Lee@...imintegrated.com>
> Cc: lgirdwood@...il.com; broonie@...nel.org; robh+dt@...nel.org;
> mark.rutland@....com; perex@...ex.cz; tiwai@...e.com;
> kuninori.morimoto.gx@...esas.com; arnd@...db.de; lars@...afoo.de;
> bardliao@...ltek.com; nh6z@...z.net; KCHSU0@...oton.com;
> axel.lin@...ics.com; romain.perier@...labora.com; petr@...ix.com;
> srinivas.kandagatla@...aro.org; oder_chiou@...ltek.com;
> Paul.Handrigan@...rus.com; alsa-devel@...a-project.org;
> devicetree@...r.kernel.org; linux-kernel@...r.kernel.org;
> dgreid@...gle.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@...imintegrated.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
Powered by blists - more mailing lists