Welcome to the Linux Foundation Forum!

Best way to extend an audio codec driver with a clock driver


Maybe someone here can give me some hints/pointers with respect to the following.

I want to add an external clock to an audio codec. Clock configuration depends on the sample rate, so the codec driver must control the clock in some way.

Clock chip is a PLL1708, which is SPI controlled (In my case software SPI/GPIO connected, since speed is not a concern)

I assume the preferred way is, to instantiate a software SPI driver, create a PLL1708 kernel module, which uses the software SPI, implement the PLL chip specific functionality and provide some high level function towards the codec driver for clock selection.
This strcuture also allows to replace the clock PLL later easily by something else.

I have some basic device driver experience, but I do not know, how to setup the interaction between those 3 drivers. e.g. How set setup the software SPI and use it from a kernel module and how to make some the PLL driver functions available to the codec driver.

Any help, suggestions or examples would be appreciated.


Upcoming Training