~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/pinctrl/machine.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/pinctrl/machine.h (Version linux-6.11-rc3) and /include/linux/pinctrl/machine.h (Version linux-4.9.337)


  1 /* SPDX-License-Identifier: GPL-2.0-only */    << 
  2 /*                                                  1 /*
  3  * Machine interface for the pinctrl subsystem      2  * Machine interface for the pinctrl subsystem.
  4  *                                                  3  *
  5  * Copyright (C) 2011 ST-Ericsson SA                4  * Copyright (C) 2011 ST-Ericsson SA
  6  * Written on behalf of Linaro for ST-Ericsson      5  * Written on behalf of Linaro for ST-Ericsson
  7  * Based on bits of regulator core, gpio core       6  * Based on bits of regulator core, gpio core and clk core
  8  *                                                  7  *
  9  * Author: Linus Walleij <linus.walleij@linaro      8  * Author: Linus Walleij <linus.walleij@linaro.org>
                                                   >>   9  *
                                                   >>  10  * License terms: GNU General Public License (GPL) version 2
 10  */                                                11  */
 11 #ifndef __LINUX_PINCTRL_MACHINE_H                  12 #ifndef __LINUX_PINCTRL_MACHINE_H
 12 #define __LINUX_PINCTRL_MACHINE_H                  13 #define __LINUX_PINCTRL_MACHINE_H
 13                                                    14 
 14 #include <linux/array_size.h>                  !!  15 #include <linux/bug.h>
 15                                                    16 
 16 #include <linux/pinctrl/pinctrl-state.h>           17 #include <linux/pinctrl/pinctrl-state.h>
 17                                                    18 
 18 enum pinctrl_map_type {                            19 enum pinctrl_map_type {
 19         PIN_MAP_TYPE_INVALID,                      20         PIN_MAP_TYPE_INVALID,
 20         PIN_MAP_TYPE_DUMMY_STATE,                  21         PIN_MAP_TYPE_DUMMY_STATE,
 21         PIN_MAP_TYPE_MUX_GROUP,                    22         PIN_MAP_TYPE_MUX_GROUP,
 22         PIN_MAP_TYPE_CONFIGS_PIN,                  23         PIN_MAP_TYPE_CONFIGS_PIN,
 23         PIN_MAP_TYPE_CONFIGS_GROUP,                24         PIN_MAP_TYPE_CONFIGS_GROUP,
 24 };                                                 25 };
 25                                                    26 
 26 /**                                                27 /**
 27  * struct pinctrl_map_mux - mapping table cont     28  * struct pinctrl_map_mux - mapping table content for MAP_TYPE_MUX_GROUP
 28  * @group: the name of the group whose mux fun     29  * @group: the name of the group whose mux function is to be configured. This
 29  *      field may be left NULL, and the first      30  *      field may be left NULL, and the first applicable group for the function
 30  *      will be used.                              31  *      will be used.
 31  * @function: the mux function to select for t     32  * @function: the mux function to select for the group
 32  */                                                33  */
 33 struct pinctrl_map_mux {                           34 struct pinctrl_map_mux {
 34         const char *group;                         35         const char *group;
 35         const char *function;                      36         const char *function;
 36 };                                                 37 };
 37                                                    38 
 38 /**                                                39 /**
 39  * struct pinctrl_map_configs - mapping table      40  * struct pinctrl_map_configs - mapping table content for MAP_TYPE_CONFIGS_*
 40  * @group_or_pin: the name of the pin or group     41  * @group_or_pin: the name of the pin or group whose configuration parameters
 41  *      are to be configured.                      42  *      are to be configured.
 42  * @configs: a pointer to an array of config p     43  * @configs: a pointer to an array of config parameters/values to program into
 43  *      hardware. Each individual pin controll     44  *      hardware. Each individual pin controller defines the format and meaning
 44  *      of config parameters.                      45  *      of config parameters.
 45  * @num_configs: the number of entries in arra     46  * @num_configs: the number of entries in array @configs
 46  */                                                47  */
 47 struct pinctrl_map_configs {                       48 struct pinctrl_map_configs {
 48         const char *group_or_pin;                  49         const char *group_or_pin;
 49         unsigned long *configs;                    50         unsigned long *configs;
 50         unsigned int num_configs;              !!  51         unsigned num_configs;
 51 };                                                 52 };
 52                                                    53 
 53 /**                                                54 /**
 54  * struct pinctrl_map - boards/machines shall      55  * struct pinctrl_map - boards/machines shall provide this map for devices
 55  * @dev_name: the name of the device using thi     56  * @dev_name: the name of the device using this specific mapping, the name
 56  *      must be the same as in your struct dev     57  *      must be the same as in your struct device*. If this name is set to the
 57  *      same name as the pin controllers own d     58  *      same name as the pin controllers own dev_name(), the map entry will be
 58  *      hogged by the driver itself upon regis     59  *      hogged by the driver itself upon registration
 59  * @name: the name of this specific map entry      60  * @name: the name of this specific map entry for the particular machine.
 60  *      This is the parameter passed to pinmux     61  *      This is the parameter passed to pinmux_lookup_state()
 61  * @type: the type of mapping table entry          62  * @type: the type of mapping table entry
 62  * @ctrl_dev_name: the name of the device cont     63  * @ctrl_dev_name: the name of the device controlling this specific mapping,
 63  *      the name must be the same as in your s     64  *      the name must be the same as in your struct device*. This field is not
 64  *      used for PIN_MAP_TYPE_DUMMY_STATE          65  *      used for PIN_MAP_TYPE_DUMMY_STATE
 65  * @data: Data specific to the mapping type        66  * @data: Data specific to the mapping type
 66  */                                                67  */
 67 struct pinctrl_map {                               68 struct pinctrl_map {
 68         const char *dev_name;                      69         const char *dev_name;
 69         const char *name;                          70         const char *name;
 70         enum pinctrl_map_type type;                71         enum pinctrl_map_type type;
 71         const char *ctrl_dev_name;                 72         const char *ctrl_dev_name;
 72         union {                                    73         union {
 73                 struct pinctrl_map_mux mux;        74                 struct pinctrl_map_mux mux;
 74                 struct pinctrl_map_configs con     75                 struct pinctrl_map_configs configs;
 75         } data;                                    76         } data;
 76 };                                                 77 };
 77                                                    78 
 78 /* Convenience macros to create mapping table      79 /* Convenience macros to create mapping table entries */
 79                                                    80 
 80 #define PIN_MAP_DUMMY_STATE(dev, state) \          81 #define PIN_MAP_DUMMY_STATE(dev, state) \
 81         {                                          82         {                                                               \
 82                 .dev_name = dev,                   83                 .dev_name = dev,                                        \
 83                 .name = state,                     84                 .name = state,                                          \
 84                 .type = PIN_MAP_TYPE_DUMMY_STA     85                 .type = PIN_MAP_TYPE_DUMMY_STATE,                       \
 85         }                                          86         }
 86                                                    87 
 87 #define PIN_MAP_MUX_GROUP(dev, state, pinctrl,     88 #define PIN_MAP_MUX_GROUP(dev, state, pinctrl, grp, func)               \
 88         {                                          89         {                                                               \
 89                 .dev_name = dev,                   90                 .dev_name = dev,                                        \
 90                 .name = state,                     91                 .name = state,                                          \
 91                 .type = PIN_MAP_TYPE_MUX_GROUP     92                 .type = PIN_MAP_TYPE_MUX_GROUP,                         \
 92                 .ctrl_dev_name = pinctrl,          93                 .ctrl_dev_name = pinctrl,                               \
 93                 .data.mux = {                      94                 .data.mux = {                                           \
 94                         .group = grp,              95                         .group = grp,                                   \
 95                         .function = func,          96                         .function = func,                               \
 96                 },                                 97                 },                                                      \
 97         }                                          98         }
 98                                                    99 
 99 #define PIN_MAP_MUX_GROUP_DEFAULT(dev, pinctrl    100 #define PIN_MAP_MUX_GROUP_DEFAULT(dev, pinctrl, grp, func)              \
