• L
    ASoC: dapm: Add a flag to mark paths connected to supply widgets · c1862c8b
    Lars-Peter Clausen 提交于
    Supply widgets do not count towards the input and output widgets of their
    neighbors and for supply widgets themselves we do not care for the number
    of input or output paths. This means that a path that connects to a supply
    widget effectively behaves the same as a path that as the weak property set.
    This patch adds a new path flag that gets set to true when the path is
    connected to at least one supply widget. If a path with the flag set is
    encountered in is_connected_{input,output}_ep() is is skipped in the same
    way that weak paths are skipped. This slightly brings down the number of
    path checks.
    
    Since both the weak and the supply flag are implemented as bitfields which
    are stored in the same word there is no runtime overhead due to checking
    both rather than just one and also the size of the path struct is not
    increased by this patch. Another advantage is that we do not have to handle
    supply widgets in is_connected_{input,output}_ep() anymore since it will
    never be called for supply widgets. The only exception is from
    dapm_widget_power_read_file() where a check is added to special case supply
    widgets.
    
    Testing with the ADAU1761, which has a handful of supply widgets, shows the
    following changes in the DAPM stats for a playback stream start.
    
             Power  Path  Neighbour
    Before:  34     78    117
    After:   34     48    117
    Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: NMark Brown <broonie@kernel.org>
    c1862c8b
soc-dapm.h 25.5 KB