Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v4.19-rc4 132 lines 3.4 kB view raw
1/* 2 * Internal interface between the core pin control system and the 3 * pin config portions 4 * 5 * Copyright (C) 2011 ST-Ericsson SA 6 * Written on behalf of Linaro for ST-Ericsson 7 * Based on bits of regulator core, gpio core and clk core 8 * 9 * Author: Linus Walleij <linus.walleij@linaro.org> 10 * 11 * License terms: GNU General Public License (GPL) version 2 12 */ 13 14#ifdef CONFIG_PINCONF 15 16int pinconf_check_ops(struct pinctrl_dev *pctldev); 17int pinconf_validate_map(const struct pinctrl_map *map, int i); 18int pinconf_map_to_setting(const struct pinctrl_map *map, 19 struct pinctrl_setting *setting); 20void pinconf_free_setting(const struct pinctrl_setting *setting); 21int pinconf_apply_setting(const struct pinctrl_setting *setting); 22 23int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin, 24 unsigned long *configs, size_t nconfigs); 25 26/* 27 * You will only be interested in these if you're using PINCONF 28 * so don't supply any stubs for these. 29 */ 30int pin_config_get_for_pin(struct pinctrl_dev *pctldev, unsigned pin, 31 unsigned long *config); 32int pin_config_group_get(const char *dev_name, const char *pin_group, 33 unsigned long *config); 34 35#else 36 37static inline int pinconf_check_ops(struct pinctrl_dev *pctldev) 38{ 39 return 0; 40} 41 42static inline int pinconf_validate_map(const struct pinctrl_map *map, int i) 43{ 44 return 0; 45} 46 47static inline int pinconf_map_to_setting(const struct pinctrl_map *map, 48 struct pinctrl_setting *setting) 49{ 50 return 0; 51} 52 53static inline void pinconf_free_setting(const struct pinctrl_setting *setting) 54{ 55} 56 57static inline int pinconf_apply_setting(const struct pinctrl_setting *setting) 58{ 59 return 0; 60} 61 62static inline int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin, 63 unsigned long *configs, size_t nconfigs) 64{ 65 return -ENOTSUPP; 66} 67 68#endif 69 70#if defined(CONFIG_PINCONF) && defined(CONFIG_DEBUG_FS) 71 72void pinconf_show_map(struct seq_file *s, const struct pinctrl_map *map); 73void pinconf_show_setting(struct seq_file *s, 74 const struct pinctrl_setting *setting); 75void pinconf_init_device_debugfs(struct dentry *devroot, 76 struct pinctrl_dev *pctldev); 77 78#else 79 80static inline void pinconf_show_map(struct seq_file *s, 81 const struct pinctrl_map *map) 82{ 83} 84 85static inline void pinconf_show_setting(struct seq_file *s, 86 const struct pinctrl_setting *setting) 87{ 88} 89 90static inline void pinconf_init_device_debugfs(struct dentry *devroot, 91 struct pinctrl_dev *pctldev) 92{ 93} 94 95#endif 96 97/* 98 * The following functions are available if the driver uses the generic 99 * pin config. 100 */ 101 102#if defined(CONFIG_GENERIC_PINCONF) && defined(CONFIG_DEBUG_FS) 103 104void pinconf_generic_dump_pins(struct pinctrl_dev *pctldev, 105 struct seq_file *s, const char *gname, 106 unsigned pin); 107 108void pinconf_generic_dump_config(struct pinctrl_dev *pctldev, 109 struct seq_file *s, unsigned long config); 110#else 111 112static inline void pinconf_generic_dump_pins(struct pinctrl_dev *pctldev, 113 struct seq_file *s, 114 const char *gname, unsigned pin) 115{ 116 return; 117} 118 119static inline void pinconf_generic_dump_config(struct pinctrl_dev *pctldev, 120 struct seq_file *s, 121 unsigned long config) 122{ 123 return; 124} 125#endif 126 127#if defined(CONFIG_GENERIC_PINCONF) && defined(CONFIG_OF) 128int pinconf_generic_parse_dt_config(struct device_node *np, 129 struct pinctrl_dev *pctldev, 130 unsigned long **configs, 131 unsigned int *nconfigs); 132#endif