• Stephan Gerhold's avatar
    ASoC: qcom: common: Parse auxiliary devices from device tree · 1b839d3e
    Stephan Gerhold authored
    In some cases we need to probe additional audio components that do
    not appear as part of the DAI links specified in the device tree.
    Examples for this are auxiliary devices such as analog amplifiers
    or codecs.
    
    The ASoC core provides a way to probe these components by adding
    them to snd_soc_card->aux_dev. We can use the snd_soc_of_parse_aux_devs()
    function to parse them from the device tree.
    
    As an example for this, some MSM8916 smartphones have an analog
    speaker amplifier connected to the HPHR output. With the new property
    this can be modelled as follows:
    
    	speaker-amp: audio-amplifier {
    		compatible = "simple-audio-amplifier";
    		enable-gpios = <&msmgpio 114 GPIO_ACTIVE_HIGH>;
    		sound-name-prefix = "Speaker Amp";
    	};
    
    	&sound {
    		aux-devs = <&speaker_amp>;
    		audio-routing = "Speaker Amp IN", "HPHR";
    	};
    
    Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
    Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
    Link: https://lore.kernel.org/r/20200826095141.94017-3-stephan@gerhold.netSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    1b839d3e
common.c 3.93 KB