AnsweredAssumed Answered

imx6 spidev cannot set spi_mode (CPOL = 1)

Question asked by jongjyh hsieh on Jun 4, 2018
Latest reply on Jun 7, 2018 by Carlos_Musich

I am trying to use mx6q spidev to control a dac chip.

The chip requires CPOL to be enabled so that SCLK is high at idle and starts out with a falling edge.

 

I have set the SPI_MODE_2(CPOL =1 , CPHA = 0) from user space via ioctrl to the /dev/spidevX.X and was able to read back the same mode from SPI_IOC_RD_MODE. Though when I send spi data, the oscilloscope wave shows that CPOL remains zero at the idle and starts with a rising edge. 

 

Is there any other setting required to change SPI_MODE?

any help would be appreciated. 

 

envrioment:

. imx6q

. linux kernel 3.0.101 

. imx_spi, spi_dev

 

 

John 

Outcomes