SPI on Android


Hi everyone!

I am having pretty much the same problems as the guy in this post: http://www.96boards.org/forums/topic/spi-on-android/#gsc.tab=0
There, Akira Tsukamoto said that they were working on a fix. Is this fix already available?
If not, I am afraid, I have to rebuild the kernel as the guy in this post:
However I have never done that. Is there any good documentation?




Refer to https://developer.qualcomm.com/download/db410c/linux-android-software-build-and-installation-guide.pdf for building the kernel. Once you have the kernel source code downloaded, you can check the device tree to see if the relevant spi nodes are defined. E.g. for Debian they are http://git.linaro.org/landing-teams/working/qualcomm/kernel.git/tree/arch/arm64/boot/dts/qcom/msm8916.dtsi#n402 and http://git.linaro.org/landing-teams/working/qualcomm/kernel.git/tree/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi#n27. Then you need to register your slave device. For that you can reference https://github.com/96boards/documentation/blob/master/ConsumerEdition/DragonBoard-410c/Configuration/EnableSPI.md.


Thank you for your help!

Meanwhile there came a much simpler solution to my mind, where we don’t even need the SPI module: We only need it to write some configuration bytes. So we will just do it by simulating a SPI with software (setting the GPIOs).
However I hope that your summary of links will be useful to others with a similar problem.


You’re welcome!
For SPI via GPIO bit-banging, just make sure the GPIO pins used are configured as GPIO since they can sometimes be used/configured for other functions. Or manually change the configurations yourself (to GPIO) before using the pins, if they’re not used for other required functions.