|
84 | 84 |
|
85 | 85 | #define INGENIC_PIN_GROUP_FUNCS(_name_, id, funcs) \
|
86 | 86 | { \
|
87 |
| - .name = _name_, \ |
88 |
| - .pins = id##_pins, \ |
89 |
| - .num_pins = ARRAY_SIZE(id##_pins), \ |
| 87 | + .grp = PINCTRL_PINGROUP(_name_, id##_pins, ARRAY_SIZE(id##_pins)), \ |
90 | 88 | .data = funcs, \
|
91 | 89 | }
|
92 | 90 |
|
93 | 91 | #define INGENIC_PIN_GROUP(_name_, id, func) \
|
94 | 92 | { \
|
95 |
| - .name = _name_, \ |
96 |
| - .pins = id##_pins, \ |
97 |
| - .num_pins = ARRAY_SIZE(id##_pins), \ |
| 93 | + .grp = PINCTRL_PINGROUP(_name_, id##_pins, ARRAY_SIZE(id##_pins)), \ |
98 | 94 | .data = (void *)func, \
|
99 | 95 | }
|
100 | 96 |
|
@@ -3766,17 +3762,17 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev *pctldev,
|
3766 | 3762 | return -EINVAL;
|
3767 | 3763 |
|
3768 | 3764 | dev_dbg(pctldev->dev, "enable function %s group %s\n",
|
3769 |
| - func->name, grp->name); |
| 3765 | + func->name, grp->grp.name); |
3770 | 3766 |
|
3771 | 3767 | mode = (uintptr_t)grp->data;
|
3772 | 3768 | if (mode <= 3) {
|
3773 |
| - for (i = 0; i < grp->num_pins; i++) |
3774 |
| - ingenic_pinmux_set_pin_fn(jzpc, grp->pins[i], mode); |
| 3769 | + for (i = 0; i < grp->grp.npins; i++) |
| 3770 | + ingenic_pinmux_set_pin_fn(jzpc, grp->grp.pins[i], mode); |
3775 | 3771 | } else {
|
3776 | 3772 | pin_modes = grp->data;
|
3777 | 3773 |
|
3778 |
| - for (i = 0; i < grp->num_pins; i++) |
3779 |
| - ingenic_pinmux_set_pin_fn(jzpc, grp->pins[i], pin_modes[i]); |
| 3774 | + for (i = 0; i < grp->grp.npins; i++) |
| 3775 | + ingenic_pinmux_set_pin_fn(jzpc, grp->grp.pins[i], pin_modes[i]); |
3780 | 3776 | }
|
3781 | 3777 |
|
3782 | 3778 | return 0;
|
@@ -4303,12 +4299,12 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
|
4303 | 4299 |
|
4304 | 4300 | for (i = 0; i < chip_info->num_groups; i++) {
|
4305 | 4301 | const struct group_desc *group = &chip_info->groups[i];
|
| 4302 | + const struct pingroup *grp = &group->grp; |
4306 | 4303 |
|
4307 |
| - err = pinctrl_generic_add_group(jzpc->pctl, group->name, |
4308 |
| - group->pins, group->num_pins, group->data); |
| 4304 | + err = pinctrl_generic_add_group(jzpc->pctl, grp->name, grp->pins, grp->npins, |
| 4305 | + group->data); |
4309 | 4306 | if (err < 0) {
|
4310 |
| - dev_err(dev, "Failed to register group %s\n", |
4311 |
| - group->name); |
| 4307 | + dev_err(dev, "Failed to register group %s\n", grp->name); |
4312 | 4308 | return err;
|
4313 | 4309 | }
|
4314 | 4310 | }
|
|
0 commit comments