diff mbox

Fixed data sampling on the correct edge

Message ID 95F51F4B902CAC40AF459205F6322F0171E8D4987E@BMK019S01.emtrion.local (mailing list archive)
State Accepted
Headers show

Commit Message

Pietrek, Markus Jan. 29, 2010, 1:37 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/spi/spi_sh_msiof.c b/drivers/spi/spi_sh_msiof.c
index 51e5e1d..af15e97 100644
--- a/drivers/spi/spi_sh_msiof.c
+++ b/drivers/spi/spi_sh_msiof.c
@@ -173,13 +173,11 @@  static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p,
        int edge;

        /*
-        * CPOL CPHA     TSCKIZ RSCKIZ TEDG REDG(!)
-        *    0    0         10     10    1    0
-        *    0    1         10     10    0    1
-        *    1    0         11     11    0    1
-        *    1    1         11     11    1    0
-        *
-        * (!) Note: REDG is inverted recommended data sheet setting
+        * CPOL CPHA     TSCKIZ RSCKIZ TEDG REDG
+        *    0    0         10     10    1    1
+        *    0    1         10     10    0    0
+        *    1    0         11     11    0    0
+        *    1    1         11     11    1    1
         */

        sh_msiof_write(p, FCTR, 0);
@@ -193,7 +191,7 @@  static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p,
        edge = cpol ? cpha : !cpha;

        tmp |= edge << 27; /* TEDG */
-       tmp |= !edge << 26; /* REDG */
+       tmp |= edge << 26; /* REDG */
        tmp |= (tx_hi_z ? 2 : 0) << 22; /* TXDIZ */
        sh_msiof_write(p, CTR, tmp);
 }