Commit 999b85bf authored by Andy Shevchenko's avatar Andy Shevchenko

pinctrl: intel: Make use of struct pinfunction and PINCTRL_PINFUNCTION()

Since pin control provides a generic data type and a macro for
the pin function definition, use them in the Intel driver.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent 443a0a0f
...@@ -372,7 +372,7 @@ static const char *intel_get_function_name(struct pinctrl_dev *pctldev, ...@@ -372,7 +372,7 @@ static const char *intel_get_function_name(struct pinctrl_dev *pctldev,
{ {
struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
return pctrl->soc->functions[function].name; return pctrl->soc->functions[function].func.name;
} }
static int intel_get_function_groups(struct pinctrl_dev *pctldev, static int intel_get_function_groups(struct pinctrl_dev *pctldev,
...@@ -382,8 +382,8 @@ static int intel_get_function_groups(struct pinctrl_dev *pctldev, ...@@ -382,8 +382,8 @@ static int intel_get_function_groups(struct pinctrl_dev *pctldev,
{ {
struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
*groups = pctrl->soc->functions[function].groups; *groups = pctrl->soc->functions[function].func.groups;
*ngroups = pctrl->soc->functions[function].ngroups; *ngroups = pctrl->soc->functions[function].func.ngroups;
return 0; return 0;
} }
......
...@@ -36,11 +36,13 @@ struct intel_pingroup { ...@@ -36,11 +36,13 @@ struct intel_pingroup {
/** /**
* struct intel_function - Description about a function * struct intel_function - Description about a function
* @func: Generic data of the pin function (name and groups of pins)
* @name: Name of the function * @name: Name of the function
* @groups: An array of groups for this function * @groups: An array of groups for this function
* @ngroups: Number of groups in @groups * @ngroups: Number of groups in @groups
*/ */
struct intel_function { struct intel_function {
struct pinfunction func;
const char *name; const char *name;
const char * const *groups; const char * const *groups;
size_t ngroups; size_t ngroups;
...@@ -185,6 +187,7 @@ struct intel_community { ...@@ -185,6 +187,7 @@ struct intel_community {
#define FUNCTION(n, g) \ #define FUNCTION(n, g) \
{ \ { \
.func = PINCTRL_PINFUNCTION((n), (g), ARRAY_SIZE(g)), \
.name = (n), \ .name = (n), \
.groups = (g), \ .groups = (g), \
.ngroups = ARRAY_SIZE((g)), \ .ngroups = ARRAY_SIZE((g)), \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment