linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Kees Cook <kees@kernel.org>, Mika Westerberg <westeri@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Saravana Kannan <saravanak@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andy Shevchenko <andy@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Srinivas Kandagatla <srini@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH v2 00/10] gpio: improve support for shared GPIOs
Date: Fri, 24 Oct 2025 10:32:25 +0300	[thread overview]
Message-ID: <3907f4ea-31c2-42fb-b4ff-a6952874a9bb@linux.intel.com> (raw)
In-Reply-To: <CAMRc=MdWjyTyJh5zfE5qncO8ABn7QSuV1CUZXa+cSMjWoXUrNA@mail.gmail.com>



On 24/10/2025 10:20, Bartosz Golaszewski wrote:
> On Fri, Oct 24, 2025 at 9:17 AM Péter Ujfalusi
> <peter.ujfalusi@linux.intel.com> wrote:
>>
>>
>>
>> On 22/10/2025 16:10, Bartosz Golaszewski wrote:
>>> Problem statement: GPIOs are implemented as a strictly exclusive
>>> resource in the kernel but there are lots of platforms on which single
>>> pin is shared by multiple devices which don't communicate so need some
>>> way of properly sharing access to a GPIO. What we have now is the
>>> GPIOD_FLAGS_BIT_NONEXCLUSIVE flag which was introduced as a hack and
>>> doesn't do any locking or arbitration of access - it literally just hand
>>> the same GPIO descriptor to all interested users.
>>
>> I had few stabs on this in the past, all got somehow derailed, one
>> example was:
>> https://lkml.org/lkml/2019/10/30/311
>>
> 
> The main issue I see with this approach is adding an actual device
> node for the shared GPIO which is now not accepted in DT bindings. We
> only create nodes for actual HW components.

Right, that policy came later, true.

All the information is
> already in the device-tree, we just need to scan it which is what I'm
> trying to do here.

I had a prototype later without the sofware-node which worked for the
use case I had, but over the years I dropped it, it was a bit of hassle
to roll it for nothing.

One can argue that the shared-gpio node is describing the solder blob
where the GPIO line is split and routed to two different component.
With the approach one can handle cases where the level is inverted by a
passive component for one of the device for example - unfortunately I
have seen such a board marvel as well.

The device's binding will tell _how_ it expects the GPIO's active level,
which might or might not match with the real level of the GPIO line and
if one of the device's branch have an inverter, that is going to be
interesting to work out in conjunction with the other devices non
inverted 'direct' line to the same GPIO.

Never the less, it is great that someone is trying to get this supported!

> 
> Bartosz

-- 
Péter


      reply	other threads:[~2025-10-24  7:32 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 13:10 [PATCH v2 00/10] gpio: improve support for shared GPIOs Bartosz Golaszewski
2025-10-22 13:10 ` [PATCH v2 01/10] string: provide strends() Bartosz Golaszewski
2025-10-22 13:33   ` Andy Shevchenko
2025-10-22 13:40     ` Bartosz Golaszewski
2025-10-22 15:23       ` Andy Shevchenko
2025-10-22 15:25   ` Andy Shevchenko
2025-10-22 15:36     ` Bartosz Golaszewski
2025-10-22 17:12       ` Andy Shevchenko
2025-10-23 18:43         ` Bartosz Golaszewski
2025-10-22 13:10 ` [PATCH v2 02/10] gpiolib: define GPIOD_FLAG_SHARED Bartosz Golaszewski
2025-10-22 13:10 ` [PATCH v2 03/10] gpiolib: implement low-level, shared GPIO support Bartosz Golaszewski
2025-10-22 17:34   ` Andy Shevchenko
2025-10-23 18:55     ` Bartosz Golaszewski
2025-10-24  7:09       ` Andy Shevchenko
2025-10-27 18:02         ` Bartosz Golaszewski
2025-10-22 13:10 ` [PATCH v2 04/10] gpio: shared-proxy: implement the shared GPIO proxy driver Bartosz Golaszewski
2025-10-22 18:04   ` Andy Shevchenko
2025-10-24  7:03     ` Bartosz Golaszewski
2025-10-22 13:10 ` [PATCH v2 05/10] gpiolib: support shared GPIOs in core subsystem code Bartosz Golaszewski
2025-10-22 13:10 ` [PATCH v2 06/10] gpio: provide gpiod_is_shared() Bartosz Golaszewski
2025-10-22 13:10 ` [PATCH v2 07/10] arm64: select HAVE_SHARED_GPIOS for ARCH_QCOM Bartosz Golaszewski
2025-10-22 13:10 ` [PATCH v2 08/10] ASoC: wsa881x: drop GPIOD_FLAGS_BIT_NONEXCLUSIVE flag from GPIO lookup Bartosz Golaszewski
2025-10-24 15:46   ` Mark Brown
2025-10-24 23:32   ` Alexey Klimov
2025-10-22 13:10 ` [PATCH v2 09/10] ASoC: wsa883x: " Bartosz Golaszewski
2025-10-24 15:46   ` Mark Brown
2025-10-22 13:10 ` [PATCH v2 10/10] regulator: make the subsystem aware of shared GPIOs Bartosz Golaszewski
2025-10-24 15:57   ` Mark Brown
2025-10-24  7:17 ` [PATCH v2 00/10] gpio: improve support for " Péter Ujfalusi
2025-10-24  7:20   ` Bartosz Golaszewski
2025-10-24  7:32     ` Péter Ujfalusi [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=3907f4ea-31c2-42fb-b4ff-a6952874a9bb@linux.intel.com \
    --to=peter.ujfalusi@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andy@kernel.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kees@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=saravanak@google.com \
    --cc=srini@kernel.org \
    --cc=tiwai@suse.com \
    --cc=westeri@kernel.org \
    --cc=will@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;
as well as URLs for NNTP newsgroup(s).