Linux-GPIO Archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Stefan Wahren <wahrenst@gmx.net>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Phil Elwell <phil@raspberrypi.com>,
	Kent Gibson <warthog618@gmail.com>
Subject: Re: [PATCH V2] pinctrl: bcm2835: Make pin freeing behavior configurable
Date: Mon, 6 May 2024 23:31:07 +0300	[thread overview]
Message-ID: <Zjk-C0nLmlynqLAE@surfacebook.localdomain> (raw)
In-Reply-To: <20240503062745.11298-1-wahrenst@gmx.net>

Fri, May 03, 2024 at 08:27:45AM +0200, Stefan Wahren kirjoitti:
> Until now after a bcm2835 pin was freed its pinmux was set to GPIO_IN.
> So in case it was configured as GPIO_OUT before the configured output
> level also get lost. As long as GPIO sysfs was used this wasn't
> actually a problem because the pins and their possible output level
> were kept by sysfs.
> 
> Since more and more Raspberry Pi users start using libgpiod they are
> confused about this behavior. So make the pin freeing behavior of
> GPIO_OUT configurable via module parameter. In case
> pinctrl-bcm2835.persist_gpio_outputs is set to 1, the output level is
> kept.
> 
> This patch based on the downstream work of Phil Elwell.

...

> +static bool persist_gpio_outputs;
> +module_param(persist_gpio_outputs, bool, 0644);

Do you need 'w' attribute?

...

> +	dev_info(dev, "GPIO_OUT persistence: %s\n",
> +		 persist_gpio_outputs ? "yes" : "no");

str_yes_no() and with it can be put on a single line.

-- 
With Best Regards,
Andy Shevchenko



      parent reply	other threads:[~2024-05-06 20:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03  6:27 [PATCH V2] pinctrl: bcm2835: Make pin freeing behavior configurable Stefan Wahren
2024-05-06  6:14 ` Linus Walleij
2024-05-06 20:31 ` Andy Shevchenko [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=Zjk-C0nLmlynqLAE@surfacebook.localdomain \
    --to=andy.shevchenko@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=brgl@bgdev.pl \
    --cc=florian.fainelli@broadcom.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=phil@raspberrypi.com \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=wahrenst@gmx.net \
    --cc=warthog618@gmail.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).