提交 443a0a0f 编写于 作者: A Andy Shevchenko

pinctrl: Introduce struct pinfunction and PINCTRL_PINFUNCTION() macro

There are many pin control drivers define their own data type for
pin function representation which is the same or embed the same data
as newly introduced one. Provide the data type and convenient macro
for all pin control drivers.
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
上级 ed153b07
...@@ -206,6 +206,26 @@ extern int pinctrl_get_group_pins(struct pinctrl_dev *pctldev, ...@@ -206,6 +206,26 @@ extern int pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
const char *pin_group, const unsigned **pins, const char *pin_group, const unsigned **pins,
unsigned *num_pins); unsigned *num_pins);
/**
* struct pinfunction - Description about a function
* @name: Name of the function
* @groups: An array of groups for this function
* @ngroups: Number of groups in @groups
*/
struct pinfunction {
const char *name;
const char * const *groups;
size_t ngroups;
};
/* Convenience macro to define a single named pinfunction */
#define PINCTRL_PINFUNCTION(_name, _groups, _ngroups) \
(struct pinfunction) { \
.name = (_name), \
.groups = (_groups), \
.ngroups = (_ngroups), \
}
#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL) #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL)
extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np);
#else #else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册