linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: at91: enhance (debugfs) at91_gpio_dbg_show
@ 2014-11-18 14:43 Nicolas Ferre
  2014-12-02 14:58 ` Nicolas Ferre
  2014-12-03 11:23 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Nicolas Ferre @ 2014-11-18 14:43 UTC (permalink / raw)
  To: linux-arm-kernel

From: Matthieu Crapet <mcrapet@gmail.com>

When a pin is configured as GPIO, print also direction (input or output).

Signed-off-by: Matthieu Crapet <mcrapet@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/pinctrl/pinctrl-at91.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 354a81d40925..a6b29ebc3cc3 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -1344,7 +1344,6 @@ static void at91_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
 	for (i = 0; i < chip->ngpio; i++) {
 		unsigned mask = pin_to_mask(i);
 		const char *gpio_label;
-		u32 pdsr;
 
 		gpio_label = gpiochip_is_requested(chip, i);
 		if (!gpio_label)
@@ -1353,11 +1352,13 @@ static void at91_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
 		seq_printf(s, "[%s] GPIO%s%d: ",
 			   gpio_label, chip->label, i);
 		if (mode == AT91_MUX_GPIO) {
-			pdsr = readl_relaxed(pio + PIO_PDSR);
-
-			seq_printf(s, "[gpio] %s\n",
-				   pdsr & mask ?
-				   "set" : "clear");
+			seq_printf(s, "[gpio] ");
+			seq_printf(s, "%s ",
+				      readl_relaxed(pio + PIO_OSR) & mask ?
+				      "output" : "input");
+			seq_printf(s, "%s\n",
+				      readl_relaxed(pio + PIO_PDSR) & mask ?
+				      "set" : "clear");
 		} else {
 			seq_printf(s, "[periph %c]\n",
 				   mode + 'A' - 1);
-- 
2.1.3

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

* [PATCH] pinctrl: at91: enhance (debugfs) at91_gpio_dbg_show
  2014-11-18 14:43 [PATCH] pinctrl: at91: enhance (debugfs) at91_gpio_dbg_show Nicolas Ferre
@ 2014-12-02 14:58 ` Nicolas Ferre
  2014-12-03 11:23 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Ferre @ 2014-12-02 14:58 UTC (permalink / raw)
  To: linux-arm-kernel

Le 18/11/2014 15:43, Nicolas Ferre a ?crit :
> From: Matthieu Crapet <mcrapet@gmail.com>
> 
> When a pin is configured as GPIO, print also direction (input or output).
> 
> Signed-off-by: Matthieu Crapet <mcrapet@gmail.com>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  drivers/pinctrl/pinctrl-at91.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)

Linus, ping?

> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index 354a81d40925..a6b29ebc3cc3 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -1344,7 +1344,6 @@ static void at91_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
>  	for (i = 0; i < chip->ngpio; i++) {
>  		unsigned mask = pin_to_mask(i);
>  		const char *gpio_label;
> -		u32 pdsr;
>  
>  		gpio_label = gpiochip_is_requested(chip, i);
>  		if (!gpio_label)
> @@ -1353,11 +1352,13 @@ static void at91_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
>  		seq_printf(s, "[%s] GPIO%s%d: ",
>  			   gpio_label, chip->label, i);
>  		if (mode == AT91_MUX_GPIO) {
> -			pdsr = readl_relaxed(pio + PIO_PDSR);
> -
> -			seq_printf(s, "[gpio] %s\n",
> -				   pdsr & mask ?
> -				   "set" : "clear");
> +			seq_printf(s, "[gpio] ");
> +			seq_printf(s, "%s ",
> +				      readl_relaxed(pio + PIO_OSR) & mask ?
> +				      "output" : "input");
> +			seq_printf(s, "%s\n",
> +				      readl_relaxed(pio + PIO_PDSR) & mask ?
> +				      "set" : "clear");
>  		} else {
>  			seq_printf(s, "[periph %c]\n",
>  				   mode + 'A' - 1);
> 


-- 
Nicolas Ferre

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

* [PATCH] pinctrl: at91: enhance (debugfs) at91_gpio_dbg_show
  2014-11-18 14:43 [PATCH] pinctrl: at91: enhance (debugfs) at91_gpio_dbg_show Nicolas Ferre
  2014-12-02 14:58 ` Nicolas Ferre
@ 2014-12-03 11:23 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2014-12-03 11:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 18, 2014 at 3:43 PM, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:

> From: Matthieu Crapet <mcrapet@gmail.com>
>
> When a pin is configured as GPIO, print also direction (input or output).
>
> Signed-off-by: Matthieu Crapet <mcrapet@gmail.com>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Patch applied.

Yours,
Linus Walleij

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

end of thread, other threads:[~2014-12-03 11:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-18 14:43 [PATCH] pinctrl: at91: enhance (debugfs) at91_gpio_dbg_show Nicolas Ferre
2014-12-02 14:58 ` Nicolas Ferre
2014-12-03 11:23 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).