diff options
author | Reid Tonking <reidt@ti.com> | 2023-12-22 12:28:35 -0600 |
---|---|---|
committer | Francesco Dolcini <francesco.dolcini@toradex.com> | 2024-03-21 14:26:33 +0000 |
commit | 58bb5cc8e3b0abb5a70ba739f739f5b2bee3cb0e (patch) | |
tree | 56141aaa5816705c533355f3e831ce52b491bbd0 /drivers | |
parent | d73d85d25f888203ac94968a8004ee614acf4e06 (diff) |
misc: k3_avs: add k3_check_opp function
Useful when trying to check if an opp efuse is burned in or not.
k3_avs driver checks opp_ids when probing and overwrites the voltage
values in vd_data for the respective board. This can be called to check
that data and returns 0 if valid.
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Reid Tonking <reidt@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/misc/k3_avs.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/misc/k3_avs.c b/drivers/misc/k3_avs.c index d7312175f1..d922b8808b 100644 --- a/drivers/misc/k3_avs.c +++ b/drivers/misc/k3_avs.c @@ -194,6 +194,29 @@ static int match_opp(struct vd_data *vd, u32 freq) } /** + * k3_check_opp: Check for presence of opp efuse + * @opp_id: opp id to check if voltage is present + * + * Checks to see if an opp has voltage. k3_avs probe will populate + * votlage data if efuse is present. Returns 0 if data is valid. + */ +int k3_check_opp(int opp_id) +{ + struct vd_data *vd; + struct k3_avs_privdata *priv = k3_avs_priv; + int volt; + + vd = priv->vd_config->vds; + volt = vd->opps[opp_id].volt; + + if (volt) + return 0; + + printf("No efuse found for opp_%d\n", opp_id); + return -EINVAL; +} + +/** * k3_avs_notify_freq: Notify clock rate change towards AVS subsystem * @dev_id: Device ID for the clock to be changed * @clk_id: Clock ID for the clock to be changed |