Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2013861 authored by David Collins's avatar David Collins
Browse files

regulator: cpr3-hmss-regulator: add support for msm8996pro differences



The lower Turbo fuse corner reference voltage for speed bin 1
with CPR revision >= 5 only applies to MSM8996v3 chips.  It
should not be used on MSM8996-Pro chips.  Therefore, add support
to distinguish MSM8996v3 from MSM8996-Pro and add a V3 check
to the reference voltage selection logic.

Change-Id: Iae7d49fe1b2539727160649cbf60ce57b73d639e
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent 804a2a69
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -40,9 +40,10 @@ HMSS specific properties:
		    "qcom,cpr3-msm8996-v1-hmss-regulator",
		    "qcom,cpr3-msm8996-v2-hmss-regulator",
		    "qcom,cpr3-msm8996-v3-hmss-regulator",
		    "qcom,cpr3-msm8996-hmss-regulator".
		    "qcom,cpr3-msm8996-hmss-regulator",
		    "qcom,cpr3-msm8996pro-hmss-regulator".
		    If the SoC revision is not specified, then it is assumed to
		    be the most recent revision, i.e. v3.
		    be the most recent revision of MSM8996, i.e. v3.

- interrupts
	Usage:      required
+13 −6
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-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
@@ -324,6 +324,8 @@ msm8996_hmss_aging_init_quot_diff_param[] = {
	{},
};

#define MSM8996PRO_SOC_ID			4

/*
 * Some initial msm8996 parts cannot be used in a meaningful way by software.
 * Other parts can only be used when operating with CPR disabled (i.e. at the
@@ -633,7 +635,8 @@ static int cpr3_msm8996_hmss_calculate_open_loop_voltages(
	soc_revision = vreg->thread->ctrl->soc_revision;
	if (soc_revision == 1 || soc_revision == 2)
		ref_volt = msm8996_v1_v2_hmss_fuse_ref_volt;
	else if (fuse->speed_bin == 1 && fuse->cpr_fusing_rev >= 5)
	else if (soc_revision == 3 && fuse->speed_bin == 1
				   && fuse->cpr_fusing_rev >= 5)
		ref_volt = msm8996_v3_speed_bin1_rev5_hmss_fuse_ref_volt;
	else
		ref_volt = msm8996_v3_hmss_fuse_ref_volt;
@@ -1583,19 +1586,23 @@ static int cpr3_hmss_regulator_resume(struct platform_device *pdev)
static struct of_device_id cpr_regulator_match_table[] = {
	{
		.compatible = "qcom,cpr3-msm8996-v1-hmss-regulator",
		.data = (void *)1
		.data = (void *)(uintptr_t)1
	},
	{
		.compatible = "qcom,cpr3-msm8996-v2-hmss-regulator",
		.data = (void *)2
		.data = (void *)(uintptr_t)2
	},
	{
		.compatible = "qcom,cpr3-msm8996-v3-hmss-regulator",
		.data = (void *)3
		.data = (void *)(uintptr_t)3
	},
	{
		.compatible = "qcom,cpr3-msm8996-hmss-regulator",
		.data = (void *)3
		.data = (void *)(uintptr_t)3
	},
	{
		.compatible = "qcom,cpr3-msm8996pro-hmss-regulator",
		.data = (void *)(uintptr_t)MSM8996PRO_SOC_ID,
	},
	{}
};