mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
soc: fsl: qe: 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> Link: https://lore.kernel.org/r/20250610-gpiochip-set-rv-soc-v1-1-1a0c36c9deed@linaro.org Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
This commit is contained in:
parent
19272b37aa
commit
52ccf19527
|
|
@ -57,7 +57,7 @@ static int qe_gpio_get(struct gpio_chip *gc, unsigned int gpio)
|
||||||
return !!(ioread32be(®s->cpdata) & pin_mask);
|
return !!(ioread32be(®s->cpdata) & pin_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qe_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
|
static int qe_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
|
||||||
{
|
{
|
||||||
struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
|
struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
|
||||||
struct qe_gpio_chip *qe_gc = gpiochip_get_data(gc);
|
struct qe_gpio_chip *qe_gc = gpiochip_get_data(gc);
|
||||||
|
|
@ -75,6 +75,8 @@ static void qe_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
|
||||||
iowrite32be(qe_gc->cpdata, ®s->cpdata);
|
iowrite32be(qe_gc->cpdata, ®s->cpdata);
|
||||||
|
|
||||||
spin_unlock_irqrestore(&qe_gc->lock, flags);
|
spin_unlock_irqrestore(&qe_gc->lock, flags);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qe_gpio_set_multiple(struct gpio_chip *gc,
|
static void qe_gpio_set_multiple(struct gpio_chip *gc,
|
||||||
|
|
@ -317,7 +319,7 @@ static int __init qe_add_gpiochips(void)
|
||||||
gc->direction_input = qe_gpio_dir_in;
|
gc->direction_input = qe_gpio_dir_in;
|
||||||
gc->direction_output = qe_gpio_dir_out;
|
gc->direction_output = qe_gpio_dir_out;
|
||||||
gc->get = qe_gpio_get;
|
gc->get = qe_gpio_get;
|
||||||
gc->set = qe_gpio_set;
|
gc->set_rv = qe_gpio_set;
|
||||||
gc->set_multiple = qe_gpio_set_multiple;
|
gc->set_multiple = qe_gpio_set_multiple;
|
||||||
|
|
||||||
ret = of_mm_gpiochip_add_data(np, mm_gc, qe_gc);
|
ret = of_mm_gpiochip_add_data(np, mm_gc, qe_gc);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user