From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Hans de Goede <hansg@kernel.org>, Khalil <khalilst@gmail.com>,
broonie@kernel.org, ilpo.jarvinen@linux.intel.com
Cc: linux-spi@vger.kernel.org, platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, Khalil <khalil@rentman.nl>
Subject: Re: [PATCH v2 2/3] platform/x86: serial-multi-instantiate: Fix SPI chip select on platforms with incomplete ACPI cs-gpios
Date: Mon, 13 Apr 2026 13:51:22 +0100 [thread overview]
Message-ID: <a451416b-80a6-439f-8340-e53e4b30d87a@opensource.cirrus.com> (raw)
In-Reply-To: <6af0a67a-c028-45c5-b514-52570ecfcc68@kernel.org>
On 13/04/2026 12:43 pm, Hans de Goede wrote:
> Hi,
>
> On 13-Apr-26 12:05 PM, Khalil wrote:
>> Some HP laptops with Intel Lunar Lake and dual Cirrus Logic CS35L56
>> amplifiers over SPI have an incomplete cs-gpios property in the SPI
>> controller's _DSD - it only declares the first chip select. The
>> remaining chip select GPIOs are defined as GpioIo resources in the
>> peripheral's ACPI node but are not referenced by the controller.
>>
>> This causes the SPI framework to reject devices whose chip select
>> exceeds num_chipselect with -EINVAL, preventing the second amplifier
>> from probing.
>>
>> Fix this on known affected platforms by:
>>
<SNIP>
>> +
>> +/*
>> + * ACPI GPIO mapping for the chip select GpioIo resource.
>> + * Maps "cs-gpios" to the GpioIo resource at index 0 of the ACPI _CRS.
>> + */
>> +static const struct acpi_gpio_params smi_cs_gpio_params = { 0, 0, false };
>> +
>> +static const struct acpi_gpio_mapping smi_cs_gpio_mapping[] = {
>> + { "cs-gpios", &smi_cs_gpio_params, 1 },
>> + { }
>> };
>
> I'm confused here you say that the chip-select for the second amplifier
> is missing, but I would expect that to be the GpioIo resource at index 1
> not 0?
>
> I would expect the GpioIo resource at index 0 to be for the first
> amplifier which does have a GPIO already in the _DSD cs-gpios property ?
>
> Since this is a multi-serial device ACPI node, there is only one
> set of resources for both amplifiers (with their also being 2 SPI
> resources in the _CRS list).
>
> So I would expect there to also be multiple GPIO entries in the
> _CRS list, with the order of the chip-selects GPIOs resources matching
> the order of the SPI resources.
You can't assume that. There is no ACPI reason why the GpioIo should be
in order of chip selects. In fact, some manufacturers scramble them
(e.g. CS2, CS1, CS3). You have to remember that the ACPI is written so
that it works with Windows (which is the reason we need this serial
multi-instantiate driver.) so it may contain Windowsisms.
next prev parent reply other threads:[~2026-04-13 12:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 10:05 [PATCH v2 0/3] Fix CS35L56 amplifier on Intel LPSS SPI with broken ACPI cs-gpios Khalil
2026-04-13 10:05 ` [PATCH v2 1/3] spi: Preserve preset cs_gpiod in __spi_add_device() Khalil
2026-04-13 14:01 ` Mark Brown
2026-04-13 10:05 ` [PATCH v2 2/3] platform/x86: serial-multi-instantiate: Fix SPI chip select on platforms with incomplete ACPI cs-gpios Khalil
2026-04-13 10:44 ` Ilpo Järvinen
2026-04-13 11:43 ` Hans de Goede
2026-04-13 12:51 ` Richard Fitzgerald [this message]
2026-04-13 15:05 ` Hans de Goede
2026-04-13 10:05 ` [PATCH v2 3/3] spi: pxa2xx: Handle clock gating for GPIO chip select devices Khalil
-- strict thread matches above, loose matches on Subject: below --
2026-04-13 10:01 [PATCH v2 0/3] Fix CS35L56 amplifier on Intel LPSS SPI with broken ACPI cs-gpios Khalil
2026-04-13 10:01 ` [PATCH v2 2/3] platform/x86: serial-multi-instantiate: Fix SPI chip select on platforms with incomplete " Khalil
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=a451416b-80a6-439f-8340-e53e4b30d87a@opensource.cirrus.com \
--to=rf@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=khalil@rentman.nl \
--cc=khalilst@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/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