Patchwork [2/4] s5pc110: Implement s5pc110 chip_probe for OneNAND probe

login
register
mail settings
Submitter Marek Szyprowski
Date June 9, 2010, 2:05 p.m.
Message ID <1276092335-3245-3-git-send-email-m.szyprowski@samsung.com>
Download mbox | patch
Permalink /patch/55094/
State New
Headers show

Comments

Marek Szyprowski - June 9, 2010, 2:05 p.m.
From: Kyungmin Park <kyungmin.park@samsung.com>

This patch introduces a noop chip probe callback for OneNAND Samsung
S5PC110 driver. This way the workarounds can be removed from the
onenand_setup function and onenand framework.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

---
 drivers/mtd/onenand/samsung.c |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

Patch

diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c
index 2750317..fa4b743 100644
--- a/drivers/mtd/onenand/samsung.c
+++ b/drivers/mtd/onenand/samsung.c
@@ -738,6 +738,11 @@  static void s3c_unlock_all(struct mtd_info *mtd)
 	s3c_onenand_check_lock_status(mtd);
 }
 
+static int s5pc110_chip_probe(struct mtd_info *mtd)
+{
+	return 0;
+}
+
 static void s3c_onenand_setup(struct mtd_info *mtd)
 {
 	struct onenand_chip *this = mtd->priv;
@@ -757,6 +762,7 @@  static void s3c_onenand_setup(struct mtd_info *mtd)
 		/* Use generic onenand functions */
 		onenand->cmd_map = s5pc1xx_cmd_map;
 		this->read_bufferram = s5pc110_read_bufferram;
+		this->chip_probe = s5pc110_chip_probe;
 		return;
 	} else {
 		BUG();
@@ -781,7 +787,6 @@  static int s3c_onenand_probe(struct platform_device *pdev)
 	struct mtd_info *mtd;
 	struct resource *r;
 	int size, err;
-	unsigned long onenand_ctrl_cfg = 0;
 
 	pdata = pdev->dev.platform_data;
 	/* No need to check pdata. the platform data is optional */
@@ -900,14 +905,6 @@  static int s3c_onenand_probe(struct platform_device *pdev)
 		}
 
 		onenand->phys_base = onenand->base_res->start;
-
-		onenand_ctrl_cfg = readl(onenand->dma_addr + 0x100);
-		if ((onenand_ctrl_cfg & ONENAND_SYS_CFG1_SYNC_WRITE) &&
-		    onenand->dma_addr)
-			writel(onenand_ctrl_cfg & ~ONENAND_SYS_CFG1_SYNC_WRITE,
-					onenand->dma_addr + 0x100);
-		else
-			onenand_ctrl_cfg = 0;
 	}
 
 	if (onenand_scan(mtd, 1)) {
@@ -915,10 +912,7 @@  static int s3c_onenand_probe(struct platform_device *pdev)
 		goto scan_failed;
 	}
 
-	if (onenand->type == TYPE_S5PC110) {
-		if (onenand_ctrl_cfg && onenand->dma_addr)
-			writel(onenand_ctrl_cfg, onenand->dma_addr + 0x100);
-	} else {
+	if (onenand->type != TYPE_S5PC110) {
 		/* S3C doesn't handle subpage write */
 		mtd->subpage_sft = 0;
 		this->subpagesize = mtd->writesize;