[alsa-devel] DAPM over two regmaps (and a mailbox)

Maxime Ripard maxime.ripard at free-electrons.com
Mon Sep 19 12:54:19 CEST 2016


Hi,

We've been working recently on a later SoC (Allwinner A33) with a
codec directly embedded into it, just like
sound/soc/sunxi/sun4i-codec.c, but this time using the usual i2s
controller we had, instead of a custom DAI.

That codec is mapped in memory, however, we have a bunch of DAPM
widgets that are mapped in a separate register space, that should
probably be exposed through a syscon (but isn't yet).

Those are apparently used to control the analog part of the codec,
including powering up the DAC, so it really feels like they should be
part of DAPM.

However, since we will obviously have a regmap for the main register
space of the codec, that leaves us with two regmaps that we need to
use, depending on the register we want to set, and DAPM doesn't really
seem to be able to handle that.

To make things worse, the register in the syscon behaves as a mailbox,
where you actually have to set in that register the address you want
to modify and the new value, in a single write. This also seem to
deviate from the usual DAPM access pattern.

I'm not really sure how to handle that properly. For now, we just did
those writes outside of DAPM, in the startup, shutdown and prepare
shutdowns. We could also have a meta-regmap, that would have custom
write and read functions, and depending on the register would turn to
our syscon, or do a writel.

Or we could try to make DAPM able to use different regmaps depending
on the register, but that seem do be very intrusive.

Do you have any suggestions or preferences on how to implement this
properly?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20160919/942cd7c5/attachment.sig>


More information about the Alsa-devel mailing list