From: Quentin Schulz <quentin.schulz@cherry.de>
To: Jonas Karlman <jonas@kwiboo.se>,
Kever Yang <kever.yang@rock-chips.com>,
Simon Glass <sjg@chromium.org>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH v2 08/10] gpio: rockchip: Add request() ops
Date: Wed, 7 Aug 2024 12:12:20 +0200 [thread overview]
Message-ID: <0b58cdae-8ab1-4dd0-8a8e-501f4e5c13a3@cherry.de> (raw)
In-Reply-To: <20240802225705.2640999-9-jonas@kwiboo.se>
Hi Jonas,
On 8/3/24 12:56 AM, Jonas Karlman wrote:
> Add a request() ops that call pinctrl_gpio_request() when the required
> gpio-ranges prop has been defined to signal pinctrl driver to use gpio
> pinmux.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> ---
> v2: New patch from "rockchip: Add gpio request() ops" series
> ---
> drivers/gpio/rk_gpio.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/gpio/rk_gpio.c b/drivers/gpio/rk_gpio.c
> index 5972f7f8612d..65811dbc78d6 100644
> --- a/drivers/gpio/rk_gpio.c
> +++ b/drivers/gpio/rk_gpio.c
> @@ -126,6 +126,15 @@ static int rockchip_gpio_get_function(struct udevice *dev, unsigned offset)
> return (data & mask) ? GPIOF_OUTPUT : GPIOF_INPUT;
> }
>
> +static int rockchip_gpio_request(struct udevice *dev, unsigned offset,
> + const char *label)
> +{
> + if (CONFIG_IS_ENABLED(PINCTRL) && dev_read_bool(dev, "gpio-ranges"))
I assume we check for gpio-ranges property because
pinctrl_gpio_get_pinctrl_and_offset called by pinctrl_gpio_request will
return an error if the property isn't there?
I see that you're adding the gpio-ranges to Rockchip SoCs that are
missing them (as well as the aliases), wouldn't it make more sense to
move this commit after that commit and remove the dependency on
gpio-ranges property and let pinctrl_gpio_request fail if it isn't there?
Cheers,
Quentin
next prev parent reply other threads:[~2024-08-07 10:12 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 22:56 [PATCH v2 00/10] rockchip: pinctrl: Add support for pinmux status cmd Jonas Karlman
2024-08-02 22:56 ` [PATCH v2 01/10] pinctrl: rockchip: Use syscon_regmap_lookup_by_phandle() Jonas Karlman
2024-08-06 15:12 ` Quentin Schulz
2024-08-02 22:56 ` [PATCH v2 02/10] pinctrl: rockchip: Add a pin_to_bank() helper Jonas Karlman
2024-08-06 15:36 ` Quentin Schulz
2024-08-09 9:35 ` Kever Yang
2024-08-02 22:56 ` [PATCH v2 03/10] pinctrl: rockchip: Update get_gpio_mux() ops Jonas Karlman
2024-08-02 22:56 ` [PATCH v2 04/10] pinctrl: rockchip: Add pinmux status related ops Jonas Karlman
2024-08-07 9:20 ` Quentin Schulz
2024-08-02 22:56 ` [PATCH v2 05/10] pinctrl: rockchip: Add gpio_request_enable() ops Jonas Karlman
2024-08-07 9:25 ` Quentin Schulz
2024-08-09 9:37 ` Kever Yang
2024-08-02 22:56 ` [PATCH v2 06/10] gpio: rockchip: Get pinctrl device from gpio-ranges prop Jonas Karlman
2024-08-07 9:49 ` Quentin Schulz
2024-08-02 22:56 ` [PATCH v2 07/10] gpio: rockchip: Use pinctrl pin offset to get_gpio_mux() Jonas Karlman
2024-08-07 10:02 ` Quentin Schulz
2024-08-02 22:56 ` [PATCH v2 08/10] gpio: rockchip: Add request() ops Jonas Karlman
2024-08-07 10:12 ` Quentin Schulz [this message]
2024-08-09 9:38 ` Kever Yang
2024-08-02 22:56 ` [PATCH v2 09/10] rockchip: gpio: Add gpio-ranges props Jonas Karlman
2024-08-07 10:28 ` Quentin Schulz
2024-08-09 9:38 ` Kever Yang
2024-08-02 22:56 ` [PATCH v2 10/10] rockchip: gpio: Add missing gpio aliases Jonas Karlman
2024-08-07 10:47 ` Quentin Schulz
2024-08-09 9:39 ` Kever Yang
2024-08-12 6:30 ` [PATCH v2 00/10] rockchip: pinctrl: Add support for pinmux status cmd Kever Yang
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=0b58cdae-8ab1-4dd0-8a8e-501f4e5c13a3@cherry.de \
--to=quentin.schulz@cherry.de \
--cc=jonas@kwiboo.se \
--cc=kever.yang@rock-chips.com \
--cc=philipp.tomsich@vrull.eu \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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