Commit 10ce59c6 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

pinctrl: ingenic: Convert to use grp member

Convert drivers to use grp member embedded in struct group_desc,
because other members will be removed to avoid duplication and
desynchronisation of the generic pin group description.
Acked-by: default avatarPaul Cercueil <paul@crapouillou.net>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231211190321.307330-9-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 390270f2
...@@ -84,17 +84,13 @@ ...@@ -84,17 +84,13 @@
#define INGENIC_PIN_GROUP_FUNCS(_name_, id, funcs) \ #define INGENIC_PIN_GROUP_FUNCS(_name_, id, funcs) \
{ \ { \
.name = _name_, \ .grp = PINCTRL_PINGROUP(_name_, id##_pins, ARRAY_SIZE(id##_pins)), \
.pins = id##_pins, \
.num_pins = ARRAY_SIZE(id##_pins), \
.data = funcs, \ .data = funcs, \
} }
#define INGENIC_PIN_GROUP(_name_, id, func) \ #define INGENIC_PIN_GROUP(_name_, id, func) \
{ \ { \
.name = _name_, \ .grp = PINCTRL_PINGROUP(_name_, id##_pins, ARRAY_SIZE(id##_pins)), \
.pins = id##_pins, \
.num_pins = ARRAY_SIZE(id##_pins), \
.data = (void *)func, \ .data = (void *)func, \
} }
...@@ -3766,17 +3762,17 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev *pctldev, ...@@ -3766,17 +3762,17 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev *pctldev,
return -EINVAL; return -EINVAL;
dev_dbg(pctldev->dev, "enable function %s group %s\n", dev_dbg(pctldev->dev, "enable function %s group %s\n",
func->name, grp->name); func->name, grp->grp.name);
mode = (uintptr_t)grp->data; mode = (uintptr_t)grp->data;
if (mode <= 3) { if (mode <= 3) {
for (i = 0; i < grp->num_pins; i++) for (i = 0; i < grp->grp.npins; i++)
ingenic_pinmux_set_pin_fn(jzpc, grp->pins[i], mode); ingenic_pinmux_set_pin_fn(jzpc, grp->grp.pins[i], mode);
} else { } else {
pin_modes = grp->data; pin_modes = grp->data;
for (i = 0; i < grp->num_pins; i++) for (i = 0; i < grp->grp.npins; i++)
ingenic_pinmux_set_pin_fn(jzpc, grp->pins[i], pin_modes[i]); ingenic_pinmux_set_pin_fn(jzpc, grp->grp.pins[i], pin_modes[i]);
} }
return 0; return 0;
...@@ -4303,12 +4299,12 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev) ...@@ -4303,12 +4299,12 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
for (i = 0; i < chip_info->num_groups; i++) { for (i = 0; i < chip_info->num_groups; i++) {
const struct group_desc *group = &chip_info->groups[i]; const struct group_desc *group = &chip_info->groups[i];
const struct pingroup *grp = &group->grp;
err = pinctrl_generic_add_group(jzpc->pctl, group->name, err = pinctrl_generic_add_group(jzpc->pctl, grp->name, grp->pins, grp->npins,
group->pins, group->num_pins, group->data); group->data);
if (err < 0) { if (err < 0) {
dev_err(dev, "Failed to register group %s\n", dev_err(dev, "Failed to register group %s\n", grp->name);
group->name);
return err; return err;
} }
} }
......
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