* v3 Exynos5422 odroidxu3 pwm-fan control using thermal sensors
@ 2015-04-12 14:54 Anand Moon
2015-04-12 14:54 ` [PATCH v3 1/6] ARM: dts :exynos5422-odroidxu3 Add pwm-fan node to the Odroid-XU3 board Anand Moon
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Anand Moon @ 2015-04-12 14:54 UTC (permalink / raw)
To: Lukasz Majewski, Guenter Roeck, Eduardo Valentin, Sjoerd Simons,
Markus Reichl, Russell King, Kukjin Kim
Cc: devicetree, linux-samsung-soc, linux-arm-kernel
This work depeds upon work done by Lukasz Majewski <l.majewski@samsung.com>
and Sjoerd Simons <sjoerd.simons@collabora.co.uk> regarding the pwm-fan.
Changes from v1
fixed the registration of thermal sensor to tmu_cpu0
Dropped patches.
0005-pwm-samsung-Fix-output-race-on-disabling.patch
0006-hwmon-pwm-fan-Update-the-duty-cycle-inorder-to-contr.patch
changes from v2
Added patch
0006-hwmon-pwm-fan-Update-the-duty-cycle-inorder-to-contr.patch
-Anand Moon
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 1/6] ARM: dts :exynos5422-odroidxu3 Add pwm-fan node to the Odroid-XU3 board.
2015-04-12 14:54 v3 Exynos5422 odroidxu3 pwm-fan control using thermal sensors Anand Moon
@ 2015-04-12 14:54 ` Anand Moon
2015-04-12 14:54 ` [PATCH v3 2/6] ARM: dts: OdroidXU3: Enable TMU at Exynos5422 base Anand Moon
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Anand Moon @ 2015-04-12 14:54 UTC (permalink / raw)
To: Lukasz Majewski, Guenter Roeck, Eduardo Valentin, Sjoerd Simons,
Markus Reichl, Russell King, Kukjin Kim
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, Anand Moon
Add pwm-fan node to the OdroidXU3 board.
Tested on OdroidXU3 board.
Changes since v1 : None
Changes since v2 : None
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
arch/arm/boot/dts/exynos5422-odroidxu3.dts | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
index a519c86..04d982b 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts
+++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
@@ -278,6 +278,15 @@
rtc@101E0000 {
status = "okay";
};
+
+ fan0: pwm-fan {
+ compatible = "pwm-fan";
+ pwms = <&pwm 0 20972 0>;
+ cooling-min-state = <0>;
+ cooling-max-state = <3>;
+ #cooling-cells = <2>;
+ cooling-levels = <0 130 170 230>;
+ };
};
&hdmi {
@@ -369,3 +378,10 @@
shunt-resistor = <10000>;
};
};
+
+&pwm {
+ pinctrl-0 = <&pwm0_out>;
+ pinctrl-names = "default";
+ samsung,pwm-outputs = <0>;
+ status = "okay";
+};
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 2/6] ARM: dts: OdroidXU3: Enable TMU at Exynos5422 base.
2015-04-12 14:54 v3 Exynos5422 odroidxu3 pwm-fan control using thermal sensors Anand Moon
2015-04-12 14:54 ` [PATCH v3 1/6] ARM: dts :exynos5422-odroidxu3 Add pwm-fan node to the Odroid-XU3 board Anand Moon
@ 2015-04-12 14:54 ` Anand Moon
2015-04-12 14:54 ` [PATCH v3 3/6] ARM: dts: define default thermal-zones for exynos5 Anand Moon
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Anand Moon @ 2015-04-12 14:54 UTC (permalink / raw)
To: Lukasz Majewski, Guenter Roeck, Eduardo Valentin, Sjoerd Simons,
Markus Reichl, Russell King, Kukjin Kim
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, Anand Moon
This commit enables TMU IP block on the Exynos5422 OdroidXU3
device.
Tested on OdroidXU3 board.
Changes since v1 : None
Changes since v2 : None
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
arch/arm/boot/dts/exynos5422-odroidxu3.dts | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
index 04d982b..6e7ee53 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts
+++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
@@ -287,6 +287,31 @@
#cooling-cells = <2>;
cooling-levels = <0 130 170 230>;
};
+
+ tmu@10060000 {
+ vtmu-supply = <&ldo10_reg>;
+ status = "okay";
+ };
+
+ tmu@10064000 {
+ vtmu-supply = <&ldo10_reg>;
+ status = "okay";
+ };
+
+ tmu@10068000 {
+ vtmu-supply = <&ldo10_reg>;
+ status = "okay";
+ };
+
+ tmu@1006c000 {
+ vtmu-supply = <&ldo10_reg>;
+ status = "okay";
+ };
+
+ tmu@100a0000 {
+ vtmu-supply = <&ldo10_reg>;
+ status = "okay";
+ };
};
&hdmi {
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 3/6] ARM: dts: define default thermal-zones for exynos5
2015-04-12 14:54 v3 Exynos5422 odroidxu3 pwm-fan control using thermal sensors Anand Moon
2015-04-12 14:54 ` [PATCH v3 1/6] ARM: dts :exynos5422-odroidxu3 Add pwm-fan node to the Odroid-XU3 board Anand Moon
2015-04-12 14:54 ` [PATCH v3 2/6] ARM: dts: OdroidXU3: Enable TMU at Exynos5422 base Anand Moon
@ 2015-04-12 14:54 ` Anand Moon
2015-04-12 14:54 ` [PATCH v3 4/6] ARM: dts exynos5420 update the cooling cells for core cpu0 Anand Moon
[not found] ` <1428850452-4178-1-git-send-email-linux.amoon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
4 siblings, 0 replies; 10+ messages in thread
From: Anand Moon @ 2015-04-12 14:54 UTC (permalink / raw)
To: Lukasz Majewski, Guenter Roeck, Eduardo Valentin, Sjoerd Simons,
Markus Reichl, Russell King, Kukjin Kim
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, Anand Moon
Trip points corresponding to the one defined in the exynos_tmu_data.c
for Exynos5 have been included.
This thermal-zones attribute is afterwards reused for Exynos5422.
Changes since v1 : Fixed the thernal_sensor registration of the sensors tmu_cpu0
Changes since v2 : None
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
arch/arm/boot/dts/exynos5-cpu-thermal.dtsi | 59 ++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
create mode 100644 arch/arm/boot/dts/exynos5-cpu-thermal.dtsi
diff --git a/arch/arm/boot/dts/exynos5-cpu-thermal.dtsi b/arch/arm/boot/dts/exynos5-cpu-thermal.dtsi
new file mode 100644
index 0000000..3ce8872
--- /dev/null
+++ b/arch/arm/boot/dts/exynos5-cpu-thermal.dtsi
@@ -0,0 +1,59 @@
+/*
+ * Device tree sources for Exynos5 thermal zone
+ *
+ * Copyright (c) 2015 Lukasz Majewski <l.majewski@samsung.com>
+ * Anand Moon <linux.amoon@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <dt-bindings/thermal/thermal.h>
+
+/ {
+ thermal-zones {
+ cpu0_thermal: cpu0-thermal {
+ thermal-sensors = <&tmu_cpu0 0>;
+ polling-delay-passive = <0>;
+ polling-delay = <0>;
+ trips {
+ cpu_alert0: cpu-alert-0 {
+ temperature = <50000>; /* millicelsius */
+ hysteresis = <5000>; /* millicelsius */
+ type = "active";
+ };
+ cpu_alert1: cpu-alert-1 {
+ temperature = <60000>; /* millicelsius */
+ hysteresis = <5000>; /* millicelsius */
+ type = "active";
+ };
+ cpu_alert2: cpu-alert-2 {
+ temperature = <70000>; /* millicelsius */
+ hysteresis = <5000>; /* millicelsius */
+ type = "active";
+ };
+ cpu_crit0: cpu-crit-0 {
+ temperature = <100000>; /* millicelsius */
+ hysteresis = <0>; /* millicelsius */
+ type = "critical";
+ };
+ };
+ cooling-maps {
+ map0 {
+ trip = <&cpu_alert0>;
+ cooling-device = <&fan0 0 1>;
+ };
+ map1 {
+ trip = <&cpu_alert1>;
+ cooling-device = <&fan0 1 2>;
+ };
+ map2 {
+ trip = <&cpu_alert2>;
+ cooling-device = <&fan0 2 3>;
+ };
+ };
+ };
+ };
+};
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 4/6] ARM: dts exynos5420 update the cooling cells for core cpu0
2015-04-12 14:54 v3 Exynos5422 odroidxu3 pwm-fan control using thermal sensors Anand Moon
` (2 preceding siblings ...)
2015-04-12 14:54 ` [PATCH v3 3/6] ARM: dts: define default thermal-zones for exynos5 Anand Moon
@ 2015-04-12 14:54 ` Anand Moon
[not found] ` <1428850452-4178-1-git-send-email-linux.amoon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
4 siblings, 0 replies; 10+ messages in thread
From: Anand Moon @ 2015-04-12 14:54 UTC (permalink / raw)
To: Lukasz Majewski, Guenter Roeck, Eduardo Valentin, Sjoerd Simons,
Markus Reichl, Russell King, Kukjin Kim
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, Anand Moon
update the cooling level for cpu0 to avoid following message.
root@odroidxu3:~# dmesg | grep ther
[ 0.241511] /thermal-zones/cpu-thermal/cooling-maps/map0:
could not get #cooling-cells for /cpus/cpu@0
Tested on OdroidXU3
Changes since v1 : None
Changes since v2 : None
Tested-by: Markus Reichl <m.reichl@fivetechno.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
arch/arm/boot/dts/exynos5420.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index c0e98cf..6b49f3c 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -61,6 +61,10 @@
reg = <0x0>;
clock-frequency = <1800000000>;
cci-control-port = <&cci_control1>;
+
+ cooling-min-level = <10>;
+ cooling-max-level = <7>;
+ #cooling-cells = <2>; /* min followed by max */
};
cpu1: cpu@1 {
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 5/6] ARM: dts: Enable thermal_zone for exynos5422.
[not found] ` <1428850452-4178-1-git-send-email-linux.amoon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-04-12 14:54 ` Anand Moon
2015-04-12 14:54 ` [PATCH v3 6/6] hwmon: pwm-fan: Update the duty cycle inorder to control the pwm-fan Anand Moon
1 sibling, 0 replies; 10+ messages in thread
From: Anand Moon @ 2015-04-12 14:54 UTC (permalink / raw)
To: Lukasz Majewski, Guenter Roeck, Eduardo Valentin, Sjoerd Simons,
Markus Reichl, Russell King, Kukjin Kim
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Anand Moon
Include exynos5-cpu-thermal.dtsi to enable thermal_zone support.
Changes since v1 : Seperate the include previous patch.
Changes since v2 : None
Tested-by: Markus Reichl <m.reichl-SRyzfwRm/0rPTwkrwQOX7A@public.gmane.org>
Acked-by: Lukasz Majewski <l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Signed-off-by: Anand Moon <linux.amoon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
arch/arm/boot/dts/exynos5422-odroidxu3.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
index 6e7ee53..16a5f10 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts
+++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
@@ -12,6 +12,7 @@
/dts-v1/;
#include "exynos5800.dtsi"
+#include "exynos5-cpu-thermal.dtsi"
/ {
model = "Hardkernel Odroid XU3";
--
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 related [flat|nested] 10+ messages in thread
* [PATCH v3 6/6] hwmon: pwm-fan: Update the duty cycle inorder to control the pwm-fan
[not found] ` <1428850452-4178-1-git-send-email-linux.amoon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-04-12 14:54 ` [PATCH v3 5/6] ARM: dts: Enable thermal_zone for exynos5422 Anand Moon
@ 2015-04-12 14:54 ` Anand Moon
2015-04-12 15:07 ` Guenter Roeck
1 sibling, 1 reply; 10+ messages in thread
From: Anand Moon @ 2015-04-12 14:54 UTC (permalink / raw)
To: Lukasz Majewski, Guenter Roeck, Eduardo Valentin, Sjoerd Simons,
Markus Reichl, Russell King, Kukjin Kim
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Anand Moon
In order to disable the PWM we need to update using following sequence.
pwm_config(pwm, 0, period);
pwm_disable(pwm);
pwm_config() with a zero duty cycle to make it clear the timer and update the PWM registers.
pwm_disable will clear the TCON_AUTORELOAD(tcon_chan) and update the PWM register.
Next change in state will get trigger unless a new PWM cycle happened.
pwm_config(pwm, duty, period);
pwm_enable(pwm);
Through pwm_config we update the duty cycle and period and update the PWM register.
pwm_enable will update the state to TCON_MANUALUPDATE(tcon_chan)
and TCON_START(tcon_chan) | TCON_AUTORELOAD(tcon_chan) and update the PWM register.
Reported-by: Markus Reichl <m.reichl-SRyzfwRm/0rPTwkrwQOX7A@public.gmane.org>
Tested-by: Markus Reichl <m.reichl-SRyzfwRm/0rPTwkrwQOX7A@public.gmane.org>
Reviewed-by: Lukasz Majewski <l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Reviewed-by: Sjoerd Simons <sjoerd.simons-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
Signed-off-by: Anand Moon <linux.amoon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/hwmon/pwm-fan.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
index 7c83dc4..f25c841 100644
--- a/drivers/hwmon/pwm-fan.c
+++ b/drivers/hwmon/pwm-fan.c
@@ -44,26 +44,24 @@ static int __set_pwm(struct pwm_fan_ctx *ctx, unsigned long pwm)
int ret = 0;
mutex_lock(&ctx->lock);
+
if (ctx->pwm_value == pwm)
goto exit_set_pwm_err;
- if (pwm == 0) {
- pwm_disable(ctx->pwm);
- goto exit_set_pwm;
- }
-
duty = DIV_ROUND_UP(pwm * (ctx->pwm->period - 1), MAX_PWM);
ret = pwm_config(ctx->pwm, duty, ctx->pwm->period);
if (ret)
goto exit_set_pwm_err;
+ if (pwm == 0)
+ pwm_disable(ctx->pwm);
+
if (ctx->pwm_value == 0) {
ret = pwm_enable(ctx->pwm);
if (ret)
goto exit_set_pwm_err;
}
-exit_set_pwm:
ctx->pwm_value = pwm;
exit_set_pwm_err:
mutex_unlock(&ctx->lock);
--
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 related [flat|nested] 10+ messages in thread
* Re: [PATCH v3 6/6] hwmon: pwm-fan: Update the duty cycle inorder to control the pwm-fan
2015-04-12 14:54 ` [PATCH v3 6/6] hwmon: pwm-fan: Update the duty cycle inorder to control the pwm-fan Anand Moon
@ 2015-04-12 15:07 ` Guenter Roeck
[not found] ` <552A8A1C.9000409-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2015-04-12 15:07 UTC (permalink / raw)
To: Anand Moon, Lukasz Majewski, Eduardo Valentin, Sjoerd Simons,
Markus Reichl, Russell King, Kukjin Kim
Cc: devicetree, linux-arm-kernel, linux-samsung-soc
On 04/12/2015 07:54 AM, Anand Moon wrote:
> In order to disable the PWM we need to update using following sequence.
>
> pwm_config(pwm, 0, period);
> pwm_disable(pwm);
>
> pwm_config() with a zero duty cycle to make it clear the timer and update the PWM registers.
> pwm_disable will clear the TCON_AUTORELOAD(tcon_chan) and update the PWM register.
>
There is no TCON_AUTORELOAD in this driver. Future developers will have no idea
what you are talking about here. Please provide a generic comment.
> Next change in state will get trigger unless a new PWM cycle happened.
>
That sentence is difficult to parse. Actually, I have no idea what it is supposed to mean.
> pwm_config(pwm, duty, period);
> pwm_enable(pwm);
>
> Through pwm_config we update the duty cycle and period and update the PWM register.
> pwm_enable will update the state to TCON_MANUALUPDATE(tcon_chan)
> and TCON_START(tcon_chan) | TCON_AUTORELOAD(tcon_chan) and update the PWM register.
>
This sentence does not make sense in the context of the pwm-fan driver.
> Reported-by: Markus Reichl <m.reichl@fivetechno.de>
> Tested-by: Markus Reichl <m.reichl@fivetechno.de>
> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
> Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
> drivers/hwmon/pwm-fan.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
> index 7c83dc4..f25c841 100644
> --- a/drivers/hwmon/pwm-fan.c
> +++ b/drivers/hwmon/pwm-fan.c
> @@ -44,26 +44,24 @@ static int __set_pwm(struct pwm_fan_ctx *ctx, unsigned long pwm)
> int ret = 0;
>
> mutex_lock(&ctx->lock);
> +
Please refrain from making unnecessary whitespace changes.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 6/6] hwmon: pwm-fan: Update the duty cycle inorder to control the pwm-fan
[not found] ` <552A8A1C.9000409-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
@ 2015-04-12 15:29 ` Anand Moon
2015-04-12 15:41 ` Guenter Roeck
0 siblings, 1 reply; 10+ messages in thread
From: Anand Moon @ 2015-04-12 15:29 UTC (permalink / raw)
To: Guenter Roeck
Cc: Lukasz Majewski, Eduardo Valentin, Sjoerd Simons, Markus Reichl,
Russell King, Kukjin Kim, devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
hi Guenter,
I am referring to #linux/drivers/pwm/pwm-samsung.c
Will update the comment.
-Anand Moon
On 12 April 2015 at 20:37, Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> wrote:
> On 04/12/2015 07:54 AM, Anand Moon wrote:
>>
>> In order to disable the PWM we need to update using following sequence.
>>
>> pwm_config(pwm, 0, period);
>> pwm_disable(pwm);
>>
>> pwm_config() with a zero duty cycle to make it clear the timer and update
>> the PWM registers.
>> pwm_disable will clear the TCON_AUTORELOAD(tcon_chan) and update the PWM
>> register.
>>
> There is no TCON_AUTORELOAD in this driver. Future developers will have no
> idea
> what you are talking about here. Please provide a generic comment.
>
>> Next change in state will get trigger unless a new PWM cycle happened.
>>
> That sentence is difficult to parse. Actually, I have no idea what it is
> supposed to mean.
>
>> pwm_config(pwm, duty, period);
>> pwm_enable(pwm);
>>
>> Through pwm_config we update the duty cycle and period and update the PWM
>> register.
>> pwm_enable will update the state to TCON_MANUALUPDATE(tcon_chan)
>> and TCON_START(tcon_chan) | TCON_AUTORELOAD(tcon_chan) and update the PWM
>> register.
>>
> This sentence does not make sense in the context of the pwm-fan driver.
>
>> Reported-by: Markus Reichl <m.reichl-SRyzfwRm/0rPTwkrwQOX7A@public.gmane.org>
>> Tested-by: Markus Reichl <m.reichl-SRyzfwRm/0rPTwkrwQOX7A@public.gmane.org>
>> Reviewed-by: Lukasz Majewski <l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>> Reviewed-by: Sjoerd Simons <sjoerd.simons-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
>> Signed-off-by: Anand Moon <linux.amoon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>> drivers/hwmon/pwm-fan.c | 10 ++++------
>> 1 file changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
>> index 7c83dc4..f25c841 100644
>> --- a/drivers/hwmon/pwm-fan.c
>> +++ b/drivers/hwmon/pwm-fan.c
>> @@ -44,26 +44,24 @@ static int __set_pwm(struct pwm_fan_ctx *ctx,
>> unsigned long pwm)
>> int ret = 0;
>>
>> mutex_lock(&ctx->lock);
>> +
>
>
> Please refrain from making unnecessary whitespace changes.
>
> Thanks,
> Guenter
>
--
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 v3 6/6] hwmon: pwm-fan: Update the duty cycle inorder to control the pwm-fan
2015-04-12 15:29 ` Anand Moon
@ 2015-04-12 15:41 ` Guenter Roeck
0 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2015-04-12 15:41 UTC (permalink / raw)
To: Anand Moon
Cc: Lukasz Majewski, Eduardo Valentin, Sjoerd Simons, Markus Reichl,
Russell King, Kukjin Kim, devicetree, linux-arm-kernel,
linux-samsung-soc@vger.kernel.org
On 04/12/2015 08:29 AM, Anand Moon wrote:
> hi Guenter,
>
> I am referring to #linux/drivers/pwm/pwm-samsung.c
>
> Will update the comment.
>
Sure, but that doesn't help as patch description for the pwm-fan driver.
Guenter
> -Anand Moon
>
> On 12 April 2015 at 20:37, Guenter Roeck <linux@roeck-us.net> wrote:
>> On 04/12/2015 07:54 AM, Anand Moon wrote:
>>>
>>> In order to disable the PWM we need to update using following sequence.
>>>
>>> pwm_config(pwm, 0, period);
>>> pwm_disable(pwm);
>>>
>>> pwm_config() with a zero duty cycle to make it clear the timer and update
>>> the PWM registers.
>>> pwm_disable will clear the TCON_AUTORELOAD(tcon_chan) and update the PWM
>>> register.
>>>
>> There is no TCON_AUTORELOAD in this driver. Future developers will have no
>> idea
>> what you are talking about here. Please provide a generic comment.
>>
>>> Next change in state will get trigger unless a new PWM cycle happened.
>>>
>> That sentence is difficult to parse. Actually, I have no idea what it is
>> supposed to mean.
>>
>>> pwm_config(pwm, duty, period);
>>> pwm_enable(pwm);
>>>
>>> Through pwm_config we update the duty cycle and period and update the PWM
>>> register.
>>> pwm_enable will update the state to TCON_MANUALUPDATE(tcon_chan)
>>> and TCON_START(tcon_chan) | TCON_AUTORELOAD(tcon_chan) and update the PWM
>>> register.
>>>
>> This sentence does not make sense in the context of the pwm-fan driver.
>>
>>> Reported-by: Markus Reichl <m.reichl@fivetechno.de>
>>> Tested-by: Markus Reichl <m.reichl@fivetechno.de>
>>> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
>>> Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
>>> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
>>> ---
>>> drivers/hwmon/pwm-fan.c | 10 ++++------
>>> 1 file changed, 4 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
>>> index 7c83dc4..f25c841 100644
>>> --- a/drivers/hwmon/pwm-fan.c
>>> +++ b/drivers/hwmon/pwm-fan.c
>>> @@ -44,26 +44,24 @@ static int __set_pwm(struct pwm_fan_ctx *ctx,
>>> unsigned long pwm)
>>> int ret = 0;
>>>
>>> mutex_lock(&ctx->lock);
>>> +
>>
>>
>> Please refrain from making unnecessary whitespace changes.
>>
>> Thanks,
>> Guenter
>>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-04-12 15:41 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-12 14:54 v3 Exynos5422 odroidxu3 pwm-fan control using thermal sensors Anand Moon
2015-04-12 14:54 ` [PATCH v3 1/6] ARM: dts :exynos5422-odroidxu3 Add pwm-fan node to the Odroid-XU3 board Anand Moon
2015-04-12 14:54 ` [PATCH v3 2/6] ARM: dts: OdroidXU3: Enable TMU at Exynos5422 base Anand Moon
2015-04-12 14:54 ` [PATCH v3 3/6] ARM: dts: define default thermal-zones for exynos5 Anand Moon
2015-04-12 14:54 ` [PATCH v3 4/6] ARM: dts exynos5420 update the cooling cells for core cpu0 Anand Moon
[not found] ` <1428850452-4178-1-git-send-email-linux.amoon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-04-12 14:54 ` [PATCH v3 5/6] ARM: dts: Enable thermal_zone for exynos5422 Anand Moon
2015-04-12 14:54 ` [PATCH v3 6/6] hwmon: pwm-fan: Update the duty cycle inorder to control the pwm-fan Anand Moon
2015-04-12 15:07 ` Guenter Roeck
[not found] ` <552A8A1C.9000409-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2015-04-12 15:29 ` Anand Moon
2015-04-12 15:41 ` Guenter Roeck
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).