Inactive state of SPI data line

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Inactive state of SPI data line

ソリューションへジャンプ
719件の閲覧回数
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 解決策
632件の閲覧回数
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 返答(返信)
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 件の賞賛
632件の閲覧回数
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 件の賞賛