Skip to contentSkip to conversation

NAND: Fix ams-delta after core conversion

MTD Jonathan McDowell 2 participants 3 messages Aug 8, 2006

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

The recent hwctrl core conversion for MTD NAND devices broke the Amstrad Delta driver. This fixes it up and uses the existing control line defines rather than unclear magic numbers.

-----

drivers/mtd/nand/ams-delta.c +6 -4
index d7897dc..a0ba07c 100644
@@ -130,11 +130,13 @@ static void ams_delta_hwcontrol(struct m
 	if (ctrl & NAND_CTRL_CHANGE) {
 		unsigned long bits;
 
-		bits = (~ctrl & NAND_NCE) << 2;
-		bits |= (ctrl & NAND_CLE) << 7;
-		bits |= (ctrl & NAND_ALE) << 6;
+		bits = (~ctrl & NAND_NCE) ? AMS_DELTA_LATCH2_NAND_NCE : 0;
+		bits |= (ctrl & NAND_CLE) ? AMS_DELTA_LATCH2_NAND_CLE : 0;
+		bits |= (ctrl & NAND_ALE) ? AMS_DELTA_LATCH2_NAND_ALE : 0;
 
-		ams_delta_latch2_write(0xC2, bits);
+		ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_CLE |
+				AMS_DELTA_LATCH2_NAND_ALE |
+				AMS_DELTA_LATCH2_NAND_NCE, bits);
 	}
 
 	if (cmd != NAND_CMD_NONE)

-----

J.

Signature · 4 lines
] http://www.earth.li/~noodles/ []     "Hand me that solar-powered     [
]  PGP/GPG Key @ the.earth.li   []           flashlight..."            [
] via keyserver, web or email.  []                                     [
] RSA: 4DC4E7FD / DSA: 5B430367 []                                     [
#1 lore raw

Hello.

Quoted 3 lines · Jonathan McDowell

The recent hwctrl core conversion for MTD NAND devices broke the Amstrad Delta driver. This fixes it up and uses the existing control line defines rather than unclear magic numbers.

Ugh, au1550nd.c also looks broken by this change. No time to fix now though...

WBR, Sergei

#2 lore raw

Hello.

Quoted 5 lines · Sergei Shtylyov
Quoted 3 lines

The recent hwctrl core conversion for MTD NAND devices broke the Amstrad Delta driver. This fixes it up and uses the existing control line defines rather than unclear magic numbers.

Ugh, au1550nd.c also looks broken by this change. No time to fix now though...

OTOH, it was too hasty conclusion. This driver overrides both select_chip
and cmdfunc, so probably not. I'll try it somewhat later for real...

WBR, Sergei