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

Commit c1206fe4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: dts: msm: specify VDD_GFX CPR configurations for msm8996v3"

parents cbc9d966 0ef0c37c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -36,7 +36,13 @@ HMSS specific properties:
- compatible
	Usage:      required
	Value type: <string>
	Definition: should be "qcom,cpr3-msm8996-hmss-regulator"
	Definition: should be one of the following:
		    "qcom,cpr3-msm8996-v1-hmss-regulator",
		    "qcom,cpr3-msm8996-v2-hmss-regulator",
		    "qcom,cpr3-msm8996-v3-hmss-regulator",
		    "qcom,cpr3-msm8996-hmss-regulator".
		    If the SoC revision is not specified, then it is assumed to
		    be the most recent revision, i.e. v3.

- interrupts
	Usage:      required
+109 −99
Original line number Diff line number Diff line
@@ -496,13 +496,13 @@
			reg = <0x3200 0x100>;
			regulator-name = "pm8994_s11";
			regulator-min-microvolt = <470000>;
			regulator-max-microvolt = <1015000>;
			regulator-max-microvolt = <1140000>;
			qcom,cpu-num = <0>;

			pm8994_s11_limit: avs-limit-regulator {
				regulator-name = "pm8994_s11_avs_limit";
				regulator-min-microvolt = <470000>;
				regulator-max-microvolt = <1015000>;
				regulator-max-microvolt = <1140000>;
			};
		};
	};
