From 75eedba41c70333d7179a7010c5f15e537c1de0f Mon Sep 17 00:00:00 2001 From: Osvaldo Banuelos Date: Thu, 19 May 2016 10:47:48 -0700 Subject: [PATCH] regulator: cpr3-regulator: support corner bands with no adjustments 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 --- drivers/regulator/cpr3-regulator.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/regulator/cpr3-regulator.c b/drivers/regulator/cpr3-regulator.c index 9a5f33e3e9d8..9f5c67bc2d6f 100644 --- a/drivers/regulator/cpr3-regulator.c +++ b/drivers/regulator/cpr3-regulator.c @@ -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), -- 2.11.0