Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp41410rwb; Wed, 14 Dec 2022 13:44:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf4u+FhvSaN8qgMffAFJIFIXdpQ3wdekoTGjvuzj6byAZxTI3/ZQi4C8eH1IbieiWmDH6IPV X-Received: by 2002:a17:906:9bf0:b0:7c0:9e1d:2e8b with SMTP id de48-20020a1709069bf000b007c09e1d2e8bmr19019821ejc.23.1671054279443; Wed, 14 Dec 2022 13:44:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671054279; cv=none; d=google.com; s=arc-20160816; b=RSw2Mrzknpeijv1GMCUUvECq1JikYnOVtedKcs0tdcj/F8rMUIM083B38A6RrhqZGI 8SziGXOSZW/WEytMedqAJcSO1JLIBmtQmJ4oP/C/sfSYx8ILgh8dTMxqKpAu8TeZE1fs SZW6SX/B/i4bS0iRR+HiJGoujQiJb+lfi4ubhcbTzS7wc91kw9lZ4LIRhUzPmtO0Xh5f sq1qUoXaZc9FYdZE5zVQYz/tzmTc6Uf3TtdSG+WIJaxmJPi+/ewg4P1lo1BLBOuCnvWx 1yneAhwXY3Qb6tBefevMfz1ss0d5ebxX/5jJLlds6sHAJXv4AjMnaAXxpIEEcDZ2PlFp OHxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:organization:references:in-reply-to :message-id:subject:cc:to:from:date:dkim-signature; bh=m6GNF+3ObBWAmoieUyN/Lj65l4LYg0I8NRGLYo7td2Q=; b=X8NUFA94pyNg5pXd75cj69SeWxZaJHcGMrHaeGoomKZzlggABrq6ub4B+xViQgGKJ6 j1hSuw9f6eO7m6sNTSZeOVyuiegQdH5zH1im8EvuEgNscd9IF9rX/6Sf5obX5rX//Ww4 lvnKejzZs4VfSDFzoolbPvVM66lcqPLV3Unb9TQJV/cxi3ixpvV179C05WdtCQpkKz+G +wc2pnUb8AkJhn1HKCQ28ptCDLTzErNip6LL7LXrtUgDESCWZQyiFxDpPri1UXHTrHHY wMD1y5GjBjtY9WQuri/MhfsFd+OGFBJyhC7c+7UwtjHI9jsMPnyG8L9KHqE85V1WGc2r S3Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=QIm0wu5l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di21-20020a170906731500b007c0ab08889fsi13007945ejc.242.2022.12.14.13.44.20; Wed, 14 Dec 2022 13:44:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=QIm0wu5l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229543AbiLNVB3 (ORCPT + 69 others); Wed, 14 Dec 2022 16:01:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiLNVB1 (ORCPT ); Wed, 14 Dec 2022 16:01:27 -0500 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD54B2C112 for ; Wed, 14 Dec 2022 13:01:25 -0800 (PST) Received: from wsk (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 1BA7A8431A; Wed, 14 Dec 2022 22:01:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1671051683; bh=m6GNF+3ObBWAmoieUyN/Lj65l4LYg0I8NRGLYo7td2Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QIm0wu5lndMwQlXEcx8yTACG+iEOsKweJ4tjgQbzb98sbCRS6nsF4UqnPFT5+nDGM MrRMXelKOOHw5KxHd4Loel9OlYCQ8VIFkvOgiiwc4LuWfbYrfcxS1Y+pbgxQKEDMYf rIilIk2X1N+hrm8ASUalMQ0e7PuQSJ7Y0OX15IKgClePg/e+PEDmoD/4KRi0EOimKQ UIQtexFP6/IuqbausAf+SQLVaP0OoUYuJtmdbbRvs1RnTmVCWj+XLu1ZvjA7aYik1Q wp92+6Hyyh+qSIGGYvfBF0+WWcmwOSnKbzWaT4z1J3Cfm24yy7ue4asuUKlVCUf+km XmTUv1YvRSrnA== Date: Wed, 14 Dec 2022 22:01:22 +0100 From: Lukasz Majewski To: Charles Keepax Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Stephen Kitt , , , Subject: Re: [PATCH 2/4] ASoC: wm8940: Rewrite code to set proper clocks Message-ID: <20221214220122.093f0690@wsk> In-Reply-To: <20221214133136.GQ105268@ediswmail.ad.cirrus.com> References: <20221214123743.3713843-1-lukma@denx.de> <20221214123743.3713843-3-lukma@denx.de> <20221214133136.GQ105268@ediswmail.ad.cirrus.com> Organization: denx.de X-Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/sJOxWopwBZ1a4iXGwH5qw3i"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/sJOxWopwBZ1a4iXGwH5qw3i Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Charles, > On Wed, Dec 14, 2022 at 01:37:41PM +0100, Lukasz Majewski wrote: > > Without this change, the wm8940 driver is not working when > > set_sysclk callback (wm8940_set_dai_sysclk) is called with > > frequency not listed in the switch clause. > >=20 > > This change adjusts this driver to allow non-standard frequency > > set (just after the boot) being adjusted afterwards by the sound > > system core code. > >=20 > > Moreover, support for internal wm8940's PLL is provided, so it > > can generate clocks when HOST system is not able to do it. > >=20 > > Code in this commit is based on previous change done for wm8974 > > (SHA1: 51b2bb3f2568e6d9d81a001d38b8d70c2ba4af99). > >=20 > > Signed-off-by: Lukasz Majewski > > --- > > struct snd_soc_component *component =3D dai->component; > > + struct wm8940_priv *priv =3D > > snd_soc_component_get_drvdata(component); u16 iface =3D > > snd_soc_component_read(component, WM8940_IFACE) & 0xFD9F; u16 > > addcntrl =3D snd_soc_component_read(component, WM8940_ADDCNTRL) & > > 0xFFF1; u16 companding =3D snd_soc_component_read(component, > > WM8940_COMPANDINGCTL) & 0xFFDF; int ret; > > =20 > > + priv->fs =3D params_rate(params); > > + ret =3D wm8940_update_clocks(dai); > > + if (ret) > > + return ret; > > + =20 >=20 > I think this all looks mostly good, my only slight concern would > be the interaction with the manual functions for settings the PLL > etc. I guess under this code, whatever manual settings were > configured At least on my system - those settings are not set manually. Everythig is done in the kernel. This is important, as I do may use several other wm89* codecs, which drivers are inserted as modules. > will be overwritten with the new auto settings, I > think this should be fine as the PLL wants to be run in a pretty > narrow band anyway, so the settings are likely identical. Do you > have any thoughts? This code just follows changes done for WM8974 codec. I would leave the code as it is in this patch. >=20 > Thanks, > Charles Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/sJOxWopwBZ1a4iXGwH5qw3i Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAmOaOaIACgkQAR8vZIA0 zr0ppwgAq4USumwfUNbFwEE0l2zmXkhpIZd61zZS35gKrBug7RBtZflc8XM20V1T MRGUW3Q+mns65/tcB+Rl9q6xBhnAK231y9Sn51bxvAJ1l1aqF31zb+4h7RZR46Eu T2kL8835j400dSZifoSwSCoJdfP84aYd96FlPts99XXVW9ETJSRWJnseoqPFVzQu E09bFwsB06L9Ugnk1hH38qnl+sbKOtGhtqwIuqB8SFG3eEdLmli7rzqBkNPwn7QD 8JKOfLZgWKZrG24nR42e09O31Q1Q7act4JEYvEhEzsmLwKOLIEqFvztFc9mpyTx5 D9FOqfgNCIxk+284pDoHsFeWbq16mw== =E278 -----END PGP SIGNATURE----- --Sig_/sJOxWopwBZ1a4iXGwH5qw3i--