soc: qcom: spm: Poll for the PMIC_STATE after updating the VCTL register

The PMIC_STATE is expected to move to idle after the VCTL register
value is written to the PMIC.

Also update the PMIC_STATE poll timeout to 500us for all the targets.

CRs-Fixed: 1024714
Change-Id: If9d9875a967179c6ee5fced8f019c01f1a2f0583
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
This commit is contained in:
Anirudh Ghayal 2016-05-27 20:01:40 +05:30 committed by Gerrit - the friendly Code Review server
parent ff694c5bf8
commit 642675c40a
17 changed files with 41 additions and 39 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, 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
@ -115,7 +115,7 @@
qcom,saw2-spm-ctl = <0x1>;
qcom,saw2-pmic-data0 = <0x02030080>;
qcom,saw2-pmic-data1 = <0x00030000>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,pfm-port = <0x2>;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, 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
@ -96,7 +96,7 @@
qcom,saw2-spm-ctl = <0x0>;
qcom,saw2-pmic-data0 = <0x02030080>;
qcom,saw2-pmic-data1 = <0x00030000>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,pfm-port = <0x2>;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, 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
@ -96,7 +96,7 @@
qcom,saw2-spm-ctl = <0x0>;
qcom,saw2-pmic-data0 = <0x02030080>;
qcom,saw2-pmic-data1 = <0x00030000>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,pfm-port = <0x2>;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, 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
@ -96,7 +96,7 @@
qcom,saw2-spm-ctl = <0x0>;
qcom,saw2-pmic-data0 = <0x02030080>;
qcom,saw2-pmic-data1 = <0x00030000>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,pfm-port = <0x2>;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, 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
@ -96,7 +96,7 @@
qcom,saw2-spm-ctl = <0x0>;
qcom,saw2-pmic-data0 = <0x02030080>;
qcom,saw2-pmic-data1 = <0x00030000>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,pfm-port = <0x2>;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2016, 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
@ -100,7 +100,7 @@
qcom,saw2-pmic-data1 = <0x00030000>;
qcom,saw2-pmic-data4 = <0x00010080>;
qcom,saw2-pmic-data5 = <0x00010000>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,pfm-port = <0x2>;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, 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
@ -90,7 +90,7 @@
qcom,saw2-pmic-data1 = <0x00030000>;
qcom,saw2-pmic-data4 = <0x00010080>;
qcom,saw2-pmic-data5 = <0x00010000>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,pfm-port = <0x2>;

View File

@ -27,7 +27,7 @@
qcom,saw2-pmic-data1 = <0x00030000>;
qcom,saw2-pmic-data4 = <0x00010080>;
qcom,saw2-pmic-data5 = <0x00010000>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,pfm-port = <0x2>;

View File

@ -22,7 +22,7 @@
qcom,saw2-spm-dly = <0X3c102800>;
qcom,saw2-spm-ctl = <0x8>;
qcom,cpu-vctl-list = <&CPU0 &CPU1 &CPU2 &CPU3>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,saw2-pmic-data0 = <0x03030080>; /* VDD_APC0 on */
@ -42,7 +42,7 @@
qcom,saw2-spm-dly = <0x3c11840a>;
qcom,saw2-spm-ctl = <0x8>;
qcom,cpu-vctl-list = <&CPU4 &CPU5>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,saw2-pmic-data0 = <0x03030080>; /* VDD_APC1 on */

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, 2016, 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
@ -119,7 +119,7 @@
qcom,saw2-spm-ctl = <0x1>;
qcom,saw2-pmic-data0 = <0x02030080>;
qcom,saw2-pmic-data1 = <0x00030000>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,cpu-vctl-mask = <0xf>;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, 2016, 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
@ -120,7 +120,7 @@
qcom,saw2-spm-ctl = <0x1>;
qcom,saw2-pmic-data0 = <0x02030080>;
qcom,saw2-pmic-data1 = <0x00030000>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,pfm-port = <0x2>;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, 2016, 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
@ -124,7 +124,7 @@
qcom,saw2-spm-ctl = <0x1>;
qcom,saw2-pmic-data0 = <0x02030080>;
qcom,saw2-pmic-data1 = <0x00030000>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,pfm-port = <0x2>;

