linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Van Asbroeck <thesven73@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	alsa-devel@alsa-project.org,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 2/2] ASoC: Add initial ZL38060 driver
Date: Thu, 16 Apr 2020 11:23:14 -0400	[thread overview]
Message-ID: <CAGngYiVXk+1Qzs3yLwyne3X567_yvbuRfXkjihmGc0EigHo50A@mail.gmail.com> (raw)
In-Reply-To: <20200416124239.GH5354@sirena.org.uk>

Thank you Mark for the constructive feedback !
A few follow-up questions below.

On Thu, Apr 16, 2020 at 8:42 AM Mark Brown <broonie@kernel.org> wrote:
>
> > +++ b/sound/soc/codecs/zl38060.c
> > @@ -0,0 +1,643 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +/*
> > + * Codec driver for Microsemi ZL38060 Connected Home Audio Processor.
> > + *
>
> Please make the entire comment a C++ one so things look more
> intentional.

The 'weird' combination of // SPDX and /* Description/copyright */ seems to
be a kernel-wide standard (for C files, at least) ?

E.g.:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/codecs/wm9090.c?h=v5.7-rc1#n2
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/codecs/wm8904.c?h=v5.7-rc1#n2

Ok to keep?

>
> > +skip_setup:
> > +     if (priv->amp_en_gpio && tx) {
> > +             /* enable the external amplifier before playback starts */
> > +             gpiod_set_value_cansleep(priv->amp_en_gpio, 1);
> > +             if (priv->amp_startup_delay_ms)
> > +                     msleep(priv->amp_startup_delay_ms);
> > +     }
>
> This external amplifier support shouldn't be here, if there's other
> devices in the system then they will have their own drivers and the
> machine driver will take care of linking things together.

In our application, the amp is a "dumb" class-D amp with a single enable line:
https://www.onsemi.com/pub/Collateral/FAB3103-D.pdf

I am not sure how I could make this more general. Could you point me to an
example somewhere in the tree?

>
> > +     priv->regmap = devm_regmap_init(dev, &zl38_regmap_bus, spi,
> > +                                     &zl38_regmap_conf);
> > +     if (IS_ERR(priv->regmap))
> > +             return PTR_ERR(priv->regmap);
>
> devm_regmap_init_spi()

I wish !! This chip has complex SPI addressing, using an "address" which:
- is variable length, depending on the page of the register being accessed;
- contains a field with the length of the data to follow.

Unfortunately, during firmware programming, multi-writes are mandatory
(usually address header + 32 data bytes).

Implementing my own regmap_bus looked like the only way out.

  reply	other threads:[~2020-04-16 15:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16  0:14 [PATCH v1 1/2] dt-bindings: sound: add Microsemi ZL38060 binding Sven Van Asbroeck
2020-04-16  0:14 ` [PATCH v1 2/2] ASoC: Add initial ZL38060 driver Sven Van Asbroeck
2020-04-16 12:42   ` Mark Brown
2020-04-16 15:23     ` Sven Van Asbroeck [this message]
2020-04-16 15:51       ` Mark Brown

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=CAGngYiVXk+1Qzs3yLwyne3X567_yvbuRfXkjihmGc0EigHo50A@mail.gmail.com \
    --to=thesven73@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --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: 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).