From: Mark Brown <broonie@kernel.org> To: Arnd Bergmann <arnd@arndb.de> Cc: Liam Girdwood <lgirdwood@gmail.com>, Akshu Agrawal <akshu.agrawal@amd.com>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Oder Chiou <oder_chiou@realtek.com>, Cezary Rojewski <cezary.rojewski@intel.com>, Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH] ASoC: rt5682: split i2c driver into separate module Date: Wed, 27 May 2020 21:56:58 +0100 [thread overview] Message-ID: <20200527205658.GM5308@sirena.org.uk> (raw) In-Reply-To: <20200527193730.930412-1-arnd@arndb.de> [-- Attachment #1: Type: text/plain, Size: 1319 bytes --] On Wed, May 27, 2020 at 09:34:13PM +0200, Arnd Bergmann wrote: > index 000000000000..c891aa80757f > --- /dev/null > +++ b/sound/soc/codecs/rt5682-i2c.c > @@ -0,0 +1,341 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * rt5682.c -- RT5682 ALSA SoC audio component driver > + * Please keep the entire comment C++ so things look more intentional. > +static const char *rt5682_supply_names[RT5682_NUM_SUPPLIES] = { > + "AVDD", > + "MICVDD", > + "VBAT", > +}; I'm *fairly* sure the device needs power even with Soundwire? > +static void rt5682_jd_check_handler(struct work_struct *work) > +{ > + struct rt5682_priv *rt5682 = container_of(work, struct rt5682_priv, > + jd_check_work.work); > +static int rt5682_parse_dt(struct rt5682_priv *rt5682, struct device *dev) > +{ > + > + device_property_read_u32(dev, "realtek,dmic1-data-pin", > + &rt5682->pdata.dmic1_data_pin); > + device_property_read_u32(dev, "realtek,dmic1-clk-pin", > + &rt5682->pdata.dmic1_clk_pin); This doesn't look very I2C specific either, nor do chunks of the rest of the code. The usual pattern with this stuff is to have the bus specific code do bus specific stuff like setting up the regmap and then call into a common init function for the shared parts of the chip. I'd expect a bit more unshared code here but not this much. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org> To: Arnd Bergmann <arnd@arndb.de> Cc: Oder Chiou <oder_chiou@realtek.com>, Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>, Cezary Rojewski <cezary.rojewski@intel.com>, alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>, linux-kernel@vger.kernel.org, Takashi Iwai <tiwai@suse.com>, Akshu Agrawal <akshu.agrawal@amd.com> Subject: Re: [PATCH] ASoC: rt5682: split i2c driver into separate module Date: Wed, 27 May 2020 21:56:58 +0100 [thread overview] Message-ID: <20200527205658.GM5308@sirena.org.uk> (raw) In-Reply-To: <20200527193730.930412-1-arnd@arndb.de> [-- Attachment #1: Type: text/plain, Size: 1319 bytes --] On Wed, May 27, 2020 at 09:34:13PM +0200, Arnd Bergmann wrote: > index 000000000000..c891aa80757f > --- /dev/null > +++ b/sound/soc/codecs/rt5682-i2c.c > @@ -0,0 +1,341 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * rt5682.c -- RT5682 ALSA SoC audio component driver > + * Please keep the entire comment C++ so things look more intentional. > +static const char *rt5682_supply_names[RT5682_NUM_SUPPLIES] = { > + "AVDD", > + "MICVDD", > + "VBAT", > +}; I'm *fairly* sure the device needs power even with Soundwire? > +static void rt5682_jd_check_handler(struct work_struct *work) > +{ > + struct rt5682_priv *rt5682 = container_of(work, struct rt5682_priv, > + jd_check_work.work); > +static int rt5682_parse_dt(struct rt5682_priv *rt5682, struct device *dev) > +{ > + > + device_property_read_u32(dev, "realtek,dmic1-data-pin", > + &rt5682->pdata.dmic1_data_pin); > + device_property_read_u32(dev, "realtek,dmic1-clk-pin", > + &rt5682->pdata.dmic1_clk_pin); This doesn't look very I2C specific either, nor do chunks of the rest of the code. The usual pattern with this stuff is to have the bus specific code do bus specific stuff like setting up the regmap and then call into a common init function for the shared parts of the chip. I'd expect a bit more unshared code here but not this much. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-05-27 20:57 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-27 19:34 [PATCH] ASoC: rt5682: split i2c driver into separate module Arnd Bergmann 2020-05-27 19:34 ` Arnd Bergmann 2020-05-27 20:56 ` Mark Brown [this message] 2020-05-27 20:56 ` Mark Brown 2020-05-27 21:57 ` Arnd Bergmann 2020-05-27 21:57 ` Arnd Bergmann 2020-05-27 22:07 ` Mark Brown 2020-05-27 22:07 ` Mark Brown 2020-05-27 21:57 ` Pierre-Louis Bossart 2020-05-27 21:57 ` Pierre-Louis Bossart
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=20200527205658.GM5308@sirena.org.uk \ --to=broonie@kernel.org \ --cc=akshu.agrawal@amd.com \ --cc=alsa-devel@alsa-project.org \ --cc=arnd@arndb.de \ --cc=cezary.rojewski@intel.com \ --cc=lgirdwood@gmail.com \ --cc=linux-kernel@vger.kernel.org \ --cc=oder_chiou@realtek.com \ --cc=perex@perex.cz \ --cc=pierre-louis.bossart@linux.intel.com \ --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: linkBe 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.