OPP: Add generic key finding helpers and use them for freq APIs
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 2 Jun 2022 07:33:05 +0000 (13:03 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Fri, 8 Jul 2022 05:57:50 +0000 (11:27 +0530)
commitaab8ced2210837c3f1f7f42f715cdf32729cabde
treef5bcfeeaa9a35378987c0376724edfd9cc340c51
parent9fbb62605607d8f00c32a4765cd1ae67f022b640
OPP: Add generic key finding helpers and use them for freq APIs

There are three type of helpers, to find exact, ceil, and floor values,
replicated for multiple key types, freq, level, bw. And all of these
helpers share a lot of boilerplate code.

Add generic key finding helpers to reduce code redundancy.

Also update the freq finder helpers to use the new infrastructure.

Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/opp/core.c