From 08db9f492da3f362262cd37d6ff779359ab0b9d8 Mon Sep 17 00:00:00 2001 From: Kiran Gunda Date: Mon, 23 Jan 2017 12:44:02 +0530 Subject: [PATCH] regulator: qpnp-labibb: Do not program LAB_CURRENT_SENSE for PM660A Programming the default (1.5x) LAB_CURRENT_SENSE configuration is not required for PM660A. Configure it only if explicitly specified in the DT config. CRs-Fixed: 1114628 Change-Id: Ib09e6430e99a7f39a9d2f837494a977daff354ba Signed-off-by: Kiran Gunda --- drivers/regulator/qpnp-labibb-regulator.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/qpnp-labibb-regulator.c b/drivers/regulator/qpnp-labibb-regulator.c index 8dbe3080873c..52282cca6b9a 100644 --- a/drivers/regulator/qpnp-labibb-regulator.c +++ b/drivers/regulator/qpnp-labibb-regulator.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -2643,7 +2643,8 @@ static int register_qpnp_lab_regulator(struct qpnp_labibb *labibb, return rc; } - if (labibb->mode == QPNP_LABIBB_AMOLED_MODE) { + if (labibb->mode == QPNP_LABIBB_AMOLED_MODE && + labibb->pmic_rev_id->pmic_subtype != PM660L_SUBTYPE) { /* * default to 1.5 times current gain if * user doesn't specify the current-sense @@ -2684,7 +2685,7 @@ static int register_qpnp_lab_regulator(struct qpnp_labibb *labibb, val = (labibb->standalone) ? 0 : LAB_IBB_EN_RDY_EN; rc = qpnp_labibb_sec_write(labibb, labibb->lab_base, - REG_LAB_IBB_EN_RDY, val); + REG_LAB_IBB_EN_RDY, val); if (rc < 0) { pr_err("qpnp_lab_sec_write register %x failed rc = %d\n", @@ -3829,9 +3830,10 @@ static int qpnp_labibb_regulator_probe(struct platform_device *pdev) } } dev_set_drvdata(&pdev->dev, labibb); - pr_info("LAB/IBB registered successfully, lab_vreg enable=%d ibb_vreg enable=%d\n", + pr_info("LAB/IBB registered successfully, lab_vreg enable=%d ibb_vreg enable=%d swire_control=%d\n", labibb->lab_vreg.vreg_enabled, - labibb->ibb_vreg.vreg_enabled); + labibb->ibb_vreg.vreg_enabled, + labibb->swire_control); return 0;