All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] pinctrl: qcom-spmi-gpio: Fix output type configuration
@ 2015-04-09 15:18 Ivan T. Ivanov
  2015-04-09 15:18 ` [PATCH 2/3] pinctrl: qcom-spmi-gpio: Fix input value report Ivan T. Ivanov
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Ivan T. Ivanov @ 2015-04-09 15:18 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Bjorn Andersson, Arnd Bergmann, Soren Brinkmann, linux-gpio,
	linux-kernel, linux-arm-msm

GPIO output type configuration was incorrectly overwritten
by strength value. Fix this.

Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
---
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index b2d2221..4b21aac 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -417,7 +417,7 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
 		return ret;

 	val = pad->buffer_type << PMIC_GPIO_REG_OUT_TYPE_SHIFT;
-	val = pad->strength << PMIC_GPIO_REG_OUT_STRENGTH_SHIFT;
+	val |= pad->strength << PMIC_GPIO_REG_OUT_STRENGTH_SHIFT;

 	ret = pmic_gpio_write(state, pad, PMIC_GPIO_REG_DIG_OUT_CTL, val);
 	if (ret < 0)
--
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] pinctrl: qcom-spmi-gpio: Fix input value report
  2015-04-09 15:18 [PATCH 1/3] pinctrl: qcom-spmi-gpio: Fix output type configuration Ivan T. Ivanov
@ 2015-04-09 15:18 ` Ivan T. Ivanov
  2015-04-09 16:01   ` Bjorn Andersson
  2015-04-28 12:49   ` Linus Walleij
  2015-04-09 15:18 ` [PATCH 3/3] pinctrl: qcom-spmi-mpp: " Ivan T. Ivanov
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Ivan T. Ivanov @ 2015-04-09 15:18 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Bjorn Andersson, Arnd Bergmann, Soren Brinkmann, linux-gpio,
	linux-kernel, linux-arm-msm

Read input buffer when input is enabled, not when it is
disabled. Also fix interpretation of the pmic_gpio_read()
return code, negative value means an error.

Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
---
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index 4b21aac..e8b74c6 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -466,12 +466,13 @@ static void pmic_gpio_config_dbg_show(struct pinctrl_dev *pctldev,
 		seq_puts(s, " ---");
 	} else {

-		if (!pad->input_enabled) {
+		if (pad->input_enabled) {
 			ret = pmic_gpio_read(state, pad, PMIC_MPP_REG_RT_STS);
-			if (!ret) {
-				ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
-				pad->out_value = ret;
-			}
+			if (ret < 0)
+				return;
+
+			ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
+			pad->out_value = ret;
 		}

 		seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in");
--
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] pinctrl: qcom-spmi-mpp: Fix input value report
  2015-04-09 15:18 [PATCH 1/3] pinctrl: qcom-spmi-gpio: Fix output type configuration Ivan T. Ivanov
  2015-04-09 15:18 ` [PATCH 2/3] pinctrl: qcom-spmi-gpio: Fix input value report Ivan T. Ivanov
