From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752874AbbJZTUH (ORCPT ); Mon, 26 Oct 2015 15:20:07 -0400 Received: from down.free-electrons.com ([37.187.137.238]:51605 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751108AbbJZTUF (ORCPT ); Mon, 26 Oct 2015 15:20:05 -0400 Date: Mon, 26 Oct 2015 20:20:02 +0100 From: Maxime Ripard To: Code Kipper Cc: Liam Girdwood , linux-arm-kernel , Mark Brown , linux-sunxi , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, "Andrea Venturi (pers)" Subject: Re: [PATCH v2 4/4] ASOC: sunxi: Add support for the spdif block Message-ID: <20151026192002.GZ10947@lukather> References: <1443635458-8873-1-git-send-email-codekipper@gmail.com> <1443635458-8873-5-git-send-email-codekipper@gmail.com> <20151001201122.GM7104@lukather> <20151006090042.GR2696@lukather> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="z9U9oWULJx7fFSwf" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --z9U9oWULJx7fFSwf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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_R= ESET); > >> >> + > >> >> + /* MCLK OUTPUT enable */ > >> >> + regmap_update_bits(host->regmap, SUN4I_SPDIF_CTL, > >> >> + SUN4I_SPDIF_CTL_MCLKOUTEN, SUN4I_SPDIF_CTL_MC= LKOUTEN); > >> > > >> > 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. >=20 > 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 =3D substream->private_data; > >> >> + struct sun4i_spdif_dev *host =3D snd_soc_dai_get_drvdata(rtd-= >cpu_dai); > >> >> + > >> >> + if (substream->stream !=3D 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. >=20 > 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 --=20 Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --z9U9oWULJx7fFSwf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWLnziAAoJEBx+YmzsjxAgY5EP/3d9SLC5Zb44URpVGxz2v4Wf VPj2lUxN0AeSNeVd+u5nh84ej7TnOqMy7oOUMTBInOgLV7ZC5R1Oyb6L4Bp4csyx oWAo02MfkOE3ZmTJsS/MLWa7i0pIi+52534mW0nKGHmZDNJkm71NC2DSOu6Dxk6g gA6qpFVDHIB35Iu2PUhuDemNnUiQKtAiSyoR9GoEy87lwfUA+TsWG9c4gUiq8152 xZhSk5gQ/+xJHB1q7zHE0czqar5mM6W0xfFANf6gx3DmFjCEtruBk3GK1VrxiTaX UrBF2oIstL9jpQCevw3idjDCZYTxt4jD6zxa4x+Oae1CgtxyfbyhWIWHgZPFdtyg jg3BxL6JHNqQs50xwl4tAjrMYvFUotnoY29qZSfTKhIvFMD+JVenjZ3blF/hOVUH cdur6jWm0OdILQ37O+PaUMWP+lYl35OQrxDRnbhivTZnlcfdzh4OW1UCljJBCM07 smF7Nun9GrT8boGfu9NWXoUGvlpxsQzOq+og+0uIF3V9Dr84jQi45csMMknYESO9 aVUywbu5dYI3xPVr5EVjntoeI6WNZR4i6CypvC5CCRC8/i1tkECdtxRYBh0+qJoI CsPnu2lzRmS7O/ronrgbUNNJkZXS8UDJ8j6YhlUr9cn5HMcxfFmwnZk3JN3sDUi8 NhLeUAvVj3b6SR6Iwdoz =T9wj -----END PGP SIGNATURE----- --z9U9oWULJx7fFSwf--