* [PATCH] spi: sun6i: Fix define for SUN6I_TFR_CTL_CS_MASK
@ 2014-02-13 2:18 Axel Lin
2014-02-14 21:13 ` Maxime Ripard
2014-02-16 1:11 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2014-02-13 2:18 UTC (permalink / raw)
To: Mark Brown; +Cc: Maxime Ripard, linux-spi-u79uwXL29TY76Z2rM5mHXA
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-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
---
drivers/spi/spi-sun6i.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c
index 94d38d0..dacc8d6 100644
--- a/drivers/spi/spi-sun6i.c
+++ b/drivers/spi/spi-sun6i.c
@@ -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)
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: sun6i: Fix define for SUN6I_TFR_CTL_CS_MASK
2014-02-13 2:18 [PATCH] spi: sun6i: Fix define for SUN6I_TFR_CTL_CS_MASK Axel Lin
@ 2014-02-14 21:13 ` Maxime Ripard
2014-02-16 1:11 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2014-02-14 21:13 UTC (permalink / raw)
To: Axel Lin; +Cc: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 542 bytes --]
On Thu, Feb 13, 2014 at 10:18:15AM +0800, Axel Lin wrote:
> 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-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
Oops, good catch.
Acked-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: sun6i: Fix define for SUN6I_TFR_CTL_CS_MASK
2014-02-13 2:18 [PATCH] spi: sun6i: Fix define for SUN6I_TFR_CTL_CS_MASK Axel Lin
2014-02-14 21:13 ` Maxime Ripard
@ 2014-02-16 1:11 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-02-16 1:11 UTC (permalink / raw)
To: Axel Lin; +Cc: Maxime Ripard, linux-spi-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 229 bytes --]
On Thu, Feb 13, 2014 at 10:18:15AM +0800, Axel Lin wrote:
> 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.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-16 1:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-13 2:18 [PATCH] spi: sun6i: Fix define for SUN6I_TFR_CTL_CS_MASK Axel Lin
2014-02-14 21:13 ` Maxime Ripard
2014-02-16 1:11 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.