* [PATCH] drm/bridge: ti-sn65dsi86: use new GPIO line value setter callbacks
@ 2025-06-10 12:34 Bartosz Golaszewski
2025-06-10 16:27 ` Doug Anderson
0 siblings, 1 reply; 3+ messages in thread
From: Bartosz Golaszewski @ 2025-06-10 12:34 UTC (permalink / raw)
To: Douglas Anderson, Andrzej Hajda, Neil Armstrong, Robert Foss,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Linus Walleij, Bartosz Golaszewski
Cc: dri-devel, linux-kernel, linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
Commit 98ce1eb1fd87e ("gpiolib: introduce gpio_chip setters that return
values") added new line setter callbacks to struct gpio_chip. They allow
to indicate failures to callers. We're in the process of converting all
GPIO controllers to using them before removing the old ones.
---
drivers/gpu/drm/bridge/ti-sn65dsi86.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index 60224f476e1d048c693ab36a0a79b6897c6101a8..3814253f36755ca749426993fcc964fa253cb5f2 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -1707,24 +1707,20 @@ static int ti_sn_bridge_gpio_get(struct gpio_chip *chip, unsigned int offset)
return !!(val & BIT(SN_GPIO_INPUT_SHIFT + offset));
}
-static void ti_sn_bridge_gpio_set(struct gpio_chip *chip, unsigned int offset,
- int val)
+static int ti_sn_bridge_gpio_set(struct gpio_chip *chip, unsigned int offset,
+ int val)
{
struct ti_sn65dsi86 *pdata = gpiochip_get_data(chip);
- int ret;
if (!test_bit(offset, pdata->gchip_output)) {
dev_err(pdata->dev, "Ignoring GPIO set while input\n");
- return;
+ return -EPERM;
}
val &= 1;
- ret = regmap_update_bits(pdata->regmap, SN_GPIO_IO_REG,
- BIT(SN_GPIO_OUTPUT_SHIFT + offset),
- val << (SN_GPIO_OUTPUT_SHIFT + offset));
- if (ret)
- dev_warn(pdata->dev,
- "Failed to set bridge GPIO %u: %d\n", offset, ret);
+ return regmap_update_bits(pdata->regmap, SN_GPIO_IO_REG,
+ BIT(SN_GPIO_OUTPUT_SHIFT + offset),
+ val << (SN_GPIO_OUTPUT_SHIFT + offset));
}
static int ti_sn_bridge_gpio_direction_input(struct gpio_chip *chip,
@@ -1828,7 +1824,7 @@ static int ti_sn_gpio_probe(struct auxiliary_device *adev,
pdata->gchip.direction_input = ti_sn_bridge_gpio_direction_input;
pdata->gchip.direction_output = ti_sn_bridge_gpio_direction_output;
pdata->gchip.get = ti_sn_bridge_gpio_get;
- pdata->gchip.set = ti_sn_bridge_gpio_set;
+ pdata->gchip.set_rv = ti_sn_bridge_gpio_set;
pdata->gchip.can_sleep = true;
pdata->gchip.names = ti_sn_bridge_gpio_names;
pdata->gchip.ngpio = SN_NUM_GPIOS;
---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250522-gpiochip-set-rv-gpu-a52d543ca722
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/bridge: ti-sn65dsi86: use new GPIO line value setter callbacks
2025-06-10 12:34 [PATCH] drm/bridge: ti-sn65dsi86: use new GPIO line value setter callbacks Bartosz Golaszewski
@ 2025-06-10 16:27 ` Doug Anderson
2025-06-17 0:14 ` Doug Anderson
0 siblings, 1 reply; 3+ messages in thread
From: Doug Anderson @ 2025-06-10 16:27 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Linus Walleij,
dri-devel, linux-kernel, linux-gpio, Bartosz Golaszewski
Hi,
On Tue, Jun 10, 2025 at 5:34 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> struct gpio_chip now has callbacks for setting line values that return
> an integer, allowing to indicate failures. Convert the driver to using
> them.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
> Commit 98ce1eb1fd87e ("gpiolib: introduce gpio_chip setters that return
> values") added new line setter callbacks to struct gpio_chip. They allow
> to indicate failures to callers. We're in the process of converting all
> GPIO controllers to using them before removing the old ones.
> ---
> drivers/gpu/drm/bridge/ti-sn65dsi86.c | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Looks like this should be fine to go through drm-misc. I'll plan to
apply it next week unless I get overly distracted.
-Doug
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/bridge: ti-sn65dsi86: use new GPIO line value setter callbacks
2025-06-10 16:27 ` Doug Anderson
@ 2025-06-17 0:14 ` Doug Anderson
0 siblings, 0 replies; 3+ messages in thread
From: Doug Anderson @ 2025-06-17 0:14 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Linus Walleij,
dri-devel, linux-kernel, linux-gpio, Bartosz Golaszewski
Hi,
On Tue, Jun 10, 2025 at 9:27 AM Doug Anderson <dianders@chromium.org> wrote:
>
> Hi,
>
> On Tue, Jun 10, 2025 at 5:34 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> > struct gpio_chip now has callbacks for setting line values that return
> > an integer, allowing to indicate failures. Convert the driver to using
> > them.
> >
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > ---
> > Commit 98ce1eb1fd87e ("gpiolib: introduce gpio_chip setters that return
> > values") added new line setter callbacks to struct gpio_chip. They allow
> > to indicate failures to callers. We're in the process of converting all
> > GPIO controllers to using them before removing the old ones.
> > ---
> > drivers/gpu/drm/bridge/ti-sn65dsi86.c | 18 +++++++-----------
> > 1 file changed, 7 insertions(+), 11 deletions(-)
>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
>
> Looks like this should be fine to go through drm-misc. I'll plan to
> apply it next week unless I get overly distracted.
Pushed to drm-misc-next:
[1/1] drm/bridge: ti-sn65dsi86: use new GPIO line value setter callbacks
commit: 98df1626ae036c1ba8c844c9fd995ab8f23bbe37
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-17 0:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 12:34 [PATCH] drm/bridge: ti-sn65dsi86: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-06-10 16:27 ` Doug Anderson
2025-06-17 0:14 ` Doug Anderson
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).