@@ -589,43 +589,42 @@
			apc0_pwrcl_vreg: regulator-pwrcl {
				regulator-name = "apc0_pwrcl_corner";
				regulator-min-microvolt = <1>;
				regulator-max-microvolt = <19>;
				regulator-max-microvolt = <16>;

				qcom,cpr-pd-bypass-mask = <0x07>;
				qcom,cpr-fuse-corners = <5>;
				qcom,cpr-fuse-combos = <4>;
				qcom,cpr-corners = <19>;
				qcom,cpr-fuse-combos = <2>;
				qcom,cpr-corners = <16>;

				qcom,ldo-headroom-voltage = <150000>;
				qcom,ldo-max-voltage = <805000>;
				qcom,ldo-disable;

				qcom,cpr-corner-fmax-map = <1 2 6 11 19>;
				qcom,cpr-corner-fmax-map = <1 2 7 12 16>;

				qcom,cpr-voltage-ceiling =
					<670000  670000  745000  745000  745000
					 745000  905000  905000  905000  905000
					 905000 1015000 1015000 1015000 1015000
					1015000 1015000 1015000 1015000>;
					 745000  745000  905000  905000  905000
					 905000  905000 1140000 1140000 1140000
					1140000>;
				qcom,cpr-voltage-floor =
					<470000  470000  470000  470000  470000
					 470000  470000  470000  470000  470000
					 470000  470000  470000  470000  470000
					 470000  470000  470000  470000>;
					 470000>;
				qcom,cpr-floor-to-ceiling-max-range =
					 <80000   80000   80000   80000   80000
					  80000   80000   80000   80000   80000
					  80000   80000   80000   80000   80000
					  80000   80000   80000   80000>;
					  80000>;

				qcom,corner-frequencies =
					<192000000  268800000  307200000
					 345600000  403200000  480000000
					 576000000  633600000  729600000
					 806400000  883200000  960000000
					1017600000 1113600000 1190400000
					1267200000 1344000000 1420800000
					1459200000>;
					<307200000  422400000  480000000
					 556800000  652800000  729600000
					 844800000  960000000 1036800000
					1113600000 1190400000 1228800000
					1324800000 1401600000 1478400000
					1593600000>;

				qcom,cpr-ro-scaling-factor =
				      <   0    0    0    0 2222 2275 2506 2491
@@ -640,13 +639,9 @@
				       2193 2201 2283 2296    0    0    0    0>;

				qcom,cpr-open-loop-voltage-fuse-adjustment =
					<0 0 0 0 0>,
					<0 0 0 0 0>,
					<0 0 0 0 0>,
					<0 0 0 0 0>;
				qcom,cpr-closed-loop-voltage-fuse-adjustment =
					<0 0 0 0 0>,
					<0 0 0 0 0>,
					<0 0 0 0 0>,
					<0 0 0 0 0>;

@@ -658,30 +653,39 @@
			apc0_cbf_vreg: regulator-cbf {
				regulator-name = "apc0_cbf_corner";
				regulator-min-microvolt = <1>;
				regulator-max-microvolt = <10>;
				regulator-max-microvolt = <19>;

				qcom,cpr-pd-bypass-mask = <0x18>;
				qcom,cpr-fuse-corners = <5>;
				qcom,cpr-fuse-combos = <4>;
				qcom,cpr-corners = <10>;
				qcom,cpr-fuse-combos = <2>;
				qcom,cpr-corners = <19>;

				qcom,cpr-corner-fmax-map = <1 2 5 9 10>;
				qcom,cpr-corner-fmax-map = <1 2 5 13 19>;

				qcom,cpr-voltage-ceiling =
				       <605000  670000  745000  745000  745000
					905000  905000  905000  905000 1015000>;
				       <670000  670000  745000  745000  745000
					905000  905000  905000  905000  905000
					905000  905000  905000 1140000 1140000
				       1140000 1140000 1140000 1140000>;
				qcom,cpr-voltage-floor =
				       <470000  470000  470000  470000  470000
					470000  470000  470000  470000  470000>;
					470000  470000  470000  470000  470000
					470000  470000  470000  470000  470000
					470000  470000  470000  470000>;
				qcom,cpr-floor-to-ceiling-max-range =
					<80000   80000   80000   80000   80000
					 80000   80000   80000   80000   80000>;
					 80000   80000   80000   80000   80000
					 80000   80000   80000   80000   80000
					 80000   80000   80000   80000>;

				qcom,corner-frequencies =
					<150000000  307200000  384000000
					 499200000  595200000  691200000
					 787200000  883200000  960000000
					1036800000>;
					<307200000  384000000  460800000
					 537600000  595200000  672000000
					 748800000  825600000  902400000
					 979200000 1056000000 1132800000
					1190400000 1228800000 1305600000
					1382400000 1459200000 1536000000
					1593600000>;

				qcom,cpr-ro-scaling-factor =
				      <   0    0    0    0 2222 2275 2506 2491
@@ -697,14 +701,10 @@

				qcom,cpr-open-loop-voltage-fuse-adjustment =
					<0 0 0 0 0>,
					<0 0 0 0 0>,
					<0 0 0 0 (-130000)>,
					<0 0 0 0 (-130000)>;
					<0 0 0 0 0>;
				qcom,cpr-closed-loop-voltage-fuse-adjustment =
					<0 0 0 0 0>,
					<0 0 0 0 0>,
					<0 0 0 0 (-115000)>,
					<0 0 0 0 (-115000)>;
					<0 0 0 0 0>;

				qcom,allow-voltage-interpolation;
				qcom,allow-quotient-interpolation;
@@ -722,42 +722,48 @@
			apc1_vreg: regulator {
				regulator-name = "apc1_corner";
				regulator-min-microvolt = <1>;
				regulator-max-microvolt = <18>;
				regulator-max-microvolt = <25>;

				qcom,cpr-pd-bypass-mask = <0xe0>;
				qcom,cpr-fuse-corners = <5>;
				qcom,cpr-fuse-combos = <4>;
				qcom,cpr-corners = <18>;
				qcom,cpr-fuse-combos = <2>;
				qcom,cpr-corners = <25>;

				qcom,ldo-headroom-voltage = <150000>;
				qcom,ldo-max-voltage = <805000>;
				qcom,ldo-disable;

				qcom,cpr-corner-fmax-map = <1 3 5 11 18>;
				qcom,cpr-corner-fmax-map = <1 4 9 13 25>;

				qcom,cpr-voltage-ceiling =
					<670000  670000  670000  745000  745000
					 905000  905000  905000  905000  905000
					 905000 1015000 1015000 1015000 1015000
					1015000 1015000 1015000>;
				       <670000  670000  670000  670000  745000
					745000  745000  745000  745000  905000
					905000  905000  905000 1140000 1140000
				       1140000 1140000 1140000 1140000 1140000
				       1140000 1140000 1140000 1140000 1140000>;
				qcom,cpr-voltage-floor =
				       <470000  470000  470000  470000  470000
					470000  470000  470000  470000  470000
					470000  470000  470000  470000  470000
					 470000  470000  470000>;
					470000  470000  470000  470000  470000
					470000  470000  470000  470000  470000>;
				qcom,cpr-floor-to-ceiling-max-range =
					<80000   80000   80000   80000   80000
					 80000   80000   80000   80000   80000
					 80000   80000   80000   80000   80000
					  80000   80000   80000>;
					 80000   80000   80000   80000   80000
					 80000   80000   80000   80000   80000>;

				qcom,corner-frequencies =
					<307200000  345600000  403200000
					 480000000  576000000  633600000
					 729600000  806400000  883200000
					 960000000 1017600000 1113600000
					1190400000 1267200000 1344000000
					1420800000 1497600000 1593600000>;
					<307200000  403200000  480000000
					 556800000  652800000  729600000
					 806400000  883200000  940800000
					1036800000 1113600000 1190400000
					1248000000 1324800000 1401600000
					1478400000 1555200000 1632000000
					1708800000 1785600000 1826400000
					1920000000 1996800000 2073600000
					2150400000>;

				qcom,cpr-ro-scaling-factor =
				      <   0    0    0    0 2212 2273 2517 2506
@@ -772,13 +778,9 @@
				       2203 2210 2297 2297    0    0    0    0>;

				qcom,cpr-open-loop-voltage-fuse-adjustment =
					<0 0 0 5000 0>,
					<0 0 0 5000 0>,
					<0 0 0 0 0>,
					<0 0 0 0 0>;
				qcom,cpr-closed-loop-voltage-fuse-adjustment =
					<0 0 0 20000 0>,
					<0 0 0 20000 0>,
					<0 0 0 0 0>,
					<0 0 0 0 0>;

@@ -813,8 +815,6 @@

		system-supply = <&pm8994_s1_corner>;

		qcom,cpr-enable;

		thread@0 {
			qcom,cpr-thread-id = <0>;
			qcom,cpr-consecutive-up = <0>;
@@ -825,55 +825,65 @@
			gfx_vreg: regulator {
				regulator-name = "gfx_corner";
				regulator-min-microvolt = <1>;
				regulator-max-microvolt = <5>;
				regulator-max-microvolt = <7>;

				qcom,cpr-fuse-corners = <4>;
				qcom,cpr-fuse-combos = <1>;
				qcom,cpr-corners = <5>;
				qcom,cpr-corners = <7>;

				qcom,cpr-corner-fmax-map = <2 3 4 5>;
				qcom,cpr-corner-fmax-map = <2 3 5 7>;

				qcom,cpr-voltage-ceiling =
					<400000 670000  745000  905000 1015000>;
					<400000  670000  745000  905000  905000
					1015000 1015000>;
				qcom,cpr-voltage-floor =
					<400000 520000  520000  520000  520000>;
					<400000  520000  520000  520000  520000
					 520000  520000>;

				qcom,system-voltage = <2 2 2 2 4>;
				qcom,system-voltage = <2 2 2 2 2 2 4>;

				qcom,corner-frequencies =
					<0 210000000 300000000 500000000
					 604800000>;
					<0 210000000 300000000 401800000
					 510000000 549000000 624000000>;

				qcom,cpr-target-quotients =
				      <   0    0    0    0  249  232    0  394
					  0  422    0    0    0    0    0    0>,
				      <   0    0    0    0  249  232    0  394
					  0  422    0    0    0    0    0    0>,
				      <   0    0    0    0  400  363    0  565
					  0  603    0    0    0    0    0    0>,
				      <   0    0    0    0  669  601    0  851
					  0  905    0    0    0    0    0    0>,
				      <   0    0    0    0  899  806    0 1084
					  0 1149    0    0    0    0    0    0>;
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>,
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>,
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>,
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>,
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>,
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>,
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>;

				qcom,cpr-ro-scaling-factor =
				      <   0    0    0    0 2268 2004    0 2408
					  0 2539    0    0    0    0    0    0>,
				      <   0    0    0    0 2268 2004    0 2408
					  0 2539    0    0    0    0    0    0>,
				      <   0    0    0    0 2268 2004    0 2408
					  0 2539    0    0    0    0    0    0>,
				      <   0    0    0    0 2268 2004    0 2408
					  0 2539    0    0    0    0    0    0>,
				      <   0    0    0    0 2268 2004    0 2408
					  0 2539    0    0    0    0    0    0>;
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>,
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>,
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>,
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>,
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>,
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>,
				      <   0    0    0    0    0    0    0    0
					  0    0    0    0    0    0    0    0>;

				qcom,cpr-open-loop-voltage-fuse-adjustment =
					<0 (-5000) (-30000) (-115000)>;
					<0 0 0 0>;
				qcom,cpr-closed-loop-voltage-adjustment =
					<0 0 0 (-10000) (-65000)>;
					<0 0 0 0 0 0 0>;
				qcom,cpr-floor-to-ceiling-max-range =
					<0 130000 40000 85000 85000>;
					<0 0 0 0 0 0 0>;

				qcom,allow-voltage-interpolation;
				qcom,cpr-scaled-open-loop-voltage-as-ceiling;
+236 −0
Original line number Diff line number Diff line
@@ -62,6 +62,242 @@
		 <&clock_gpu clk_gfx3d_clk_src_v2>;
};

&pm8994_s11 {
	regulator-max-microvolt = <1015000>;
};

&pm8994_s11_limit {
	regulator-max-microvolt = <1015000>;
};

&apcc_cpr {
	compatible = "qcom,cpr3-msm8996-v2-hmss-regulator";

	qcom,apm-ctrl = <&apc_apm>;
	qcom,apm-threshold-voltage = <850000>;
	qcom,apm-hysteresis-voltage = <5000>;

	qcom,cpr-enable;
};

&apc0_pwrcl_vreg {
	regulator-min-microvolt = <1>;
	regulator-max-microvolt = <19>;

	qcom,cpr-fuse-corners = <5>;
	qcom,cpr-fuse-combos = <4>;
	qcom,cpr-corners = <19>;

	qcom,ldo-headroom-voltage = <150000>;
	qcom,ldo-max-voltage = <805000>;
	qcom,ldo-disable;

	qcom,cpr-corner-fmax-map = <1 2 6 11 19>;

	qcom,cpr-voltage-ceiling =
		<670000  670000  745000  745000  745000  745000  905000  905000
		 905000  905000  905000 1015000 1015000 1015000 1015000 1015000
		1015000 1015000 1015000>;
	qcom,cpr-voltage-floor =
		<470000  470000  470000  470000  470000  470000  470000  470000
		 470000  470000  470000  470000  470000  470000  470000  470000
		 470000  470000  470000>;
	qcom,cpr-floor-to-ceiling-max-range =
		 <80000   80000   80000   80000   80000   80000   80000   80000
		  80000   80000   80000   80000   80000   80000   80000   80000
		  80000   80000   80000>;

	qcom,corner-frequencies =
		<192000000  268800000  307200000  345600000  403200000
		 480000000  576000000  633600000  729600000  806400000
		 883200000  960000000 1017600000 1113600000 1190400000
		1267200000 1344000000 1420800000 1459200000>;

	qcom,cpr-ro-scaling-factor =
	      <   0    0    0    0 2222 2275 2506 2491 2649 2640 2886 2866    0
		  0    0    0>,
	      <   0    0    0    0 2222 2275 2506 2491 2649 2640 2886 2866    0
		  0    0    0>,
	      <   0    0    0    0 2222 2275 2506 2491 2649 2640 2886 2866    0
		  0    0    0>,
	      <   0    0    0    0 2147 2226 2310 2312 2450 2447 2603 2600    0
		  0    0    0>,
	      <   0    0    0    0 1989 2079 2066 2083 2193 2201 2283 2296    0
		  0    0    0>;

	qcom,cpr-open-loop-voltage-fuse-adjustment =
		<0 0 0 0 0>,
		<0 0 0 0 0>,
		<0 0 0 0 0>,
		<0 0 0 0 0>;
	qcom,cpr-closed-loop-voltage-fuse-adjustment =
		<0 0 0 0 0>,
		<0 0 0 0 0>,
		<0 0 0 0 0>,
		<0 0 0 0 0>;
};

&apc0_cbf_vreg {
	regulator-min-microvolt = <1>;
	regulator-max-microvolt = <10>;

	qcom,cpr-fuse-corners = <5>;
	qcom,cpr-fuse-combos = <4>;
	qcom,cpr-corners = <10>;

	qcom,cpr-corner-fmax-map = <1 2 5 9 10>;

	qcom,cpr-voltage-ceiling =
	       <605000  670000  745000  745000  745000  905000  905000  905000
		905000 1015000>;
	qcom,cpr-voltage-floor =
	       <470000  470000  470000  470000  470000  470000  470000  470000
		470000  470000>;
	qcom,cpr-floor-to-ceiling-max-range =
		<80000   80000   80000   80000   80000   80000   80000   80000
		 80000   80000>;

	qcom,corner-frequencies =
		<150000000  307200000  384000000  499200000  595200000
		 691200000  787200000  883200000  960000000 1036800000>;

	qcom,cpr-ro-scaling-factor =
	      <   0    0    0    0 2222 2275 2506 2491 2649 2640 2886 2866    0
		  0    0    0>,
	      <   0    0    0    0 2222 2275 2506 2491 2649 2640 2886 2866    0
		  0    0    0>,
	      <   0    0    0    0 2222 2275 2506 2491 2649 2640 2886 2866    0
		  0    0    0>,
	      <   0    0    0    0 2147 2226 2310 2312 2450 2447 2603 2600    0
		  0    0    0>,
	      <   0    0    0    0 1989 2079 2066 2083 2193 2201 2283 2296    0
		  0    0    0>;

	qcom,cpr-open-loop-voltage-fuse-adjustment =
		<0 0 0 0 0>,
		<0 0 0 0 0>,
		<0 0 0 0 (-130000)>,
		<0 0 0 0 (-130000)>;
	qcom,cpr-closed-loop-voltage-fuse-adjustment =
		<0 0 0 0 0>,
		<0 0 0 0 0>,
		<0 0 0 0 (-115000)>,
		<0 0 0 0 (-115000)>;
};

&apc1_vreg {
	regulator-min-microvolt = <1>;
	regulator-max-microvolt = <18>;

	qcom,cpr-fuse-corners = <5>;
	qcom,cpr-fuse-combos = <4>;
	qcom,cpr-corners = <18>;

	qcom,ldo-headroom-voltage = <150000>;
	qcom,ldo-max-voltage = <805000>;
	qcom,ldo-disable;

	qcom,cpr-corner-fmax-map = <1 3 5 11 18>;

	qcom,cpr-voltage-ceiling =
		<670000  670000  670000  745000  745000  905000  905000  905000
		 905000  905000  905000 1015000 1015000 1015000 1015000 1015000
		 1015000 1015000>;
	qcom,cpr-voltage-floor =
		<470000  470000  470000  470000  470000  470000  470000  470000
		 470000  470000  470000  470000  470000  470000  470000  470000
		 470000  470000>;
	qcom,cpr-floor-to-ceiling-max-range =
		 <80000   80000   80000   80000   80000   80000   80000   80000
		  80000   80000   80000   80000   80000   80000   80000   80000
		  80000   80000>;

	qcom,corner-frequencies =
		<307200000  345600000  403200000  480000000  576000000
		 633600000  729600000  806400000  883200000  960000000
		1017600000 1113600000 1190400000 1267200000 1344000000
		1420800000 1497600000 1593600000>;

	qcom,cpr-ro-scaling-factor =
	      <   0    0    0    0 2212 2273 2517 2506 2663 2650 2908 2891    0
		  0    0    0>,
	      <   0    0    0    0 2212 2273 2517 2506 2663 2650 2908 2891    0
		  0    0    0>,
	      <   0    0    0    0 2212 2273 2517 2506 2663 2650 2908 2891    0
		  0    0    0>,
	      <   0    0    0    0 2152 2237 2321 2337 2475 2469 2636 2612    0
		  0    0    0>,
	      <   0    0    0    0 2001 2102 2092 2090 2203 2210 2297 2297    0
		  0    0    0>;

	qcom,cpr-open-loop-voltage-fuse-adjustment =
		<0 0 0 5000 0>,
		<0 0 0 5000 0>,
		<0 0 0 0 0>,
		<0 0 0 0 0>;
	qcom,cpr-closed-loop-voltage-fuse-adjustment =
		<0 0 0 20000 0>,
		<0 0 0 20000 0>,
		<0 0 0 0 0>,
		<0 0 0 0 0>;
};

&gfx_cpr {
	qcom,cpr-enable;
};

&gfx_vreg {
	regulator-min-microvolt = <1>;
	regulator-max-microvolt = <5>;

	qcom,cpr-fuse-corners = <4>;
	qcom,cpr-fuse-combos = <1>;
	qcom,cpr-corners = <5>;

	qcom,cpr-corner-fmax-map = <2 3 4 5>;

	qcom,cpr-voltage-ceiling =
		<400000 670000  745000  905000 1015000>;
	qcom,cpr-voltage-floor =
		<400000 520000  520000  520000  520000>;

	qcom,system-voltage = <2 2 2 2 4>;

	qcom,corner-frequencies =
		<0 210000000 300000000 500000000 604800000>;

	qcom,cpr-target-quotients =
	      <   0    0    0    0  249  232    0  394    0  422    0    0    0
		  0    0    0>,
	      <   0    0    0    0  249  232    0  394    0  422    0    0    0
		  0    0    0>,
	      <   0    0    0    0  400  363    0  565    0  603    0    0    0
		  0    0    0>,
	      <   0    0    0    0  669  601    0  851    0  905    0    0    0
		  0    0    0>,
	      <   0    0    0    0  899  806    0 1084    0 1149    0    0    0
		  0    0    0>;

	qcom,cpr-ro-scaling-factor =
	      <   0    0    0    0 2268 2004    0 2408    0 2539    0    0    0
		  0    0    0>,
	      <   0    0    0    0 2268 2004    0 2408    0 2539    0    0    0
		  0    0    0>,
	      <   0    0    0    0 2268 2004    0 2408    0 2539    0    0    0
		  0    0    0>,
	      <   0    0    0    0 2268 2004    0 2408    0 2539    0    0    0
		  0    0    0>,
	      <   0    0    0    0 2268 2004    0 2408    0 2539    0    0    0
		  0    0    0>;

	qcom,cpr-open-loop-voltage-fuse-adjustment =
		<0 (-5000) (-30000) (-115000)>;
	qcom,cpr-closed-loop-voltage-adjustment =
		<0 0 0 (-10000) (-65000)>;
	qcom,cpr-floor-to-ceiling-max-range =
		<0 130000 40000 85000 85000>;
};

/* GPU overrides */
&msm_gpu {
	/* Updated chip ID */
+43 −5
Original line number Diff line number Diff line
@@ -329,8 +329,8 @@ enum msm8996_cpr_limitation {

/* Additional MSM8996 specific data: */

/* Open loop voltage fuse reference voltages in microvolts */
static const int msm8996_hmss_fuse_ref_volt[MSM8996_HMSS_FUSE_CORNERS] = {
/* Open loop voltage fuse reference voltages in microvolts for MSM8996 v1/v2 */
static const int msm8996_v1_v2_hmss_fuse_ref_volt[MSM8996_HMSS_FUSE_CORNERS] = {
	605000,
	745000, /* Place holder entry for LowSVS */
	745000,
@@ -338,6 +338,15 @@ static const int msm8996_hmss_fuse_ref_volt[MSM8996_HMSS_FUSE_CORNERS] = {
	1015000,
};

/* Open loop voltage fuse reference voltages in microvolts for MSM8996 v3 */
static const int msm8996_v3_hmss_fuse_ref_volt[MSM8996_HMSS_FUSE_CORNERS] = {
	605000,
	745000, /* Place holder entry for LowSVS */
	745000,
	905000,
	1140000,
};

#define MSM8996_HMSS_FUSE_STEP_VOLT		10000
#define MSM8996_HMSS_VOLTAGE_FUSE_SIZE		6
#define MSM8996_HMSS_QUOT_OFFSET_SCALE		5
@@ -529,7 +538,8 @@ static int cpr3_msm8996_hmss_calculate_open_loop_voltages(
	int rc = 0;
	bool allow_interpolation;
	u64 freq_low, volt_low, freq_high, volt_high;
	int i, j;
	int i, j, soc_revision;
	const int *ref_volt;
	int *fuse_volt;
	int *fmax_corner;

@@ -542,9 +552,14 @@ static int cpr3_msm8996_hmss_calculate_open_loop_voltages(
		goto done;
	}

	soc_revision = vreg->thread->ctrl->soc_revision;
	ref_volt = soc_revision == 1 || soc_revision == 2
			? msm8996_v1_v2_hmss_fuse_ref_volt
			: msm8996_v3_hmss_fuse_ref_volt;

	for (i = 0; i < vreg->fuse_corner_count; i++) {
		fuse_volt[i] = cpr3_convert_open_loop_voltage_fuse(
			msm8996_hmss_fuse_ref_volt[i],
			ref_volt[i],
			MSM8996_HMSS_FUSE_STEP_VOLT, fuse->init_voltage[i],
			MSM8996_HMSS_VOLTAGE_FUSE_SIZE);

@@ -1439,14 +1454,31 @@ static int cpr3_hmss_regulator_resume(struct platform_device *pdev)
	return cpr3_regulator_resume(ctrl);
}

/* Data corresponds to the SoC revision */
static struct of_device_id cpr_regulator_match_table[] = {
	{ .compatible = "qcom,cpr3-msm8996-hmss-regulator", },
	{
		.compatible = "qcom,cpr3-msm8996-v1-hmss-regulator",
		.data = (void *)1
	},
	{
		.compatible = "qcom,cpr3-msm8996-v2-hmss-regulator",
		.data = (void *)2
	},
	{
		.compatible = "qcom,cpr3-msm8996-v3-hmss-regulator",
		.data = (void *)3
	},
	{
		.compatible = "qcom,cpr3-msm8996-hmss-regulator",
		.data = (void *)3
	},
	{}
};

static int cpr3_hmss_regulator_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	const struct of_device_id *match;
	struct cpr3_controller *ctrl;
	struct cpr3_regulator *vreg;
	int i, j, rc;
@@ -1472,6 +1504,12 @@ static int cpr3_hmss_regulator_probe(struct platform_device *pdev)
		return rc;
	}

	match = of_match_node(cpr_regulator_match_table, dev->of_node);
	if (match)
		ctrl->soc_revision = (uintptr_t)match->data;
	else
		cpr3_err(ctrl, "could not find compatible string match\n");

	rc = cpr3_map_fuse_base(ctrl, pdev);
	if (rc) {
		cpr3_err(ctrl, "could not map fuse base address\n");
+4 −0
Original line number Diff line number Diff line
@@ -260,6 +260,9 @@ enum cpr3_count_mode {
 * @sensor_count:	The number of CPR sensors found on the CPR loop managed
 *			by this CPR controller.  Must be equal to the number of
 *			elements in the sensor_owner array
 * @soc_revision:	Revision number of the SoC.  This may be unused by
 *			platforms that do not have different behavior for
 *			different SoC revisions.
 * @lock:		Mutex lock used to ensure mutual exclusion between
 *			all of the threads associated with the controller
 * @vdd_regulator:	Pointer to the VDD supply regulator which this CPR3
@@ -350,6 +353,7 @@ struct cpr3_controller {
	int			thread_count;
	u8			*sensor_owner;
	int			sensor_count;
	int			soc_revision;
	struct mutex		lock;
	struct regulator	*vdd_regulator;
	struct regulator	*system_regulator;