dty...@anduin.org.uk (Dave Tyson) writes: >/dev/spi0 is defined which is a good start::
>[ 1.000003] sun4ispi0 at simplebus1: SPI >[ 1.000003] sun4ispi0: interrupting on GIC irq 42 >[ 1.000003] spi0 at sun4ispi0: SPI bus >The board has the SPI mos1/miso/clk together with cs0 and cs1. >Looking at spi(4) there is no mention of a way to control cs0/1 to select >devices so I guess this is down to using gpio commands to pull the appropriate >pin low. The spi driver gets an address parameter that may control which cs line is asserted. It depends on the hardware if that is actually used. On these devices, the SPI controller is multiplexed on GPIO pins. You need to activate the function. This can be done by providing the proper DTB file or overlay, it _could_ also be done with the gpio driver (selecting an alt mode), but the sunxi gpio driver doesn't support that. > command = 0 ; /*we are not sending anything */ > spit.sit_addr = 0x00 ; > spit.sit_send = &command ; if you don't send anything, use NULL. >The device just needs the register address sending and should return a single >byte with the contents. Not sure what you want to control, but most devices require a read command to actually send data. The read command then usually includes the register address, sit_addr is not the register address but selects a slave device.