devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
	alsa-devel@alsa-project.org, bgoswami@codeaurora.org,
	linux-kernel@vger.kernel.org, lgirdwood@gmail.com,
	robh+dt@kernel.org, tiwai@suse.com, vkoul@kernel.org,
	broonie@kernel.org
Subject: Re: [PATCH v2 02/10] mfd: wcd9335: add support to wcd9335 core
Date: Thu, 2 Aug 2018 10:57:41 +0100	[thread overview]
Message-ID: <20180802095741.GP4662@dell> (raw)
In-Reply-To: <9a33e0ce-a385-cdad-f610-655562bec1f5@linaro.org>

On Thu, 02 Aug 2018, Srinivas Kandagatla wrote:
> On 02/08/18 09:33, Lee Jones wrote:
> > On Fri, 27 Jul 2018, Srinivas Kandagatla wrote:
> > 
> > > Qualcomm WCD9335 Codec is a standalone Hi-Fi audio codec IC,
> > > It has mulitple blocks like Soundwire controller, codec,
> > > Codec processing engine, ClassH controller, interrupt mux.
> > > It supports both I2S/I2C and SLIMbus audio interfaces.
> > > 
> > > This patch adds support to SLIMbus audio interface.
> > > 
> > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> > > ---
> > >   drivers/mfd/Kconfig                   |  18 ++
> > >   drivers/mfd/Makefile                  |   4 +
> > >   drivers/mfd/wcd9335-core.c            | 268 ++++++++++++++++
> > >   include/linux/mfd/wcd9335/registers.h | 580 ++++++++++++++++++++++++++++++++++
> > >   include/linux/mfd/wcd9335/wcd9335.h   |  42 +++
> > >   5 files changed, 912 insertions(+)
> > >   create mode 100644 drivers/mfd/wcd9335-core.c
> > >   create mode 100644 include/linux/mfd/wcd9335/registers.h
> > >   create mode 100644 include/linux/mfd/wcd9335/wcd9335.h
> > > 
> > > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> > > index f3fa516011ec..6e5b5f3cfe20 100644
> > > --- a/drivers/mfd/Kconfig
> > > +++ b/drivers/mfd/Kconfig
> > > @@ -1807,6 +1807,24 @@ config MFD_WM97xx
> > >   	  support for the WM97xx, in order to use the actual functionaltiy of
> > >   	  the device other drivers must be enabled.
> > > +config MFD_WCD9335
> > > +	tristate
> > > +	select MFD_CORE
> > > +	select REGMAP
> > > +	select REGMAP_IRQ
> > > +
> > > +config MFD_WCD9335_SLIM
> > > +	tristate "Qualcomm WCD9335 with SLIMbus"
> > > +	select MFD_WCD9335
> > > +	select REGMAP_SLIMBUS
> > > +	depends on SLIMBUS
> > > +	help
> > > +	The WCD9335 is a standalone Hi-Fi audio codec IC, supports
> > 
> > s/codec/CODEC/
> Yep.

If you agree with something, best just to snip it.

No need to reply at all if you agree with everything.

[...]

