hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/pinctrl/pinctrl.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Interface the pinctrl subsystem
34 *
....@@ -6,13 +7,9 @@
67 * This interface is used in the core to keep track of pins.
78 *
89 * Author: Linus Walleij <linus.walleij@linaro.org>
9
- *
10
- * License terms: GNU General Public License (GPL) version 2
1110 */
1211 #ifndef __LINUX_PINCTRL_PINCTRL_H
1312 #define __LINUX_PINCTRL_PINCTRL_H
14
-
15
-#ifdef CONFIG_PINCTRL
1613
1714 #include <linux/radix-tree.h>
1815 #include <linux/list.h>
....@@ -125,6 +122,10 @@
125122 * the hardware description
126123 * @custom_conf_items: Information how to print @params in debugfs, must be
127124 * the same size as the @custom_params, i.e. @num_custom_params
125
+ * @link_consumers: If true create a device link between pinctrl and its
126
+ * consumers (i.e. the devices requesting pin control states). This is
127
+ * sometimes necessary to ascertain the right suspend/resume order for
128
+ * example.
128129 */
129130 struct pinctrl_desc {
130131 const char *name;
....@@ -139,6 +140,7 @@
139140 const struct pinconf_generic_params *custom_params;
140141 const struct pin_config_item *custom_conf_items;
141142 #endif
143
+ bool link_consumers;
142144 };
143145
144146 /* External interface to pin controller */
....@@ -167,7 +169,6 @@
167169 extern void devm_pinctrl_unregister(struct device *dev,
168170 struct pinctrl_dev *pctldev);
169171
170
-extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin);
171172 extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
172173 struct pinctrl_gpio_range *range);
173174 extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev,
....@@ -185,7 +186,7 @@
185186 const char *pin_group, const unsigned **pins,
186187 unsigned *num_pins);
187188
188
-#ifdef CONFIG_OF
189
+#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL)
189190 extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np);
190191 #else
191192 static inline
....@@ -198,16 +199,5 @@
198199 extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
199200 extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev);
200201 extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
201
-#else
202
-
203
-struct pinctrl_dev;
204
-
205
-/* Sufficiently stupid default functions when pinctrl is not in use */
206
-static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin)
207
-{
208
- return pin >= 0;
209
-}
210
-
211
-#endif /* !CONFIG_PINCTRL */
212202
213203 #endif /* __LINUX_PINCTRL_PINCTRL_H */