From f26945d76a90f93a40e27238210bf0580cf8476f Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 30 May 2024 11:55:14 +0300 Subject: 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 Link: https://lore.kernel.org/r/20240530085745.1539925-6-andy.shevchenko@gmail.com Signed-off-by: Linus Walleij --- drivers/pinctrl/pinmux.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'drivers/pinctrl/pinmux.h') diff --git a/drivers/pinctrl/pinmux.h b/drivers/pinctrl/pinmux.h index 7c8aa25ccc80..52e6e4db88b4 100644 --- a/drivers/pinctrl/pinmux.h +++ b/drivers/pinctrl/pinmux.h @@ -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, -- cgit v1.2.3