All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Tony Lindgren <tony@atomide.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Roger Quadros <rogerq@ti.com>
Subject: [PATCH v6 11/14] mtd: onenand: omap2: Do not make delay for GPIO OMAP3 specific
Date: Fri, 12 Jan 2018 14:16:28 +0100	[thread overview]
Message-ID: <20180112131628.GL13810@lenoch> (raw)
In-Reply-To: <20180112131105.GA13810@lenoch>

Second commit in driver history (782b7a367d81: "[MTD] [OneNAND] OMAP3:
add delay for GPIO") added quirk for waiting until GPIO line settle.
As DMA was disabled for OMAP2 boards, chances are this problem was
not OMAP3 specific and as it is just one register read, previous
test for SoC type is approximately as expensive as read itself.
Make delay unconditional, which allows removing SoC specific code
alltogether.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Roger Quadros <rogerq@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3:
- new patch

Changes in v2: None

 drivers/mtd/onenand/omap2.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index c9ff67100ef4..e4857a41760d 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -57,7 +57,6 @@ struct omap2_onenand {
 	struct dma_chan *dma_chan;
 	int freq;
 	int (*setup)(void __iomem *base, int *freq_ptr);
-	u8 flags;
 };
 
 static void omap2_onenand_dma_complete_func(void *completion)
@@ -148,9 +147,8 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
 		if (!(syscfg & ONENAND_SYS_CFG1_IOBE)) {
 			syscfg |= ONENAND_SYS_CFG1_IOBE;
 			write_reg(c, syscfg, ONENAND_REG_SYS_CFG1);
-			if (c->flags & ONENAND_IN_OMAP34XX)
-				/* Add a delay to let GPIO settle */
-				syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
+			/* Add a delay to let GPIO settle */
+			syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
 		}
 
 		reinit_completion(&c->irq_done);
@@ -470,7 +468,6 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 
 	init_completion(&c->irq_done);
 	init_completion(&c->dma_done);
-	c->flags = pdata->flags;
 	c->gpmc_cs = pdata->cs;
 	c->gpio_irq = pdata->gpio_irq;
 	if (pdata->dma_channel < 0) {
-- 
2.15.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Ladislav Michl <ladis@linux-mips.org>
To: linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>,
	Roger Quadros <rogerq@ti.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Tony Lindgren <tony@atomide.com>
Subject: [PATCH v6 11/14] mtd: onenand: omap2: Do not make delay for GPIO OMAP3 specific
Date: Fri, 12 Jan 2018 14:16:28 +0100	[thread overview]
Message-ID: <20180112131628.GL13810@lenoch> (raw)
In-Reply-To: <20180112131105.GA13810@lenoch>

Second commit in driver history (782b7a367d81: "[MTD] [OneNAND] OMAP3:
add delay for GPIO") added quirk for waiting until GPIO line settle.
As DMA was disabled for OMAP2 boards, chances are this problem was
not OMAP3 specific and as it is just one register read, previous
test for SoC type is approximately as expensive as read itself.
Make delay unconditional, which allows removing SoC specific code
alltogether.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Roger Quadros <rogerq@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3:
- new patch

Changes in v2: None

 drivers/mtd/onenand/omap2.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index c9ff67100ef4..e4857a41760d 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -57,7 +57,6 @@ struct omap2_onenand {
 	struct dma_chan *dma_chan;
 	int freq;
 	int (*setup)(void __iomem *base, int *freq_ptr);
-	u8 flags;
 };
 
 static void omap2_onenand_dma_complete_func(void *completion)
@@ -148,9 +147,8 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
 		if (!(syscfg & ONENAND_SYS_CFG1_IOBE)) {
 			syscfg |= ONENAND_SYS_CFG1_IOBE;
 			write_reg(c, syscfg, ONENAND_REG_SYS_CFG1);
-			if (c->flags & ONENAND_IN_OMAP34XX)
-				/* Add a delay to let GPIO settle */
-				syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
+			/* Add a delay to let GPIO settle */
+			syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
 		}
 
 		reinit_completion(&c->irq_done);
@@ -470,7 +468,6 @@ static int omap2_onenand_probe(struct platform_device *pdev)
 
 	init_completion(&c->irq_done);
 	init_completion(&c->dma_done);
-	c->flags = pdata->flags;
 	c->gpmc_cs = pdata->cs;
 	c->gpio_irq = pdata->gpio_irq;
 	if (pdata->dma_channel < 0) {
-- 
2.15.1

  parent reply	other threads:[~2018-01-12 13:16 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 13:11 [PATCH v6 00/14] OMAP2+ OneNAND driver update Ladislav Michl
2018-01-12 13:11 ` Ladislav Michl
2018-01-12 13:11 ` [PATCH v6 01/14] dt-bindings: mtd: gpmc-onenand: Update properties description Ladislav Michl
2018-01-12 13:11   ` Ladislav Michl
2018-01-12 13:12 ` [PATCH v6 02/14] ARM: dts: OMAP2+: Add compatible property to onenand node Ladislav Michl
2018-01-12 13:12   ` Ladislav Michl
2018-01-12 13:13 ` [PATCH v6 03/14] ARM: dts: omap3-igep: Update onenand node timings Ladislav Michl
2018-01-12 13:13   ` Ladislav Michl
2018-01-12 13:13 ` [PATCH v6 04/14] mtd: onenand: omap2: Remove regulator support Ladislav Michl
2018-01-12 13:13   ` Ladislav Michl
2018-01-12 13:13 ` [PATCH v6 05/14] mtd: onenand: omap2: Remove skip initial unlocking support Ladislav Michl
2018-01-12 13:13   ` Ladislav Michl
2018-01-12 13:14 ` [PATCH v6 06/14] mtd: onenand: omap2: Remove partitioning support from platform data Ladislav Michl
2018-01-12 13:14   ` Ladislav Michl
2018-01-12 13:14 ` [PATCH v6 07/14] mtd: onenand: omap2: Account waiting time as waiting on IO Ladislav Michl
2018-01-12 13:14   ` Ladislav Michl
2018-01-12 13:15 ` [PATCH v6 08/14] mtd: onenand: omap2: Simplify the DMA setup for various paths Ladislav Michl
2018-01-12 13:15   ` Ladislav Michl
2018-01-12 13:15 ` [PATCH v6 09/14] mtd: onenand: omap2: Unify OMAP2 and OMAP3 DMA implementation Ladislav Michl
2018-01-12 13:15   ` Ladislav Michl
2018-01-12 13:16 ` [PATCH v6 10/14] mtd: onenand: omap2: Convert to use dmaengine for memcpy Ladislav Michl
2018-01-12 13:16   ` Ladislav Michl
2018-01-12 13:16 ` Ladislav Michl [this message]
2018-01-12 13:16   ` [PATCH v6 11/14] mtd: onenand: omap2: Do not make delay for GPIO OMAP3 specific Ladislav Michl
2018-01-12 13:16 ` [PATCH v6 12/14] mtd: onenand: omap2: Decouple DMA enabling from INT pin availability Ladislav Michl
2018-01-12 13:16   ` Ladislav Michl
2018-01-12 13:46   ` Roger Quadros
2018-01-12 13:46     ` Roger Quadros
2018-01-12 13:56     ` Roger Quadros
2018-01-12 13:56       ` Roger Quadros
2018-01-12 13:17 ` [PATCH v6 13/14] mtd: onenand: omap2: Configure driver from DT Ladislav Michl
2018-01-12 13:17   ` Ladislav Michl
2018-01-12 13:47   ` Roger Quadros
2018-01-12 13:47     ` Roger Quadros
2018-12-22  1:02   ` Aaro Koskinen
2018-12-22  1:02     ` Aaro Koskinen
2018-12-22 10:19     ` Ladislav Michl
2018-12-22 10:19       ` Ladislav Michl
2018-12-23 12:51       ` Aaro Koskinen
2018-12-23 12:51         ` Aaro Koskinen
2018-12-23 15:56         ` Tony Lindgren
2018-12-23 15:56           ` Tony Lindgren
2018-01-12 13:18 ` [PATCH v6 14/14] ARM: OMAP2+: Remove gpmc-onenand Ladislav Michl
2018-01-12 13:18   ` Ladislav Michl
2018-01-12 14:03 ` [PATCH v6 00/14] OMAP2+ OneNAND driver update Boris Brezillon
2018-01-12 14:03   ` Boris Brezillon
2018-01-12 14:20   ` Tony Lindgren
2018-01-12 14:20     ` Tony Lindgren
2018-01-12 15:03   ` Roger Quadros
2018-01-12 15:03     ` Roger Quadros
2018-01-13 17:31 ` Boris Brezillon
2018-01-13 17:31   ` Boris Brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180112131628.GL13810@lenoch \
    --to=ladis@linux-mips.org \
    --cc=aaro.koskinen@iki.fi \
    --cc=boris.brezillon@free-electrons.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    --cc=rogerq@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.