100         PIN_MAP_MUX_GROUP(dev, PINCTRL_STATE_D    101         PIN_MAP_MUX_GROUP(dev, PINCTRL_STATE_DEFAULT, pinctrl, grp, func)
101                                                   102 
102 #define PIN_MAP_MUX_GROUP_HOG(dev, state, grp,    103 #define PIN_MAP_MUX_GROUP_HOG(dev, state, grp, func)                    \
103         PIN_MAP_MUX_GROUP(dev, state, dev, grp    104         PIN_MAP_MUX_GROUP(dev, state, dev, grp, func)
104                                                   105 
105 #define PIN_MAP_MUX_GROUP_HOG_DEFAULT(dev, grp    106 #define PIN_MAP_MUX_GROUP_HOG_DEFAULT(dev, grp, func)                   \
106         PIN_MAP_MUX_GROUP(dev, PINCTRL_STATE_D    107         PIN_MAP_MUX_GROUP(dev, PINCTRL_STATE_DEFAULT, dev, grp, func)
107                                                   108 
108 #define PIN_MAP_CONFIGS_PIN(dev, state, pinctr    109 #define PIN_MAP_CONFIGS_PIN(dev, state, pinctrl, pin, cfgs)             \
109         {                                         110         {                                                               \
110                 .dev_name = dev,                  111                 .dev_name = dev,                                        \
111                 .name = state,                    112                 .name = state,                                          \
112                 .type = PIN_MAP_TYPE_CONFIGS_P    113                 .type = PIN_MAP_TYPE_CONFIGS_PIN,                       \
113                 .ctrl_dev_name = pinctrl,         114                 .ctrl_dev_name = pinctrl,                               \
114                 .data.configs = {                 115                 .data.configs = {                                       \
115                         .group_or_pin = pin,      116                         .group_or_pin = pin,                            \
116                         .configs = cfgs,          117                         .configs = cfgs,                                \
117                         .num_configs = ARRAY_S    118                         .num_configs = ARRAY_SIZE(cfgs),                \
118                 },                                119                 },                                                      \
119         }                                         120         }
120                                                   121 
121 #define PIN_MAP_CONFIGS_PIN_DEFAULT(dev, pinct    122 #define PIN_MAP_CONFIGS_PIN_DEFAULT(dev, pinctrl, pin, cfgs)            \
122         PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE    123         PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_DEFAULT, pinctrl, pin, cfgs)
123                                                   124 
124 #define PIN_MAP_CONFIGS_PIN_HOG(dev, state, pi    125 #define PIN_MAP_CONFIGS_PIN_HOG(dev, state, pin, cfgs)                  \
125         PIN_MAP_CONFIGS_PIN(dev, state, dev, p    126         PIN_MAP_CONFIGS_PIN(dev, state, dev, pin, cfgs)
126                                                   127 
127 #define PIN_MAP_CONFIGS_PIN_HOG_DEFAULT(dev, p    128 #define PIN_MAP_CONFIGS_PIN_HOG_DEFAULT(dev, pin, cfgs)                 \
128         PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE    129         PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_DEFAULT, dev, pin, cfgs)
129                                                   130 
130 #define PIN_MAP_CONFIGS_GROUP(dev, state, pinc    131 #define PIN_MAP_CONFIGS_GROUP(dev, state, pinctrl, grp, cfgs)           \
131         {                                         132         {                                                               \
132                 .dev_name = dev,                  133                 .dev_name = dev,                                        \
133                 .name = state,                    134                 .name = state,                                          \
134                 .type = PIN_MAP_TYPE_CONFIGS_G    135                 .type = PIN_MAP_TYPE_CONFIGS_GROUP,                     \
135                 .ctrl_dev_name = pinctrl,         136                 .ctrl_dev_name = pinctrl,                               \
136                 .data.configs = {                 137                 .data.configs = {                                       \
137                         .group_or_pin = grp,      138                         .group_or_pin = grp,                            \
138                         .configs = cfgs,          139                         .configs = cfgs,                                \
139                         .num_configs = ARRAY_S    140                         .num_configs = ARRAY_SIZE(cfgs),                \
140                 },                                141                 },                                                      \
141         }                                         142         }
142                                                   143 
143 #define PIN_MAP_CONFIGS_GROUP_DEFAULT(dev, pin    144 #define PIN_MAP_CONFIGS_GROUP_DEFAULT(dev, pinctrl, grp, cfgs)          \
144         PIN_MAP_CONFIGS_GROUP(dev, PINCTRL_STA    145         PIN_MAP_CONFIGS_GROUP(dev, PINCTRL_STATE_DEFAULT, pinctrl, grp, cfgs)
145                                                   146 
146 #define PIN_MAP_CONFIGS_GROUP_HOG(dev, state,     147 #define PIN_MAP_CONFIGS_GROUP_HOG(dev, state, grp, cfgs)                \
147         PIN_MAP_CONFIGS_GROUP(dev, state, dev,    148         PIN_MAP_CONFIGS_GROUP(dev, state, dev, grp, cfgs)
148                                                   149 
149 #define PIN_MAP_CONFIGS_GROUP_HOG_DEFAULT(dev,    150 #define PIN_MAP_CONFIGS_GROUP_HOG_DEFAULT(dev, grp, cfgs)               \
150         PIN_MAP_CONFIGS_GROUP(dev, PINCTRL_STA    151         PIN_MAP_CONFIGS_GROUP(dev, PINCTRL_STATE_DEFAULT, dev, grp, cfgs)
151                                                   152 
152 struct pinctrl_map;                            << 
153                                                << 
154 #ifdef CONFIG_PINCTRL                             153 #ifdef CONFIG_PINCTRL
155                                                   154 
156 extern int pinctrl_register_mappings(const str !! 155 extern int pinctrl_register_mappings(struct pinctrl_map const *map,
157                                      unsigned  !! 156                                 unsigned num_maps);
158 extern void pinctrl_unregister_mappings(const  << 
159 extern void pinctrl_provide_dummies(void);        157 extern void pinctrl_provide_dummies(void);
160 #else                                             158 #else
161                                                   159 
162 static inline int pinctrl_register_mappings(co !! 160 static inline int pinctrl_register_mappings(struct pinctrl_map const *map,
163                                             un !! 161                                            unsigned num_maps)
164 {                                                 162 {
165         return 0;                                 163         return 0;
166 }                                              << 
167                                                << 
168 static inline void pinctrl_unregister_mappings << 
169 {                                              << 
170 }                                                 164 }
171                                                   165 
172 static inline void pinctrl_provide_dummies(voi    166 static inline void pinctrl_provide_dummies(void)
173 {                                                 167 {
174 }                                                 168 }
175 #endif /* !CONFIG_PINCTRL */                      169 #endif /* !CONFIG_PINCTRL */
176 #endif                                            170 #endif
177                                                   171 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php