Unfortunately we are not having any example custom drivers. Refer the spi kernel documentation for the same, here.
Other possible way is to use spidev to communicate with the slave device. By default spidev interface support is available on our prebuild Linux images(not enabled by default), with which one can communicate with slave devices connected over the bus, have a look at this. One can communicate with the slave SPI devices connected on the bus via /dev/spidevB.C. More information related to spidev is available here and spidev usage example here.