Inactive state of SPI data line

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Inactive state of SPI data line

Jump to solution
709 Views
system_link
Contributor I

Hello!

I'm use i.MX6Dual proc with kernel 4.13.0. I have external device, that I control via SPI interface. I have spidev0.0 and it's work well. But I want change inactive state of data line to low. Default inactive state is high. At reference manual I was find register ECSPIx_CONFIGREG that contain DATA_CTL field, that control inactive state of data line. I try update this field in spi driver init, but it's don't work. I don't understud, at what step in kernel I must edit this field.

Can anybody help me in this question? Thank you!

Labels (2)
0 Kudos
1 Solution
622 Views
system_link
Contributor I

Hello!

I resolved my problem. In kernel 4.13.0 (and I think in kernel 4.1.15) was use driver file spi-imx.c. i.MX6 use iMX5 initialization function. In this function I wrote: 

#define MX51_ECSPI_CONFIG_DATALOW(cs) (1 << ((cs) + 16))

near other #define and include line:

cfg |= MX51_ECSPI_CONFIG_DATALOW(spi->chip_select);

in function mx51_ecspi_config. Now I have low data line in inactive state.

View solution in original post

0 Kudos
2 Replies
623 Views
system_link
Contributor I

Hello!

I resolved my problem. In kernel 4.13.0 (and I think in kernel 4.1.15) was use driver file spi-imx.c. i.MX6 use iMX5 initialization function. In this function I wrote: 

#define MX51_ECSPI_CONFIG_DATALOW(cs) (1 << ((cs) + 16))

near other #define and include line:

cfg |= MX51_ECSPI_CONFIG_DATALOW(spi->chip_select);

in function mx51_ecspi_config. Now I have low data line in inactive state.

0 Kudos
622 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ivan

kernel 4.13.0 is not supported by nxp, one can try with kernels from source.codeaurora.org

nxp repository, change /* Default mode/csmode for eSPI controller */ in

https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/spi/spi-fsl-espi.c?h=imx_4.1.15_2....spi-fsl-espi.c\spi\drivers - linux-imx - i.MX Linux kernel 


Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos