lkml.org 
[lkml]   [2015]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] pinctrl: qcom: enable generic support and input-enable pinctrl conf
Date
Enables generic pinconf support and add handling for 'input-enable'
pinconf property.

Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
---
drivers/pinctrl/qcom/pinctrl-msm.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index e730935..4a47eb1 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -193,11 +193,11 @@ static int msm_config_reg(struct msm_pinctrl *pctrl,
*mask = 7;
break;
case PIN_CONFIG_OUTPUT:
+ case PIN_CONFIG_INPUT_ENABLE:
*bit = g->oe_bit;
*mask = 1;
break;
default:
- dev_err(pctrl->dev, "Invalid config param %04x\n", param);
return -ENOTSUPP;
}

@@ -208,14 +208,12 @@ static int msm_config_get(struct pinctrl_dev *pctldev,
unsigned int pin,
unsigned long *config)
{
- dev_err(pctldev->dev, "pin_config_set op not supported\n");
return -ENOTSUPP;
}

static int msm_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *configs, unsigned num_configs)
{
- dev_err(pctldev->dev, "pin_config_set op not supported\n");
return -ENOTSUPP;
}

@@ -276,9 +274,11 @@ static int msm_config_group_get(struct pinctrl_dev *pctldev,
val = readl(pctrl->regs + g->io_reg);
arg = !!(val & BIT(g->in_bit));
break;
+ case PIN_CONFIG_INPUT_ENABLE:
+ val = readl(pctrl->regs + g->io_reg);
+ arg = !!(val & BIT(g->in_bit));
+ break;
default:
- dev_err(pctrl->dev, "Unsupported config parameter: %x\n",
- param);
return -EINVAL;
}

@@ -348,6 +348,10 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev,
/* enable output */
arg = 1;
break;
+ case PIN_CONFIG_INPUT_ENABLE:
+ /* disable output */
+ arg = 0;
+ break;
default:
dev_err(pctrl->dev, "Unsupported config parameter: %x\n",
param);
@@ -372,6 +376,9 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev,
}

static const struct pinconf_ops msm_pinconf_ops = {
+#ifdef CONFIG_GENERIC_PINCONF
+ .is_generic = true,
+#endif
.pin_config_get = msm_config_get,
.pin_config_set = msm_config_set,
.pin_config_group_get = msm_config_group_get,
--
1.7.0.4


\
 
 \ /
  Last update: 2015-01-26 17:41    [W:0.112 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site