@ 2015-04-09 15:18 ` Ivan T. Ivanov
  2015-04-09 16:03   ` Bjorn Andersson
  2015-04-28 12:53   ` Linus Walleij
  2015-04-09 15:53 ` [PATCH 1/3] pinctrl: qcom-spmi-gpio: Fix output type configuration Bjorn Andersson
  2015-04-28 12:48 ` Linus Walleij
  3 siblings, 2 replies; 9+ messages in thread
From: Ivan T. Ivanov @ 2015-04-09 15:18 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Bjorn Andersson, linux-gpio, linux-kernel, linux-arm-msm

Fix interpretation of the pmic_mpp_read() return code,
negative value means an error.

Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
---
 drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
index 8f36c5f..8f6c7be 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
@@ -576,10 +576,11 @@ static void pmic_mpp_config_dbg_show(struct pinctrl_dev *pctldev,

 		if (pad->input_enabled) {
 			ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS);
-			if (!ret) {
-				ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
-				pad->out_value = ret;
-			}
+			if (ret < 0)
+				return;
+
+			ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
+			pad->out_value = ret;
 		}

 		seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in");
--
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] pinctrl: qcom-spmi-gpio: Fix output type configuration
  2015-04-09 15:18 [PATCH 1/3] pinctrl: qcom-spmi-gpio: Fix output type configuration Ivan T. Ivanov
  2015-04-09 15:18 ` [PATCH 2/3] pinctrl: qcom-spmi-gpio: Fix input value report Ivan T. Ivanov
  2015-04-09 15:18 ` [PATCH 3/3] pinctrl: qcom-spmi-mpp: " Ivan T. Ivanov
@ 2015-04-09 15:53 ` Bjorn Andersson
  2015-04-28 12:48 ` Linus Walleij
  3 siblings, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2015-04-09 15:53 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: Linus Walleij, Arnd Bergmann, Soren Brinkmann, linux-gpio,
	linux-kernel, linux-arm-msm

On Thu 09 Apr 08:18 PDT 2015, Ivan T. Ivanov wrote:

> GPIO output type configuration was incorrectly overwritten
> by strength value. Fix this.
> 
> Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
> ---

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

Regards,
Bjorn


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] pinctrl: qcom-spmi-gpio: Fix input value report
  2015-04-09 15:18 ` [PATCH 2/3] pinctrl: qcom-spmi-gpio: Fix input value report Ivan T. Ivanov
@ 2015-04-09 16:01   ` Bjorn Andersson
  2015-04-28 12:49   ` Linus Walleij
  1 sibling, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2015-04-09 16:01 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: Linus Walleij, Arnd Bergmann, Soren Brinkmann, linux-gpio,
	linux-kernel, linux-arm-msm

On Thu 09 Apr 08:18 PDT 2015, Ivan T. Ivanov wrote:

> Read input buffer when input is enabled, not when it is
> disabled. Also fix interpretation of the pmic_gpio_read()
> return code, negative value means an error.
> 
> Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
> ---

