Skip to contentSkip to conversation

mtd: nand-gpio: Prepare driver to support multichip devices

RFC New Alexander Shiyan 1 participant 1 message May 28, 2013

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 mtd: nand-gpio: Prepare driver to support multichip devices

---
 arch/arm/mach-clps711x/board-autcpu12.c |  4 +--
 arch/arm/mach-clps711x/board-p720t.c    |  4 +--
 arch/arm/mach-pxa/cm-x255.c             | 10 ++++----
 drivers/mtd/nand/gpio.c                 | 45 +++++++++++++++------------------
 include/linux/mtd/nand-gpio.h           | 12 +++++----
 5 files changed, 37 insertions(+), 38 deletions(-)
arch/arm/mach-clps711x/board-autcpu12.c +2 -2
index f385847..260a28a 100644
@@ -107,11 +107,11 @@ static void __init autcpu12_adjust_parts(struct gpio_nand_platdata *pdata,
 }
 
 static struct gpio_nand_platdata autcpu12_nand_pdata __initdata = {
-	.gpio_rdy	= AUTCPU12_SMC_RDY,
-	.gpio_nce	= AUTCPU12_SMC_NCE,
 	.gpio_ale	= AUTCPU12_SMC_ALE,
 	.gpio_cle	= AUTCPU12_SMC_CLE,
 	.gpio_nwp	= -1,
+	.gpio_nce[0]	= AUTCPU12_SMC_NCE,
+	.gpio_rdy[0]	= AUTCPU12_SMC_RDY,
 	.chip_delay	= 20,
 	.parts		= autcpu12_nand_parts,
 	.num_parts	= ARRAY_SIZE(autcpu12_nand_parts),
arch/arm/mach-clps711x/board-p720t.c +2 -2
index 8d3ee67..82a81de 100644
@@ -69,11 +69,11 @@ static struct mtd_partition p720t_nand_parts[] __initdata = {
 };
 
 static struct gpio_nand_platdata p720t_nand_pdata __initdata = {
-	.gpio_rdy	= -1,
-	.gpio_nce	= P720T_NAND_NCE,
 	.gpio_ale	= P720T_NAND_ALE,
 	.gpio_cle	= P720T_NAND_CLE,
 	.gpio_nwp	= -1,
+	.gpio_nce[0]	= P720T_NAND_NCE,
+	.gpio_rdy[0]	= -1,
 	.chip_delay	= 15,
 	.parts		= p720t_nand_parts,
 	.num_parts	= ARRAY_SIZE(p720t_nand_parts),
arch/arm/mach-pxa/cm-x255.c +5 -5
index be75147..40ae03f 100644
@@ -198,11 +198,11 @@ static struct mtd_partition cmx255_nand_parts[] = {
 };
 
 static struct gpio_nand_platdata cmx255_nand_platdata = {
-	.gpio_nce = GPIO_NAND_CS,
-	.gpio_cle = GPIO_NAND_CLE,
-	.gpio_ale = GPIO_NAND_ALE,
-	.gpio_rdy = GPIO_NAND_RB,
-	.gpio_nwp = -1,
+	.gpio_ale	= GPIO_NAND_ALE,
+	.gpio_cle	= GPIO_NAND_CLE,
+	.gpio_nwp	= -1,
+	.gpio_nce[0]	= GPIO_NAND_CS,
+	.gpio_rdy[0]	= GPIO_NAND_RB,
 	.parts = cmx255_nand_parts,
 	.num_parts = ARRAY_SIZE(cmx255_nand_parts),
 	.chip_delay = 25,
drivers/mtd/nand/gpio.c +21 -24

112 lines not on this page · raw message

include/linux/mtd/nand-gpio.h +7 -5
index 51534e5..0e66068 100644
@@ -3,12 +3,14 @@
 
 #include <linux/mtd/nand.h>
 
+#define MAX_NAND_PER_CHIP	1	
+
 struct gpio_nand_platdata {
-	int	gpio_nce;
-	int	gpio_nwp;
-	int	gpio_cle;
-	int	gpio_ale;
-	int	gpio_rdy;
+	int	gpio_ale;			/* ALE */
+	int	gpio_cle;			/* CLE */
+	int	gpio_nwp;			/* NWP (Optional) */
+	int	gpio_nce[MAX_NAND_PER_CHIP];	/* NCE */
+	int	gpio_rdy[MAX_NAND_PER_CHIP];	/* RDY (Optional) */
 	void	(*adjust_parts)(struct gpio_nand_platdata *, size_t);
 	struct mtd_partition *parts;
 	unsigned int num_parts;
Signature · 1 line
1.8.1.5