Commit 44c7288f authored by Linus Walleij's avatar Linus Walleij

gpio: move gpiod_set_array_value_priv()

This renames gpiod_set_array_value_priv() to
gpiod_set_array_value_complex() and moves it to the gpiolib.h
private header file so we can reuse it in the subsystem.
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 327819d1
...@@ -1825,7 +1825,7 @@ static void gpio_chip_set_multiple(struct gpio_chip *chip, ...@@ -1825,7 +1825,7 @@ static void gpio_chip_set_multiple(struct gpio_chip *chip,
} }
} }
static void gpiod_set_array_value_priv(bool raw, bool can_sleep, void gpiod_set_array_value_complex(bool raw, bool can_sleep,
unsigned int array_size, unsigned int array_size,
struct gpio_desc **desc_array, struct gpio_desc **desc_array,
int *value_array) int *value_array)
...@@ -1934,7 +1934,7 @@ void gpiod_set_raw_array_value(unsigned int array_size, ...@@ -1934,7 +1934,7 @@ void gpiod_set_raw_array_value(unsigned int array_size,
{ {
if (!desc_array) if (!desc_array)
return; return;
gpiod_set_array_value_priv(true, false, array_size, desc_array, gpiod_set_array_value_complex(true, false, array_size, desc_array,
value_array); value_array);
} }
EXPORT_SYMBOL_GPL(gpiod_set_raw_array_value); EXPORT_SYMBOL_GPL(gpiod_set_raw_array_value);
...@@ -1956,7 +1956,7 @@ void gpiod_set_array_value(unsigned int array_size, ...@@ -1956,7 +1956,7 @@ void gpiod_set_array_value(unsigned int array_size,
{ {
if (!desc_array) if (!desc_array)
return; return;
gpiod_set_array_value_priv(false, false, array_size, desc_array, gpiod_set_array_value_complex(false, false, array_size, desc_array,
value_array); value_array);
} }
EXPORT_SYMBOL_GPL(gpiod_set_array_value); EXPORT_SYMBOL_GPL(gpiod_set_array_value);
...@@ -2160,7 +2160,7 @@ void gpiod_set_raw_array_value_cansleep(unsigned int array_size, ...@@ -2160,7 +2160,7 @@ void gpiod_set_raw_array_value_cansleep(unsigned int array_size,
might_sleep_if(extra_checks); might_sleep_if(extra_checks);
if (!desc_array) if (!desc_array)
return; return;
gpiod_set_array_value_priv(true, true, array_size, desc_array, gpiod_set_array_value_complex(true, true, array_size, desc_array,
value_array); value_array);
} }
EXPORT_SYMBOL_GPL(gpiod_set_raw_array_value_cansleep); EXPORT_SYMBOL_GPL(gpiod_set_raw_array_value_cansleep);
...@@ -2183,7 +2183,7 @@ void gpiod_set_array_value_cansleep(unsigned int array_size, ...@@ -2183,7 +2183,7 @@ void gpiod_set_array_value_cansleep(unsigned int array_size,
might_sleep_if(extra_checks); might_sleep_if(extra_checks);
if (!desc_array) if (!desc_array)
return; return;
gpiod_set_array_value_priv(false, true, array_size, desc_array, gpiod_set_array_value_complex(false, true, array_size, desc_array,
value_array); value_array);
} }
EXPORT_SYMBOL_GPL(gpiod_set_array_value_cansleep); EXPORT_SYMBOL_GPL(gpiod_set_array_value_cansleep);
......
...@@ -141,6 +141,10 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np, ...@@ -141,6 +141,10 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np,
const char *list_name, int index, enum of_gpio_flags *flags); const char *list_name, int index, enum of_gpio_flags *flags);
struct gpio_desc *gpiochip_get_desc(struct gpio_chip *chip, u16 hwnum); struct gpio_desc *gpiochip_get_desc(struct gpio_chip *chip, u16 hwnum);
void gpiod_set_array_value_complex(bool raw, bool can_sleep,
unsigned int array_size,
struct gpio_desc **desc_array,
int *value_array);
extern struct spinlock gpio_lock; extern struct spinlock gpio_lock;
extern struct list_head gpio_devices; extern struct list_head gpio_devices;
......
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