• Jarkko Nikula's avatar
    ASoC: Move widgets from DAPM context to snd_soc_card · 97c866de
    Jarkko Nikula authored
    Decoupling widgets from DAPM context is required when extending the ASoC
    core to cross-device paths. Even the list of widgets are now kept in
    struct snd_soc_card, the widget listing in sysfs and debugs remain sorted
    per device.
    
    This patch makes possible to build cross-device paths but does not extend
    yet the DAPM to handle codec bias and widget power changes of an another
    device.
    
    Cross-device paths are registered by listing the widgets from device A in
    a map for device B. In case of conflicting widget names between the devices,
    a uniform name prefix is needed to separate them. See commit ead9b919
    "ASoC: Add optional name_prefix for kcontrol, widget and route names" for
    help.
    
    An example below shows a path that connects MONO out of A into Line In of B:
    
    static const struct snd_soc_dapm_route mapA[] = {
    	{"MONO", NULL, "DAC"},
    };
    
    static const struct snd_soc_dapm_route mapB[] = {
    	{"Line In", NULL, "MONO"},
    };
    Signed-off-by: default avatarJarkko Nikula <jhnikula@gmail.com>
    Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
    Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
    97c866de
soc-dapm.c 58.7 KB