Mark Brown wrote:
On Mon, Sep 29, 2008 at 10:27:06AM -0700, Troy Kisky wrote:
Mark Brown wrote:
codec. Can the I2c code be moved into the board directory? I have my spi code in the board directory and just pass the write function pointer. i.e.
No, the I2C and SPI support should both be part of the driver. The driver should just be modified to allow both I2C and SPI support to be compiled in and let the board driver register the appropriate one at run time.
Can you please explain to me why they should both be part of the codec driver?
Neither is board specific - there's no sense in having each board that needs SPI support replicate the code to register a SPI device and do the marshalling of data for SPI writes. What motivation do you see for not doing that?
It just doesn't seem to be logically a part of the codec code. And I didn't register an spi device. I just linked the simple spi routines with my board code (separate file).
Plus, it seems a lot of code duplication if each codec registers the spi device and I2C device. Are there more boards, or more codecs???
Thanks Troy