* [PATCH RFT] spi: spi-xcomm: Fix wrong setting for SPI_XCOMM_SETTINGS_CPHA
@ 2012-12-04 6:27 Axel Lin
2012-12-05 17:39 ` Lars-Peter Clausen
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-12-04 6:27 UTC (permalink / raw)
To: Mark Brown, Grant Likely
Cc: Lars-Peter Clausen, spi-devel-general, linux-kernel
The logic of setting SPI_XCOMM_SETTINGS_CPHA bit is reversed.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi Lars,
The logic of setting SPI_XCOMM_SETTINGS_CPHA bit looks wrong to me.
Can you check if this patch works?
Thanks,
Axel
drivers/spi/spi-xcomm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-xcomm.c b/drivers/spi/spi-xcomm.c
index 266a847..c2a3e8f 100644
--- a/drivers/spi/spi-xcomm.c
+++ b/drivers/spi/spi-xcomm.c
@@ -99,9 +99,9 @@ static int spi_xcomm_setup_transfer(struct spi_xcomm *spi_xcomm,
*settings &= ~SPI_XCOMM_SETTINGS_CPOL;
if (spi->mode & SPI_CPHA)
- *settings &= ~SPI_XCOMM_SETTINGS_CPHA;
- else
*settings |= SPI_XCOMM_SETTINGS_CPHA;
+ else
+ *settings &= ~SPI_XCOMM_SETTINGS_CPHA;
if (spi->mode & SPI_3WIRE)
*settings |= SPI_XCOMM_SETTINGS_3WIRE;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH RFT] spi: spi-xcomm: Fix wrong setting for SPI_XCOMM_SETTINGS_CPHA
2012-12-04 6:27 [PATCH RFT] spi: spi-xcomm: Fix wrong setting for SPI_XCOMM_SETTINGS_CPHA Axel Lin
@ 2012-12-05 17:39 ` Lars-Peter Clausen
0 siblings, 0 replies; 2+ messages in thread
From: Lars-Peter Clausen @ 2012-12-05 17:39 UTC (permalink / raw)
To: Axel Lin; +Cc: Mark Brown, Grant Likely, spi-devel-general, linux-kernel
On 12/04/2012 07:27 AM, Axel Lin wrote:
> The logic of setting SPI_XCOMM_SETTINGS_CPHA bit is reversed.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> Hi Lars,
> The logic of setting SPI_XCOMM_SETTINGS_CPHA bit looks wrong to me.
> Can you check if this patch works?
>
> Thanks,
> Axel
Hi Axel,
Thanks for the patch. But the code is correct as it is. The CPHA definition
of the chip is inverted to that of Linux.
Thanks,
- Lars
>
> drivers/spi/spi-xcomm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-xcomm.c b/drivers/spi/spi-xcomm.c
> index 266a847..c2a3e8f 100644
> --- a/drivers/spi/spi-xcomm.c
> +++ b/drivers/spi/spi-xcomm.c
> @@ -99,9 +99,9 @@ static int spi_xcomm_setup_transfer(struct spi_xcomm *spi_xcomm,
> *settings &= ~SPI_XCOMM_SETTINGS_CPOL;
>
> if (spi->mode & SPI_CPHA)
> - *settings &= ~SPI_XCOMM_SETTINGS_CPHA;
> - else
> *settings |= SPI_XCOMM_SETTINGS_CPHA;
> + else
> + *settings &= ~SPI_XCOMM_SETTINGS_CPHA;
>
> if (spi->mode & SPI_3WIRE)
> *settings |= SPI_XCOMM_SETTINGS_3WIRE;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-05 17:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-04 6:27 [PATCH RFT] spi: spi-xcomm: Fix wrong setting for SPI_XCOMM_SETTINGS_CPHA Axel Lin
2012-12-05 17:39 ` Lars-Peter Clausen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).