Commit c47bee95 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Linus Walleij

gpio: mockup: implement gpio_mockup_set_multiple()

Implement the set_multiple() callback and register it with the gpiolib
framework. This is only meant to also test the internal kernel API.
Signed-off-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 2a9d742c
...@@ -96,6 +96,16 @@ static void gpio_mockup_set(struct gpio_chip *gc, ...@@ -96,6 +96,16 @@ static void gpio_mockup_set(struct gpio_chip *gc,
chip->lines[offset].value = !!value; chip->lines[offset].value = !!value;
} }
static void gpio_mockup_set_multiple(struct gpio_chip *gc,
unsigned long *mask, unsigned long *bits)
{
unsigned int bit;
for_each_set_bit(bit, mask, gc->ngpio)
gpio_mockup_set(gc, bit, test_bit(bit, bits));
}
static int gpio_mockup_dirout(struct gpio_chip *gc, static int gpio_mockup_dirout(struct gpio_chip *gc,
unsigned int offset, int value) unsigned int offset, int value)
{ {
...@@ -269,6 +279,7 @@ static int gpio_mockup_probe(struct platform_device *pdev) ...@@ -269,6 +279,7 @@ static int gpio_mockup_probe(struct platform_device *pdev)
gc->parent = dev; gc->parent = dev;
gc->get = gpio_mockup_get; gc->get = gpio_mockup_get;
gc->set = gpio_mockup_set; gc->set = gpio_mockup_set;
gc->set_multiple = gpio_mockup_set_multiple;
gc->direction_output = gpio_mockup_dirout; gc->direction_output = gpio_mockup_dirout;
gc->direction_input = gpio_mockup_dirin; gc->direction_input = gpio_mockup_dirin;
gc->get_direction = gpio_mockup_get_direction; gc->get_direction = gpio_mockup_get_direction;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment