-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rpi 4.1.y spi bcm2835 patches clock-polarity issues #1125
Rpi 4.1.y spi bcm2835 patches clock-polarity issues #1125
Conversation
When using reverse polarity for clock (spi-cpol) on a device the clock line gets altered after chip-select has been asserted resulting in an additional clock beat, which confuses hardware. This did not show when using native-CS, as the same register is used to control cs as well as polarity, so the changes came into effect at the same time. Unfortunately this is not true with gpio-cs. To avoid this situation this patch moves the setup of polarity (spi-cpol and spi-cpha) outside of the chip-select into prepare_message, which is run prior to asserting chip-select. Also fixes resetting 3-wire mode after use of rx-mode, so that a 3-Wire sequence TX, RX, TX works as well (right now it runs TX, RX, RX instead) Reported-by: Noralf Tronnes <noralf@tronnes.org> Signed-off-by: Martin Sperl <kernel@martin.sperl.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org (cherry picked from commit acace73)
This resulted in the use of polling mode when other approaches (dma or interrupts) would have been more appropriate. Happened for transfers longer than 477 bytes. Reported-by: Noralf Tronnes <noralf@tronnes.org> Signed-off-by: Martin Sperl <kernel@martin.sperl.org> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 0122a51)
@notro: please check |
Looks OK to me. |
I haven't got time to actually test it now, but it looks like what I tested previously. |
@notro: it is exactly what you have tested before - it is exactly upstream, so it should work... |
…xpolarity Rpi 4.1.y spi bcm2835 patches clock-polarity issues
It may be valuable to push this into 4.2 as well, as it will only show up officially in 4.3! |
Was ahead of you there: https://github.com/raspberrypi/linux/tree/rpi-4.2.y |
See: raspberrypi/linux#756 kernel: spi-bcm2835: merge upstream patches allowing DMA transfers See: raspberrypi/linux#1085 kernel: rpisense-fb: add low-light mode and gamma control See: raspberrypi/linux#1104 kernel: bcm2708-dmaengine: Use more DMA channels (but not 12) See: raspberrypi/linux#1113 kernel: Add /dev/gpiomem device for rootless user GPIO access See: raspberrypi/linux#1112 kernel: Add RaspiDAC3 support kernel: Rpi 4.1.y spi bcm2835 patches clock-polarity issue See: raspberrypi/linux#1125 kernel: BCM270X_DT: Add SDIO overlay
See: raspberrypi/linux#756 kernel: spi-bcm2835: merge upstream patches allowing DMA transfers See: raspberrypi/linux#1085 kernel: rpisense-fb: add low-light mode and gamma control See: raspberrypi/linux#1104 kernel: bcm2708-dmaengine: Use more DMA channels (but not 12) See: raspberrypi/linux#1113 kernel: Add /dev/gpiomem device for rootless user GPIO access See: raspberrypi/linux#1112 kernel: Add RaspiDAC3 support kernel: Rpi 4.1.y spi bcm2835 patches clock-polarity issue See: raspberrypi/linux#1125 kernel: BCM270X_DT: Add SDIO overlay
See: raspberrypi/linux#756 kernel: spi-bcm2835: merge upstream patches allowing DMA transfers See: raspberrypi/linux#1085 kernel: rpisense-fb: add low-light mode and gamma control See: raspberrypi/linux#1104 kernel: bcm2708-dmaengine: Use more DMA channels (but not 12) See: raspberrypi/linux#1113 kernel: Add /dev/gpiomem device for rootless user GPIO access See: raspberrypi/linux#1112 kernel: Add RaspiDAC3 support kernel: Rpi 4.1.y spi bcm2835 patches clock-polarity issue See: raspberrypi/linux#1125 kernel: BCM270X_DT: Add SDIO overlay
merge from 4.3-pre back to 4.1 to fix #1077.