linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: linux-gpio@vger.kernel.org,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>
Subject: Re: [RFC PATCH 2/2] gpio: provide a consumer when requesting a gpio
Date: Thu, 18 Jan 2018 11:30:00 +0100	[thread overview]
Message-ID: <CACRpkdbsYyHRz826K0QA=Y7Dvf_sm714o5601KBD7Zo4+1hrQA@mail.gmail.com> (raw)
In-Reply-To: <20180115162407.6314-3-ludovic.desroches@microchip.com>

On Mon, Jan 15, 2018 at 5:24 PM, Ludovic Desroches
<ludovic.desroches@microchip.com> wrote:

> It can be useful for the pinmuxing layer to know which device is
> requesting a GPIO. Add a consumer variant for gpiod_request to
> reach this goal.
>
> GPIO chips managed by pin controllers should provide the new
> request_consumer operation. They can rely on
> gpiochip_generic_request_consumer instead of
> gpiochip_generic_request.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>

I think we need to think over what is a good way to share ownership
of a pin.

Russell pointed me to a similar problem incidentally and I briefly looked
into it: there are cases when several devices may need to hold the
same pin.

Can't we just look up the associated gpio_chip from the GPIO range,
and in case the pin is connected between the pin controller and
the GPIO chip, then we allow the gpiochip to also take a
reference?

I.e. in that case you just allow gpio_owner to proceed and take the
pin just like with a non-strict controller.

Yours,
Linus Walleij

  reply	other threads:[~2018-01-18 10:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15 16:24 [RESEND RFC PATCH 0/2] fixing the gpio ownership Ludovic Desroches
2018-01-15 16:24 ` [RFC PATCH 1/2] pinctrl: add consumer variant for gpio request Ludovic Desroches
2018-01-15 16:24 ` [RFC PATCH 2/2] gpio: provide a consumer when requesting a gpio Ludovic Desroches
2018-01-18 10:30   ` Linus Walleij [this message]
2018-01-18 15:22     ` Ludovic Desroches
2018-01-24 13:07       ` Ludovic Desroches
2018-01-24 15:42         ` Andy Shevchenko
2018-01-26  7:32           ` Ludovic Desroches
2018-01-26 17:13             ` Andy Shevchenko
2018-01-29 13:43               ` Ludovic Desroches
2018-01-18 10:16 ` [RESEND RFC PATCH 0/2] fixing the gpio ownership Linus Walleij
2018-01-18 15:12   ` Ludovic Desroches
2018-01-19 21:02     ` Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2018-01-15 16:22 [RFC " Ludovic Desroches
2018-01-15 16:22 ` [RFC PATCH 2/2] gpio: provide a consumer when requesting a gpio Ludovic Desroches

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='CACRpkdbsYyHRz826K0QA=Y7Dvf_sm714o5601KBD7Zo4+1hrQA@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=nicolas.ferre@microchip.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 NNTP newsgroup(s).