Hello,

It is a late response, but I had the same thing in the LTS kernel 4.9.x.

After some research I saw that in the function: sun4i_spi_runtime_resume 
the following code:

sun4i_spi_write(sspi, SUN4I_CTL_REG,
            SUN4I_CTL_ENABLE | SUN4I_CTL_MASTER | SUN4I_CTL_TP);

This will setup the spi in master mode, stop transmit data when RXFifo is 
full and enable the spi,
but also the wrong settings for CPOL, CPHA and CS etc.. this is done later 
in the driver code and that causes the glitch, 
so I enabled the spi later after all the settings are done and that works 
just fine.

So I changes this code to:
sun4i_spi_write(sspi, SUN4I_CTL_REG,
             SUN4I_CTL_MASTER | SUN4I_CTL_TP);

And in the function sun4i_spi_transfer_one @ 238 i added:
    
    /* Enable here the SPI */
    reg |= SUN4I_CTL_ENABLE;

After this I compiled the code and tested it with spi mode 0,1,2,3 and now 
all works just fine.

Kind regards
Patrick


Op donderdag 22 september 2016 23:53:01 UTC+2 schreef Danny Milosavljevic:
>
> Hello, 
>
> when using SPI on Allwinner A20 with CPOL=1 and CPHA=1 with Linux 
> 4.8.0-rc6 Psychotic Stoned Sheep I see a weird dip in the beginning (which 
> also confuses the slave) on the SCLK line right when SSEL goes low - see 
> attachment. 
>
> The lines are, starting from the top, SCLK MOSI MISO SSEL. 
>
> I'm using spidev. 
>
> Did anyone see this problem before? 
>
> Regards, 
>    Danny 
>

-- 
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 linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to