mirror of
https://xff.cz/git/u-boot/
synced 2025-09-05 02:32:11 +02:00
gpio: rockchip: Add request() ops
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>
This commit is contained in:
committed by
Ondrej Jirman
parent
57e968110a
commit
e7351eef7a
@@ -126,6 +126,15 @@ static int rockchip_gpio_get_function(struct udevice *dev, unsigned offset)
|
|||||||
return (data & mask) ? GPIOF_OUTPUT : GPIOF_INPUT;
|
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"))
|
||||||
|
return pinctrl_gpio_request(dev, offset, label);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Simple SPL interface to GPIOs */
|
/* Simple SPL interface to GPIOs */
|
||||||
#ifdef CONFIG_XPL_BUILD
|
#ifdef CONFIG_XPL_BUILD
|
||||||
|
|
||||||
@@ -229,6 +238,7 @@ static int rockchip_gpio_probe(struct udevice *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct dm_gpio_ops gpio_rockchip_ops = {
|
static const struct dm_gpio_ops gpio_rockchip_ops = {
|
||||||
|
.request = rockchip_gpio_request,
|
||||||
.direction_input = rockchip_gpio_direction_input,
|
.direction_input = rockchip_gpio_direction_input,
|
||||||
.direction_output = rockchip_gpio_direction_output,
|
.direction_output = rockchip_gpio_direction_output,
|
||||||
.get_value = rockchip_gpio_get_value,
|
.get_value = rockchip_gpio_get_value,
|
||||||
|
Reference in New Issue
Block a user