From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751988AbdC0Fpt (ORCPT ); Mon, 27 Mar 2017 01:45:49 -0400 Received: from mail-by2nam03on0138.outbound.protection.outlook.com ([104.47.42.138]:45291 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751852AbdC0Fpn (ORCPT ); Mon, 27 Mar 2017 01:45:43 -0400 From: Ryans Lee To: Charles Keepax 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" , "ryan.lee.maxim@gmail.com" Subject: RE: [alsa-devel] [PATCH] ASoC: Add support for Maxim Integrated MAX98927 Amplifier Thread-Topic: [alsa-devel] [PATCH] ASoC: Add support for Maxim Integrated MAX98927 Amplifier Thread-Index: AQHSoRKkERf+Q4vqhk24BeY3uVJtv6GdxlOAgApvIQA= Date: Mon, 27 Mar 2017 05:45:23 +0000 Message-ID: References: <1489970423-29353-1-git-send-email-ryans.lee@maximintegrated.com> <20170320141407.GS6986@localhost.localdomain> In-Reply-To: <20170320141407.GS6986@localhost.localdomain> Accept-Language: en-US, ko-KR Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: opensource.wolfsonmicro.com; dkim=none (message not signed) header.d=none;opensource.wolfsonmicro.com; dmarc=none action=none header.from=maximintegrated.com; x-originating-ip: [204.17.143.20] x-microsoft-exchange-diagnostics: 1;BY2PR11MB0837;7:p8zjEseCvdDyhdrp5wGvpElpxVtJqOFLimPswfapambxJWpDoRxy6mwiq0uKE7DQGEkWuZhiXriuEa2KsZB8KBT1ufzMP0e5cc97cGAuWtkwGUO4L/ZqiqKY8mH+huXalCWX204WCJWG2eOkD8hL+LPpIocn7jbi8K4sayAGb5ICYJ5c3M4CvcdI9bdBQO/HZlS09eSMPVw90t5CHJxm6+/Ga34xCeD6XK7Nz8EVDaycG7duM57eNyqvQgifmgx4BFzxg/zZrEkclOTZT6O1sLtYwu53mGnIQ1ZOr6riGLd10ZzxaxaixpJUxoPOvzkb2Uw70n2gCCY04F4zdmFCvA== x-ms-office365-filtering-correlation-id: 2546db03-a87c-4a99-d89d-08d474d476b8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081);SRVR:BY2PR11MB0837; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(9452136761055)(211936372134217)(108721460000369); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(20161123558025)(6072148);SRVR:BY2PR11MB0837;BCL:0;PCL:0;RULEID:;SRVR:BY2PR11MB0837; x-forefront-prvs: 02596AB7DA x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(39840400002)(39450400003)(39850400002)(39410400002)(377454003)(13464003)(24454002)(189998001)(53546009)(25786009)(53936002)(33656002)(2900100001)(6436002)(122556002)(77096006)(6246003)(6506006)(81166006)(8936002)(8676002)(4326008)(54906002)(55016002)(8666007)(9686003)(99286003)(38730400002)(110136004)(50986999)(66066001)(54356999)(76176999)(39060400002)(3280700002)(7416002)(345774005)(3660700001)(7736002)(2906002)(6116002)(102836003)(5660300001)(3846002)(86362001)(74316002)(305945005)(229853002)(5890100001)(7696004)(2950100002)(6916009);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR11MB0837;H:BY2PR11MB0837.namprd11.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: maximintegrated.com X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2017 05:45:23.7140 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fbd909df-ea69-4788-a554-f24b7854ad03 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR11MB0837 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v2R5kWHH003849 > -----Original Message----- > From: Charles Keepax [mailto:ckeepax@opensource.wolfsonmicro.com] > Sent: Monday, March 20, 2017 7:14 AM > To: Ryans Lee > 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 >> --- >> Resubmit the intial version of MAX98927 driver. Added all fixes into the initial patch. > >> +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. > > >> +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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryans Lee Subject: RE: [alsa-devel] [PATCH] ASoC: Add support for Maxim Integrated MAX98927 Amplifier Date: Mon, 27 Mar 2017 05:45:23 +0000 Message-ID: References: <1489970423-29353-1-git-send-email-ryans.lee@maximintegrated.com> <20170320141407.GS6986@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20170320141407.GS6986-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> Content-Language: en-US Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Charles Keepax 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" List-Id: devicetree@vger.kernel.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 > Cc: lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org; robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org;=20 > mark.rutland-5wv7dgnIgG8@public.gmane.org; perex-/Fr2/VpizcU@public.gmane.org; tiwai-IBi9RG/b67k@public.gmane.org;=20 > kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org; arnd-r2nGTMty4D4@public.gmane.org; lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org;=20 > bardliao-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org; nh6z-fFIq/eER6g8@public.gmane.org; KCHSU0-KrzQf0k3Iz9BDgjK7y7TUQ@public.gmane.org;=20 > axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org; romain.perier-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org; petr-Qh/3xLP0EvwAvxtiuMwx3w@public.gmane.org;=20 > srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org; oder_chiou-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org;=20 > Paul.Handrigan-jGc1dHjMKG3QT0dZR+AlfA@public.gmane.org; alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org;=20 > devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org;=20 > dgreid-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org > Subject: Re: [alsa-devel] [PATCH] ASoC: Add support for Maxim=20 > Integrated MAX98927 Amplifier > > EXTERNAL EMAIL > > > > On Mon, Mar 20, 2017 at 09:40:23AM +0900, Ryan Lee wrote: >> Signed-off-by: Ryan Lee >> --- >> Resubmit the intial version of MAX98927 driver. Added all fixes into the= initial patch. > >> +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 =3D snd_soc_kcontrol_codec(kcontrol); >> + struct max98927_priv *max98927 =3D snd_soc_codec_get_drvdata(codec= ); >> + int data; >> + >> + regmap_read(max98927->regmap, reg, &data); >> + ucontrol->value.integer.value[0] =3D (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 =3D snd_soc_kcontrol_codec(kcontrol); >> + struct max98927_priv *max98927 =3D snd_soc_codec_get_drvdata(codec= ); >> + unsigned int sel =3D 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. > > >> +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 inf= ormation attached to the control? There doesn't seem to be any special beha= viour 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 be= ing 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