[MTD] [NAND] Fix refactoring of EDB7312 hwcontrol function.

2007-10-13 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4a32cfa0f5c3f9e8a0da610002e4555173226650
Commit: 4a32cfa0f5c3f9e8a0da610002e4555173226650
Parent: 030f9e13bec9aaae1def86c23963a1a825ccdab5
Author: Roland Stigge <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 18 14:56:11 2007 +0200
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Mon Jul 23 12:49:13 2007 +0100

    [MTD] [NAND] Fix refactoring of EDB7312 hwcontrol function.

The patch ensures that the current code (kernel 2.6.22) uses the bits
like the code prior to the refactoring. The variable "bits" is employed
in a useful way now.

Signed-off-by: Roland Stigge <[EMAIL PROTECTED]>
Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
---
 drivers/mtd/nand/edb7312.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/edb7312.c b/drivers/mtd/nand/edb7312.c
index 1daf823..0146cdc 100644
--- a/drivers/mtd/nand/edb7312.c
+++ b/drivers/mtd/nand/edb7312.c
@@ -74,7 +74,7 @@ static struct mtd_partition partition_info[] = {
 /*
  * hardware specific access to control-lines
  *
- * NAND_NCE: bit 0 -> bit 7
+ * NAND_NCE: bit 0 -> bit 6 (bit 7 = 1)
  * NAND_CLE: bit 1 -> bit 4
  * NAND_ALE: bit 2 -> bit 5
  */
@@ -83,12 +83,12 @@ static void ep7312_hwcontrol(struct mtd_info *mtd, int cmd, 
unsigned int ctrl)
struct nand_chip *chip = mtd->priv;
 
if (ctrl & NAND_CTRL_CHANGE) {
-   unsigned char bits;
+   unsigned char bits = 0x80;
 
-   bits = (ctrl & (NAND_CLE | NAND_ALE)) << 3;
-   bits = (ctrl & NAND_NCE) << 7;
+   bits |= (ctrl & (NAND_CLE | NAND_ALE)) << 3;
+   bits |= (ctrl & NAND_NCE) ? 0x00 : 0x40;
 
-   clps_writeb((clps_readb(ep7312_pxdr)  & 0xB0) | 0x10,
+   clps_writeb((clps_readb(ep7312_pxdr)  & 0xF0) | bits,
ep7312_pxdr);
}
if (cmd != NAND_CMD_NONE)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MTD] [NAND] Fix refactoring of EDB7312 hwcontrol function.

2007-08-02 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d7b4b5562b60c826c71cf2e1b7b63add42e527f
Commit: 9d7b4b5562b60c826c71cf2e1b7b63add42e527f
Parent: 47af05dd4b98b57eeb682596a0df42d106e02167
Author: Roland Stigge <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 18 14:56:11 2007 +0200
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Thu Aug 2 21:46:07 2007 +0100

    [MTD] [NAND] Fix refactoring of EDB7312 hwcontrol function.

The patch ensures that the current code (kernel 2.6.22) uses the bits
like the code prior to the refactoring. The variable "bits" is employed
in a useful way now.

Signed-off-by: Roland Stigge <[EMAIL PROTECTED]>
Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
---
 drivers/mtd/nand/edb7312.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/edb7312.c b/drivers/mtd/nand/edb7312.c
index 1daf823..0146cdc 100644
--- a/drivers/mtd/nand/edb7312.c
+++ b/drivers/mtd/nand/edb7312.c
@@ -74,7 +74,7 @@ static struct mtd_partition partition_info[] = {
 /*
  * hardware specific access to control-lines
  *
- * NAND_NCE: bit 0 -> bit 7
+ * NAND_NCE: bit 0 -> bit 6 (bit 7 = 1)
  * NAND_CLE: bit 1 -> bit 4
  * NAND_ALE: bit 2 -> bit 5
  */
@@ -83,12 +83,12 @@ static void ep7312_hwcontrol(struct mtd_info *mtd, int cmd, 
unsigned int ctrl)
struct nand_chip *chip = mtd->priv;
 
if (ctrl & NAND_CTRL_CHANGE) {
-   unsigned char bits;
+   unsigned char bits = 0x80;
 
-   bits = (ctrl & (NAND_CLE | NAND_ALE)) << 3;
-   bits = (ctrl & NAND_NCE) << 7;
+   bits |= (ctrl & (NAND_CLE | NAND_ALE)) << 3;
+   bits |= (ctrl & NAND_NCE) ? 0x00 : 0x40;
 
-   clps_writeb((clps_readb(ep7312_pxdr)  & 0xB0) | 0x10,
+   clps_writeb((clps_readb(ep7312_pxdr)  & 0xF0) | bits,
ep7312_pxdr);
}
if (cmd != NAND_CMD_NONE)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html