* [PATCH 0/5] thermal: rockchip: add tsadc support in thermal driver and IPA thermal control for rk3328 in dts
@ 2017-07-25 9:09 Rocky Hao
2017-07-25 9:09 ` [PATCH 1/5] dt-bindings: rockchip-thermal: Support the RK3328 SoC compatible Rocky Hao
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Rocky Hao @ 2017-07-25 9:09 UTC (permalink / raw)
To: rui.zhang-ral2JQCrhuEAvxtiuMwx3w,
edubezval-Re5JQEeQqe8AvxtiuMwx3w, heiko-4mtYJXux2i+zQB+pC5nmwQ,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
catalin.marinas-5wv7dgnIgG8, will.deacon-5wv7dgnIgG8
Cc: shawn.lin-TNX95d0MmH7DzftRWevZcw, cl-TNX95d0MmH7DzftRWevZcw,
william.wu-TNX95d0MmH7DzftRWevZcw,
linux-pm-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, xxx-TNX95d0MmH7DzftRWevZcw,
jay.xu-TNX95d0MmH7DzftRWevZcw, wxt-TNX95d0MmH7DzftRWevZcw,
huangtao-TNX95d0MmH7DzftRWevZcw, rocky.hao-TNX95d0MmH7DzftRWevZcw
This series patches add the tsadc support in thermal driver and in devicetree for rk3328.
Also add thermal control with Intelligent Power Allocation (IPA) policy by default. Please
refer to https://developer.arm.com/open-source/intelligent-power-allocation for more information
about IPA.
Rocky Hao (5):
dt-bindings: rockchip-thermal: Support the RK3328 SoC compatible
thermal: rockchip: Support the RK3328 SOC in thermal driver
arm64: dts: rockchip: add tsadc node for rk3328 SoC
arm64: dts: rockchip: add thermal nodes for rk3328 SoC
arm64: dts: rockchip: Enable tsadc module on RK3328 eavluation board
.../bindings/thermal/rockchip-thermal.txt | 1 +
arch/arm64/boot/dts/rockchip/rk3328-evb.dts | 4 ++
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 63 +++++++++++++++++++++
drivers/thermal/rockchip_thermal.c | 65 ++++++++++++++++++++++
4 files changed, 133 insertions(+)
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/5] dt-bindings: rockchip-thermal: Support the RK3328 SoC compatible
2017-07-25 9:09 [PATCH 0/5] thermal: rockchip: add tsadc support in thermal driver and IPA thermal control for rk3328 in dts Rocky Hao
@ 2017-07-25 9:09 ` Rocky Hao
[not found] ` <1500973788-14627-2-git-send-email-rocky.hao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-07-25 9:09 ` [PATCH 2/5] thermal: rockchip: Support the RK3328 SOC in thermal driver Rocky Hao
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Rocky Hao @ 2017-07-25 9:09 UTC (permalink / raw)
To: rui.zhang, edubezval, heiko, robh+dt, mark.rutland,
catalin.marinas, will.deacon
Cc: shawn.lin, cl, william.wu, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, devicetree, xxx, jay.xu, wxt,
huangtao, rocky.hao
attempt to new compatible for thermal founding on RK3328 SoC.
Change-Id: Ie6f6d7b4e545891a0035851a923c0412f584140c
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
---
Documentation/devicetree/bindings/thermal/rockchip-thermal.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/thermal/rockchip-thermal.txt b/Documentation/devicetree/bindings/thermal/rockchip-thermal.txt
index 43003aec94bd..e3a6234fb1ac 100644
--- a/Documentation/devicetree/bindings/thermal/rockchip-thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/rockchip-thermal.txt
@@ -4,6 +4,7 @@ Required properties:
- compatible : should be "rockchip,<name>-tsadc"
"rockchip,rk3228-tsadc": found on RK3228 SoCs
"rockchip,rk3288-tsadc": found on RK3288 SoCs
+ "rockchip,rk3328-tsadc": found on RK3328 SoCs
"rockchip,rk3368-tsadc": found on RK3368 SoCs
"rockchip,rk3399-tsadc": found on RK3399 SoCs
- reg : physical base address of the controller and length of memory mapped
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/5] thermal: rockchip: Support the RK3328 SOC in thermal driver
2017-07-25 9:09 [PATCH 0/5] thermal: rockchip: add tsadc support in thermal driver and IPA thermal control for rk3328 in dts Rocky Hao
2017-07-25 9:09 ` [PATCH 1/5] dt-bindings: rockchip-thermal: Support the RK3328 SoC compatible Rocky Hao
@ 2017-07-25 9:09 ` Rocky Hao
2017-08-11 3:02 ` Zhang Rui
2017-07-25 9:09 ` [PATCH 3/5] arm64: dts: rockchip: add tsadc node for rk3328 SoC Rocky Hao
` (2 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Rocky Hao @ 2017-07-25 9:09 UTC (permalink / raw)
To: rui.zhang, edubezval, heiko, robh+dt, mark.rutland,
catalin.marinas, will.deacon
Cc: shawn.lin, cl, william.wu, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, devicetree, xxx, jay.xu, wxt,
huangtao, rocky.hao
RK3328 SOC has one Temperature Sensor for CPU.
Change-Id: I176c76bae1801d815a513986cfefcb55272c69a8
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
---
drivers/thermal/rockchip_thermal.c | 65 ++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index 4c7796512453..206035139110 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -320,6 +320,44 @@ struct tsadc_table {
{0, 125000},
};
+static const struct tsadc_table rk3328_code_table[] = {
+ {0, -40000},
+ {296, -40000},
+ {304, -35000},
+ {313, -30000},
+ {331, -20000},
+ {340, -15000},
+ {349, -10000},
+ {359, -5000},
+ {368, 0},
+ {378, 5000},
+ {388, 10000},
+ {398, 15000},
+ {408, 20000},
+ {418, 25000},
+ {429, 30000},
+ {440, 35000},
+ {451, 40000},
+ {462, 45000},
+ {473, 50000},
+ {485, 55000},
+ {496, 60000},
+ {508, 65000},
+ {521, 70000},
+ {533, 75000},
+ {546, 80000},
+ {559, 85000},
+ {572, 90000},
+ {586, 95000},
+ {600, 100000},
+ {614, 105000},
+ {629, 110000},
+ {644, 115000},
+ {659, 120000},
+ {675, 125000},
+ {TSADCV2_DATA_MASK, 125000},
+};
+
static const struct tsadc_table rk3368_code_table[] = {
{0, -40000},
{106, -40000},
@@ -790,6 +828,29 @@ static void rk_tsadcv2_tshut_mode(int chn, void __iomem *regs,
},
};
+static const struct rockchip_tsadc_chip rk3328_tsadc_data = {
+ .chn_id[SENSOR_CPU] = 0, /* cpu sensor is channel 0 */
+ .chn_num = 1, /* one channels for tsadc */
+
+ .tshut_mode = TSHUT_MODE_CRU, /* default TSHUT via CRU */
+ .tshut_temp = 95000,
+
+ .initialize = rk_tsadcv2_initialize,
+ .irq_ack = rk_tsadcv3_irq_ack,
+ .control = rk_tsadcv3_control,
+ .get_temp = rk_tsadcv2_get_temp,
+ .set_alarm_temp = rk_tsadcv2_alarm_temp,
+ .set_tshut_temp = rk_tsadcv2_tshut_temp,
+ .set_tshut_mode = rk_tsadcv2_tshut_mode,
+
+ .table = {
+ .id = rk3328_code_table,
+ .length = ARRAY_SIZE(rk3328_code_table),
+ .data_mask = TSADCV2_DATA_MASK,
+ .mode = ADC_INCREMENT,
+ },
+};
+
static const struct rockchip_tsadc_chip rk3366_tsadc_data = {
.chn_id[SENSOR_CPU] = 0, /* cpu sensor is channel 0 */
.chn_id[SENSOR_GPU] = 1, /* gpu sensor is channel 1 */
@@ -875,6 +936,10 @@ static void rk_tsadcv2_tshut_mode(int chn, void __iomem *regs,
.data = (void *)&rk3288_tsadc_data,
},
{
+ .compatible = "rockchip,rk3328-tsadc",
+ .data = (void *)&rk3328_tsadc_data,
+ },
+ {
.compatible = "rockchip,rk3366-tsadc",
.data = (void *)&rk3366_tsadc_data,
},
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/5] arm64: dts: rockchip: add tsadc node for rk3328 SoC
2017-07-25 9:09 [PATCH 0/5] thermal: rockchip: add tsadc support in thermal driver and IPA thermal control for rk3328 in dts Rocky Hao
2017-07-25 9:09 ` [PATCH 1/5] dt-bindings: rockchip-thermal: Support the RK3328 SoC compatible Rocky Hao
2017-07-25 9:09 ` [PATCH 2/5] thermal: rockchip: Support the RK3328 SOC in thermal driver Rocky Hao
@ 2017-07-25 9:09 ` Rocky Hao
2017-07-25 9:09 ` [PATCH 4/5] arm64: dts: rockchip: add thermal nodes " Rocky Hao
2017-07-25 9:16 ` [PATCH 5/5] arm64: dts: rockchip: Enable tsadc module on RK3328 eavluation board Rocky Hao
4 siblings, 0 replies; 10+ messages in thread
From: Rocky Hao @ 2017-07-25 9:09 UTC (permalink / raw)
To: rui.zhang, edubezval, heiko, robh+dt, mark.rutland,
catalin.marinas, will.deacon
Cc: shawn.lin, cl, william.wu, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, devicetree, xxx, jay.xu, wxt,
huangtao, rocky.hao
add tsadc needed main information for rk3328 SoC.
50000Hz is the max clock rate supported by tsadc module.
Change-Id: I2429c24edccd4c797e2f4577151be76372adfbe5
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
---
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index db4b2708084d..186fb93fdffd 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -308,6 +308,26 @@
interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
};
+ tsadc: tsadc@ff250000 {
+ compatible = "rockchip,rk3328-tsadc";
+ reg = <0x0 0xff250000 0x0 0x100>;
+ interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH 0>;
+ rockchip,grf = <&grf>;
+ clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>;
+ clock-names = "tsadc", "apb_pclk";
+ assigned-clocks = <&cru SCLK_TSADC>;
+ assigned-clock-rates = <50000>;
+ resets = <&cru SRST_TSADC>;
+ reset-names = "tsadc-apb";
+ pinctrl-names = "init", "default", "sleep";
+ pinctrl-0 = <&otp_gpio>;
+ pinctrl-1 = <&otp_out>;
+ pinctrl-2 = <&otp_gpio>;
+ #thermal-sensor-cells = <1>;
+ rockchip,hw-tshut-temp = <100000>;
+ status = "disabled";
+ };
+
saradc: adc@ff280000 {
compatible = "rockchip,rk3328-saradc", "rockchip,rk3399-saradc";
reg = <0x0 0xff280000 0x0 0x100>;
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/5] arm64: dts: rockchip: add thermal nodes for rk3328 SoC
2017-07-25 9:09 [PATCH 0/5] thermal: rockchip: add tsadc support in thermal driver and IPA thermal control for rk3328 in dts Rocky Hao
` (2 preceding siblings ...)
2017-07-25 9:09 ` [PATCH 3/5] arm64: dts: rockchip: add tsadc node for rk3328 SoC Rocky Hao
@ 2017-07-25 9:09 ` Rocky Hao
2017-07-25 9:16 ` [PATCH 5/5] arm64: dts: rockchip: Enable tsadc module on RK3328 eavluation board Rocky Hao
4 siblings, 0 replies; 10+ messages in thread
From: Rocky Hao @ 2017-07-25 9:09 UTC (permalink / raw)
To: rui.zhang, edubezval, heiko, robh+dt, mark.rutland,
catalin.marinas, will.deacon
Cc: shawn.lin, cl, william.wu, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, devicetree, xxx, jay.xu, wxt,
huangtao, rocky.hao
add thermal zone and dynamic CPU power coefficients for rk3328
Change-Id: I227468506c0b978a0fd4dd9596631e026743910e
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
---
arch/arm64/boot/dts/rockchip/rk3328.dtsi | 43 ++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index 186fb93fdffd..68829f808320 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -47,6 +47,7 @@
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/power/rk3328-power.h>
#include <dt-bindings/soc/rockchip,boot-mode.h>
+#include <dt-bindings/thermal/thermal.h>
/ {
compatible = "rockchip,rk3328";
@@ -74,6 +75,8 @@
compatible = "arm,cortex-a53", "arm,armv8";
reg = <0x0 0x0>;
clocks = <&cru ARMCLK>;
+ #cooling-cells = <2>; /* min followed by max */
+ dynamic-power-coefficient = <120>;
enable-method = "psci";
next-level-cache = <&l2>;
};
@@ -83,6 +86,7 @@
compatible = "arm,cortex-a53", "arm,armv8";
reg = <0x0 0x1>;
clocks = <&cru ARMCLK>;
+ dynamic-power-coefficient = <120>;
enable-method = "psci";
next-level-cache = <&l2>;
};
@@ -92,6 +96,7 @@
compatible = "arm,cortex-a53", "arm,armv8";
reg = <0x0 0x2>;
clocks = <&cru ARMCLK>;
+ dynamic-power-coefficient = <120>;
enable-method = "psci";
next-level-cache = <&l2>;
};
@@ -101,6 +106,7 @@
compatible = "arm,cortex-a53", "arm,armv8";
reg = <0x0 0x3>;
clocks = <&cru ARMCLK>;
+ dynamic-power-coefficient = <120>;
enable-method = "psci";
next-level-cache = <&l2>;
};
@@ -308,6 +314,43 @@
interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
};
+ thermal-zones {
+ soc_thermal: soc-thermal {
+ polling-delay-passive = <20>; /* milliseconds */
+ polling-delay = <1000>; /* milliseconds */
+ sustainable-power = <1000>; /* milliwatts */
+
+ thermal-sensors = <&tsadc 0>;
+
+ trips {
+ threshold: trip-point0 {
+ temperature = <70000>; /* millicelsius */
+ hysteresis = <2000>; /* millicelsius */
+ type = "passive";
+ };
+ target: trip-point1 {
+ temperature = <85000>; /* millicelsius */
+ hysteresis = <2000>; /* millicelsius */
+ type = "passive";
+ };
+ soc_crit: soc-crit {
+ temperature = <95000>; /* millicelsius */
+ hysteresis = <2000>; /* millicelsius */
+ type = "critical";
+ };
+ };
+
+ cooling-maps {
+ map0 {
+ trip = <&target>;
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+ contribution = <4096>;
+ };
+ };
+ };
+
+ };
+
tsadc: tsadc@ff250000 {
compatible = "rockchip,rk3328-tsadc";
reg = <0x0 0xff250000 0x0 0x100>;
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/5] arm64: dts: rockchip: Enable tsadc module on RK3328 eavluation board
2017-07-25 9:09 [PATCH 0/5] thermal: rockchip: add tsadc support in thermal driver and IPA thermal control for rk3328 in dts Rocky Hao
` (3 preceding siblings ...)
2017-07-25 9:09 ` [PATCH 4/5] arm64: dts: rockchip: add thermal nodes " Rocky Hao
@ 2017-07-25 9:16 ` Rocky Hao
4 siblings, 0 replies; 10+ messages in thread
From: Rocky Hao @ 2017-07-25 9:16 UTC (permalink / raw)
To: rui.zhang, edubezval, heiko, robh+dt, mark.rutland,
catalin.marinas, will.deacon
Cc: shawn.lin, cl, william.wu, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, devicetree, xxx, jay.xu, wxt,
huangtao, rocky.hao
enable tsadc module on RK3328 eavluation board
Change-Id: Ieb45a02b90dae3fbefe7d2b571b3961412d866ad
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
---
arch/arm64/boot/dts/rockchip/rk3328-evb.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-evb.dts b/arch/arm64/boot/dts/rockchip/rk3328-evb.dts
index 8c61d91bf89b..e7db0dc97ce0 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328-evb.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-evb.dts
@@ -52,6 +52,10 @@
};
};
+&tsadc {
+ status = "okay";
+};
+
&uart2 {
status = "okay";
};
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/5] dt-bindings: rockchip-thermal: Support the RK3328 SoC compatible
[not found] ` <1500973788-14627-2-git-send-email-rocky.hao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
@ 2017-07-27 6:36 ` Heiko Stübner
2017-07-27 6:49 ` rocky.hao
0 siblings, 1 reply; 10+ messages in thread
From: Heiko Stübner @ 2017-07-27 6:36 UTC (permalink / raw)
To: Rocky Hao
Cc: rui.zhang-ral2JQCrhuEAvxtiuMwx3w,
edubezval-Re5JQEeQqe8AvxtiuMwx3w, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
mark.rutland-5wv7dgnIgG8, catalin.marinas-5wv7dgnIgG8,
will.deacon-5wv7dgnIgG8, shawn.lin-TNX95d0MmH7DzftRWevZcw,
cl-TNX95d0MmH7DzftRWevZcw, william.wu-TNX95d0MmH7DzftRWevZcw,
linux-pm-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, xxx-TNX95d0MmH7DzftRWevZcw,
jay.xu-TNX95d0MmH7DzftRWevZcw, wxt-TNX95d0MmH7DzftRWevZcw,
huangtao-TNX95d0MmH7DzftRWevZcw
Hi Rocky,
Am Dienstag, 25. Juli 2017, 17:09:44 CEST schrieb Rocky Hao:
> attempt to new compatible for thermal founding on RK3328 SoC.
>
> Change-Id: Ie6f6d7b4e545891a0035851a923c0412f584140c
> Signed-off-by: Rocky Hao <rocky.hao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
generally looks good but you should not have gerrit Change-Ids in patches
for mainline. This is true for all patches in this series.
Heiko
> ---
> Documentation/devicetree/bindings/thermal/rockchip-thermal.txt | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/thermal/rockchip-thermal.txt
> b/Documentation/devicetree/bindings/thermal/rockchip-thermal.txt index
> 43003aec94bd..e3a6234fb1ac 100644
> --- a/Documentation/devicetree/bindings/thermal/rockchip-thermal.txt
> +++ b/Documentation/devicetree/bindings/thermal/rockchip-thermal.txt
> @@ -4,6 +4,7 @@ Required properties:
> - compatible : should be "rockchip,<name>-tsadc"
> "rockchip,rk3228-tsadc": found on RK3228 SoCs
> "rockchip,rk3288-tsadc": found on RK3288 SoCs
> + "rockchip,rk3328-tsadc": found on RK3328 SoCs
> "rockchip,rk3368-tsadc": found on RK3368 SoCs
> "rockchip,rk3399-tsadc": found on RK3399 SoCs
> - reg : physical base address of the controller and length of memory mapped
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/5] dt-bindings: rockchip-thermal: Support the RK3328 SoC compatible
2017-07-27 6:36 ` Heiko Stübner
@ 2017-07-27 6:49 ` rocky.hao
0 siblings, 0 replies; 10+ messages in thread
From: rocky.hao @ 2017-07-27 6:49 UTC (permalink / raw)
To: Heiko Stübner
Cc: rui.zhang, edubezval, robh+dt, mark.rutland, catalin.marinas,
will.deacon, shawn.lin, cl, william.wu, linux-pm,
linux-arm-kernel, linux-rockchip, linux-kernel, devicetree, xxx,
jay.xu, wxt, huangtao
Hi Heiko,
Thank you for the quick reply. I will remove the gerrit Change-Ids in my
v2 patches.
Thanks again,
Rocky
在 2017/7/27 14:36, Heiko Stübner 写道:
> Hi Rocky,
>
> Am Dienstag, 25. Juli 2017, 17:09:44 CEST schrieb Rocky Hao:
>> attempt to new compatible for thermal founding on RK3328 SoC.
>>
>> Change-Id: Ie6f6d7b4e545891a0035851a923c0412f584140c
>> Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
>
> generally looks good but you should not have gerrit Change-Ids in patches
> for mainline. This is true for all patches in this series.
>
>
> Heiko
>
>> ---
>> Documentation/devicetree/bindings/thermal/rockchip-thermal.txt | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/Documentation/devicetree/bindings/thermal/rockchip-thermal.txt
>> b/Documentation/devicetree/bindings/thermal/rockchip-thermal.txt index
>> 43003aec94bd..e3a6234fb1ac 100644
>> --- a/Documentation/devicetree/bindings/thermal/rockchip-thermal.txt
>> +++ b/Documentation/devicetree/bindings/thermal/rockchip-thermal.txt
>> @@ -4,6 +4,7 @@ Required properties:
>> - compatible : should be "rockchip,<name>-tsadc"
>> "rockchip,rk3228-tsadc": found on RK3228 SoCs
>> "rockchip,rk3288-tsadc": found on RK3288 SoCs
>> + "rockchip,rk3328-tsadc": found on RK3328 SoCs
>> "rockchip,rk3368-tsadc": found on RK3368 SoCs
>> "rockchip,rk3399-tsadc": found on RK3399 SoCs
>> - reg : physical base address of the controller and length of memory mapped
>
>
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/5] thermal: rockchip: Support the RK3328 SOC in thermal driver
2017-07-25 9:09 ` [PATCH 2/5] thermal: rockchip: Support the RK3328 SOC in thermal driver Rocky Hao
@ 2017-08-11 3:02 ` Zhang Rui
[not found] ` <1502420573.2598.7.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Zhang Rui @ 2017-08-11 3:02 UTC (permalink / raw)
To: Rocky Hao, edubezval, heiko, robh+dt, mark.rutland,
catalin.marinas, will.deacon
Cc: shawn.lin, cl, william.wu, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, devicetree, xxx, jay.xu, wxt,
huangtao
On Tue, 2017-07-25 at 17:09 +0800, Rocky Hao wrote:
> RK3328 SOC has one Temperature Sensor for CPU.
>
> Change-Id: I176c76bae1801d815a513986cfefcb55272c69a8
> Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
Caesar,
what do you think of this patch?
thanks,
rui
> ---
> drivers/thermal/rockchip_thermal.c | 65
> ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 65 insertions(+)
>
> diff --git a/drivers/thermal/rockchip_thermal.c
> b/drivers/thermal/rockchip_thermal.c
> index 4c7796512453..206035139110 100644
> --- a/drivers/thermal/rockchip_thermal.c
> +++ b/drivers/thermal/rockchip_thermal.c
> @@ -320,6 +320,44 @@ struct tsadc_table {
> {0, 125000},
> };
>
> +static const struct tsadc_table rk3328_code_table[] = {
> + {0, -40000},
> + {296, -40000},
> + {304, -35000},
> + {313, -30000},
> + {331, -20000},
> + {340, -15000},
> + {349, -10000},
> + {359, -5000},
> + {368, 0},
> + {378, 5000},
> + {388, 10000},
> + {398, 15000},
> + {408, 20000},
> + {418, 25000},
> + {429, 30000},
> + {440, 35000},
> + {451, 40000},
> + {462, 45000},
> + {473, 50000},
> + {485, 55000},
> + {496, 60000},
> + {508, 65000},
> + {521, 70000},
> + {533, 75000},
> + {546, 80000},
> + {559, 85000},
> + {572, 90000},
> + {586, 95000},
> + {600, 100000},
> + {614, 105000},
> + {629, 110000},
> + {644, 115000},
> + {659, 120000},
> + {675, 125000},
> + {TSADCV2_DATA_MASK, 125000},
> +};
> +
> static const struct tsadc_table rk3368_code_table[] = {
> {0, -40000},
> {106, -40000},
> @@ -790,6 +828,29 @@ static void rk_tsadcv2_tshut_mode(int chn, void
> __iomem *regs,
> },
> };
>
> +static const struct rockchip_tsadc_chip rk3328_tsadc_data = {
> + .chn_id[SENSOR_CPU] = 0, /* cpu sensor is channel 0 */
> + .chn_num = 1, /* one channels for tsadc */
> +
> + .tshut_mode = TSHUT_MODE_CRU, /* default TSHUT via CRU */
> + .tshut_temp = 95000,
> +
> + .initialize = rk_tsadcv2_initialize,
> + .irq_ack = rk_tsadcv3_irq_ack,
> + .control = rk_tsadcv3_control,
> + .get_temp = rk_tsadcv2_get_temp,
> + .set_alarm_temp = rk_tsadcv2_alarm_temp,
> + .set_tshut_temp = rk_tsadcv2_tshut_temp,
> + .set_tshut_mode = rk_tsadcv2_tshut_mode,
> +
> + .table = {
> + .id = rk3328_code_table,
> + .length = ARRAY_SIZE(rk3328_code_table),
> + .data_mask = TSADCV2_DATA_MASK,
> + .mode = ADC_INCREMENT,
> + },
> +};
> +
> static const struct rockchip_tsadc_chip rk3366_tsadc_data = {
> .chn_id[SENSOR_CPU] = 0, /* cpu sensor is channel 0 */
> .chn_id[SENSOR_GPU] = 1, /* gpu sensor is channel 1 */
> @@ -875,6 +936,10 @@ static void rk_tsadcv2_tshut_mode(int chn, void
> __iomem *regs,
> .data = (void *)&rk3288_tsadc_data,
> },
> {
> + .compatible = "rockchip,rk3328-tsadc",
> + .data = (void *)&rk3328_tsadc_data,
> + },
> + {
> .compatible = "rockchip,rk3366-tsadc",
> .data = (void *)&rk3366_tsadc_data,
> },
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/5] thermal: rockchip: Support the RK3328 SOC in thermal driver
[not found] ` <1502420573.2598.7.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2017-08-11 4:03 ` Caesar Wang
0 siblings, 0 replies; 10+ messages in thread
From: Caesar Wang @ 2017-08-11 4:03 UTC (permalink / raw)
To: Zhang Rui, Rocky Hao, edubezval-Re5JQEeQqe8AvxtiuMwx3w,
heiko-4mtYJXux2i+zQB+pC5nmwQ, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
mark.rutland-5wv7dgnIgG8, catalin.marinas-5wv7dgnIgG8,
will.deacon-5wv7dgnIgG8, wxt-TNX95d0MmH7DzftRWevZcw
Cc: huangtao-TNX95d0MmH7DzftRWevZcw,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-pm-u79uwXL29TY76Z2rM5mHXA, shawn.lin-TNX95d0MmH7DzftRWevZcw,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
cl-TNX95d0MmH7DzftRWevZcw, william.wu-TNX95d0MmH7DzftRWevZcw,
jay.xu-TNX95d0MmH7DzftRWevZcw, xxx-TNX95d0MmH7DzftRWevZcw,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
在 2017年08月11日 11:02, Zhang Rui 写道:
> On Tue, 2017-07-25 at 17:09 +0800, Rocky Hao wrote:
>> RK3328 SOC has one Temperature Sensor for CPU.
>>
>> Change-Id: I176c76bae1801d815a513986cfefcb55272c69a8
>> Signed-off-by: Rocky Hao <rocky.hao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Reviewed-by: Caesar Wang <wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> Caesar,
>
> what do you think of this patch?
Have a look at the rk3328's TRM, looks good to me.
-Caesar
>
> thanks,
> rui
>
>> ---
>> drivers/thermal/rockchip_thermal.c | 65
>> ++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 65 insertions(+)
>>
>> diff --git a/drivers/thermal/rockchip_thermal.c
>> b/drivers/thermal/rockchip_thermal.c
>> index 4c7796512453..206035139110 100644
>> --- a/drivers/thermal/rockchip_thermal.c
>> +++ b/drivers/thermal/rockchip_thermal.c
>> @@ -320,6 +320,44 @@ struct tsadc_table {
>> {0, 125000},
>> };
>>
>> +static const struct tsadc_table rk3328_code_table[] = {
>> + {0, -40000},
>> + {296, -40000},
>> + {304, -35000},
>> + {313, -30000},
>> + {331, -20000},
>> + {340, -15000},
>> + {349, -10000},
>> + {359, -5000},
>> + {368, 0},
>> + {378, 5000},
>> + {388, 10000},
>> + {398, 15000},
>> + {408, 20000},
>> + {418, 25000},
>> + {429, 30000},
>> + {440, 35000},
>> + {451, 40000},
>> + {462, 45000},
>> + {473, 50000},
>> + {485, 55000},
>> + {496, 60000},
>> + {508, 65000},
>> + {521, 70000},
>> + {533, 75000},
>> + {546, 80000},
>> + {559, 85000},
>> + {572, 90000},
>> + {586, 95000},
>> + {600, 100000},
>> + {614, 105000},
>> + {629, 110000},
>> + {644, 115000},
>> + {659, 120000},
>> + {675, 125000},
>> + {TSADCV2_DATA_MASK, 125000},
>> +};
>> +
>> static const struct tsadc_table rk3368_code_table[] = {
>> {0, -40000},
>> {106, -40000},
>> @@ -790,6 +828,29 @@ static void rk_tsadcv2_tshut_mode(int chn, void
>> __iomem *regs,
>> },
>> };
>>
>> +static const struct rockchip_tsadc_chip rk3328_tsadc_data = {
>> + .chn_id[SENSOR_CPU] = 0, /* cpu sensor is channel 0 */
>> + .chn_num = 1, /* one channels for tsadc */
>> +
>> + .tshut_mode = TSHUT_MODE_CRU, /* default TSHUT via CRU */
>> + .tshut_temp = 95000,
>> +
>> + .initialize = rk_tsadcv2_initialize,
>> + .irq_ack = rk_tsadcv3_irq_ack,
>> + .control = rk_tsadcv3_control,
>> + .get_temp = rk_tsadcv2_get_temp,
>> + .set_alarm_temp = rk_tsadcv2_alarm_temp,
>> + .set_tshut_temp = rk_tsadcv2_tshut_temp,
>> + .set_tshut_mode = rk_tsadcv2_tshut_mode,
>> +
>> + .table = {
>> + .id = rk3328_code_table,
>> + .length = ARRAY_SIZE(rk3328_code_table),
>> + .data_mask = TSADCV2_DATA_MASK,
>> + .mode = ADC_INCREMENT,
>> + },
>> +};
>> +
>> static const struct rockchip_tsadc_chip rk3366_tsadc_data = {
>> .chn_id[SENSOR_CPU] = 0, /* cpu sensor is channel 0 */
>> .chn_id[SENSOR_GPU] = 1, /* gpu sensor is channel 1 */
>> @@ -875,6 +936,10 @@ static void rk_tsadcv2_tshut_mode(int chn, void
>> __iomem *regs,
>> .data = (void *)&rk3288_tsadc_data,
>> },
>> {
>> + .compatible = "rockchip,rk3328-tsadc",
>> + .data = (void *)&rk3328_tsadc_data,
>> + },
>> + {
>> .compatible = "rockchip,rk3366-tsadc",
>> .data = (void *)&rk3366_tsadc_data,
>> },
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-08-11 4:03 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-25 9:09 [PATCH 0/5] thermal: rockchip: add tsadc support in thermal driver and IPA thermal control for rk3328 in dts Rocky Hao
2017-07-25 9:09 ` [PATCH 1/5] dt-bindings: rockchip-thermal: Support the RK3328 SoC compatible Rocky Hao
[not found] ` <1500973788-14627-2-git-send-email-rocky.hao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-07-27 6:36 ` Heiko Stübner
2017-07-27 6:49 ` rocky.hao
2017-07-25 9:09 ` [PATCH 2/5] thermal: rockchip: Support the RK3328 SOC in thermal driver Rocky Hao
2017-08-11 3:02 ` Zhang Rui
[not found] ` <1502420573.2598.7.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-08-11 4:03 ` Caesar Wang
2017-07-25 9:09 ` [PATCH 3/5] arm64: dts: rockchip: add tsadc node for rk3328 SoC Rocky Hao
2017-07-25 9:09 ` [PATCH 4/5] arm64: dts: rockchip: add thermal nodes " Rocky Hao
2017-07-25 9:16 ` [PATCH 5/5] arm64: dts: rockchip: Enable tsadc module on RK3328 eavluation board Rocky Hao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).