soc: renesas: pwc-rzv2m: Use new GPIO line value setter callbacks
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> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/20250610-gpiochip-set-rv-soc-v1-2-1a0c36c9deed@linaro.org Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
This commit is contained in:
committed by
Geert Uytterhoeven
parent
c7968f5e7c
commit
1cf74da68c
@@ -24,8 +24,8 @@ struct rzv2m_pwc_priv {
|
||||
DECLARE_BITMAP(ch_en_bits, 2);
|
||||
};
|
||||
|
||||
static void rzv2m_pwc_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
static int rzv2m_pwc_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
struct rzv2m_pwc_priv *priv = gpiochip_get_data(chip);
|
||||
u32 reg;
|
||||
@@ -38,6 +38,8 @@ static void rzv2m_pwc_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
writel(reg, priv->base + PWC_GPIO);
|
||||
|
||||
assign_bit(offset, priv->ch_en_bits, value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rzv2m_pwc_gpio_get(struct gpio_chip *chip, unsigned int offset)
|
||||
@@ -62,7 +64,7 @@ static const struct gpio_chip rzv2m_pwc_gc = {
|
||||
.label = "gpio_rzv2m_pwc",
|
||||
.owner = THIS_MODULE,
|
||||
.get = rzv2m_pwc_gpio_get,
|
||||
.set = rzv2m_pwc_gpio_set,
|
||||
.set_rv = rzv2m_pwc_gpio_set,
|
||||
.direction_output = rzv2m_pwc_gpio_direction_output,
|
||||
.can_sleep = false,
|
||||
.ngpio = 2,
|
||||
|
||||
Reference in New Issue
Block a user