summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-07-17 15:48:18 +0900
committerPaul Mundt <lethal@linux-sh.org>2012-07-17 15:48:18 +0900
commite3f805e897320c3c25d7d5f67e0fb59c5a7199bc (patch)
tree697028ecaca3008c78d6a2d8290aa1ed41f43cf6
parente3e79454a7c81a5e48c6d6b31068b12936e7d780 (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>
-rw-r--r--drivers/sh/pfc/pinctrl.c26
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 {
static struct sh_pfc_pinctrl *sh_pfc_pmx;
-/*
- * No group support yet
- */
-static int sh_pfc_get_noop_count(struct pinctrl_dev *pctldev)
+static int sh_pfc_get_groups_count(struct pinctrl_dev *pctldev)
{
- return 0;
+ struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev);
+
+ return pmx->nr_pads;
}
-static const char *sh_pfc_get_noop_name(struct pinctrl_dev *pctldev,
+static const char *sh_pfc_get_group_name(struct pinctrl_dev *pctldev,
unsigned selector)
{
- return NULL;
+ struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev);
+
+ return pmx->pads[selector].name;
}
static int sh_pfc_get_group_pins(struct pinctrl_dev *pctldev, unsigned group,
const unsigned **pins, unsigned *num_pins)
{
- return -ENOTSUPP;
+ struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev);
+
+ *pins = &pmx->pads[group].number;
+ *num_pins = 1;
+
+ return 0;
}
static struct pinctrl_ops sh_pfc_pinctrl_ops = {
- .get_groups_count = sh_pfc_get_noop_count,
- .get_group_name = sh_pfc_get_noop_name,
+ .get_groups_count = sh_pfc_get_groups_count,
+ .get_group_name = sh_pfc_get_group_name,
.get_group_pins = sh_pfc_get_group_pins,
};