imx6ul ECSPI Word Delay in Linux SPI API

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

imx6ul ECSPI Word Delay in Linux SPI API

Jump to solution
1,667 Views
ibrahimbb
Contributor I

Hi, I'm trying to write a Linux module for an accel with SPI with imx6ul applications processor. For some reason, I needed to use word_delay of SPI API.

I'm setting word length to 8 bits, and setting word delay to 25 usecs. As a fact, I do not expect word delay to be exactly 25 usecs because of the scheduling but I want it to be at least 25 usecs. Still, this seems to have absolutely no effect on anything and delay between words is generally ~5 usecs (1MHz SCLK). So this made me wonder if there is such implementation in spi-imx driver.

The code:
spi->word_delay.value = 25;
spi->word_delay.unit = SPI_DELAY_UNIT_USECS;
spi->bits_per_word = 8;
spi_setup(spi);
 
I'm using lf-6.1.y. Have anyone has any such experience? Thanks.
Labels (2)
Tags (3)
0 Kudos
Reply
1 Solution
1,635 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

There is no such function in spi-imx driver, you can try to use lower speed in device tree.

View solution in original post

1 Reply
1,636 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

There is no such function in spi-imx driver, you can try to use lower speed in device tree.

%3CLINGO-SUB%20id%3D%22lingo-sub-1869464%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Eimx6ul%20ECSPI%20Word%20Delay%20in%20Linux%20SPI%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1869464%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%20I'm%20trying%20to%20write%20a%20Linux%20module%20for%20an%20accel%20with%20SPI%20with%20imx6ul%20applications%20processor.%20For%20some%20reason%2C%20I%20needed%20to%20use%20word_delay%20of%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Felixir.bootlin.com%2Flinux%2Fv6.1%2Fsource%2Finclude%2Flinux%2Fspi%2Fspi.h%23L203%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ESPI%20API.%3C%2FA%3E%3C%2FP%3E%3CP%3EI'm%20setting%20word%20length%20to%208%20bits%2C%20and%20setting%20word%20delay%20to%2025%20usecs.%20As%20a%20fact%2C%20I%20do%20not%20expect%20word%20delay%20to%20be%20exactly%2025%20usecs%20because%20of%20the%20scheduling%20but%20I%20want%20it%20to%20be%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Eat%20least%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E25%20usecs.%20Still%2C%20this%20seems%20to%20have%20absolutely%20no%20effect%20on%20anything%20and%20delay%20between%20words%20is%20generally%20~5%20usecs%20(1MHz%20SCLK).%20So%20this%20made%20me%20wonder%20if%20there%20is%20such%20implementation%20in%20spi-imx%20driver.%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EThe%20code%3A%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Espi%3C%2FSPAN%3E%3CSPAN%3E-%26gt%3B%3C%2FSPAN%3E%3CSPAN%3Eword_delay%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3Evalue%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E25%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Espi%3C%2FSPAN%3E%3CSPAN%3E-%26gt%3B%3C%2FSPAN%3E%3CSPAN%3Eword_delay%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3Eunit%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3ESPI_DELAY_UNIT_USECS%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Espi%3C%2FSPAN%3E%3CSPAN%3E-%26gt%3B%3C%2FSPAN%3E%3CSPAN%3Ebits_per_word%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E8%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Espi_setup(spi)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EI'm%20using%20lf-6.1.y.%20Have%20anyone%20has%20any%20such%20experience%3F%20Thanks.%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1869464%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX6%20All%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX6UL%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1871604%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20imx6ul%20ECSPI%20Word%20Delay%20in%20Linux%20SPI%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1871604%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThere%20is%20no%20such%20function%20in%20spi-imx%20driver%2C%20you%20can%20try%20to%20use%20lower%20speed%20in%20device%20tree.%3C%2FP%3E%3C%2FLINGO-BODY%3E