Hi,

while doing more debugging and examining the output from the SPI controller
on an oscilloscope, I noticed another problem in the spi-sun4i driver. Now I'm
really unsure how to deal with these fixes with regard to the word wait time
patch series...  Should I fold them into the existing series, or should I
create a new one only for the fixes?

And if folding in is the way to go, do I send the whole series to all relevant
recipients of all patches, or should each patch be sent only to the recipients
relevant for each separate patch?

I'm sorry, I know this is all very noisy. I'm new to this and am still
learning the ropes...

Cheers,

  Marcus

---
The SPI core calls set_cs before a transfer, but the SUN4I_CTL_CS_MANUAL
flag is only set in transfer one. This leads to the following pattern on
the chip-select line (with runtime power-management on every transfer,
without it only on the first one):

activate, deactivate, activate, transfer, deactivate

Moving the configuration of the SUN4I_CTL_CS_MANUAL flag from transfer_one
to set_cs removes this problem.

Signed-off-by: Marcus Weseloh <[email protected]>
---
 drivers/spi/spi-sun4i.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
index ccbc21f..959bbb6 100644
--- a/drivers/spi/spi-sun4i.c
+++ b/drivers/spi/spi-sun4i.c
@@ -143,6 +143,9 @@ static void sun4i_spi_set_cs(struct spi_device *spi, bool 
enable)
        reg &= ~SUN4I_CTL_CS_MASK;
        reg |= SUN4I_CTL_CS(spi->chip_select);
 
+       /* We want to control the chip select manually */
+       reg |= SUN4I_CTL_CS_MANUAL;
+
        if (enable)
                reg |= SUN4I_CTL_CS_LEVEL;
        else
@@ -228,9 +231,6 @@ static int sun4i_spi_transfer_one(struct spi_master *master,
        else
                reg |= SUN4I_CTL_DHB;
 
-       /* We want to control the chip select manually */
-       reg |= SUN4I_CTL_CS_MANUAL;
-
        sun4i_spi_write(sspi, SUN4I_CTL_REG, reg);
 
        /*
-- 
1.9.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to