/src/barebox/include/pinctrl.h
Line | Count | Source |
1 | | /* SPDX-License-Identifier: GPL-2.0-only */ |
2 | | #ifndef PINCTRL_H |
3 | | #define PINCTRL_H |
4 | | |
5 | | #include <linux/types.h> |
6 | | #include <linux/pinctrl/consumer.h> |
7 | | |
8 | | struct pinctrl_device; |
9 | | struct device_node; |
10 | | |
11 | | struct pinctrl_ops { |
12 | | int (*set_state)(struct pinctrl_device *, struct device_node *); |
13 | | int (*set_direction)(struct pinctrl_device *, unsigned int, bool); |
14 | | int (*get_direction)(struct pinctrl_device *, unsigned int); |
15 | | }; |
16 | | |
17 | | struct pinctrl_device { |
18 | | struct device *dev; |
19 | | struct pinctrl_ops *ops; |
20 | | struct list_head list; |
21 | | struct device_node *node; |
22 | | unsigned int base, npins; |
23 | | }; |
24 | | |
25 | | int pinctrl_register(struct pinctrl_device *pdev); |
26 | | void pinctrl_unregister(struct pinctrl_device *pdev); |
27 | | |
28 | | #ifdef CONFIG_PINCTRL_STATE_PARAM |
29 | | void of_pinctrl_register_consumer(struct device *dev, struct device_node *np); |
30 | | void of_pinctrl_unregister_consumer(struct device *dev); |
31 | | #else |
32 | | static inline void of_pinctrl_register_consumer(struct device *dev, struct device_node *np) |
33 | 11.6k | { |
34 | 11.6k | } |
35 | 10.6k | static inline void of_pinctrl_unregister_consumer(struct device *dev) {} |
36 | | #endif |
37 | | |
38 | | #endif /* PINCTRL_H */ |