Linux-GPIO Archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: broonie@kernel.org, linus.walleij@linaro.org,
	andy.shevchenko@gmail.com,  bard.liao@intel.com,
	linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org,
	 patches@opensource.cirrus.com
Subject: Re: [PATCH v6 1/4] gpio: swnode: Add ability to specify native chip selects for SPI
Date: Tue, 16 Apr 2024 23:09:09 +0200	[thread overview]
Message-ID: <CAMRc=MfKExrzoSe41O_E9TuVTiMq2j8phYiS8dXDg+kmU_EpLg@mail.gmail.com> (raw)
In-Reply-To: <20240415140925.3518990-2-ckeepax@opensource.cirrus.com>

On Mon, Apr 15, 2024 at 4:09 PM Charles Keepax
<ckeepax@opensource.cirrus.com> wrote:
>
> SPI devices can specify a cs-gpios property to enumerate their
> chip selects. Under device tree, a zero entry in this property can
> be used to specify that a particular chip select is using the SPI
> controllers native chip select, for example:
>
>         cs-gpios = <&gpio1 0 0>, <0>;
>
> Here, the second chip select is native. However, when using swnodes
> there is currently no way to specify a native chip select. The
> proposal here is to register a swnode_gpio_undefined software node,
> that can be specified to allow the indication of a native chip
> select. For example:
>
> static const struct software_node_ref_args device_cs_refs[] = {
>         {
>                 .node  = &device_gpiochip_swnode,
>                 .nargs = 2,
>                 .args  = { 0, GPIO_ACTIVE_LOW },
>         },
>         {
>                 .node  = &swnode_gpio_undefined,
>                 .nargs = 0,
>         },
> };
>
> Register the swnode as the gpiolib is initialised and check in
> swnode_get_gpio_device() if the returned node matches
> swnode_gpio_undefined and return -ENOENT, which matches the
> behaviour of the device tree system when it encounters a 0 phandle.
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> ---
>

Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

  parent reply	other threads:[~2024-04-16 21:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 14:09 [PATCH v6 0/4] Add bridged amplifiers to cs42l43 Charles Keepax
2024-04-15 14:09 ` [PATCH v6 1/4] gpio: swnode: Add ability to specify native chip selects for SPI Charles Keepax
2024-04-15 16:05   ` Andy Shevchenko
2024-04-16 21:09   ` Bartosz Golaszewski [this message]
2024-04-15 14:09 ` [PATCH v6 2/4] spi: Switch to using is_acpi_device_node() in spi_dev_set_name() Charles Keepax
2024-04-15 16:06   ` Andy Shevchenko
2024-04-16  9:53     ` Charles Keepax
2024-04-15 14:09 ` [PATCH v6 3/4] spi: Update swnode based SPI devices to use the fwnode name Charles Keepax
2024-04-15 16:09   ` Andy Shevchenko
2024-04-15 14:09 ` [PATCH v6 4/4] spi: cs42l43: Add bridged cs35l56 amplifiers Charles Keepax
2024-04-15 16:17   ` Andy Shevchenko
2024-04-16  9:54     ` Charles Keepax

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='CAMRc=MfKExrzoSe41O_E9TuVTiMq2j8phYiS8dXDg+kmU_EpLg@mail.gmail.com' \
    --to=brgl@bgdev.pl \
    --cc=andy.shevchenko@gmail.com \
    --cc=bard.liao@intel.com \
    --cc=broonie@kernel.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=patches@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).