summaryrefslogtreecommitdiff
path: root/include/soc
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2021-12-01 02:23:09 +0300
committerThierry Reding <treding@nvidia.com>2021-12-16 14:03:38 +0100
commit9131c6331726514f0d0364c41f8733cc5eec11ab (patch)
tree3819a544c1b3709482dff282cb0a44ac3a14db79 /include/soc
parent006da96c840ff60a1764fc38ee7adc3dc4191d79 (diff)
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>
Diffstat (limited to 'include/soc')
-rw-r--r--include/soc/tegra/common.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/soc/tegra/common.h b/include/soc/tegra/common.h
index af41ad80ec21..8ec1ac07fc85 100644
--- a/include/soc/tegra/common.h
+++ b/include/soc/tegra/common.h
@@ -39,4 +39,19 @@ devm_tegra_core_dev_init_opp_table(struct device *dev,
}
#endif
+static inline int
+devm_tegra_core_dev_init_opp_table_common(struct device *dev)
+{
+ struct tegra_core_opp_params opp_params = {};
+ int err;
+
+ opp_params.init_state = true;
+
+ err = devm_tegra_core_dev_init_opp_table(dev, &opp_params);
+ if (err != -ENODEV)
+ return err;
+
+ return 0;
+}
+
#endif /* __SOC_TEGRA_COMMON_H__ */