mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
pinctrl: pinmux: Add a convenient define PINCTRL_FUNCTION_DESC()
Add PINCTRL_FUNCTION_DESC() macro for inline use. While at it, fix adjective form in the comment of PINCTRL_GROUP_DESC(). Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240530085745.1539925-6-andy.shevchenko@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
dc02d925dc
commit
f26945d76a
@ -206,7 +206,7 @@ struct group_desc {
|
||||
void *data;
|
||||
};
|
||||
|
||||
/* Convenience macro to define a generic pin group descriptor */
|
||||
/* Convenient macro to define a generic pin group descriptor */
|
||||
#define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data) \
|
||||
(struct group_desc) { \
|
||||
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
|
||||
|
@ -852,13 +852,13 @@ EXPORT_SYMBOL_GPL(pinmux_generic_get_function);
|
||||
* @pctldev: pin controller device
|
||||
* @name: name of the function
|
||||
* @groups: array of pin groups
|
||||
* @num_groups: number of pin groups
|
||||
* @ngroups: number of pin groups
|
||||
* @data: pin controller driver specific data
|
||||
*/
|
||||
int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
|
||||
const char *name,
|
||||
const char * const *groups,
|
||||
const unsigned int num_groups,
|
||||
const unsigned int ngroups,
|
||||
void *data)
|
||||
{
|
||||
struct function_desc *function;
|
||||
@ -877,10 +877,7 @@ int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
|
||||
if (!function)
|
||||
return -ENOMEM;
|
||||
|
||||
function->name = name;
|
||||
function->group_names = groups;
|
||||
function->num_group_names = num_groups;
|
||||
function->data = data;
|
||||
*function = PINCTRL_FUNCTION_DESC(name, groups, ngroups, data);
|
||||
|
||||
error = radix_tree_insert(&pctldev->pin_function_tree, selector, function);
|
||||
if (error)
|
||||
|
@ -145,6 +145,15 @@ struct function_desc {
|
||||
void *data;
|
||||
};
|
||||
|
||||
/* Convenient macro to define a generic pin function descriptor */
|
||||
#define PINCTRL_FUNCTION_DESC(_name, _grps, _num_grps, _data) \
|
||||
(struct function_desc) { \
|
||||
.name = _name, \
|
||||
.group_names = _grps, \
|
||||
.num_group_names = _num_grps, \
|
||||
.data = _data, \
|
||||
}
|
||||
|
||||
int pinmux_generic_get_function_count(struct pinctrl_dev *pctldev);
|
||||
|
||||
const char *
|
||||
@ -162,7 +171,7 @@ struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctldev,
|
||||
int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
|
||||
const char *name,
|
||||
const char * const *groups,
|
||||
unsigned int const num_groups,
|
||||
unsigned int const ngroups,
|
||||
void *data);
|
||||
|
||||
int pinmux_generic_remove_function(struct pinctrl_dev *pctldev,
|
||||
|
Loading…
Reference in New Issue
Block a user