summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/renesas
diff options
context:
space:
mode:
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>2020-11-28 13:13:09 +0000
committerMarek Vasut <marek.vasut+renesas@gmail.com>2021-01-18 13:29:12 +0100
commit8096e2426d4d61e3a41139b99db5cc554d45b87a (patch)
treec580f9069934d34c81e3226eeaed442f1cd2c865 /drivers/pinctrl/renesas
parentcc6aa80dd1b75ee9f4661b4aa0719c13c66f1fde (diff)
downloadu-boot-8096e2426d4d61e3a41139b99db5cc554d45b87a.tar.gz
u-boot-8096e2426d4d61e3a41139b99db5cc554d45b87a.tar.xz
u-boot-8096e2426d4d61e3a41139b99db5cc554d45b87a.zip
pinctrl: renesas: Implement get_pin_muxing() callback
Implement get_pin_muxing() callback so that pinmux status command can be used on Renesas platforms. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Diffstat (limited to 'drivers/pinctrl/renesas')
-rw-r--r--drivers/pinctrl/renesas/pfc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/pinctrl/renesas/pfc.c b/drivers/pinctrl/renesas/pfc.c
index b9238d032c..6ff948420c 100644
--- a/drivers/pinctrl/renesas/pfc.c
+++ b/drivers/pinctrl/renesas/pfc.c
@@ -449,6 +449,30 @@ static const char *sh_pfc_pinctrl_get_group_name(struct udevice *dev,
return priv->pfc.info->groups[selector].name;
}
+static int sh_pfc_pinctrl_get_pin_muxing(struct udevice *dev,
+ unsigned int selector,
+ char *buf, int size)
+{
+ struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
+ struct sh_pfc_pinctrl *pmx = &priv->pmx;
+ struct sh_pfc *pfc = &priv->pfc;
+ struct sh_pfc_pin_config *cfg;
+ const struct sh_pfc_pin *pin;
+ int idx;
+
+ pin = &priv->pfc.info->pins[selector];
+ if (!pin) {
+ snprintf(buf, size, "Unknown");
+ return -EINVAL;
+ }
+
+ idx = sh_pfc_get_pin_index(pfc, pin->pin);
+ cfg = &pmx->configs[idx];
+ snprintf(buf, size, "%s", cfg->name);
+
+ return 0;
+}
+
static int sh_pfc_pinctrl_get_functions_count(struct udevice *dev)
{
struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
@@ -815,6 +839,7 @@ static struct pinctrl_ops sh_pfc_pinctrl_ops = {
.get_pin_name = sh_pfc_pinctrl_get_pin_name,
.get_groups_count = sh_pfc_pinctrl_get_groups_count,
.get_group_name = sh_pfc_pinctrl_get_group_name,
+ .get_pin_muxing = sh_pfc_pinctrl_get_pin_muxing,
.get_functions_count = sh_pfc_pinctrl_get_functions_count,
.get_function_name = sh_pfc_pinctrl_get_function_name,