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 Content-Length: 3019 Lines: 70 > -----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