diff options
author | Paul Mundt <lethal@linux-sh.org> | 2012-07-17 02:48:18 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-07-17 02:48:18 -0400 |
commit | e3f805e897320c3c25d7d5f67e0fb59c5a7199bc (patch) | |
tree | 697028ecaca3008c78d6a2d8290aa1ed41f43cf6 /drivers/sh | |
parent | e3e79454a7c81a5e48c6d6b31068b12936e7d780 (diff) |
sh: pfc: pinctrl legacy group support.
This follows the function support by simply doing 1 pin per group
encapsulation in order to keep with legacy behaviour. This will be
built on incrementally as SoCs define their own pin groups.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/sh')
-rw-r--r-- | drivers/sh/pfc/pinctrl.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/sh/pfc/pinctrl.c b/drivers/sh/pfc/pinctrl.c index e79e379917fc..45e80ee70766 100644 --- a/drivers/sh/pfc/pinctrl.c +++ b/drivers/sh/pfc/pinctrl.c | |||
@@ -37,29 +37,35 @@ struct sh_pfc_pinctrl { | |||
37 | 37 | ||
38 | static struct sh_pfc_pinctrl *sh_pfc_pmx; | 38 | static struct sh_pfc_pinctrl *sh_pfc_pmx; |
39 | 39 | ||
40 | /* | 40 | static int sh_pfc_get_groups_count(struct pinctrl_dev *pctldev) |
41 | * No group support yet | ||
42 | */ | ||
43 | static int sh_pfc_get_noop_count(struct pinctrl_dev *pctldev) | ||
44 | { | 41 | { |
45 | return 0; | 42 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); |
43 | |||
44 | return pmx->nr_pads; | ||
46 | } | 45 | } |
47 | 46 | ||
48 | static const char *sh_pfc_get_noop_name(struct pinctrl_dev *pctldev, | 47 | static const char *sh_pfc_get_group_name(struct pinctrl_dev *pctldev, |
49 | unsigned selector) | 48 | unsigned selector) |
50 | { | 49 | { |
51 | return NULL; | 50 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); |
51 | |||
52 | return pmx->pads[selector].name; | ||
52 | } | 53 | } |
53 | 54 | ||
54 | static int sh_pfc_get_group_pins(struct pinctrl_dev *pctldev, unsigned group, | 55 | static int sh_pfc_get_group_pins(struct pinctrl_dev *pctldev, unsigned group, |
55 | const unsigned **pins, unsigned *num_pins) | 56 | const unsigned **pins, unsigned *num_pins) |
56 | { | 57 | { |
57 | return -ENOTSUPP; | 58 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); |
59 | |||
60 | *pins = &pmx->pads[group].number; | ||
61 | *num_pins = 1; | ||
62 | |||
63 | return 0; | ||
58 | } | 64 | } |
59 | 65 | ||
60 | static struct pinctrl_ops sh_pfc_pinctrl_ops = { | 66 | static struct pinctrl_ops sh_pfc_pinctrl_ops = { |
61 | .get_groups_count = sh_pfc_get_noop_count, | 67 | .get_groups_count = sh_pfc_get_groups_count, |
62 | .get_group_name = sh_pfc_get_noop_name, | 68 | .get_group_name = sh_pfc_get_group_name, |
63 | .get_group_pins = sh_pfc_get_group_pins, | 69 | .get_group_pins = sh_pfc_get_group_pins, |
64 | }; | 70 | }; |
65 | 71 | ||