All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: robh+dt@kernel.org, broonie@kernel.org, mark.rutland@arm.com,
	lgirdwood@gmail.com, bgoswami@codeaurora.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	vkoul@kernel.org, alsa-devel@alsa-project.org
Subject: Re: [PATCH v3 02/13] mfd: wcd9335: add support to wcd9335 core
Date: Wed, 12 Sep 2018 11:59:41 +0100	[thread overview]
Message-ID: <20180912105941.GS4185@dell> (raw)
In-Reply-To: <b4ddfd10-360c-a844-8542-1f81a1cc9c6b@linaro.org>

On Wed, 12 Sep 2018, Srinivas Kandagatla wrote:

> 
> 
> On 12/09/18 09:58, Lee Jones wrote:
> > > > > +static const struct mfd_cell wcd9335_devices[] = {
> > > > > +	{ .name = "wcd9335-codec", },
> > > > > +};
> > > > Are there more devices to come?
> > > > 
> > > Yes, that is the plan, we are kind of limited in hardware setup to test few
> > > things like soundwire controller. We are exploring other ways to test these.
> > I normally don't accept MFDs with just one device enabled.  Since it's
> > not really an MFD (M == Multi) until it has more than one function.
> > 
> 
> WCD9335 Codec hw itself has multiple hw blocks.
> 
> If the issue is about adding more entries to mfd cells then we should be
> able to add below entry:
> 
> 	{ .name = "wcd9335-soundwire-controller", },
> 
> Actual driver for soundwire controller is not something We can test with
> regular dragon boards, it needs special hw for smart speakers. Once we have
> that we can test and post the drivers for that.
> 
> Otherwise
> 
> Are you suggesting that I move everything to  sound/soc/codecs and then back
> to mfd once soundwire controller driver is added?

My preference would be for you to add at least one other (tested)
device.  However, in your case I know where you live, so I can throw
tomatoes at your house if you don't upstream more device support
promptly! ;)

When will you be enabling more devices?  If the answer is 'never',
then creating an MFD is a waste of time.

> > [...]
> > 
> > > > > +	struct device_node *ifc_dev_np;
> > > > ifc isn't very forthcoming.  Any way you can improve the name?
> > > ifc was suggested in dt bindings by Rob,  I can proably rename to
> > > interface_node.
> > ifc is a horrible variable name - just sayin'.
> > 
> > [...]
> > 
> > > > > +	ret = wcd9335_bring_up(wcd);
> > > > So the device_status call-back brings up the hardware?
> > > > 
> > > device status reports the device status at runtime. We can not communicate
> > > with the device until it is up, enumerated by slimbus and a logical address
> > > is assigned to it. So the best place to initialize it is in status callback
> > > where all the above are expected to be done.
> > Right, I understand what's happening.  I just think the semantics are
> > wrong.  The Subsystem (I'm assuming it's a Subsystem) requests for
> > status and it ends up initiating a start-up sequence.  Just from a
> > purist's point of view (I understand that it "works"), it's not good
> > practice.
> > 
> > > Probe is expected to setup the external configurations like regulators/pins
> > > and so on which gets the device out of reset and ready to be enumerated by
> > > the slimbus controller.
> > I suggest fully starting the device in probe() is a better approach.
> > 
> Its catch-22 situation, without device being powered up and reset correctly
> there is no way to enumerate it.

Isn't power-up and reset also done in probe()?

What am I missing?

> > [...]
> > 
> > > > > +struct wcd9335 {
> > > > > +	int version;
> > > > > +	int intr1;
> > > > What's this?  If I have to ask, it's probably not a good name.
> > > > 
> > > This is a hardware pin name for interrupt line 1.
> > I don't see how this is used, so it's difficult for me to advise
> > fully, but I find this confusing.  Pin name/number?  Shouldn't this be
> > handed by Pinctrl?
> > 
> This is represented as proper irq line in dt via  pintrl irq controller.

So why can't it just be 'irq' like most of the time?

What is the 1 in reference to?  Will there be a 2?

> > intr1 could be quite ambiguous.  Especually as the '1' could easily be
> > read as an 'l'.  Suggest that 'irq1' or 'irq_1' or 'irq_one'.
> 
> I can change this to something more readable in next version or may be I can
> even remove it may be just use a local variable.

If it's possible for it to be a local variable, then it should not be
placed in device data.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2018-09-12 10:59 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 10:24 [PATCH v3 00/13] ASoC: Add support to WCD9335 Audio Codec Srinivas Kandagatla
2018-09-04 10:24 ` [PATCH v3 01/13] ASoC: dt-bindings: update wcd9335 bindings Srinivas Kandagatla
2018-09-04 10:24   ` Srinivas Kandagatla
2018-09-10 20:02   ` Rob Herring
2018-09-10 20:02     ` Rob Herring
2018-09-04 10:24 ` [PATCH v3 02/13] mfd: wcd9335: add support to wcd9335 core Srinivas Kandagatla
2018-09-11 15:33   ` Lee Jones
2018-09-12  7:23     ` Srinivas Kandagatla
2018-09-12  8:58       ` Lee Jones
2018-09-12  9:32         ` Srinivas Kandagatla
2018-09-12 10:59           ` Lee Jones [this message]
2018-09-12 11:11             ` Srinivas Kandagatla
2018-09-12 11:46               ` Lee Jones
2018-09-12 12:43                 ` Srinivas Kandagatla
2018-09-17  1:08                   ` Lee Jones
2018-09-04 10:24 ` [PATCH v3 03/13] mfd: wcd9335: add wcd irq support Srinivas Kandagatla
2018-09-04 10:24   ` Srinivas Kandagatla
2018-09-11 15:35   ` Lee Jones
2018-09-11 15:35     ` Lee Jones
2018-09-04 10:24 ` [PATCH v3 04/13] ASoC: wcd9335: add support to wcd9335 codec Srinivas Kandagatla
2018-09-04 10:24   ` Srinivas Kandagatla
2018-09-04 10:24 ` [PATCH v3 05/13] ASoC: wcd9335: add CLASS-H Controller support Srinivas Kandagatla
2018-09-04 10:24   ` Srinivas Kandagatla
2018-09-04 10:24 ` [PATCH v3 06/13] ASoC: wcd9335: add basic controls Srinivas Kandagatla
2018-09-04 10:24 ` [PATCH v3 07/13] ASoC: wcd9335: add playback dapm widgets Srinivas Kandagatla
2018-09-04 10:24 ` [PATCH v3 08/13] ASoC: wcd9335: add capture " Srinivas Kandagatla
2018-09-04 10:24 ` [PATCH v3 09/13] ASoC: wcd9335: add audio routings Srinivas Kandagatla
2018-09-04 10:24 ` [PATCH v3 10/13] ASoC: dt-bindings: Add WCD9335 MBHC specific properties Srinivas Kandagatla
2018-09-10 20:06   ` Rob Herring
2018-09-12  7:44     ` Srinivas Kandagatla
2018-09-04 10:24 ` [PATCH v3 11/13] ASoC: wcd9335: add mbhc support Srinivas Kandagatla
2018-09-04 10:24 ` [PATCH v3 12/13] ASoC: apq8096: add slim support Srinivas Kandagatla
2018-09-10  8:24   ` kbuild test robot
2018-09-10  8:24     ` kbuild test robot
2018-09-04 10:25 ` [PATCH v3 13/13] ASoC: apq8096: add headset JACK support Srinivas Kandagatla

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=20180912105941.GS4185@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=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 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.