public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: David Rhodes <david.rhodes@cirrus.com>,
	Richard Fitzgerald <rf@opensource.cirrus.com>,
	Lee Jones <lee@kernel.org>, Mark Brown <broonie@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	Maciej Strozek <mstrozek@opensource.cirrus.com>,
	Andy Shevchenko <andy@kernel.org>,
	linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
	linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH RFT/RFC] mfd: cs42l43: setup true links with software nodes
Date: Wed, 19 Nov 2025 09:30:59 +0000	[thread overview]
Message-ID: <aR2OU4se7lxcMtGW@opensource.cirrus.com> (raw)
In-Reply-To: <20251119-cs42l43-gpio-swnodes-v1-1-25996afebd97@linaro.org>

On Wed, Nov 19, 2025 at 10:10:24AM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> Currently the SPI driver sets up a software node rerefencing the GPIO
> controller exposing the chip-select GPIO but this node never gets
> attached to the actual GPIO provider. The lookup uses the weird way GPIO
> core performs the software node lookup by the swnode's name. We want to
> switch to a true firmware node lookup so the actual link must exist.
> Move the configuration to the MFD core and connect the SPI and pinctrl
> sub-devices with software node references.
> 
> Fixes: 439fbc97502a ("spi: cs42l43: Add bridged cs35l56 amplifiers")
> Reported-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> Closes: https://lore.kernel.org/all/aRyf7qDdHKABppP8@opensource.cirrus.com/
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
> Hi Charles!
> 
> Please give this a try. It's only build-tested so far. I hope I
> understood correctly that it's the SPI driver that needs the "cs" GPIO
> from the pinctrl.

Unfortunately it fails with an -EBUSY on adding the MFD children.
I will investigate a little more and report back.

> +static const struct software_node cs42l43_gpiochip_swnode = {
> +	.name = "cs42l43-pinctrl",
> +};
> +
> +static const struct property_entry cs42l43_cs_props[] = {
> +	PROPERTY_ENTRY_GPIO("cs-gpios", &cs42l43_gpiochip_swnode, 0, GPIO_ACTIVE_LOW),
> +	{ }
> +};

This drops the undefined node, that is important as it lets the
SPI core know that device is using an internal chip select rather
than a GPIO.

> +static const struct software_node cs42l43_spi_swnode = {
> +	.properties = cs42l43_cs_props,
> +};
> +
>  static const struct mfd_cell cs42l43_devs[] = {
> -	{ .name = "cs42l43-pinctrl", },
> -	{ .name = "cs42l43-spi", },
> +	{
> +		.name = "cs42l43-pinctrl",
> +		.swnode = &cs42l43_gpiochip_swnode,
> +	},
> +	{
> +		.name = "cs42l43-spi",
> +		.swnode = &cs42l43_spi_swnode,

I will need to think about this a little more but I suspect this
no longer being conditional on the magic ACPI properties could
cause issues if a system was to use the SPI controller more
traditionally and actually have CS GPIOs in the firmware.
Although maybe that real node would take preference over the
swnode?

Thanks,
Charles

  reply	other threads:[~2025-11-19  9:31 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19  9:10 [PATCH RFT/RFC] mfd: cs42l43: setup true links with software nodes Bartosz Golaszewski
2025-11-19  9:30 ` Charles Keepax [this message]
2025-11-19  9:35   ` Andy Shevchenko
2025-11-19  9:40   ` Bartosz Golaszewski
2025-11-19  9:57     ` Charles Keepax
2025-11-19 10:20       ` Bartosz Golaszewski
2025-11-19 10:38       ` Bartosz Golaszewski
2025-11-19 10:47         ` Charles Keepax
2025-11-19 10:50           ` Bartosz Golaszewski
2025-11-19 10:58             ` Andy Shevchenko
2025-11-19 11:06               ` Bartosz Golaszewski
2025-11-19 11:24                 ` Charles Keepax
2025-11-19 11:53                   ` Andy Shevchenko
2025-11-19 12:08                     ` Bartosz Golaszewski
2025-11-19 11:58                   ` Bartosz Golaszewski
2025-11-19 12:53                     ` Charles Keepax
2025-11-19 13:07                       ` Bartosz Golaszewski
2025-11-19 13:26                         ` Charles Keepax
2025-11-19 13:34                           ` Bartosz Golaszewski
2025-11-19 14:11                             ` Andy Shevchenko
2025-11-19 14:15                               ` Bartosz Golaszewski
2025-11-19 14:23                                 ` Andy Shevchenko
2025-11-19 14:30                                   ` Bartosz Golaszewski
2025-11-19 20:38                                     ` Andy Shevchenko
2025-11-20  9:12                                       ` Bartosz Golaszewski
2025-11-20  9:56                                         ` Andy Shevchenko
2025-11-20 12:33                                           ` Bartosz Golaszewski
2025-11-19 14:09                           ` Bartosz Golaszewski
2025-11-19 14:45                             ` Bartosz Golaszewski

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=aR2OU4se7lxcMtGW@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=broonie@kernel.org \
    --cc=david.rhodes@cirrus.com \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mstrozek@opensource.cirrus.com \
    --cc=p.zabel@pengutronix.de \
    --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