View File

@ -22,7 +22,7 @@
qcom,saw2-spm-dly = <0X3c102800>;
qcom,saw2-spm-ctl = <0x8>;
qcom,cpu-vctl-list = <&CPU0 &CPU1 &CPU2 &CPU3>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,saw2-pmic-data0 = <0x03030080>; /* VDD_APC0 on */
@ -42,7 +42,7 @@
qcom,saw2-spm-dly = <0x3c11840a>;
qcom,saw2-spm-ctl = <0x8>;
qcom,cpu-vctl-list = <&CPU4 &CPU5 &CPU6 &CPU7>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,saw2-pmic-data0 = <0x03030080>; /* VDD_APC1 on */

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2016, 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
@ -22,7 +22,7 @@
qcom,saw2-spm-dly = <0X3c100c00>;
qcom,saw2-spm-ctl = <0x0>;
qcom,cpu-vctl-list = <&CPU0 &CPU1 &CPU2 &CPU3>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,supports-rpm-hs;
@ -65,7 +65,7 @@
qcom,saw2-spm-dly = <0x3c100c30>;
qcom,saw2-spm-ctl = <0x8>;
qcom,cpu-vctl-list = <&CPU4 &CPU5>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,saw2-pmic-data0 = <0x00030000>; /* VDD_APC1 off */

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2016, 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
@ -22,7 +22,7 @@
qcom,saw2-spm-dly = <0X3c100c00>;
qcom,saw2-spm-ctl = <0x0>;
qcom,cpu-vctl-list = <&CPU0 &CPU1 &CPU2 &CPU3>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,supports-rpm-hs;
@ -65,7 +65,7 @@
qcom,saw2-spm-dly = <0x3c100c30>;
qcom,saw2-spm-ctl = <0x0>;
qcom,cpu-vctl-list = <&CPU4 &CPU5 &CPU6 &CPU7>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,saw2-pmic-data0 = <0x00030000>; /* VDD_APC1 off */

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2016, 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
@ -22,7 +22,7 @@
qcom,saw2-spm-dly = <0X3c100c00>;
qcom,saw2-spm-ctl = <0x0>;
qcom,cpu-vctl-list = <&CPU0 &CPU1 &CPU2 &CPU3>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,supports-rpm-hs;
@ -65,7 +65,7 @@
qcom,saw2-spm-dly = <0x3c100c30>;
qcom,saw2-spm-ctl = <0x8>;
qcom,cpu-vctl-list = <&CPU4 &CPU5 &CPU6 &CPU7>;
qcom,vctl-timeout-us = <50>;
qcom,vctl-timeout-us = <500>;
qcom,vctl-port = <0x0>;
qcom,phase-port = <0x1>;
qcom,saw2-pmic-data0 = <0x00030000>; /* VDD_APC1 off */

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2016, 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
@ -232,7 +232,7 @@ uint32_t msm_spm_drv_get_sts_curr_pmic_data(
struct msm_spm_driver_data *dev)
{
msm_spm_drv_load_shadow(dev, MSM_SPM_REG_SAW_PMIC_STS);
return dev->reg_shadow[MSM_SPM_REG_SAW_PMIC_STS] & 0xFF;
return dev->reg_shadow[MSM_SPM_REG_SAW_PMIC_STS] & 0x300FF;
}
static inline void msm_spm_drv_get_saw2_ver(struct msm_spm_driver_data *dev,
@ -425,10 +425,12 @@ int msm_spm_drv_set_vdd(struct msm_spm_driver_data *dev, unsigned int vlevel)
timeout_us = dev->vctl_timeout_us;
/* Confirm the voltage we set was what hardware sent */
do {
new_level = msm_spm_drv_get_sts_curr_pmic_data(dev);
if (new_level == vlevel)
break;
udelay(1);
new_level = msm_spm_drv_get_sts_curr_pmic_data(dev);
/* FSM is idle */
if (((new_level & 0x30000) == 0) &&
((new_level & 0xFF) == vlevel))
break;
} while (--timeout_us);
if (!timeout_us) {
pr_info("Wrong level %#x\n", new_level);