aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/gpio/consumer.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index bed128e8f4b1..6a37ef0dc59c 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -23,6 +23,12 @@ struct gpio_desc *__must_check gpiod_get(struct device *dev,
23struct gpio_desc *__must_check gpiod_get_index(struct device *dev, 23struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
24 const char *con_id, 24 const char *con_id,
25 unsigned int idx); 25 unsigned int idx);
26struct gpio_desc *__must_check gpiod_get_optional(struct device *dev,
27 const char *con_id);
28struct gpio_desc *__must_check gpiod_get_index_optional(struct device *dev,
29 const char *con_id,
30 unsigned int index);
31
26void gpiod_put(struct gpio_desc *desc); 32void gpiod_put(struct gpio_desc *desc);
27 33
28struct gpio_desc *__must_check devm_gpiod_get(struct device *dev, 34struct gpio_desc *__must_check devm_gpiod_get(struct device *dev,
@@ -30,6 +36,12 @@ struct gpio_desc *__must_check devm_gpiod_get(struct device *dev,
30struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev, 36struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
31 const char *con_id, 37 const char *con_id,
32 unsigned int idx); 38 unsigned int idx);
39struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,
40 const char *con_id);
41struct gpio_desc *__must_check
42devm_gpiod_get_index_optional(struct device *dev, const char *con_id,
43 unsigned int index);
44
33void devm_gpiod_put(struct device *dev, struct gpio_desc *desc); 45void devm_gpiod_put(struct device *dev, struct gpio_desc *desc);
34 46
35int gpiod_get_direction(const struct gpio_desc *desc); 47int gpiod_get_direction(const struct gpio_desc *desc);
@@ -73,6 +85,20 @@ static inline struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
73{ 85{
74 return ERR_PTR(-ENOSYS); 86 return ERR_PTR(-ENOSYS);
75} 87}
88
89static inline struct gpio_desc *__must_check
90gpiod_get_optional(struct device *dev, const char *con_id)
91{
92 return ERR_PTR(-ENOSYS);
93}
94
95static inline struct gpio_desc *__must_check
96gpiod_get_index_optional(struct device *dev, const char *con_id,
97 unsigned int index)
98{
99 return ERR_PTR(-ENOSYS);
100}
101
76static inline void gpiod_put(struct gpio_desc *desc) 102static inline void gpiod_put(struct gpio_desc *desc)
77{ 103{
78 might_sleep(); 104 might_sleep();
@@ -93,6 +119,20 @@ struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
93{ 119{
94 return ERR_PTR(-ENOSYS); 120 return ERR_PTR(-ENOSYS);
95} 121}
122
123static inline struct gpio_desc *__must_check
124devm_gpiod_get_optional(struct device *dev, const char *con_id)
125{
126 return ERR_PTR(-ENOSYS);
127}
128
129static inline struct gpio_desc *__must_check
130devm_gpiod_get_index_optional(struct device *dev, const char *con_id,
131 unsigned int index)
132{
133 return ERR_PTR(-ENOSYS);
134}
135
96static inline void devm_gpiod_put(struct device *dev, struct gpio_desc *desc) 136static inline void devm_gpiod_put(struct device *dev, struct gpio_desc *desc)
97{ 137{
98 might_sleep(); 138 might_sleep();