orangepi_PC_gpio_pyH3 icon indicating copy to clipboard operation
orangepi_PC_gpio_pyH3 copied to clipboard

Default SPI speed is much too slow

Open martinayotte opened this issue 8 years ago • 1 comments

(I've also open issue to original author : https://github.com/OLIMEX/OLINUXINO/issues/39 )

Default SPI speed is much too slow !

I've an SPI LCD that was working fine in kernel 4.4.5, and suddenly was way too slow when I've upgraded to 4.5.x or 4.6.x. After some debugging, I've figured out that kernel was now using "transfer-speed" instead of "spi-device-max-speed", the first been set during ioctrl, but ignored/not-used in older kernels.

Here is the commit merge in Mainline 9 months ago :

https://github.com/megous/linux/commit/47284e3e0f3c427c93f8583549b6c938e8a18015

I've finally figured out that guilty code was in pyA20 providing a wrong default ioctrl value for the "transfer-speed" of 100kHz, while we all know that SPI default should be 10MHz :

diff pyA20-0.2.1/pyA20/spi/spi.c~ pyA20-0.2.1/pyA20/spi/spi.c
238c238
<     config.speed = 100000;

---
>     config.speed = 10000000;

martinayotte avatar Aug 11 '16 02:08 martinayotte

I'm sorry ,the spi device ,i have not test on board!

You can read the source to solve your question,Thanks.

------------------ 原始邮件 ------------------ 发件人: "martinayotte";[email protected]; 发送时间: 2016年8月11日(星期四) 上午10:06 收件人: "duxingkei33/orangepi_PC_gpio_pyH3"[email protected];

主题: [duxingkei33/orangepi_PC_gpio_pyH3] Default SPI speed is much tooslow (#4)

(I've also open issue to original author : OLIMEX/OLINUXINO#39 )

Default SPI speed is much too slow !

I've an SPI LCD that was working fine in kernel 4.4.5, and suddenly was way too slow when I've upgraded to 4.5.x or 4.6.x. After some debugging, I've figured out that kernel was now using "transfer-speed" instead of "spi-device-max-speed", the first been set during ioctrl, but ignored/not-used in older kernels.

Here is the commit merge in Mainline 9 months ago :

megous/linux@47284e3

I've finally figured out that guilty code was in pyA20 providing a wrong default ioctrl value for the "transfer-speed" of 100kHz, while we all know that SPI default should be 10MHz : diff pyA20-0.2.1/pyA20/spi/spi.c~ pyA20-0.2.1/pyA20/spi/spi.c 238c238 < config.speed = 100000; --- > config.speed = 10000000;
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

duxingkei33 avatar Aug 16 '16 02:08 duxingkei33