Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 2 | #ifndef __LINUX_GPIO_CONSUMER_H |
| 3 | #define __LINUX_GPIO_CONSUMER_H |
| 4 | |
Arnd Bergmann | cdf86cd2 | 2014-05-08 15:42:25 +0200 | [diff] [blame] | 5 | #include <linux/bug.h> |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 6 | #include <linux/err.h> |
| 7 | #include <linux/kernel.h> |
| 8 | |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 9 | struct device; |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 10 | |
| 11 | /** |
| 12 | * Opaque descriptor for a GPIO. These are obtained using gpiod_get() and are |
| 13 | * preferable to the old integer-based handles. |
| 14 | * |
| 15 | * Contrary to integers, a pointer to a gpio_desc is guaranteed to be valid |
| 16 | * until the GPIO is released. |
| 17 | */ |
| 18 | struct gpio_desc; |
| 19 | |
Rojhalat Ibrahim | 6685852 | 2015-02-11 17:27:58 +0100 | [diff] [blame] | 20 | /** |
Janusz Krzysztofik | bf9346f | 2018-09-05 23:50:06 +0200 | [diff] [blame] | 21 | * Opaque descriptor for a structure of GPIO array attributes. This structure |
| 22 | * is attached to struct gpiod_descs obtained from gpiod_get_array() and can be |
| 23 | * passed back to get/set array functions in order to activate fast processing |
| 24 | * path if applicable. |
| 25 | */ |
| 26 | struct gpio_array; |
| 27 | |
| 28 | /** |
Rojhalat Ibrahim | 6685852 | 2015-02-11 17:27:58 +0100 | [diff] [blame] | 29 | * Struct containing an array of descriptors that can be obtained using |
| 30 | * gpiod_get_array(). |
| 31 | */ |
| 32 | struct gpio_descs { |
Janusz Krzysztofik | bf9346f | 2018-09-05 23:50:06 +0200 | [diff] [blame] | 33 | struct gpio_array *info; |
Rojhalat Ibrahim | 6685852 | 2015-02-11 17:27:58 +0100 | [diff] [blame] | 34 | unsigned int ndescs; |
| 35 | struct gpio_desc *desc[]; |
| 36 | }; |
| 37 | |
Alexandre Courbot | 39b2bbe | 2014-07-25 23:38:36 +0900 | [diff] [blame] | 38 | #define GPIOD_FLAGS_BIT_DIR_SET BIT(0) |
| 39 | #define GPIOD_FLAGS_BIT_DIR_OUT BIT(1) |
| 40 | #define GPIOD_FLAGS_BIT_DIR_VAL BIT(2) |
Linus Walleij | f926dfc | 2017-09-10 19:26:22 +0200 | [diff] [blame] | 41 | #define GPIOD_FLAGS_BIT_OPEN_DRAIN BIT(3) |
Linus Walleij | b0ce7b29 | 2018-10-12 14:54:12 +0200 | [diff] [blame] | 42 | #define GPIOD_FLAGS_BIT_NONEXCLUSIVE BIT(4) |
Alexandre Courbot | 39b2bbe | 2014-07-25 23:38:36 +0900 | [diff] [blame] | 43 | |
| 44 | /** |
| 45 | * Optional flags that can be passed to one of gpiod_* to configure direction |
| 46 | * and output value. These values cannot be OR'd. |
| 47 | */ |
| 48 | enum gpiod_flags { |
| 49 | GPIOD_ASIS = 0, |
| 50 | GPIOD_IN = GPIOD_FLAGS_BIT_DIR_SET, |
| 51 | GPIOD_OUT_LOW = GPIOD_FLAGS_BIT_DIR_SET | GPIOD_FLAGS_BIT_DIR_OUT, |
| 52 | GPIOD_OUT_HIGH = GPIOD_FLAGS_BIT_DIR_SET | GPIOD_FLAGS_BIT_DIR_OUT | |
| 53 | GPIOD_FLAGS_BIT_DIR_VAL, |
Andy Shevchenko | 0969a20 | 2018-07-27 17:47:01 +0300 | [diff] [blame] | 54 | GPIOD_OUT_LOW_OPEN_DRAIN = GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_OPEN_DRAIN, |
| 55 | GPIOD_OUT_HIGH_OPEN_DRAIN = GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_OPEN_DRAIN, |
Alexandre Courbot | 39b2bbe | 2014-07-25 23:38:36 +0900 | [diff] [blame] | 56 | }; |
| 57 | |
Linus Walleij | 58b84f6 | 2014-08-19 12:00:53 -0500 | [diff] [blame] | 58 | #ifdef CONFIG_GPIOLIB |
| 59 | |
Rojhalat Ibrahim | 6685852 | 2015-02-11 17:27:58 +0100 | [diff] [blame] | 60 | /* Return the number of GPIOs associated with a device / function */ |
| 61 | int gpiod_count(struct device *dev, const char *con_id); |
| 62 | |
Alexandre Courbot | bae48da | 2013-10-17 10:21:38 -0700 | [diff] [blame] | 63 | /* Acquire and dispose GPIOs */ |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 64 | struct gpio_desc *__must_check gpiod_get(struct device *dev, |
Alexandre Courbot | 39b2bbe | 2014-07-25 23:38:36 +0900 | [diff] [blame] | 65 | const char *con_id, |
| 66 | enum gpiod_flags flags); |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 67 | struct gpio_desc *__must_check gpiod_get_index(struct device *dev, |
Alexandre Courbot | bae48da | 2013-10-17 10:21:38 -0700 | [diff] [blame] | 68 | const char *con_id, |
Alexandre Courbot | 39b2bbe | 2014-07-25 23:38:36 +0900 | [diff] [blame] | 69 | unsigned int idx, |
| 70 | enum gpiod_flags flags); |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 71 | struct gpio_desc *__must_check gpiod_get_optional(struct device *dev, |
Alexandre Courbot | 39b2bbe | 2014-07-25 23:38:36 +0900 | [diff] [blame] | 72 | const char *con_id, |
| 73 | enum gpiod_flags flags); |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 74 | struct gpio_desc *__must_check gpiod_get_index_optional(struct device *dev, |
Thierry Reding | 29a1f233 | 2014-04-25 17:10:06 +0200 | [diff] [blame] | 75 | const char *con_id, |
Alexandre Courbot | 39b2bbe | 2014-07-25 23:38:36 +0900 | [diff] [blame] | 76 | unsigned int index, |
| 77 | enum gpiod_flags flags); |
Rojhalat Ibrahim | 6685852 | 2015-02-11 17:27:58 +0100 | [diff] [blame] | 78 | struct gpio_descs *__must_check gpiod_get_array(struct device *dev, |
| 79 | const char *con_id, |
| 80 | enum gpiod_flags flags); |
| 81 | struct gpio_descs *__must_check gpiod_get_array_optional(struct device *dev, |
| 82 | const char *con_id, |
| 83 | enum gpiod_flags flags); |
Alexandre Courbot | bae48da | 2013-10-17 10:21:38 -0700 | [diff] [blame] | 84 | void gpiod_put(struct gpio_desc *desc); |
Rojhalat Ibrahim | 6685852 | 2015-02-11 17:27:58 +0100 | [diff] [blame] | 85 | void gpiod_put_array(struct gpio_descs *descs); |
Alexandre Courbot | bae48da | 2013-10-17 10:21:38 -0700 | [diff] [blame] | 86 | |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 87 | struct gpio_desc *__must_check devm_gpiod_get(struct device *dev, |
Alexandre Courbot | 39b2bbe | 2014-07-25 23:38:36 +0900 | [diff] [blame] | 88 | const char *con_id, |
| 89 | enum gpiod_flags flags); |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 90 | struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev, |
Alexandre Courbot | bae48da | 2013-10-17 10:21:38 -0700 | [diff] [blame] | 91 | const char *con_id, |
Alexandre Courbot | 39b2bbe | 2014-07-25 23:38:36 +0900 | [diff] [blame] | 92 | unsigned int idx, |
| 93 | enum gpiod_flags flags); |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 94 | struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev, |
Alexandre Courbot | 39b2bbe | 2014-07-25 23:38:36 +0900 | [diff] [blame] | 95 | const char *con_id, |
| 96 | enum gpiod_flags flags); |
Thierry Reding | 29a1f233 | 2014-04-25 17:10:06 +0200 | [diff] [blame] | 97 | struct gpio_desc *__must_check |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 98 | devm_gpiod_get_index_optional(struct device *dev, const char *con_id, |
Alexandre Courbot | 39b2bbe | 2014-07-25 23:38:36 +0900 | [diff] [blame] | 99 | unsigned int index, enum gpiod_flags flags); |
Rojhalat Ibrahim | 331758e | 2015-02-11 17:28:02 +0100 | [diff] [blame] | 100 | struct gpio_descs *__must_check devm_gpiod_get_array(struct device *dev, |
| 101 | const char *con_id, |
| 102 | enum gpiod_flags flags); |
| 103 | struct gpio_descs *__must_check |
| 104 | devm_gpiod_get_array_optional(struct device *dev, const char *con_id, |
| 105 | enum gpiod_flags flags); |
Alexandre Courbot | bae48da | 2013-10-17 10:21:38 -0700 | [diff] [blame] | 106 | void devm_gpiod_put(struct device *dev, struct gpio_desc *desc); |
Rojhalat Ibrahim | 331758e | 2015-02-11 17:28:02 +0100 | [diff] [blame] | 107 | void devm_gpiod_put_array(struct device *dev, struct gpio_descs *descs); |
Alexandre Courbot | bae48da | 2013-10-17 10:21:38 -0700 | [diff] [blame] | 108 | |
Alexandre Courbot | 8e53b0f | 2014-11-25 17:16:31 +0900 | [diff] [blame] | 109 | int gpiod_get_direction(struct gpio_desc *desc); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 110 | int gpiod_direction_input(struct gpio_desc *desc); |
| 111 | int gpiod_direction_output(struct gpio_desc *desc, int value); |
Philipp Zabel | ef70bbe | 2014-01-07 12:34:11 +0100 | [diff] [blame] | 112 | int gpiod_direction_output_raw(struct gpio_desc *desc, int value); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 113 | |
| 114 | /* Value get/set from non-sleeping context */ |
| 115 | int gpiod_get_value(const struct gpio_desc *desc); |
Lukas Wunner | eec1d56 | 2017-10-12 12:40:10 +0200 | [diff] [blame] | 116 | int gpiod_get_array_value(unsigned int array_size, |
Janusz Krzysztofik | b9762be | 2018-09-05 23:50:05 +0200 | [diff] [blame] | 117 | struct gpio_desc **desc_array, |
Janusz Krzysztofik | 77588c1 | 2018-09-05 23:50:07 +0200 | [diff] [blame] | 118 | struct gpio_array *array_info, |
Janusz Krzysztofik | b9762be | 2018-09-05 23:50:05 +0200 | [diff] [blame] | 119 | unsigned long *value_bitmap); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 120 | void gpiod_set_value(struct gpio_desc *desc, int value); |
Geert Uytterhoeven | cf9af0d | 2018-09-27 13:38:09 +0200 | [diff] [blame] | 121 | int gpiod_set_array_value(unsigned int array_size, |
| 122 | struct gpio_desc **desc_array, |
| 123 | struct gpio_array *array_info, |
| 124 | unsigned long *value_bitmap); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 125 | int gpiod_get_raw_value(const struct gpio_desc *desc); |
Lukas Wunner | eec1d56 | 2017-10-12 12:40:10 +0200 | [diff] [blame] | 126 | int gpiod_get_raw_array_value(unsigned int array_size, |
| 127 | struct gpio_desc **desc_array, |
Janusz Krzysztofik | 77588c1 | 2018-09-05 23:50:07 +0200 | [diff] [blame] | 128 | struct gpio_array *array_info, |
Janusz Krzysztofik | b9762be | 2018-09-05 23:50:05 +0200 | [diff] [blame] | 129 | unsigned long *value_bitmap); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 130 | void gpiod_set_raw_value(struct gpio_desc *desc, int value); |
Laura Abbott | 3027743 | 2018-05-21 10:57:07 -0700 | [diff] [blame] | 131 | int gpiod_set_raw_array_value(unsigned int array_size, |
Geert Uytterhoeven | 3c94066 | 2018-09-27 13:38:10 +0200 | [diff] [blame] | 132 | struct gpio_desc **desc_array, |
| 133 | struct gpio_array *array_info, |
| 134 | unsigned long *value_bitmap); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 135 | |
| 136 | /* Value get/set from sleeping context */ |
| 137 | int gpiod_get_value_cansleep(const struct gpio_desc *desc); |
Lukas Wunner | eec1d56 | 2017-10-12 12:40:10 +0200 | [diff] [blame] | 138 | int gpiod_get_array_value_cansleep(unsigned int array_size, |
| 139 | struct gpio_desc **desc_array, |
Janusz Krzysztofik | 77588c1 | 2018-09-05 23:50:07 +0200 | [diff] [blame] | 140 | struct gpio_array *array_info, |
Janusz Krzysztofik | b9762be | 2018-09-05 23:50:05 +0200 | [diff] [blame] | 141 | unsigned long *value_bitmap); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 142 | void gpiod_set_value_cansleep(struct gpio_desc *desc, int value); |
Geert Uytterhoeven | cf9af0d | 2018-09-27 13:38:09 +0200 | [diff] [blame] | 143 | int gpiod_set_array_value_cansleep(unsigned int array_size, |
| 144 | struct gpio_desc **desc_array, |
| 145 | struct gpio_array *array_info, |
| 146 | unsigned long *value_bitmap); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 147 | int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc); |
Lukas Wunner | eec1d56 | 2017-10-12 12:40:10 +0200 | [diff] [blame] | 148 | int gpiod_get_raw_array_value_cansleep(unsigned int array_size, |
| 149 | struct gpio_desc **desc_array, |
Janusz Krzysztofik | 77588c1 | 2018-09-05 23:50:07 +0200 | [diff] [blame] | 150 | struct gpio_array *array_info, |
Janusz Krzysztofik | b9762be | 2018-09-05 23:50:05 +0200 | [diff] [blame] | 151 | unsigned long *value_bitmap); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 152 | void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, int value); |
Laura Abbott | 3027743 | 2018-05-21 10:57:07 -0700 | [diff] [blame] | 153 | int gpiod_set_raw_array_value_cansleep(unsigned int array_size, |
Geert Uytterhoeven | 3c94066 | 2018-09-27 13:38:10 +0200 | [diff] [blame] | 154 | struct gpio_desc **desc_array, |
| 155 | struct gpio_array *array_info, |
| 156 | unsigned long *value_bitmap); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 157 | |
| 158 | int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce); |
Andrew Jeffery | e10f72b | 2017-11-30 14:25:24 +1030 | [diff] [blame] | 159 | int gpiod_set_transitory(struct gpio_desc *desc, bool transitory); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 160 | |
| 161 | int gpiod_is_active_low(const struct gpio_desc *desc); |
| 162 | int gpiod_cansleep(const struct gpio_desc *desc); |
| 163 | |
| 164 | int gpiod_to_irq(const struct gpio_desc *desc); |
Muchun Song | 18534df | 2018-11-01 21:12:50 +0800 | [diff] [blame^] | 165 | int gpiod_set_consumer_name(struct gpio_desc *desc, const char *name); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 166 | |
| 167 | /* Convert between the old gpio_ and new gpiod_ interfaces */ |
| 168 | struct gpio_desc *gpio_to_desc(unsigned gpio); |
| 169 | int desc_to_gpio(const struct gpio_desc *desc); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 170 | |
Mika Westerberg | 40b7318 | 2014-10-21 13:33:59 +0200 | [diff] [blame] | 171 | /* Child properties interface */ |
Linus Walleij | 92542ed | 2017-12-29 22:52:02 +0100 | [diff] [blame] | 172 | struct device_node; |
Mika Westerberg | 40b7318 | 2014-10-21 13:33:59 +0200 | [diff] [blame] | 173 | struct fwnode_handle; |
| 174 | |
Linus Walleij | 92542ed | 2017-12-29 22:52:02 +0100 | [diff] [blame] | 175 | struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev, |
| 176 | struct device_node *node, |
| 177 | const char *propname, int index, |
| 178 | enum gpiod_flags dflags, |
| 179 | const char *label); |
Mika Westerberg | 40b7318 | 2014-10-21 13:33:59 +0200 | [diff] [blame] | 180 | struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, |
Boris Brezillon | 537b94d | 2017-02-02 14:53:11 +0100 | [diff] [blame] | 181 | const char *propname, int index, |
Alexander Stein | b2987d7 | 2017-01-12 17:39:24 +0100 | [diff] [blame] | 182 | enum gpiod_flags dflags, |
| 183 | const char *label); |
Boris Brezillon | 537b94d | 2017-02-02 14:53:11 +0100 | [diff] [blame] | 184 | struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev, |
| 185 | const char *con_id, int index, |
| 186 | struct fwnode_handle *child, |
| 187 | enum gpiod_flags flags, |
| 188 | const char *label); |
Linus Walleij | 3498d86 | 2017-02-21 14:19:45 +0100 | [diff] [blame] | 189 | |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 190 | #else /* CONFIG_GPIOLIB */ |
| 191 | |
Rojhalat Ibrahim | 6685852 | 2015-02-11 17:27:58 +0100 | [diff] [blame] | 192 | static inline int gpiod_count(struct device *dev, const char *con_id) |
| 193 | { |
| 194 | return 0; |
| 195 | } |
| 196 | |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 197 | static inline struct gpio_desc *__must_check gpiod_get(struct device *dev, |
| 198 | const char *con_id, |
| 199 | enum gpiod_flags flags) |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 200 | { |
| 201 | return ERR_PTR(-ENOSYS); |
| 202 | } |
Linus Walleij | 0dbc8b7 | 2014-09-01 15:15:40 +0200 | [diff] [blame] | 203 | static inline struct gpio_desc *__must_check |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 204 | gpiod_get_index(struct device *dev, |
| 205 | const char *con_id, |
| 206 | unsigned int idx, |
| 207 | enum gpiod_flags flags) |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 208 | { |
| 209 | return ERR_PTR(-ENOSYS); |
| 210 | } |
Thierry Reding | 29a1f233 | 2014-04-25 17:10:06 +0200 | [diff] [blame] | 211 | |
| 212 | static inline struct gpio_desc *__must_check |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 213 | gpiod_get_optional(struct device *dev, const char *con_id, |
| 214 | enum gpiod_flags flags) |
Thierry Reding | 29a1f233 | 2014-04-25 17:10:06 +0200 | [diff] [blame] | 215 | { |
Dmitry Torokhov | 22c4036 | 2017-02-12 17:13:55 -0800 | [diff] [blame] | 216 | return NULL; |
Thierry Reding | 29a1f233 | 2014-04-25 17:10:06 +0200 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | static inline struct gpio_desc *__must_check |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 220 | gpiod_get_index_optional(struct device *dev, const char *con_id, |
| 221 | unsigned int index, enum gpiod_flags flags) |
Thierry Reding | 29a1f233 | 2014-04-25 17:10:06 +0200 | [diff] [blame] | 222 | { |
Dmitry Torokhov | 22c4036 | 2017-02-12 17:13:55 -0800 | [diff] [blame] | 223 | return NULL; |
Thierry Reding | 29a1f233 | 2014-04-25 17:10:06 +0200 | [diff] [blame] | 224 | } |
| 225 | |
Rojhalat Ibrahim | 6685852 | 2015-02-11 17:27:58 +0100 | [diff] [blame] | 226 | static inline struct gpio_descs *__must_check |
| 227 | gpiod_get_array(struct device *dev, const char *con_id, |
| 228 | enum gpiod_flags flags) |
| 229 | { |
| 230 | return ERR_PTR(-ENOSYS); |
| 231 | } |
| 232 | |
| 233 | static inline struct gpio_descs *__must_check |
| 234 | gpiod_get_array_optional(struct device *dev, const char *con_id, |
| 235 | enum gpiod_flags flags) |
| 236 | { |
Dmitry Torokhov | 22c4036 | 2017-02-12 17:13:55 -0800 | [diff] [blame] | 237 | return NULL; |
Rojhalat Ibrahim | 6685852 | 2015-02-11 17:27:58 +0100 | [diff] [blame] | 238 | } |
| 239 | |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 240 | static inline void gpiod_put(struct gpio_desc *desc) |
| 241 | { |
| 242 | might_sleep(); |
| 243 | |
| 244 | /* GPIO can never have been requested */ |
| 245 | WARN_ON(1); |
| 246 | } |
| 247 | |
Rojhalat Ibrahim | 6685852 | 2015-02-11 17:27:58 +0100 | [diff] [blame] | 248 | static inline void gpiod_put_array(struct gpio_descs *descs) |
| 249 | { |
| 250 | might_sleep(); |
| 251 | |
| 252 | /* GPIO can never have been requested */ |
| 253 | WARN_ON(1); |
| 254 | } |
| 255 | |
Linus Walleij | 0dbc8b7 | 2014-09-01 15:15:40 +0200 | [diff] [blame] | 256 | static inline struct gpio_desc *__must_check |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 257 | devm_gpiod_get(struct device *dev, |
Linus Walleij | 0dbc8b7 | 2014-09-01 15:15:40 +0200 | [diff] [blame] | 258 | const char *con_id, |
| 259 | enum gpiod_flags flags) |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 260 | { |
| 261 | return ERR_PTR(-ENOSYS); |
| 262 | } |
| 263 | static inline |
Linus Walleij | 0dbc8b7 | 2014-09-01 15:15:40 +0200 | [diff] [blame] | 264 | struct gpio_desc *__must_check |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 265 | devm_gpiod_get_index(struct device *dev, |
Linus Walleij | 0dbc8b7 | 2014-09-01 15:15:40 +0200 | [diff] [blame] | 266 | const char *con_id, |
| 267 | unsigned int idx, |
| 268 | enum gpiod_flags flags) |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 269 | { |
| 270 | return ERR_PTR(-ENOSYS); |
| 271 | } |
Thierry Reding | 29a1f233 | 2014-04-25 17:10:06 +0200 | [diff] [blame] | 272 | |
| 273 | static inline struct gpio_desc *__must_check |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 274 | devm_gpiod_get_optional(struct device *dev, const char *con_id, |
Linus Walleij | 0dbc8b7 | 2014-09-01 15:15:40 +0200 | [diff] [blame] | 275 | enum gpiod_flags flags) |
Thierry Reding | 29a1f233 | 2014-04-25 17:10:06 +0200 | [diff] [blame] | 276 | { |
Dmitry Torokhov | 22c4036 | 2017-02-12 17:13:55 -0800 | [diff] [blame] | 277 | return NULL; |
Thierry Reding | 29a1f233 | 2014-04-25 17:10:06 +0200 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | static inline struct gpio_desc *__must_check |
Uwe Kleine-König | b17d1bf | 2015-02-11 11:52:37 +0100 | [diff] [blame] | 281 | devm_gpiod_get_index_optional(struct device *dev, const char *con_id, |
Linus Walleij | 0dbc8b7 | 2014-09-01 15:15:40 +0200 | [diff] [blame] | 282 | unsigned int index, enum gpiod_flags flags) |
Thierry Reding | 29a1f233 | 2014-04-25 17:10:06 +0200 | [diff] [blame] | 283 | { |
Dmitry Torokhov | 22c4036 | 2017-02-12 17:13:55 -0800 | [diff] [blame] | 284 | return NULL; |
Thierry Reding | 29a1f233 | 2014-04-25 17:10:06 +0200 | [diff] [blame] | 285 | } |
| 286 | |
Rojhalat Ibrahim | 331758e | 2015-02-11 17:28:02 +0100 | [diff] [blame] | 287 | static inline struct gpio_descs *__must_check |
| 288 | devm_gpiod_get_array(struct device *dev, const char *con_id, |
| 289 | enum gpiod_flags flags) |
| 290 | { |
| 291 | return ERR_PTR(-ENOSYS); |
| 292 | } |
| 293 | |
| 294 | static inline struct gpio_descs *__must_check |
| 295 | devm_gpiod_get_array_optional(struct device *dev, const char *con_id, |
| 296 | enum gpiod_flags flags) |
| 297 | { |
Dmitry Torokhov | 22c4036 | 2017-02-12 17:13:55 -0800 | [diff] [blame] | 298 | return NULL; |
Rojhalat Ibrahim | 331758e | 2015-02-11 17:28:02 +0100 | [diff] [blame] | 299 | } |
| 300 | |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 301 | static inline void devm_gpiod_put(struct device *dev, struct gpio_desc *desc) |
| 302 | { |
| 303 | might_sleep(); |
| 304 | |
| 305 | /* GPIO can never have been requested */ |
| 306 | WARN_ON(1); |
| 307 | } |
| 308 | |
Rojhalat Ibrahim | 331758e | 2015-02-11 17:28:02 +0100 | [diff] [blame] | 309 | static inline void devm_gpiod_put_array(struct device *dev, |
| 310 | struct gpio_descs *descs) |
| 311 | { |
| 312 | might_sleep(); |
| 313 | |
| 314 | /* GPIO can never have been requested */ |
| 315 | WARN_ON(1); |
| 316 | } |
| 317 | |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 318 | |
| 319 | static inline int gpiod_get_direction(const struct gpio_desc *desc) |
| 320 | { |
| 321 | /* GPIO can never have been requested */ |
| 322 | WARN_ON(1); |
| 323 | return -ENOSYS; |
| 324 | } |
| 325 | static inline int gpiod_direction_input(struct gpio_desc *desc) |
| 326 | { |
| 327 | /* GPIO can never have been requested */ |
| 328 | WARN_ON(1); |
| 329 | return -ENOSYS; |
| 330 | } |
| 331 | static inline int gpiod_direction_output(struct gpio_desc *desc, int value) |
| 332 | { |
| 333 | /* GPIO can never have been requested */ |
| 334 | WARN_ON(1); |
| 335 | return -ENOSYS; |
| 336 | } |
Philipp Zabel | ef70bbe | 2014-01-07 12:34:11 +0100 | [diff] [blame] | 337 | static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value) |
| 338 | { |
| 339 | /* GPIO can never have been requested */ |
| 340 | WARN_ON(1); |
| 341 | return -ENOSYS; |
| 342 | } |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 343 | |
| 344 | |
| 345 | static inline int gpiod_get_value(const struct gpio_desc *desc) |
| 346 | { |
| 347 | /* GPIO can never have been requested */ |
| 348 | WARN_ON(1); |
| 349 | return 0; |
| 350 | } |
Lukas Wunner | eec1d56 | 2017-10-12 12:40:10 +0200 | [diff] [blame] | 351 | static inline int gpiod_get_array_value(unsigned int array_size, |
| 352 | struct gpio_desc **desc_array, |
Janusz Krzysztofik | 77588c1 | 2018-09-05 23:50:07 +0200 | [diff] [blame] | 353 | struct gpio_array *array_info, |
Janusz Krzysztofik | b9762be | 2018-09-05 23:50:05 +0200 | [diff] [blame] | 354 | unsigned long *value_bitmap) |
Lukas Wunner | eec1d56 | 2017-10-12 12:40:10 +0200 | [diff] [blame] | 355 | { |
| 356 | /* GPIO can never have been requested */ |
| 357 | WARN_ON(1); |
| 358 | return 0; |
| 359 | } |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 360 | static inline void gpiod_set_value(struct gpio_desc *desc, int value) |
| 361 | { |
| 362 | /* GPIO can never have been requested */ |
| 363 | WARN_ON(1); |
| 364 | } |
Geert Uytterhoeven | cf9af0d | 2018-09-27 13:38:09 +0200 | [diff] [blame] | 365 | static inline int gpiod_set_array_value(unsigned int array_size, |
| 366 | struct gpio_desc **desc_array, |
| 367 | struct gpio_array *array_info, |
| 368 | unsigned long *value_bitmap) |
Rojhalat Ibrahim | 5f42424 | 2014-11-04 17:12:06 +0100 | [diff] [blame] | 369 | { |
| 370 | /* GPIO can never have been requested */ |
| 371 | WARN_ON(1); |
Geert Uytterhoeven | cf9af0d | 2018-09-27 13:38:09 +0200 | [diff] [blame] | 372 | return 0; |
Rojhalat Ibrahim | 5f42424 | 2014-11-04 17:12:06 +0100 | [diff] [blame] | 373 | } |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 374 | static inline int gpiod_get_raw_value(const struct gpio_desc *desc) |
| 375 | { |
| 376 | /* GPIO can never have been requested */ |
| 377 | WARN_ON(1); |
| 378 | return 0; |
| 379 | } |
Lukas Wunner | eec1d56 | 2017-10-12 12:40:10 +0200 | [diff] [blame] | 380 | static inline int gpiod_get_raw_array_value(unsigned int array_size, |
| 381 | struct gpio_desc **desc_array, |
Janusz Krzysztofik | 77588c1 | 2018-09-05 23:50:07 +0200 | [diff] [blame] | 382 | struct gpio_array *array_info, |
Janusz Krzysztofik | b9762be | 2018-09-05 23:50:05 +0200 | [diff] [blame] | 383 | unsigned long *value_bitmap) |
Lukas Wunner | eec1d56 | 2017-10-12 12:40:10 +0200 | [diff] [blame] | 384 | { |
| 385 | /* GPIO can never have been requested */ |
| 386 | WARN_ON(1); |
| 387 | return 0; |
| 388 | } |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 389 | static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value) |
| 390 | { |
| 391 | /* GPIO can never have been requested */ |
| 392 | WARN_ON(1); |
| 393 | } |
Laura Abbott | 3027743 | 2018-05-21 10:57:07 -0700 | [diff] [blame] | 394 | static inline int gpiod_set_raw_array_value(unsigned int array_size, |
Geert Uytterhoeven | 3c94066 | 2018-09-27 13:38:10 +0200 | [diff] [blame] | 395 | struct gpio_desc **desc_array, |
| 396 | struct gpio_array *array_info, |
| 397 | unsigned long *value_bitmap) |
Rojhalat Ibrahim | 5f42424 | 2014-11-04 17:12:06 +0100 | [diff] [blame] | 398 | { |
| 399 | /* GPIO can never have been requested */ |
| 400 | WARN_ON(1); |
Laura Abbott | 3027743 | 2018-05-21 10:57:07 -0700 | [diff] [blame] | 401 | return 0; |
Rojhalat Ibrahim | 5f42424 | 2014-11-04 17:12:06 +0100 | [diff] [blame] | 402 | } |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 403 | |
| 404 | static inline int gpiod_get_value_cansleep(const struct gpio_desc *desc) |
| 405 | { |
| 406 | /* GPIO can never have been requested */ |
| 407 | WARN_ON(1); |
| 408 | return 0; |
| 409 | } |
Lukas Wunner | eec1d56 | 2017-10-12 12:40:10 +0200 | [diff] [blame] | 410 | static inline int gpiod_get_array_value_cansleep(unsigned int array_size, |
| 411 | struct gpio_desc **desc_array, |
Janusz Krzysztofik | 77588c1 | 2018-09-05 23:50:07 +0200 | [diff] [blame] | 412 | struct gpio_array *array_info, |
Janusz Krzysztofik | b9762be | 2018-09-05 23:50:05 +0200 | [diff] [blame] | 413 | unsigned long *value_bitmap) |
Lukas Wunner | eec1d56 | 2017-10-12 12:40:10 +0200 | [diff] [blame] | 414 | { |
| 415 | /* GPIO can never have been requested */ |
| 416 | WARN_ON(1); |
| 417 | return 0; |
| 418 | } |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 419 | static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int value) |
| 420 | { |
| 421 | /* GPIO can never have been requested */ |
| 422 | WARN_ON(1); |
| 423 | } |
Geert Uytterhoeven | cf9af0d | 2018-09-27 13:38:09 +0200 | [diff] [blame] | 424 | static inline int gpiod_set_array_value_cansleep(unsigned int array_size, |
Rojhalat Ibrahim | 5f42424 | 2014-11-04 17:12:06 +0100 | [diff] [blame] | 425 | struct gpio_desc **desc_array, |
Janusz Krzysztofik | 77588c1 | 2018-09-05 23:50:07 +0200 | [diff] [blame] | 426 | struct gpio_array *array_info, |
Janusz Krzysztofik | b9762be | 2018-09-05 23:50:05 +0200 | [diff] [blame] | 427 | unsigned long *value_bitmap) |
Rojhalat Ibrahim | 5f42424 | 2014-11-04 17:12:06 +0100 | [diff] [blame] | 428 | { |
| 429 | /* GPIO can never have been requested */ |
| 430 | WARN_ON(1); |
Geert Uytterhoeven | cf9af0d | 2018-09-27 13:38:09 +0200 | [diff] [blame] | 431 | return 0; |
Rojhalat Ibrahim | 5f42424 | 2014-11-04 17:12:06 +0100 | [diff] [blame] | 432 | } |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 433 | static inline int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc) |
| 434 | { |
| 435 | /* GPIO can never have been requested */ |
| 436 | WARN_ON(1); |
| 437 | return 0; |
| 438 | } |
Lukas Wunner | eec1d56 | 2017-10-12 12:40:10 +0200 | [diff] [blame] | 439 | static inline int gpiod_get_raw_array_value_cansleep(unsigned int array_size, |
| 440 | struct gpio_desc **desc_array, |
Janusz Krzysztofik | 77588c1 | 2018-09-05 23:50:07 +0200 | [diff] [blame] | 441 | struct gpio_array *array_info, |
Janusz Krzysztofik | b9762be | 2018-09-05 23:50:05 +0200 | [diff] [blame] | 442 | unsigned long *value_bitmap) |
Lukas Wunner | eec1d56 | 2017-10-12 12:40:10 +0200 | [diff] [blame] | 443 | { |
| 444 | /* GPIO can never have been requested */ |
| 445 | WARN_ON(1); |
| 446 | return 0; |
| 447 | } |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 448 | static inline void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, |
| 449 | int value) |
| 450 | { |
| 451 | /* GPIO can never have been requested */ |
| 452 | WARN_ON(1); |
| 453 | } |
Laura Abbott | 3027743 | 2018-05-21 10:57:07 -0700 | [diff] [blame] | 454 | static inline int gpiod_set_raw_array_value_cansleep(unsigned int array_size, |
Rojhalat Ibrahim | 5f42424 | 2014-11-04 17:12:06 +0100 | [diff] [blame] | 455 | struct gpio_desc **desc_array, |
Janusz Krzysztofik | 77588c1 | 2018-09-05 23:50:07 +0200 | [diff] [blame] | 456 | struct gpio_array *array_info, |
Janusz Krzysztofik | b9762be | 2018-09-05 23:50:05 +0200 | [diff] [blame] | 457 | unsigned long *value_bitmap) |
Rojhalat Ibrahim | 5f42424 | 2014-11-04 17:12:06 +0100 | [diff] [blame] | 458 | { |
| 459 | /* GPIO can never have been requested */ |
| 460 | WARN_ON(1); |
Laura Abbott | 3027743 | 2018-05-21 10:57:07 -0700 | [diff] [blame] | 461 | return 0; |
Rojhalat Ibrahim | 5f42424 | 2014-11-04 17:12:06 +0100 | [diff] [blame] | 462 | } |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 463 | |
| 464 | static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce) |
| 465 | { |
| 466 | /* GPIO can never have been requested */ |
| 467 | WARN_ON(1); |
| 468 | return -ENOSYS; |
| 469 | } |
| 470 | |
Andrew Jeffery | e10f72b | 2017-11-30 14:25:24 +1030 | [diff] [blame] | 471 | static inline int gpiod_set_transitory(struct gpio_desc *desc, bool transitory) |
| 472 | { |
| 473 | /* GPIO can never have been requested */ |
| 474 | WARN_ON(1); |
| 475 | return -ENOSYS; |
| 476 | } |
| 477 | |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 478 | static inline int gpiod_is_active_low(const struct gpio_desc *desc) |
| 479 | { |
| 480 | /* GPIO can never have been requested */ |
| 481 | WARN_ON(1); |
| 482 | return 0; |
| 483 | } |
| 484 | static inline int gpiod_cansleep(const struct gpio_desc *desc) |
| 485 | { |
| 486 | /* GPIO can never have been requested */ |
| 487 | WARN_ON(1); |
| 488 | return 0; |
| 489 | } |
| 490 | |
| 491 | static inline int gpiod_to_irq(const struct gpio_desc *desc) |
| 492 | { |
| 493 | /* GPIO can never have been requested */ |
| 494 | WARN_ON(1); |
| 495 | return -EINVAL; |
| 496 | } |
| 497 | |
Muchun Song | 18534df | 2018-11-01 21:12:50 +0800 | [diff] [blame^] | 498 | static inline int gpiod_set_consumer_name(struct gpio_desc *desc, |
| 499 | const char *name) |
Linus Walleij | 90b39402e | 2018-06-01 13:21:27 +0200 | [diff] [blame] | 500 | { |
| 501 | /* GPIO can never have been requested */ |
| 502 | WARN_ON(1); |
Muchun Song | 18534df | 2018-11-01 21:12:50 +0800 | [diff] [blame^] | 503 | return -EINVAL; |
Linus Walleij | 90b39402e | 2018-06-01 13:21:27 +0200 | [diff] [blame] | 504 | } |
| 505 | |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 506 | static inline struct gpio_desc *gpio_to_desc(unsigned gpio) |
| 507 | { |
| 508 | return ERR_PTR(-EINVAL); |
| 509 | } |
Markus Pargmann | c0017ed | 2015-08-14 16:10:59 +0200 | [diff] [blame] | 510 | |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 511 | static inline int desc_to_gpio(const struct gpio_desc *desc) |
| 512 | { |
| 513 | /* GPIO can never have been requested */ |
| 514 | WARN_ON(1); |
| 515 | return -EINVAL; |
| 516 | } |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 517 | |
Geert Uytterhoeven | 496e7ce | 2015-05-07 01:08:08 -0700 | [diff] [blame] | 518 | /* Child properties interface */ |
Linus Walleij | 92542ed | 2017-12-29 22:52:02 +0100 | [diff] [blame] | 519 | struct device_node; |
Geert Uytterhoeven | 496e7ce | 2015-05-07 01:08:08 -0700 | [diff] [blame] | 520 | struct fwnode_handle; |
| 521 | |
Andy Shevchenko | a264d10 | 2017-01-09 16:02:28 +0200 | [diff] [blame] | 522 | static inline |
Linus Walleij | 92542ed | 2017-12-29 22:52:02 +0100 | [diff] [blame] | 523 | struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev, |
| 524 | struct device_node *node, |
| 525 | const char *propname, int index, |
| 526 | enum gpiod_flags dflags, |
| 527 | const char *label) |
| 528 | { |
| 529 | return ERR_PTR(-ENOSYS); |
| 530 | } |
| 531 | |
| 532 | static inline |
Andy Shevchenko | a264d10 | 2017-01-09 16:02:28 +0200 | [diff] [blame] | 533 | struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, |
Boris Brezillon | 537b94d | 2017-02-02 14:53:11 +0100 | [diff] [blame] | 534 | const char *propname, int index, |
Alexander Stein | b2987d7 | 2017-01-12 17:39:24 +0100 | [diff] [blame] | 535 | enum gpiod_flags dflags, |
| 536 | const char *label) |
Geert Uytterhoeven | 496e7ce | 2015-05-07 01:08:08 -0700 | [diff] [blame] | 537 | { |
| 538 | return ERR_PTR(-ENOSYS); |
| 539 | } |
| 540 | |
Andy Shevchenko | a264d10 | 2017-01-09 16:02:28 +0200 | [diff] [blame] | 541 | static inline |
Boris Brezillon | 537b94d | 2017-02-02 14:53:11 +0100 | [diff] [blame] | 542 | struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev, |
| 543 | const char *con_id, int index, |
| 544 | struct fwnode_handle *child, |
| 545 | enum gpiod_flags flags, |
| 546 | const char *label) |
| 547 | { |
| 548 | return ERR_PTR(-ENOSYS); |
| 549 | } |
| 550 | |
| 551 | #endif /* CONFIG_GPIOLIB */ |
| 552 | |
| 553 | static inline |
Boris Brezillon | 4b09479 | 2017-02-02 14:53:10 +0100 | [diff] [blame] | 554 | struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev, |
| 555 | const char *con_id, |
| 556 | struct fwnode_handle *child, |
| 557 | enum gpiod_flags flags, |
| 558 | const char *label) |
Geert Uytterhoeven | 496e7ce | 2015-05-07 01:08:08 -0700 | [diff] [blame] | 559 | { |
Boris Brezillon | 537b94d | 2017-02-02 14:53:11 +0100 | [diff] [blame] | 560 | return devm_fwnode_get_index_gpiod_from_child(dev, con_id, 0, child, |
| 561 | flags, label); |
Geert Uytterhoeven | 496e7ce | 2015-05-07 01:08:08 -0700 | [diff] [blame] | 562 | } |
| 563 | |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 564 | #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) |
| 565 | |
| 566 | int gpiod_export(struct gpio_desc *desc, bool direction_may_change); |
| 567 | int gpiod_export_link(struct device *dev, const char *name, |
| 568 | struct gpio_desc *desc); |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 569 | void gpiod_unexport(struct gpio_desc *desc); |
| 570 | |
| 571 | #else /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */ |
| 572 | |
| 573 | static inline int gpiod_export(struct gpio_desc *desc, |
| 574 | bool direction_may_change) |
| 575 | { |
| 576 | return -ENOSYS; |
| 577 | } |
| 578 | |
| 579 | static inline int gpiod_export_link(struct device *dev, const char *name, |
| 580 | struct gpio_desc *desc) |
| 581 | { |
| 582 | return -ENOSYS; |
| 583 | } |
| 584 | |
Alexandre Courbot | 79a9bec | 2013-10-17 10:21:36 -0700 | [diff] [blame] | 585 | static inline void gpiod_unexport(struct gpio_desc *desc) |
| 586 | { |
| 587 | } |
| 588 | |
| 589 | #endif /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */ |
| 590 | |
| 591 | #endif |