spi: sun6i: Fix define for SUN6I_TFR_CTL_CS_MASK
Subsystems (2)
PATCH 1/1 spi: sun6i: Fix define for SUN6I_TFR_CTL_CS_MASK
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 <[email protected]>
--- drivers/spi/spi-sun6i.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi-sun6i.c +2 -2
@@ -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)
Signature · 8 lines
1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Axel Lin
Current code in
sun6i_spi_set_cs()actually clears CPHA and CPOL bits which is obvious wrong. The define forSUN6I_TFR_CTL_CS_MASKis wrong. Fix it.Signed-off-by Axel Lin <[email protected]>
Oops, good catch.
Thanks!
Maxime
Signature · 3 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Mark Brown
AppliedQuoted 2 lines · Axel Lin
Current code in
sun6i_spi_set_cs()actually clears CPHA and CPOL bits which is obvious wrong. The define forSUN6I_TFR_CTL_CS_MASKis wrong. Fix it.
Applied, thanks.