spi: sun6i: Fix define for SUN6I_TFR_CTL_CS_MASK
authorAxel Lin <axel.lin@ingics.com>
Thu, 13 Feb 2014 02:18:15 +0000 (10:18 +0800)
committerMark Brown <broonie@linaro.org>
Sun, 16 Feb 2014 01:11:05 +0000 (09:11 +0800)
Current code in sun6i_spi_set_cs() actually clears CPHA and CPOL bits which is
obvious wrong. The define for SUN6I_TFR_CTL_CS_MASK is wrong. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-sun6i.c

index 94d38d0a86cd1772de55619f01b53f144f442b1d..4b9ec08022fec8e3c7639392e22a3db9731d829a 100644 (file)
@@ -36,8 +36,8 @@
 #define SUN6I_TFR_CTL_CPHA                     BIT(0)
 #define SUN6I_TFR_CTL_CPOL                     BIT(1)
 #define SUN6I_TFR_CTL_SPOL                     BIT(2)
-#define SUN6I_TFR_CTL_CS_MASK                  0x3
-#define SUN6I_TFR_CTL_CS(cs)                   (((cs) & SUN6I_TFR_CTL_CS_MASK) << 4)
+#define SUN6I_TFR_CTL_CS_MASK                  0x30
+#define SUN6I_TFR_CTL_CS(cs)                   (((cs) << 4) & SUN6I_TFR_CTL_CS_MASK)
 #define SUN6I_TFR_CTL_CS_MANUAL                        BIT(6)
 #define SUN6I_TFR_CTL_CS_LEVEL                 BIT(7)
 #define SUN6I_TFR_CTL_DHB                      BIT(8)
This page took 0.024761 seconds and 5 git commands to generate.