mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
pinctrl: iproc: Add 'get_direction' support
Add 'get_direction' support to the iProc GPIO driver. Signed-off-by: Rayagonda Kokatanur <[email protected]> Link: https://lore.kernel.org/r/1568178685-30738-1-git-send-email-rayagonda.kokatanur@broadcom.com Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
547f073f07
commit
0351827168
1 changed files with 10 additions and 0 deletions
|
|
@ -359,6 +359,15 @@ static int iproc_gpio_direction_output(struct gpio_chip *gc, unsigned gpio,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int iproc_gpio_get_direction(struct gpio_chip *gc, unsigned int gpio)
|
||||
{
|
||||
struct iproc_gpio *chip = gpiochip_get_data(gc);
|
||||
unsigned int offset = IPROC_GPIO_REG(gpio, IPROC_GPIO_OUT_EN_OFFSET);
|
||||
unsigned int shift = IPROC_GPIO_SHIFT(gpio);
|
||||
|
||||
return !(readl(chip->base + offset) & BIT(shift));
|
||||
}
|
||||
|
||||
static void iproc_gpio_set(struct gpio_chip *gc, unsigned gpio, int val)
|
||||
{
|
||||
struct iproc_gpio *chip = gpiochip_get_data(gc);
|
||||
|
|
@ -835,6 +844,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
|
|||
gc->free = iproc_gpio_free;
|
||||
gc->direction_input = iproc_gpio_direction_input;
|
||||
gc->direction_output = iproc_gpio_direction_output;
|
||||
gc->get_direction = iproc_gpio_get_direction;
|
||||
gc->set = iproc_gpio_set;
|
||||
gc->get = iproc_gpio_get;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue