Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc/tegra: Add devm_tegra_core_dev_init_opp_table_common()

Only couple drivers need to get the -ENODEV error code and majority of
drivers need to explicitly initialize the performance state. Add new
common helper which sets up OPP table for these drivers.

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Dmitry Osipenko and committed by
Thierry Reding
9131c633 006da96c

+15
+15
include/soc/tegra/common.h
··· 39 39 } 40 40 #endif 41 41 42 + static inline int 43 + devm_tegra_core_dev_init_opp_table_common(struct device *dev) 44 + { 45 + struct tegra_core_opp_params opp_params = {}; 46 + int err; 47 + 48 + opp_params.init_state = true; 49 + 50 + err = devm_tegra_core_dev_init_opp_table(dev, &opp_params); 51 + if (err != -ENODEV) 52 + return err; 53 + 54 + return 0; 55 + } 56 + 42 57 #endif /* __SOC_TEGRA_COMMON_H__ */