mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aaron Kling <webgeek1234@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	 Weidong Wang <wangweidong.a@awinic.com>,
	linux-sound@vger.kernel.org,  linux-kernel@vger.kernel.org,
	Val Packett <val@packett.cool>
Subject: Re: [PATCH 1/6] ASoC: codecs: aw88166: support changing sample rate and bit width
Date: Fri, 25 Sep 2026 10:56:05 -0500	[thread overview]
Message-ID: <CALHNRZ-qO4p6Fa_4te5085Lv35_FftvSB4XDBQVhtoRNmXJhtw@mail.gmail.com> (raw)
In-Reply-To: <93d91d10-3d3c-4dae-bd5a-62a2f71458a0@sirena.org.uk>

On Fri, Sep 25, 2026 at 9:00 AM Mark Brown <broonie@kernel.org> wrote:
>
> On Fri, Sep 25, 2026 at 02:47:29AM -0500, Aaron Kling via B4 Relay wrote:
>
> > The aw88166 driver only worked with 32-bit 48kHz streams so far due to
> > the lack of a proper PLL initialization sequence. Fix by selecting all
> > the necessary PLL settings based on what was passed to us by the
> > hw_params/set_fmt ops. This replaces the strange downstream routine
> > that tries two divider modes in sequence.
>
> > -     ret = regmap_read(aw_dev->regmap, AW88166_PLLCTRL2_REG, &reg_val);
> > +     /* PLL divider must be used for 8/16/32 kHz modes */
> > +     ret = regmap_update_bits(aw_dev->regmap, AW88166_PLLCTRL1_REG,
> > +                     ~AW88166_CCO_MUX_MASK, aw88166->cco_mux_value);
>
> We seem to just completely drop all reference to PLLCTRL2 and switch
> over to PLLCTRL1, I'm going to guess that this means that something that
> used to work now no longer works...

To be honest, I only understand the audio handling at a high level.
This was copied from the aw88261 change almost entirely as-is, as
mentioned in the cover letter. I did some spot checks of the data
sheet to make sure changed addresses were the same and what I checked
did match the 88261 changes. But for the hardware specific stuff, I
unfortunately don't know. What I can say is that after this change,
the AYN Odin3 aw88166 firmware blob from the stock android image works
as-is, where-as before it required some binary patches to start a
stream. Implying that the firmware defaults to settings that didn't
match what the os was using.

> > +static int aw88166_hw_params(struct snd_pcm_substream *substream,
> > +     struct snd_pcm_hw_params *params,
> > +     struct snd_soc_dai *dai)
> > +{
> > +     struct snd_soc_component *component = dai->component;
> > +     struct aw88166 *aw88166 = snd_soc_component_get_drvdata(component);
> > +
> > +     case 32:
> > +             aw88166->bck_value = AW88166_I2SBCK_64FS_VALUE;
> > +             break;
> > +     default:
> > +             dev_err(aw88166->aw_pa->dev, "unsupported physical bit width %d\n",
> > +                     params_physical_width(params));
> > +             return -EINVAL;
> > +     }
> > +
> > +     return 0;
> > +}
>
> This doesn't touch the hardware, it just writes state so if hw_params()
> is called while things are powered up nothing is going to take effect
> until the next stream.

Mmm. As mentioned above, this copies another change, so if it's wrong,
there's more places that need fixed. If there's a better way to handle
this, I can certainly update this patch.

Aaron

  reply	other threads:[~2026-09-25 15:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25  7:47 [PATCH 0/6] ASoC: codecs: aw88166: fixes and cleanup Aaron Kling via B4 Relay
2026-09-25  7:47 ` [PATCH 1/6] ASoC: codecs: aw88166: support changing sample rate and bit width Aaron Kling via B4 Relay
2026-09-25 14:00   ` Mark Brown
2026-09-25 15:56     ` Aaron Kling [this message]
2026-09-25  7:47 ` [PATCH 2/6] ASoC: codecs: aw88166: add TDM support Aaron Kling via B4 Relay
2026-09-25  7:47 ` [PATCH 3/6] ASoC: codecs: aw88166: reduce log spam Aaron Kling via B4 Relay
2026-09-25  7:47 ` [PATCH 4/6] ASoC: codecs: aw88166: remove fade in/out on start/stop Aaron Kling via B4 Relay
2026-09-25 14:11   ` Mark Brown
2026-09-25 15:59     ` Aaron Kling
2026-09-25 16:27       ` Mark Brown
2026-09-25  7:47 ` [PATCH 5/6] ASoC: codecs: aw88166: remove async start Aaron Kling via B4 Relay
2026-09-25 14:12   ` Mark Brown
2026-09-25 15:44     ` Aaron Kling
2026-09-25 16:06       ` Mark Brown
2026-09-25 16:16         ` Aaron Kling
2026-09-25 16:27           ` Mark Brown
2026-09-25 14:35   ` Cezary Rojewski
2026-09-25 15:42     ` Aaron Kling
2026-09-25  7:47 ` [PATCH 6/6] ASoC: codecs: aw88166: make volume control usable Aaron Kling via B4 Relay
2026-09-25 14:18   ` Mark Brown
2026-09-25 16:05     ` Aaron Kling
2026-09-25 16:18       ` Mark Brown
2026-09-25 16:25         ` Aaron Kling
2026-09-25 16:33           ` 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=CALHNRZ-qO4p6Fa_4te5085Lv35_FftvSB4XDBQVhtoRNmXJhtw@mail.gmail.com \
    --to=webgeek1234@gmail.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=val@packett.cool \
    --cc=wangweidong.a@awinic.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

all inboxes | Powered by JetHome®