mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Richard Fitzgerald <rf@opensource.cirrus.com>
Cc: linux-spi@vger.kernel.org, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, patches@opensource.cirrus.com
Subject: Re: [PATCH] spi: cs42l43: Workaround for wrong speaker ID on Dell XPS 13 DX13260
Date: Sun, 20 Sep 2026 17:14:06 +0200	[thread overview]
Message-ID: <aq_4PuwVngaLZ3_F@sirena.org.uk> (raw)
In-Reply-To: <20260919134730.895381-1-rf@opensource.cirrus.com>

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

On Sat, Sep 19, 2026 at 02:47:30PM +0100, Richard Fitzgerald wrote:
> Create an acpi_gpio_mapping so that speaker ID GPIOs can be read directly
> from the ACPI GpioIo() instead of relying on the spk-id-gpios property to
> have the correct number of pins. Change the reading loop to read each pin
> one at a time until it reaches a pin index that doesn't exist.

...

> Instead of quirking this specific system, the code can be rewritten so
> that it will always use the direct GpioIo() mapping. This works on all
> ACPI systems, so avoids having to keep adding quirks for other systems
> that have the same ACPI error.

Is there an overlap with cs35l56_try_get_broken_sdca_spkid_gpio() here?
Didn't check thoroughly, and if they are doing the same thing it's
probably reasonable to factor out incrementally.

> +       struct cs42l43_spk_id_gpio_mapping *mapping __free(kfree) = kzalloc_obj(*mapping,

kzalloc_obj() needs slab.h (which will be implicitly included anyway but
still).

> +static int cs42l43_get_speaker_id_gpios(struct cs42l43_spi *priv, int *result)
> +{
> +	struct fwnode_handle *gpio_fwnode = dev_fwnode(priv->dev);
> +	struct cs42l43_spk_id_gpio_mapping *mapping = NULL;
> +	struct gpio_desc *desc;
> +	u32 spkid = 0;
> +	int i, ret = 0;
> +
> +	if (is_acpi_node(gpio_fwnode)) {
> +		mapping = cs42l43_add_speaker_id_gpio_mapping(priv);
> +		if (IS_ERR(mapping)) {
> +			ret = PTR_ERR(mapping);
> +			if (ret == -ENOENT)
> +				return 0;
> +
> +			return ret;
> +		}

Could we see an -EBUSY if there's something else using another GPIO from
the same provider?  I'm a bit fuzzy on the ACPI mappings so possibly
that can't happen.

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

      reply	other threads:[~2026-09-20 15:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19 13:47 Richard Fitzgerald
2026-09-20 15:14 ` Mark Brown [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=aq_4PuwVngaLZ3_F@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rf@opensource.cirrus.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®