public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>, Stephen Kitt <steve@sk2.org>,
	<patches@opensource.cirrus.com>, <alsa-devel@alsa-project.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] ASoC: wm8940: Rewrite code to set proper clocks
Date: Wed, 14 Dec 2022 22:01:22 +0100	[thread overview]
Message-ID: <20221214220122.093f0690@wsk> (raw)
In-Reply-To: <20221214133136.GQ105268@ediswmail.ad.cirrus.com>

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

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.
> > 
> > This change adjusts this driver to allow non-standard frequency
> > set (just after the boot) being adjusted afterwards by the sound
> > system core code.
> > 
> > Moreover, support for internal wm8940's PLL is provided, so it
> > can generate clocks when HOST system is not able to do it.
> > 
> > Code in this commit is based on previous change done for wm8974
> > (SHA1: 51b2bb3f2568e6d9d81a001d38b8d70c2ba4af99).
> > 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> >  	struct snd_soc_component *component = dai->component;
> > +	struct wm8940_priv *priv =
> > snd_soc_component_get_drvdata(component); u16 iface =
> > snd_soc_component_read(component, WM8940_IFACE) & 0xFD9F; u16
> > addcntrl = snd_soc_component_read(component, WM8940_ADDCNTRL) &
> > 0xFFF1; u16 companding =  snd_soc_component_read(component,
> > WM8940_COMPANDINGCTL) & 0xFFDF; int ret;
> >  
> > +	priv->fs = params_rate(params);
> > +	ret = wm8940_update_clocks(dai);
> > +	if (ret)
> > +		return ret;
> > +  
> 
> 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.

> 
> 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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-12-14 21:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14 12:37 [PATCH 0/4] ASoC: Fixes for WM8940 codec Lukasz Majewski
2022-12-14 12:37 ` [PATCH 1/4] ASoC: wm8940: Remove warning when no plat data present Lukasz Majewski
2022-12-14 13:10   ` Charles Keepax
2022-12-14 12:37 ` [PATCH 2/4] ASoC: wm8940: Rewrite code to set proper clocks Lukasz Majewski
2022-12-14 13:31   ` Charles Keepax
2022-12-14 21:01     ` Lukasz Majewski [this message]
2022-12-14 13:56   ` Mark Brown
2022-12-14 21:10     ` Lukasz Majewski
2022-12-14 12:37 ` [PATCH 3/4] ASoC: wm8940: Mute also the speaker output Lukasz Majewski
2022-12-14 13:09   ` Charles Keepax
2022-12-14 14:19   ` Mark Brown
2022-12-14 20:55     ` Lukasz Majewski
2022-12-15  8:53       ` Lukasz Majewski
2022-12-14 12:37 ` [PATCH 4/4] ASoC: wm8940: Read chip ID when wm8940 codec probing Lukasz Majewski
2022-12-14 13:10   ` Charles Keepax
2022-12-15  9:36 ` [PATCH v2 1/3] ASoC: wm8940: Remove warning when no plat data present Lukasz Majewski
2022-12-15  9:36   ` [PATCH v2 2/3] ASoC: wm8940: Rewrite code to set proper clocks Lukasz Majewski
2022-12-15 10:13     ` Charles Keepax
2022-12-15  9:36   ` [PATCH v2 3/3] ASoC: wm8940: Read chip ID when wm8940 codec probing Lukasz Majewski
2022-12-15 11:08   ` [PATCH v2 1/3] ASoC: wm8940: Remove warning when no plat data present Mark Brown
2022-12-15 13:59     ` Lukasz Majewski
2022-12-27 11:57 ` (subset) [PATCH 0/4] ASoC: Fixes for WM8940 codec Mark Brown
2022-12-27 11:57 ` 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=20221214220122.093f0690@wsk \
    --to=lukma@denx.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=steve@sk2.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