diff options
| author | Rojhalat Ibrahim <imr@rtschenk.de> | 2015-05-13 05:04:56 -0400 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2015-06-01 09:10:09 -0400 |
| commit | 3fff99bc4e926d9602a7d6e8c008a0175a099ce4 (patch) | |
| tree | ca9e2e20152105cc49e622e982fbe491c0024728 /include/linux/gpio | |
| parent | 20a8a96873f69dc915e872e291f4376f436b295a (diff) | |
gpiolib: rename gpiod_set_array to gpiod_set_array_value
There have been concerns that the function names gpiod_set_array() and
gpiod_get_array() might be confusing to users. One might expect
gpiod_get_array() to return array values, while it is actually the array
counterpart of gpiod_get(). To be consistent with the single descriptor API
we could rename gpiod_set_array() to gpiod_set_array_value(). This makes
some function names a bit lengthy: gpiod_set_raw_array_value_cansleep().
Signed-off-by: Rojhalat Ibrahim <imr@rtschenk.de>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/gpio')
| -rw-r--r-- | include/linux/gpio/consumer.h | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index 09a7fb0062a6..fd098169fe87 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h | |||
| @@ -100,24 +100,25 @@ int gpiod_direction_output_raw(struct gpio_desc *desc, int value); | |||
| 100 | /* Value get/set from non-sleeping context */ | 100 | /* Value get/set from non-sleeping context */ |
| 101 | int gpiod_get_value(const struct gpio_desc *desc); | 101 | int gpiod_get_value(const struct gpio_desc *desc); |
| 102 | void gpiod_set_value(struct gpio_desc *desc, int value); | 102 | void gpiod_set_value(struct gpio_desc *desc, int value); |
| 103 | void gpiod_set_array(unsigned int array_size, | 103 | void gpiod_set_array_value(unsigned int array_size, |
| 104 | struct gpio_desc **desc_array, int *value_array); | 104 | struct gpio_desc **desc_array, int *value_array); |
| 105 | int gpiod_get_raw_value(const struct gpio_desc *desc); | 105 | int gpiod_get_raw_value(const struct gpio_desc *desc); |
| 106 | void gpiod_set_raw_value(struct gpio_desc *desc, int value); | 106 | void gpiod_set_raw_value(struct gpio_desc *desc, int value); |
| 107 | void gpiod_set_raw_array(unsigned int array_size, | 107 | void gpiod_set_raw_array_value(unsigned int array_size, |
| 108 | struct gpio_desc **desc_array, int *value_array); | 108 | struct gpio_desc **desc_array, |
| 109 | int *value_array); | ||
| 109 | 110 | ||
| 110 | /* Value get/set from sleeping context */ | 111 | /* Value get/set from sleeping context */ |
| 111 | int gpiod_get_value_cansleep(const struct gpio_desc *desc); | 112 | int gpiod_get_value_cansleep(const struct gpio_desc *desc); |
| 112 | void gpiod_set_value_cansleep(struct gpio_desc *desc, int value); | 113 | void gpiod_set_value_cansleep(struct gpio_desc *desc, int value); |
| 113 | void gpiod_set_array_cansleep(unsigned int array_size, | 114 | void gpiod_set_array_value_cansleep(unsigned int array_size, |
| 114 | struct gpio_desc **desc_array, | 115 | struct gpio_desc **desc_array, |
| 115 | int *value_array); | 116 | int *value_array); |
| 116 | int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc); | 117 | int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc); |
| 117 | void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, int value); | 118 | void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, int value); |
| 118 | void gpiod_set_raw_array_cansleep(unsigned int array_size, | 119 | void gpiod_set_raw_array_value_cansleep(unsigned int array_size, |
| 119 | struct gpio_desc **desc_array, | 120 | struct gpio_desc **desc_array, |
| 120 | int *value_array); | 121 | int *value_array); |
| 121 | 122 | ||
| 122 | int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce); | 123 | int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce); |
| 123 | 124 | ||
| @@ -304,9 +305,9 @@ static inline void gpiod_set_value(struct gpio_desc *desc, int value) | |||
| 304 | /* GPIO can never have been requested */ | 305 | /* GPIO can never have been requested */ |
| 305 | WARN_ON(1); | 306 | WARN_ON(1); |
| 306 | } | 307 | } |
| 307 | static inline void gpiod_set_array(unsigned int array_size, | 308 | static inline void gpiod_set_array_value(unsigned int array_size, |
| 308 | struct gpio_desc **desc_array, | 309 | struct gpio_desc **desc_array, |
| 309 | int *value_array) | 310 | int *value_array) |
| 310 | { | 311 | { |
| 311 | /* GPIO can never have been requested */ | 312 | /* GPIO can never have been requested */ |
| 312 | WARN_ON(1); | 313 | WARN_ON(1); |
| @@ -322,9 +323,9 @@ static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value) | |||
| 322 | /* GPIO can never have been requested */ | 323 | /* GPIO can never have been requested */ |
| 323 | WARN_ON(1); | 324 | WARN_ON(1); |
| 324 | } | 325 | } |
| 325 | static inline void gpiod_set_raw_array(unsigned int array_size, | 326 | static inline void gpiod_set_raw_array_value(unsigned int array_size, |
| 326 | struct gpio_desc **desc_array, | 327 | struct gpio_desc **desc_array, |
| 327 | int *value_array) | 328 | int *value_array) |
| 328 | { | 329 | { |
| 329 | /* GPIO can never have been requested */ | 330 | /* GPIO can never have been requested */ |
| 330 | WARN_ON(1); | 331 | WARN_ON(1); |
| @@ -341,7 +342,7 @@ static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int value) | |||
| 341 | /* GPIO can never have been requested */ | 342 | /* GPIO can never have been requested */ |
| 342 | WARN_ON(1); | 343 | WARN_ON(1); |
| 343 | } | 344 | } |
| 344 | static inline void gpiod_set_array_cansleep(unsigned int array_size, | 345 | static inline void gpiod_set_array_value_cansleep(unsigned int array_size, |
| 345 | struct gpio_desc **desc_array, | 346 | struct gpio_desc **desc_array, |
| 346 | int *value_array) | 347 | int *value_array) |
| 347 | { | 348 | { |
| @@ -360,7 +361,7 @@ static inline void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, | |||
| 360 | /* GPIO can never have been requested */ | 361 | /* GPIO can never have been requested */ |
| 361 | WARN_ON(1); | 362 | WARN_ON(1); |
| 362 | } | 363 | } |
| 363 | static inline void gpiod_set_raw_array_cansleep(unsigned int array_size, | 364 | static inline void gpiod_set_raw_array_value_cansleep(unsigned int array_size, |
| 364 | struct gpio_desc **desc_array, | 365 | struct gpio_desc **desc_array, |
| 365 | int *value_array) | 366 | int *value_array) |
| 366 | { | 367 | { |
