• Viresh Kumar's avatar
    opp: Allow lazy-linking of required-opps · 7eba0c76
    Viresh Kumar authored
    The OPP core currently requires the required opp tables to be available
    before the dependent OPP table is added, as it needs to create links
    from the dependent OPP table to the required ones. This may not be
    convenient for all the platforms though, as this requires strict
    ordering for probing the drivers.
    
    This patch allows lazy-linking of the required-opps. The OPP tables for
    which the required-opp-tables aren't available at the time of their
    initialization, are added to a special list of OPP tables:
    lazy_opp_tables. Later on, whenever a new OPP table is registered with
    the OPP core, we check if it is required by an OPP table in the pending
    list; if yes, then we complete the linking then and there.
    
    An OPP table is marked unusable until the time all its required-opp
    tables are available. And if lazy-linking fails for an OPP table, the
    OPP core disables all of its OPPs to make sure no one can use them.
    Tested-by: default avatarHsin-Yi Wang <hsinyi@chromium.org>
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    7eba0c76
opp.h 9.19 KB