diff options
author | Ruofei Ma <ruofeim@google.com> | 2022-11-02 16:41:57 -0700 |
---|---|---|
committer | Ruofei Ma <ruofeim@google.com> | 2022-11-02 16:41:57 -0700 |
commit | ac74f1db5029a1bea6873e4af2cff2191cd5e480 (patch) | |
tree | c0f79319557baf15f84749b9a40db9dbfa26afa1 | |
parent | 544dcaa8012840194825ef43fa9a4c14f3adb030 (diff) | |
download | gchips-ac74f1db5029a1bea6873e4af2cff2191cd5e480.tar.gz |
Support IP version
Since BW A0 supports up to 170Mhz and B0 supports all the available
frequencies, driver needs to query IP version and set frequency
accordingly.
Bug: 257137565
Change-Id: Ide2a4d882d98b05b2c8038545bdbc28885c8acbb
Signed-off-by: Ruofei Ma <ruofeim@google.com>
-rw-r--r-- | bigo_of.c | 7 | ||||
-rw-r--r-- | bigo_pm.c | 2 | ||||
-rw-r--r-- | bigo_priv.h | 1 |
3 files changed, 9 insertions, 1 deletions
@@ -63,6 +63,13 @@ static int bigo_of_get_resource(struct bigo_core *core) goto err; } + rc = of_property_read_u32(core->dev->of_node, "ip_ver", &core->ip_ver); + if (rc < 0) { + core->ip_ver = 0; + pr_info("ip_ver is not specified, default to A0\n"); + rc = 0; + } + err: return rc; } @@ -99,7 +99,7 @@ static inline void bigo_set_freq(struct bigo_core *core, u32 freq) freq = core->debugfs.set_freq; /* HW bug workaround: see b/215390692 */ - if (freq > BIGW_A0_CSR_PROG_FREQ) + if (core->ip_ver < 1 && freq > BIGW_A0_CSR_PROG_FREQ) freq = BIGW_A0_CSR_PROG_FREQ; if (!exynos_pm_qos_request_active(&core->pm.qos_bigo)) diff --git a/bigo_priv.h b/bigo_priv.h index 03be372..dcb8ff1 100644 --- a/bigo_priv.h +++ b/bigo_priv.h @@ -120,6 +120,7 @@ struct bigo_core { #if IS_ENABLED(CONFIG_EXYNOS_ITMON) struct notifier_block itmon_nb; #endif + u32 ip_ver; }; struct bigo_inst { |