Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752701AbdLYOac (ORCPT ); Mon, 25 Dec 2017 09:30:32 -0500 Received: from mail-bl2nam02on0117.outbound.protection.outlook.com ([104.47.38.117]:17816 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752210AbdLYOa3 (ORCPT ); Mon, 25 Dec 2017 09:30:29 -0500 From: Ryan Lee To: Kuninori Morimoto CC: "lgirdwood@gmail.com" , "broonie@kernel.org" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "perex@perex.cz" , "tiwai@suse.com" , "arnd@arndb.de" , "afd@ti.com" , "robert.jarzmik@free.fr" , "supercraig0719@gmail.com" , "jbrunet@baylibre.com" , "dannenberg@ti.com" , "romain.perier@collabora.com" , "bryce.ferguson@rockwellcollins.com" , "m-stecklein@ti.com" , "alsa-devel@alsa-project.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "ryan.lee.maxim@gmail.com" Subject: RE: [PATCH] ASoC: max98373: Added Amplifier Driver Thread-Topic: [PATCH] ASoC: max98373: Added Amplifier Driver Thread-Index: AQHTesaKlJCXDARpSUef19kTwx9mC6NOolsAgAQCZ2A= Date: Mon, 25 Dec 2017 14:30:23 +0000 Message-ID: References: <1513907030-18441-1-git-send-email-ryans.lee@maximintegrated.com> <87a7ybo6em.wl%kuninori.morimoto.gx@renesas.com> In-Reply-To: <87a7ybo6em.wl%kuninori.morimoto.gx@renesas.com> Accept-Language: en-US, ko-KR Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=RyanS.Lee@maximintegrated.com; x-originating-ip: [12.235.16.2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY2PR11MB0840;7:k9ty3Ef1Q4b9qMpzHGeW456jw7GXgsB2o100EyYGJcj/anFksmSdD2GAvCCocziMesnbXryGZkXFdvuhii4gmxkNOBqGxnNrGOMEpoFIkK9Op78H7uve0EAqRju26rVM4sY/3GHsy/8QGScgMAijaNq8T5DXEutLmWPHUZM+QhwKb+u1f0EtbOdoG3TWNmOARC2fmSyhmqNBzjP5xp6whyV/6y5zzauy/kNiTf7RG/O76iynCLNZfHoVzkpoh6D1 x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: cc8f9242-6312-4c53-6eda-08d54ba40919 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603307)(7153060);SRVR:BY2PR11MB0840; x-ms-traffictypediagnostic: BY2PR11MB0840: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(191636701735510)(180628864354917)(31051911155226)(9452136761055)(108721460000369); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231023)(944501075)(3002001)(10201501046)(6055026)(6041268)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011);SRVR:BY2PR11MB0840;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:BY2PR11MB0840; x-forefront-prvs: 0532BF6DC2 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(396003)(366004)(39380400002)(346002)(39860400002)(13464003)(199004)(189003)(6246003)(102836004)(97736004)(316002)(5660300001)(25786009)(54906003)(478600001)(105586002)(66066001)(3846002)(106356001)(14454004)(53936002)(72206003)(7416002)(81166006)(81156014)(8936002)(8676002)(68736007)(86362001)(4326008)(2906002)(39060400002)(55016002)(33656002)(9686003)(74316002)(99286004)(6506007)(6436002)(229853002)(77096006)(7696005)(2900100001)(76176011)(6116002)(7736002)(3660700001)(6916009)(3280700002)(2950100002)(305945005)(15866825006);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR11MB0840;H:BY2PR11MB0837.namprd11.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-microsoft-antispam-message-info: QVK5qMwr4X+bqWe1vQoC/q8cX2VE6RMFdoD6X0GADxYQ2KWnIGbxA3mk1Ujt5KjhFVxO7gPia2WnU1xfzPSEug== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: maximintegrated.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc8f9242-6312-4c53-6eda-08d54ba40919 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Dec 2017 14:30:24.0299 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fbd909df-ea69-4788-a554-f24b7854ad03 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR11MB0840 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 vBPEUaSU002905 Content-Length: 2918 Lines: 82 Hi Kuninori Miromoto, >-----Original Message----- >From: Kuninori Morimoto [mailto:kuninori.morimoto.gx@renesas.com] >Sent: Thursday, December 21, 2017 6:24 PM >To: Ryan Lee >Cc: lgirdwood@gmail.com; broonie@kernel.org; robh+dt@kernel.org; >mark.rutland@arm.com; perex@perex.cz; tiwai@suse.com; arnd@arndb.de; >afd@ti.com; robert.jarzmik@free.fr; supercraig0719@gmail.com; >jbrunet@baylibre.com; dannenberg@ti.com; romain.perier@collabora.com; >bryce.ferguson@rockwellcollins.com; m-stecklein@ti.com; alsa-devel@alsa- >project.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; >ryan.lee.maxim@gmail.com >Subject: Re: [PATCH] ASoC: max98373: Added Amplifier Driver > >EXTERNAL EMAIL > > > >Hi Ryan > >> Signed-off-by: Ryan Lee >> --- >> >> Created max98373 amplifier driver. >> >> .../devicetree/bindings/sound/max98373.txt | 43 + >> sound/soc/codecs/Kconfig | 5 + >> sound/soc/codecs/Makefile | 2 + >> sound/soc/codecs/max98373.c | 996 >+++++++++++++++++++++ >> sound/soc/codecs/max98373.h | 225 +++++ >> 5 files changed, 1271 insertions(+) >> create mode 100644 >> Documentation/devicetree/bindings/sound/max98373.txt >> create mode 100644 sound/soc/codecs/max98373.c create mode 100644 >> sound/soc/codecs/max98373.h >(snip) >> +struct max98373_priv { >> + struct regmap *regmap; >> + struct snd_soc_codec *codec; >> + unsigned int sysclk; >> + unsigned int v_slot; >> + unsigned int i_slot; >> + unsigned int spkfb_slot; >> + bool interleave_mode; >> + unsigned int ch_size; >> + unsigned int iface; >> + bool tdm_mode; >> +}; > >About this max98373->codec. >This user is only max98373_set_clock(), and it is called from >max98373_dai_hw_params(). >You are getting *codec from dai->codec in this function, and max98373 is >came from it. >This means, we can remove max98373->codec ? Thanks for your feedback. I will remove max98373->codec and change related things. > >About max98373->regmap. >You are using devm_regmap_init_i2c(), and keeping it on max98373. >Can you check snd_soc_component_add() which is called from >snd_soc_add_component(). >It will set component->regmap if you called devm_regmap_init_i2c(). >I think you can use snd_soc_component_read/write instead of >regmap_read/write. >Then, we can remove max98373->regmap too ? >Ahh, you want to check Revision ID. >then, snd_soc_component_init_regmap() can help you ? I'm sorry but I don't fully understand the benefit of this. Keeping regmap information in private driver data is very common and I can see many ASoC drivers are using it. I was able to see only a few driver use ' snd_soc_component_read'. I would like to keep regmap_read/write if it is still acceptable. > >Best regards >--- >Kuninori Morimoto