> > > +static int wcd9335_power_on_reset(struct wcd9335 *wcd)
> > > +{
> > > +	struct device *dev = wcd->dev;
> > > +	int ret;
> > > +
> > > +	ret = regulator_bulk_enable(WCD9335_MAX_SUPPLY, wcd->supplies);
> > > +	if (ret != 0) {
> > > +		dev_err(dev, "Failed to get supplies: err = %d\n", ret);
> > > +		return ret;
> > > +	}
> > > +
> > > +	/*
> > > +	 * For WCD9335, it takes about 600us for the Vout_A and
> > > +	 * Vout_D to be ready after BUCK_SIDO is powered up.
> > > +	 * SYS_RST_N shouldn't be pulled high during this time
> > > +	 */
> > > +	usleep_range(600, 650);
> > > +
> > > +	gpio_direction_output(wcd->reset_gpio, 0);
> > > +	msleep(20);
> > 
> > What's this for?  Why can't you just:
> > 
> This is just making sure that reset line is low before actual the chip is
> taken out of reset.

If it confused me, it might confuse others.

Best to add a comment to the tune of:

  "Toggle reset line off/on to ensure ... "

> >    gpio_direction_output(wcd->reset_gpio, 1);
> > 
> > ... and drop the next 2 lines?

[...]

> > > +static const struct mfd_cell wcd9335_devices[] = {
> > > +	{
> > > +		.name = "wcd9335-codec",
> > > +	},
> > > +};
> > 
> > When are you going to add the other devices?
> > 
> We are trying to sort of hw setup to test other devices like soundwire
> controller, will add these once we are in a position to test them.

Ensure that you do, or I'll revert the whole driver as "not an MFD" :)

> > By the way, one line entries should be placed on one line.
> > 
> > > +	{ .name = "wcd9335-codec" },

[...]

> > > +static int wcd9335_slim_status(struct slim_device *sdev,
> > > +				 enum slim_device_status s)
> > 
> > 's' is not a good variable name.  Suggest 'status'.
> > 
> Agreed!
> > > +{
> > > +	struct device_node *ifd_np;
> > 
> > What's 'ifd'?
> > 
> SLIMbus Interface device.

That's a terrible variable name. :)

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2018-08-02  9:57 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 12:17 [PATCH v2 00/10] ASoC: Add support to WCD9335 Audio Codec Srinivas Kandagatla
2018-07-27 12:17 ` [PATCH v2 01/10] ASoC: dt-bindings: add dt bindings for wcd9335 audio codec Srinivas Kandagatla
2018-07-31 20:43   ` Rob Herring
2018-08-01  8:56     ` Srinivas Kandagatla
2018-08-01 22:20       ` Rob Herring
2018-08-02  7:33         ` Srinivas Kandagatla
2018-08-02 14:07           ` Rob Herring
2018-08-01 11:20   ` Applied "ASoC: dt-bindings: add dt bindings for wcd9335 audio codec" to the asoc tree Mark Brown
2018-08-14 16:24     ` Rob Herring
2018-08-15 10:52       ` Mark Brown
2018-07-27 12:17 ` [PATCH v2 02/10] mfd: wcd9335: add support to wcd9335 core Srinivas Kandagatla
2018-07-30  4:12   ` Vinod
2018-08-01  8:57     ` Srinivas Kandagatla
2018-08-02  8:33   ` Lee Jones
2018-08-02  9:26     ` Srinivas Kandagatla
2018-08-02  9:57       ` Lee Jones [this message]
2018-07-27 12:17 ` [PATCH v2 03/10] mfd: wcd9335: add wcd irq support Srinivas Kandagatla
2018-07-31 20:45   ` Rob Herring
2018-08-01  8:57     ` Srinivas Kandagatla
2018-08-01 22:17       ` Rob Herring
2018-08-02  7:34         ` Srinivas Kandagatla
2018-08-02  8:05   ` Lee Jones
2018-08-02  8:54     ` Srinivas Kandagatla
2018-08-02 10:01       ` Lee Jones
2018-08-02 10:07         ` Srinivas Kandagatla
2018-07-27 12:18 ` [PATCH v2 04/10] ASoC: wcd9335: add support to wcd9335 codec Srinivas Kandagatla
2018-08-01 11:20   ` Applied "ASoC: wcd9335: add support to wcd9335 codec" to the asoc tree Mark Brown
2018-08-01 12:24     ` Srinivas Kandagatla
2018-08-02  6:32       ` Lee Jones
2018-07-27 12:18 ` [PATCH v2 05/10] ASoC: wcd9335: add CLASS-H Controller support Srinivas Kandagatla
2018-07-31 17:05   ` Mark Brown
2018-08-01  8:57     ` Srinivas Kandagatla
2018-08-01 11:20   ` Applied "ASoC: wcd9335: add CLASS-H Controller support" to the asoc tree Mark Brown
2018-08-01 12:26     ` Srinivas Kandagatla
2018-08-02  6:31       ` Lee Jones
2018-08-02  9:52         ` Mark Brown
2018-07-27 12:18 ` [PATCH v2 06/10] ASoC: wcd9335: add basic controls Srinivas Kandagatla
2018-07-31 17:16   ` Mark Brown
2018-08-01  8:57     ` Srinivas Kandagatla
2018-07-27 12:18 ` [PATCH v2 07/10] ASoC: wcd9335: add playback dapm widgets Srinivas Kandagatla
2018-07-27 12:18 ` [PATCH v2 08/10] ASoC: wcd9335: add capture " Srinivas Kandagatla
2018-07-27 12:18 ` [PATCH v2 09/10] ASoC: wcd9335: add audio routings Srinivas Kandagatla
2018-07-27 12:18 ` [PATCH v2 10/10] ASoC: apq8096: add support to Analog audio via WCD9335 slim Srinivas Kandagatla
2018-07-30  4:49 ` [PATCH v2 00/10] ASoC: Add support to WCD9335 Audio Codec Vinod

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=20180802095741.GP4662@dell \
    --to=lee.jones@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@codeaurora.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    --cc=vkoul@kernel.org \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).