devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: OMAP2+: gpmc: enable wait-pin monitoring for NAND devices via DT
@ 2014-05-20  6:24 Pekon Gupta
       [not found] ` <1400567064-20033-1-git-send-email-pekon-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Pekon Gupta @ 2014-05-20  6:24 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-omap, Ezequiel Garcia, Stefan Roese,
	Javier Martinez Canillas, Roger Quadros, Pekon Gupta,
	devicetree-u79uwXL29TY76Z2rM5mHXA

This patch enables 'wait-pin' monitoring in NAND driver if following properties
are present under NAND DT node
  gpmc,wait-pin = <wait-pin number>
  gpmc,wait-on-read
  gpmc,wait-on-write
As NAND generic framework uses common path nand_chip->dev_ready() for monitoring
completion of Read and Write status, so wait-pin monitoring is enabled only when
*both* 'gpmc,wait-on-read' and 'gpmc,wait-on-write' are specified.

CC: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Pekon Gupta <pekon-l0cyMroinI0@public.gmane.org>
---
 Documentation/devicetree/bindings/mtd/gpmc-nand.txt | 8 ++++++++
 arch/arm/mach-omap2/gpmc-nand.c                     | 8 +++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/mtd/gpmc-nand.txt b/Documentation/devicetree/bindings/mtd/gpmc-nand.txt
index eb81435..4039032 100644
--- a/Documentation/devicetree/bindings/mtd/gpmc-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmc-nand.txt
@@ -45,6 +45,14 @@ Optional properties:
 		ELM hardware engines should specify this device node in .dtsi
 		Using ELM for ECC error correction frees some CPU cycles.
 
+ - gpmc,wait-pin=<pin number>	Specifies GPMC wait-pin number to monitor
+ - gpmc,wait-on-read		Enable wait-pin monitoring for Read accesses
+ - gpmc,wait-on-write		Enable wait-pin monitoring for Write accesses
+		As NAND generic framework uses single common function
+		nand_chip->dev_ready() for polling wait-pin both for Read and
+		Write accesses. So for NAND devices both 'gpmc,wait-on-read' and
+		'gpmc,wait-on-write' need to be specified together.
+
 For inline partiton table parsing (optional):
 
  - #address-cells: should be set to 1
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 17cd393..62bc3de 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -123,11 +123,13 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
 		}
 	}
 
-	if (gpmc_nand_data->of_node)
+	if (gpmc_nand_data->of_node) {
 		gpmc_read_settings_dt(gpmc_nand_data->of_node, &s);
-	else
+		if (s.wait_on_read && s.wait_on_write)
+			gpmc_nand_data->dev_ready = true;
+	} else {
 		gpmc_set_legacy(gpmc_nand_data, &s);
-
+	}
 	s.device_nand = true;
 
 	err = gpmc_cs_program_settings(gpmc_nand_data->cs, &s);
-- 
1.8.5.1.163.gd7aced9

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-05-20 10:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-20  6:24 [PATCH v2] ARM: OMAP2+: gpmc: enable wait-pin monitoring for NAND devices via DT Pekon Gupta
     [not found] ` <1400567064-20033-1-git-send-email-pekon-l0cyMroinI0@public.gmane.org>
2014-05-20  7:45   ` Roger Quadros
     [not found]     ` <537B0803.6070702-l0cyMroinI0@public.gmane.org>
2014-05-20  8:34       ` Javier Martinez Canillas
2014-05-20  8:46       ` Gupta, Pekon
2014-05-20  9:24         ` Javier Martinez Canillas
2014-05-20  9:51           ` Roger Quadros
2014-05-20 10:03             ` Javier Martinez Canillas

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).