[alsa-devel] ASoC: TI codecs and their crazy variable length registers

Mark Brown broonie at kernel.org
Thu Jul 31 01:17:56 CEST 2014


On Wed, Jul 30, 2014 at 05:56:36PM -0400, jonsmirl at gmail.com wrote:

> I'm working on a TI codec attached via I2C.  Just to make things
> interesting the registers have varying byte lengths of - 1,4,8,12,20
> bytes. What's the best strategy for using regmap with it?

I'd use the reg_read() and reg_write() callbacks to hide the registers
that will fit in an integer, the rest of the stack can pretend they've
got 32 bit values which should improve code reuse.  The larger registers
are going to need custom controls I expect but that's probably a given
anyway, and if they're coefficeints they'll be fairly simple binary
controls.  

It should be possible to write a standard ASoC control type for binary
blocks that can be written with a single I2C transfer...

> Also, does regmap restore MMIO registers after a suspend? Allwinner
> has code in their drivers for drivers for saving/restoring the DAI
> registers over a suspend.

It can be used to do that, same as anything else you need to a cache
sync.  The Tegra audio drivers do this - that's why regmap-mmio was
originally written.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20140731/8e47f3f6/attachment.sig>


More information about the Alsa-devel mailing list