summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinmux.h
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-05-30 11:55:15 +0300
committerLinus Walleij <linus.walleij@linaro.org>2024-06-17 09:24:22 +0200
commit37997d7b55aa7a534e4fffdbe9a0388de4857b7e (patch)
tree5c1ee9026c61ce601d46c53b2231ba60faf3ec59 /drivers/pinctrl/pinmux.h
parentf26945d76a90f93a40e27238210bf0580cf8476f (diff)
downloadlwn-37997d7b55aa7a534e4fffdbe9a0388de4857b7e.tar.gz
lwn-37997d7b55aa7a534e4fffdbe9a0388de4857b7e.zip
pinctrl: pinmux: Embed struct pinfunction into struct function_desc
struct function_desc is a particular version of the struct pinfunction with associated opaque data. Start switching pin control core and drivers to use it explicitly. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240530085745.1539925-7-andy.shevchenko@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinmux.h')
-rw-r--r--drivers/pinctrl/pinmux.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinmux.h b/drivers/pinctrl/pinmux.h
index 52e6e4db88b4..9b57c1cc9d50 100644
--- a/drivers/pinctrl/pinmux.h
+++ b/drivers/pinctrl/pinmux.h
@@ -133,12 +133,14 @@ static inline void pinmux_init_device_debugfs(struct dentry *devroot,
/**
* struct function_desc - generic function descriptor
+ * @func: generic data of the pin function (name and groups of pins)
* @name: name of the function
* @group_names: array of pin group names
* @num_group_names: number of pin group names
* @data: pin controller driver specific data
*/
struct function_desc {
+ struct pinfunction func;
const char *name;
const char * const *group_names;
int num_group_names;
@@ -148,6 +150,7 @@ struct function_desc {
/* Convenient macro to define a generic pin function descriptor */
#define PINCTRL_FUNCTION_DESC(_name, _grps, _num_grps, _data) \
(struct function_desc) { \
+ .func = PINCTRL_PINFUNCTION(_name, _grps, _num_grps), \
.name = _name, \
.group_names = _grps, \
.num_group_names = _num_grps, \
@@ -163,7 +166,7 @@ pinmux_generic_get_function_name(struct pinctrl_dev *pctldev,
int pinmux_generic_get_function_groups(struct pinctrl_dev *pctldev,
unsigned int selector,
const char * const **groups,
- unsigned int * const num_groups);
+ unsigned int * const ngroups);
struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctldev,
unsigned int selector);