OSDN Git Service

regulator: cpr3-regulator: support corner bands with no adjustments
authorOsvaldo Banuelos <osvaldob@codeaurora.org>
Thu, 19 May 2016 17:47:48 +0000 (10:47 -0700)
committerKyle Yan <kyan@codeaurora.org>
Wed, 25 May 2016 21:21:21 +0000 (14:21 -0700)
Corner bands used on CPRh controllers may not necessarily define
per-online-core or per-temperature adjustments. Do not
attempt to program adjustments on corner bands whose sdelta
tables do not have either core-count or temperature based
adjustments defined.

Change-Id: I87d18778fef81671c5e7cc261cc70ce07c662933
CRs-Fixed: 1020505
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
drivers/regulator/cpr3-regulator.c

index 9a5f33e..9f5c67b 100644 (file)
@@ -1204,6 +1204,14 @@ static void cprh_controller_program_sdelta(
                corner_band = &vreg->corner_band[i];
                sdelta = corner_band->sdelta;
 
+               if (!sdelta->allow_core_count_adj && !sdelta->allow_temp_adj) {
+                       /*
+                        * Per-online-core and per-temperature margin
+                        * adjustments are disabled for this corner band.
+                        */
+                       continue;
+               }
+
                if (vreg->allow_core_count_adj)
                        cpr3_write_temp_core_margin(ctrl,
                                    CPRH_MARGIN_TEMP_CORE_VBAND(0, i),