>  drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
> index 4b21aac..e8b74c6 100644
> --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
> +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
> @@ -466,12 +466,13 @@ static void pmic_gpio_config_dbg_show(struct pinctrl_dev *pctldev,
>  		seq_puts(s, " ---");
>  	} else {
> 
> -		if (!pad->input_enabled) {
> +		if (pad->input_enabled) {
>  			ret = pmic_gpio_read(state, pad, PMIC_MPP_REG_RT_STS);
> -			if (!ret) {
> -				ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
> -				pad->out_value = ret;
> -			}
> +			if (ret < 0)
> +				return;
> +
> +			ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
> +			pad->out_value = ret;

I'm not too happy on pmic_gpio_read() returning the register value as an
signed int, sorry for not picking on this back when we merged the
driver.

As far as I can see bit 31 is reserved in all registers in the block
though, so there shouldn't be any practical issues with this _today_.

But please consider revising pmic_gpio_read() to take a u32* parameter
for the data instead.

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

Regards,
Bjorn

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] pinctrl: qcom-spmi-mpp: Fix input value report
  2015-04-09 15:18 ` [PATCH 3/3] pinctrl: qcom-spmi-mpp: " Ivan T. Ivanov
@ 2015-04-09 16:03   ` Bjorn Andersson
  2015-04-28 12:53   ` Linus Walleij
  1 sibling, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2015-04-09 16:03 UTC (permalink / raw)
  To: Ivan T. Ivanov; +Cc: Linus Walleij, linux-gpio, linux-kernel, linux-arm-msm

On Thu 09 Apr 08:18 PDT 2015, Ivan T. Ivanov wrote:

> Fix interpretation of the pmic_mpp_read() return code,
> negative value means an error.
> 
> Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
> ---
>  drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
> index 8f36c5f..8f6c7be 100644
> --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
> +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
> @@ -576,10 +576,11 @@ static void pmic_mpp_config_dbg_show(struct pinctrl_dev *pctldev,
> 
>  		if (pad->input_enabled) {
>  			ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS);
> -			if (!ret) {
> -				ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
> -				pad->out_value = ret;
> -			}
> +			if (ret < 0)
> +				return;
> +
> +			ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
> +			pad->out_value = ret;

Same as with the gpio driver.

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

Regards,
Bjrn

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] pinctrl: qcom-spmi-gpio: Fix output type configuration
  2015-04-09 15:18 [PATCH 1/3] pinctrl: qcom-spmi-gpio: Fix output type configuration Ivan T. Ivanov
                   ` (2 preceding siblings ...)
  2015-04-09 15:53 ` [PATCH 1/3] pinctrl: qcom-spmi-gpio: Fix output type configuration Bjorn Andersson
@ 2015-04-28 12:48 ` Linus Walleij
  3 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2015-04-28 12:48 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: Bjorn Andersson, Arnd Bergmann, Soren Brinkmann, linux-gpio,
	linux-kernel, linux-arm-msm

On Thu, Apr 9, 2015 at 5:18 PM, Ivan T. Ivanov <ivan.ivanov@linaro.org> wrote:

> GPIO output type configuration was incorrectly overwritten
> by strength value. Fix this.
>
> Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>

Patch applied for fixes.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] pinctrl: qcom-spmi-gpio: Fix input value report
  2015-04-09 15:18 ` [PATCH 2/3] pinctrl: qcom-spmi-gpio: Fix input value report Ivan T. Ivanov
  2015-04-09 16:01   ` Bjorn Andersson
@ 2015-04-28 12:49   ` Linus Walleij
  1 sibling, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2015-04-28 12:49 UTC (permalink / raw)
  To: Ivan T. Ivanov
  Cc: Bjorn Andersson, Arnd Bergmann, Soren Brinkmann, linux-gpio,
	linux-kernel, linux-arm-msm

On Thu, Apr 9, 2015 at 5:18 PM, Ivan T. Ivanov <ivan.ivanov@linaro.org> wrote:

> Read input buffer when input is enabled, not when it is
> disabled. Also fix interpretation of the pmic_gpio_read()
> return code, negative value means an error.
>
> Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>

Patch applied for fixes.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] pinctrl: qcom-spmi-mpp: Fix input value report
  2015-04-09 15:18 ` [PATCH 3/3] pinctrl: qcom-spmi-mpp: " Ivan T. Ivanov
  2015-04-09 16:03   ` Bjorn Andersson
@ 2015-04-28 12:53   ` Linus Walleij
  1 sibling, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2015-04-28 12:53 UTC (permalink / raw)
  To: Ivan T. Ivanov; +Cc: Bjorn Andersson, linux-gpio, linux-kernel, linux-arm-msm

On Thu, Apr 9, 2015 at 5:18 PM, Ivan T. Ivanov <ivan.ivanov@linaro.org> wrote:

> Fix interpretation of the pmic_mpp_read() return code,
> negative value means an error.
>
> Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>

Patch applied for fixes.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-04-28 12:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-09 15:18 [PATCH 1/3] pinctrl: qcom-spmi-gpio: Fix output type configuration Ivan T. Ivanov
2015-04-09 15:18 ` [PATCH 2/3] pinctrl: qcom-spmi-gpio: Fix input value report Ivan T. Ivanov
2015-04-09 16:01   ` Bjorn Andersson
2015-04-28 12:49   ` Linus Walleij
2015-04-09 15:18 ` [PATCH 3/3] pinctrl: qcom-spmi-mpp: " Ivan T. Ivanov
2015-04-09 16:03   ` Bjorn Andersson
2015-04-28 12:53   ` Linus Walleij
2015-04-09 15:53 ` [PATCH 1/3] pinctrl: qcom-spmi-gpio: Fix output type configuration Bjorn Andersson
2015-04-28 12:48 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.