diff mbox

[v2,2/2] pinctrl: qcom: handle input-enable pinconf property

Message ID 1425465717-27747-3-git-send-email-svarbanov@mm-sol.com (mailing list archive)
State New, archived
Headers show

Commit Message

Stanimir Varbanov March 4, 2015, 10:41 a.m. UTC
This enables support of 'input-enable' pinconf generic property in
the pinctrl driver.

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

Comments

Bjorn Andersson March 4, 2015, 2:38 p.m. UTC | #1
On Wed 04 Mar 02:41 PST 2015, Stanimir Varbanov wrote:

> This enables support of 'input-enable' pinconf generic property in
> the pinctrl driver.
> 
> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
> ---
>  drivers/pinctrl/qcom/pinctrl-msm.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> index d36e511..f3d800f 100644
> --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> @@ -193,6 +193,7 @@ 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;
> @@ -260,6 +261,12 @@ 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:
> +		/* Pin is output */
> +		if (arg)
> +			return -EINVAL;
> +		arg = 1;
> +		break;

I still don't like this part of the api, but the patch is

Acked-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>

>  	default:
>  		return -ENOTSUPP;
>  	}

Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Boyd March 4, 2015, 6:28 p.m. UTC | #2
On 03/04/15 02:41, Stanimir Varbanov wrote:
> This enables support of 'input-enable' pinconf generic property in
> the pinctrl driver.
>
> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
>


Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Linus Walleij March 9, 2015, 4:09 p.m. UTC | #3
On Wed, Mar 4, 2015 at 11:41 AM, Stanimir Varbanov <svarbanov@mm-sol.com> wrote:

> This enables support of 'input-enable' pinconf generic property in
> the pinctrl driver.
>
> Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>

Patch applied with the ACKs.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index d36e511..f3d800f 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -193,6 +193,7 @@  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;
@@ -260,6 +261,12 @@  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:
+		/* Pin is output */
+		if (arg)
+			return -EINVAL;
+		arg = 1;
+		break;
 	default:
 		return -ENOTSUPP;
 	}
@@ -330,6 +337,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);