Commit e1505f62 authored by Douglas Anderson's avatar Douglas Anderson Committed by Rob Clark

drm/msm: Cleanup A6XX opp-level reading

The patch ("OPP: Add support for parsing the 'opp-level' property")
adds an API enabling a cleaner way to read the opp-level.  Let's use
the new API.
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Reviewed-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 4e998517
......@@ -948,11 +948,11 @@ static int a6xx_gmu_memory_probe(struct a6xx_gmu *gmu)
}
/* Return the 'arc-level' for the given frequency */
static u32 a6xx_gmu_get_arc_level(struct device *dev, unsigned long freq)
static unsigned int a6xx_gmu_get_arc_level(struct device *dev,
unsigned long freq)
{
struct dev_pm_opp *opp;
struct device_node *np;
u32 val = 0;
unsigned int val;
if (!freq)
return 0;
......@@ -961,12 +961,7 @@ static u32 a6xx_gmu_get_arc_level(struct device *dev, unsigned long freq)
if (IS_ERR(opp))
return 0;
np = dev_pm_opp_get_of_node(opp);
if (np) {
of_property_read_u32(np, "opp-level", &val);
of_node_put(np);
}
val = dev_pm_opp_get_level(opp);
dev_pm_opp_put(opp);
......@@ -1002,7 +997,7 @@ static int a6xx_gmu_rpmh_arc_votes_init(struct device *dev, u32 *votes,
/* Construct a vote for each frequency */
for (i = 0; i < freqs_count; i++) {
u8 pindex = 0, sindex = 0;
u32 level = a6xx_gmu_get_arc_level(dev, freqs[i]);
unsigned int level = a6xx_gmu_get_arc_level(dev, freqs[i]);
/* Get the primary index that matches the arc level */
for (j = 0; j < pri_count; j++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment