mbox series

[0/2] Add msm8939 tsens support

Message ID 20200629144926.665-1-shawn.guo@linaro.org
Headers show
Series Add msm8939 tsens support | expand

Message

Shawn Guo June 29, 2020, 2:49 p.m. UTC
It's my version of msm8939 tsens series that supersides Konrad's [1].
The bindings one is taken from Konrad though.

Shawn

[1] https://lkml.org/lkml/2020/5/1/1213

Konrad Dybcio (1):
  dt-bindings: tsens: qcom: Document MSM8939 compatible

Shawn Guo (1):
  thermal: qcom: tsens-v0_1: Add support for MSM8939

 .../bindings/thermal/qcom-tsens.yaml          |   1 +
 drivers/thermal/qcom/tsens-v0_1.c             | 144 +++++++++++++++++-
 drivers/thermal/qcom/tsens.c                  |   3 +
 drivers/thermal/qcom/tsens.h                  |   2 +-
 4 files changed, 148 insertions(+), 2 deletions(-)

-- 
2.17.1

Comments

Amit Kucheria July 27, 2020, 6:36 a.m. UTC | #1
On Mon, Jul 27, 2020 at 11:56 AM Amit Kucheria <amit.kucheria@linaro.org> wrote:
>

> On Tue, Jun 30, 2020 at 1:09 AM Shawn Guo <shawn.guo@linaro.org> wrote:

> >

> > The TSENS integrated on MSM8939 is a v0_1 device with 10 sensors.

> > Different from its predecessor MSM8916, where 'calib_sel' bits sit in

> > separate qfprom word, MSM8939 has 'cailb' and 'calib_sel' bits mixed and

> > spread on discrete offsets.  That's why all qfprom bits are read as one

> > go and later mapped to calibration data for MSM8939.

> >

> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

>

> Acked-by: Amit Kucheria <amit.kucheria@linaro.org>


Shawn,

Have you not sent the change to the tsens.yaml and 8939 DT yet or did
I miss them?

Regards,
Amit
Shawn Guo July 27, 2020, 8:33 a.m. UTC | #2
Hi Amit,

On Mon, Jul 27, 2020 at 12:06:54PM +0530, Amit Kucheria wrote:
> On Mon, Jul 27, 2020 at 11:56 AM Amit Kucheria <amit.kucheria@linaro.org> wrote:

> >

> > On Tue, Jun 30, 2020 at 1:09 AM Shawn Guo <shawn.guo@linaro.org> wrote:

> > >

> > > The TSENS integrated on MSM8939 is a v0_1 device with 10 sensors.

> > > Different from its predecessor MSM8916, where 'calib_sel' bits sit in

> > > separate qfprom word, MSM8939 has 'cailb' and 'calib_sel' bits mixed and

> > > spread on discrete offsets.  That's why all qfprom bits are read as one

> > > go and later mapped to calibration data for MSM8939.

> > >

> > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

> >

> > Acked-by: Amit Kucheria <amit.kucheria@linaro.org>

> 

> Shawn,

> 

> Have you not sent the change to the tsens.yaml and 8939 DT yet or did

> I miss them?


You were copied on '[PATCH 1/2] dt-bindings: tsens: qcom: Document
MSM8939 compatible'.  For DTS change, I haven't sent them out.  In case
you want to have a look, here it is.

	thermal-zones {
		cpu0-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 5>;

			trips {
				cpu0_alert: trip0 {
					temperature = <75000>;
					hysteresis = <2000>;
					type = "passive";
				};
				cpu0_crit: trip1 {
					temperature = <110000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};

			cooling-maps {
				map0 {
					trip = <&cpu0_alert>;
					cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
				};
			};
		};

		cpu1-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 6>;

			trips {
				cpu1_alert: trip0 {
					temperature = <75000>;
					hysteresis = <2000>;
					type = "passive";
				};
				cpu1_crit: trip1 {
					temperature = <110000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};

			cooling-maps {
				map0 {
					trip = <&cpu1_alert>;
					cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
				};
			};
		};

		cpu2-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 7>;

			trips {
				cpu2_alert: trip0 {
					temperature = <75000>;
					hysteresis = <2000>;
					type = "passive";
				};
				cpu2_crit: trip1 {
					temperature = <110000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};

			cooling-maps {
				map0 {
					trip = <&cpu2_alert>;
					cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
				};
			};
		};

		cpu3-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 8>;

			trips {
				cpu3_alert: trip0 {
					temperature = <75000>;
					hysteresis = <2000>;
					type = "passive";
				};
				cpu3_crit: trip1 {
					temperature = <110000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};

			cooling-maps {
				map0 {
					trip = <&cpu3_alert>;
					cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
				};
			};
		};

		cpu4567-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 9>;

			trips {
				cpu4567_alert: trip0 {
					temperature = <75000>;
					hysteresis = <2000>;
					type = "passive";
				};
				cpu4567_crit: trip1 {
					temperature = <110000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};

			cooling-maps {
				map0 {
					trip = <&cpu4567_alert>;
					cooling-device = <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
							 <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
				};
			};
		};

	};

	qfprom: qfprom@5c000 {
		compatible = "qcom,qfprom";
		reg = <0x5c000 0x1000>;
		#address-cells = <1>;
		#size-cells = <1>;
		tsens_caldata: caldata@a0 {
			reg = <0xa0 0x5c>;
		};
	};

	tsens: thermal-sensor@4a9000 {
		compatible = "qcom,msm8939-tsens";
		reg = <0x4a9000 0x1000>, /* TM */
		      <0x4a8000 0x1000>; /* SROT */
		nvmem-cells = <&tsens_caldata>;
		nvmem-cell-names = "calib";
		#qcom,sensors = <10>;
		interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-names = "uplow";
		#thermal-sensor-cells = <1>;
	};

Shawn