summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/mvebu
diff options
context:
space:
mode:
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>2015-11-28 05:26:49 -0500
committerLinus Walleij <linus.walleij@linaro.org>2015-12-09 10:15:07 -0500
commit0581b16b184031e767f64d20a93f65433d678685 (patch)
treea81b1f1210e1f4d660b2cfef8c9f89cdb7c07c98 /drivers/pinctrl/mvebu
parentc5cdcba3d54b9bd2443bd0afe9f4828f802a944f (diff)
pinctrl: mvebu: complain about missing group after checking variant
Common MVEBU pinctrl driver core gets an array of controls to modify a specific set of registers and an array of modes for each pingroup from each of the different SoC families of MVEBU. Some SoC families comprise different variants that differ in available pingroups and also controls, but to ease driver development, we can pass a variant mask to disable specific pingroups for some variants. However, controls are limited to the true number of pinctrl groups avaiable on a variant. Now, when pinctrl core driver parses over above arrays, it tries to match modes with available controls and complains about missing controls for modes that are passed to the core but actually are not avaiable on a variant with: kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 36 This warning is a false-positive and annoying, so move the warning after we checked the variant mask for each mode setting. Also, if there is no supported setting for this variant, do not complain at all. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Reported-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/mvebu')
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-mvebu.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
index 77d2221d379d..e4d473811bb3 100644
--- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c
+++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
@@ -663,28 +663,20 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
663 /* assign mpp modes to groups */ 663 /* assign mpp modes to groups */
664 for (n = 0; n < soc->nmodes; n++) { 664 for (n = 0; n < soc->nmodes; n++) {
665 struct mvebu_mpp_mode *mode = &soc->modes[n]; 665 struct mvebu_mpp_mode *mode = &soc->modes[n];
666 struct mvebu_pinctrl_group *grp = 666 struct mvebu_mpp_ctrl_setting *set = &mode->settings[0];
667 mvebu_pinctrl_find_group_by_pid(pctl, mode->pid); 667 struct mvebu_pinctrl_group *grp;
668 unsigned num_settings; 668 unsigned num_settings;
669 669
670 if (!grp) { 670 for (num_settings = 0; ; set++) {
671 dev_warn(&pdev->dev, "unknown pinctrl group %d\n",
672 mode->pid);
673 continue;
674 }
675
676 for (num_settings = 0; ;) {
677 struct mvebu_mpp_ctrl_setting *set =
678 &mode->settings[num_settings];
679
680 if (!set->name) 671 if (!set->name)
681 break; 672 break;
682 num_settings++;
683 673
684 /* skip unsupported settings for this variant */ 674 /* skip unsupported settings for this variant */
685 if (pctl->variant && !(pctl->variant & set->variant)) 675 if (pctl->variant && !(pctl->variant & set->variant))
686 continue; 676 continue;
687 677
678 num_settings++;
679
688 /* find gpio/gpo/gpi settings */ 680 /* find gpio/gpo/gpi settings */
689 if (strcmp(set->name, "gpio") == 0) 681 if (strcmp(set->name, "gpio") == 0)
690 set->flags = MVEBU_SETTING_GPI | 682 set->flags = MVEBU_SETTING_GPI |
@@ -695,6 +687,17 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
695 set->flags = MVEBU_SETTING_GPI; 687 set->flags = MVEBU_SETTING_GPI;
696 } 688 }
697 689
690 /* skip modes with no settings for this variant */
691 if (!num_settings)
692 continue;
693
694 grp = mvebu_pinctrl_find_group_by_pid(pctl, mode->pid);
695 if (!grp) {
696 dev_warn(&pdev->dev, "unknown pinctrl group %d\n",
697 mode->pid);
698 continue;
699 }
700
698 grp->settings = mode->settings; 701 grp->settings = mode->settings;
699 grp->num_settings = num_settings; 702 grp->num_settings = num_settings;
700 } 703 }