diff options
Diffstat (limited to 'include/linux/pinctrl/pinctrl.h')
-rw-r--r-- | include/linux/pinctrl/pinctrl.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 4e9f0788c221..3b894a668d32 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
@@ -21,9 +21,11 @@ | |||
21 | 21 | ||
22 | struct device; | 22 | struct device; |
23 | struct pinctrl_dev; | 23 | struct pinctrl_dev; |
24 | struct pinctrl_map; | ||
24 | struct pinmux_ops; | 25 | struct pinmux_ops; |
25 | struct pinconf_ops; | 26 | struct pinconf_ops; |
26 | struct gpio_chip; | 27 | struct gpio_chip; |
28 | struct device_node; | ||
27 | 29 | ||
28 | /** | 30 | /** |
29 | * struct pinctrl_pin_desc - boards/machines provide information on their | 31 | * struct pinctrl_pin_desc - boards/machines provide information on their |
@@ -64,17 +66,24 @@ struct pinctrl_gpio_range { | |||
64 | /** | 66 | /** |
65 | * struct pinctrl_ops - global pin control operations, to be implemented by | 67 | * struct pinctrl_ops - global pin control operations, to be implemented by |
66 | * pin controller drivers. | 68 | * pin controller drivers. |
67 | * @list_groups: list the number of selectable named groups available | 69 | * @get_groups_count: Returns the count of total number of groups registered. |
68 | * in this pinmux driver, the core will begin on 0 and call this | ||
69 | * repeatedly as long as it returns >= 0 to enumerate the groups | ||
70 | * @get_group_name: return the group name of the pin group | 70 | * @get_group_name: return the group name of the pin group |
71 | * @get_group_pins: return an array of pins corresponding to a certain | 71 | * @get_group_pins: return an array of pins corresponding to a certain |
72 | * group selector @pins, and the size of the array in @num_pins | 72 | * group selector @pins, and the size of the array in @num_pins |
73 | * @pin_dbg_show: optional debugfs display hook that will provide per-device | 73 | * @pin_dbg_show: optional debugfs display hook that will provide per-device |
74 | * info for a certain pin in debugfs | 74 | * info for a certain pin in debugfs |
75 | * @dt_node_to_map: parse a device tree "pin configuration node", and create | ||
76 | * mapping table entries for it. These are returned through the @map and | ||
77 | * @num_maps output parameters. This function is optional, and may be | ||
78 | * omitted for pinctrl drivers that do not support device tree. | ||
79 | * @dt_free_map: free mapping table entries created via @dt_node_to_map. The | ||
80 | * top-level @map pointer must be freed, along with any dynamically | ||
81 | * allocated members of the mapping table entries themselves. This | ||
82 | * function is optional, and may be omitted for pinctrl drivers that do | ||
83 | * not support device tree. | ||
75 | */ | 84 | */ |
76 | struct pinctrl_ops { | 85 | struct pinctrl_ops { |
77 | int (*list_groups) (struct pinctrl_dev *pctldev, unsigned selector); | 86 | int (*get_groups_count) (struct pinctrl_dev *pctldev); |
78 | const char *(*get_group_name) (struct pinctrl_dev *pctldev, | 87 | const char *(*get_group_name) (struct pinctrl_dev *pctldev, |
79 | unsigned selector); | 88 | unsigned selector); |
80 | int (*get_group_pins) (struct pinctrl_dev *pctldev, | 89 | int (*get_group_pins) (struct pinctrl_dev *pctldev, |
@@ -83,6 +92,11 @@ struct pinctrl_ops { | |||
83 | unsigned *num_pins); | 92 | unsigned *num_pins); |
84 | void (*pin_dbg_show) (struct pinctrl_dev *pctldev, struct seq_file *s, | 93 | void (*pin_dbg_show) (struct pinctrl_dev *pctldev, struct seq_file *s, |
85 | unsigned offset); | 94 | unsigned offset); |
95 | int (*dt_node_to_map) (struct pinctrl_dev *pctldev, | ||
96 | struct device_node *np_config, | ||
97 | struct pinctrl_map **map, unsigned *num_maps); | ||
98 | void (*dt_free_map) (struct pinctrl_dev *pctldev, | ||
99 | struct pinctrl_map *map, unsigned num_maps); | ||
86 | }; | 100 | }; |
87 | 101 | ||
88 | /** | 102 | /** |