alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Code Kipper <codekipper-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-arm-kernel
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-sunxi <linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	"Andrea Venturi (pers)"
	<be17068-p0aYb1w59bq9tCD/VL7h6Q@public.gmane.org>
Subject: Re: [PATCH v2 4/4] ASOC: sunxi: Add support for the spdif block
Date: Mon, 26 Oct 2015 20:20:02 +0100	[thread overview]
Message-ID: <20151026192002.GZ10947@lukather> (raw)
In-Reply-To: <CAEKpxB=UZMe1=A7wguiyPn=YhuUaj8B8Ajc0nADVFcHEWQgvvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2606 bytes --]

Hi,

On Tue, Oct 06, 2015 at 12:38:57PM +0200, Code Kipper wrote:
> >> >> +static void sun4i_spdif_configure(struct sun4i_spdif_dev *host)
> >> >> +{
> >> >> +     u32 reg_val;
> >> >> +
> >> >> +     /* soft reset SPDIF */
> >> >> +     regmap_write(host->regmap, SUN4I_SPDIF_CTL, SUN4I_SPDIF_CTL_RESET);
> >> >> +
> >> >> +     /* MCLK OUTPUT enable */
> >> >> +     regmap_update_bits(host->regmap, SUN4I_SPDIF_CTL,
> >> >> +                     SUN4I_SPDIF_CTL_MCLKOUTEN, SUN4I_SPDIF_CTL_MCLKOUTEN);
> >> >
> >> > The alignment is still not right....
> >>
> >> I'm not even sure if we need mclk output enabled. Let me see what
> >> happens when I remove this.
> >
> > It's not really the point. The alignment of all your wrapped lines is
> > wrong.
> 
> Ahhhh....I was brought up to not mix tabs and spaces and I now see
> with a quick check that checkpatch doesn't barf...I'll fix this.

checkpatch --strict does

> >> >> +static int sun4i_spdif_startup(struct snd_pcm_substream *substream,
> >> >> +                             struct snd_soc_dai *cpu_dai)
> >> >> +{
> >> >> +     struct snd_soc_pcm_runtime *rtd = substream->private_data;
> >> >> +     struct sun4i_spdif_dev *host = snd_soc_dai_get_drvdata(rtd->cpu_dai);
> >> >> +
> >> >> +     if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
> >> >> +             return -EINVAL;
> >> >> +
> >> >> +     sun4i_spdif_configure(host);
> >> >> +
> >> >> +     return clk_prepare_enable(host->clk);
> >> >
> >> > You're still not using pm_runtime...
> >>
> >> I've removed the pm stuff and this is the same as you have it in
> >> sun4i-codec.
> >
> > You've removed the suspend code, and both Mark and I asked you to use
> > runtime_pm to handle your bus clock.
> >
> > And this has also been asked for the codec.
> 
> You asked if I had tested the pm operations which I hadn't so I
> removed them after looking at your driver and searching for pm_runtime
> usage elsewhere in sound/soc. I will add them back.

What we asked you to remove were the suspend / resume hooks. What we
want you to add are runtime_pm hooks. These are not the same hooks,
and they're not called at the same moment.

The suspend / resume hooks are called before entering suspend and
after coming back from it. We don't have no way to suspend at the
moment, so there's no way you've been able to test it.

The runtime_pm hooks are called whenever your device start to be used
(for example when you start playing back an audio file on your
system).

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

      parent reply	other threads:[~2015-10-26 19:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 17:50 [PATCH v2 0/4] Add SPDIF support for Allwinner SoCs codekipper-Re5JQEeQqe8AvxtiuMwx3w
     [not found] ` <1443635458-8873-1-git-send-email-codekipper-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-30 17:50   ` [PATCH v2 1/4] dt-bindings: add sunxi SPDIF transceiver bindings codekipper-Re5JQEeQqe8AvxtiuMwx3w
     [not found]     ` <1443635458-8873-2-git-send-email-codekipper-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-01 20:12       ` Maxime Ripard
2015-10-02  5:24         ` Code Kipper
     [not found]           ` <CAEKpxB=kdmrbeiq8M=dXmpccxOhd7UZTaMkLZGo9TdRB1kMz3g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-05  8:41             ` Maxime Ripard
2015-10-05 10:40               ` Code Kipper
2015-09-30 17:50   ` [PATCH v2 2/4] dt-binding: Add sunxi S/PDIF machine driver codekipper-Re5JQEeQqe8AvxtiuMwx3w
2015-09-30 17:50   ` [PATCH v2 3/4] ASoC: sunxi: Add " codekipper-Re5JQEeQqe8AvxtiuMwx3w
2015-09-30 17:50   ` [PATCH v2 4/4] ASOC: sunxi: Add support for the spdif block codekipper-Re5JQEeQqe8AvxtiuMwx3w
2015-09-30 18:26     ` [PATCH] ASOC: sunxi: fix platform_no_drv_owner.cocci warnings kbuild test robot
2015-09-30 18:26     ` [PATCH v2 4/4] ASOC: sunxi: Add support for the spdif block kbuild test robot
2015-09-30 18:52     ` [RFC PATCH] ASOC: sunxi: sun4i_snd_txctrl_on() can be static kbuild test robot
     [not found]     ` <1443635458-8873-5-git-send-email-codekipper-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-30 18:52       ` [PATCH v2 4/4] ASOC: sunxi: Add support for the spdif block kbuild test robot
2015-10-01 20:11       ` Maxime Ripard
2015-10-02  6:44         ` Code Kipper
     [not found]           ` <CAEKpxB=_coi06gaixgqpLm=AFbw2mPVLPim7HCk-T-Lnsgt6mw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-06  9:00             ` Maxime Ripard
2015-10-06 10:38               ` Code Kipper
     [not found]                 ` <CAEKpxB=UZMe1=A7wguiyPn=YhuUaj8B8Ajc0nADVFcHEWQgvvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-26 19:20                   ` Maxime Ripard [this message]

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=20151026192002.GZ10947@lukather \
    --to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=be17068-p0aYb1w59bq9tCD/VL7h6Q@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=codekipper-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.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).