Inactive state of SPI data line

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Inactive state of SPI data line

跳至解决方案
720 次查看
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!

标签 (2)
0 项奖励
1 解答
633 次查看
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 项奖励
2 回复数
634 次查看
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 项奖励
633 次查看
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 项奖励