devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs
@ 2013-04-19 16:38 Lukasz Majewski
  2013-04-19 16:38 ` [PATCH 1/6] clk:exynos4:TMU Thermal Measurement Unit clock added to common clock framework Lukasz Majewski
                   ` (7 more replies)
  0 siblings, 8 replies; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-19 16:38 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: Mike Turquette, Zhang Rui, devicetree-discuss, linux-samsung-soc,
	Linux PM list, Amit Daniel Kachhap, Lukasz Majewski

This patch series provide various fixes for TMU block.
Namely, support for common clock framework and proper regulator VDD_TS has been 
added.
Moreover device tree definitions and documentation entry are now in place.

Lukasz Majewski (6):
  clk:exynos4:TMU Thermal Measurement Unit clock added to common clock
    framework
  thermal:exynos4: TMU Common clock framework support for TMU (Thermal
    Monitoring Unit)
  thermal:exynos4: TMU device tree support for Exynos4412 targets
  thermal: Support for TMU regulator defined at device tree
  thermal:exynos4: Enable support for Exynos4412 SoCs
  thermal:exynos4: Add documentation for Exynos SoC thermal bindings

 .../devicetree/bindings/clock/exynos4-clock.txt    |    1 +
 .../devicetree/bindings/thermal/exynos-thermal.txt |   22 +++++++++++
 arch/arm/boot/dts/exynos4x12.dtsi                  |   10 +++++
 drivers/clk/samsung/clk-exynos4.c                  |    6 ++-
 drivers/thermal/exynos_thermal.c                   |   41 +++++++++++++++-----
 5 files changed, 70 insertions(+), 10 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/thermal/exynos-thermal.txt

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH 1/6] clk:exynos4:TMU Thermal Measurement Unit clock added to common clock framework
  2013-04-19 16:38 [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Lukasz Majewski
@ 2013-04-19 16:38 ` Lukasz Majewski
  2013-04-19 16:38 ` [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit) Lukasz Majewski
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-19 16:38 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: Mike Turquette, Zhang Rui, devicetree-discuss, linux-samsung-soc,
	Linux PM list, Amit Daniel Kachhap, Lukasz Majewski,
	Kyungmin Park

TMU is now supported with a exynos4 common clock framework.
"tmu_apbif" clock has been defined with a common clock framework.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Mike Turquette <mturquette@linaro.org>
---
 Documentation/devicetree/bindings/clock/exynos4-clock.txt |    1 +
 drivers/clk/samsung/clk-exynos4.c                         |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/clock/exynos4-clock.txt b/Documentation/devicetree/bindings/clock/exynos4-clock.txt
index ea5e26f..9afe6cb 100644
--- a/Documentation/devicetree/bindings/clock/exynos4-clock.txt
+++ b/Documentation/devicetree/bindings/clock/exynos4-clock.txt
@@ -235,6 +235,7 @@ Exynos4 SoC and this is specified where applicable.
   spi0_isp_sclk       380     Exynos4x12
   spi1_isp_sclk       381     Exynos4x12
   uart_isp_sclk       382     Exynos4x12
+  tmu_apbif           383
 
 		[Mux Clocks]
 
diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c
index 7104669..66c4ce4 100644
--- a/drivers/clk/samsung/clk-exynos4.c
+++ b/drivers/clk/samsung/clk-exynos4.c
@@ -170,7 +170,7 @@ enum exynos4_clks {
 	gicisp, smmu_isp, smmu_drc, smmu_fd, smmu_lite0, smmu_lite1, mcuctl_isp,
 	mpwm_isp, i2c0_isp, i2c1_isp, mtcadc_isp, pwm_isp, wdt_isp, uart_isp,
 	asyncaxim, smmu_ispcx, spi0_isp, spi1_isp, pwm_isp_sclk, spi0_isp_sclk,
-	spi1_isp_sclk, uart_isp_sclk,
+	spi1_isp_sclk, uart_isp_sclk, tmu_apbif,
 
 	/* mux clocks */
 	mout_fimc0 = 384, mout_fimc1, mout_fimc2, mout_fimc3, mout_cam0,
@@ -807,6 +807,8 @@ struct samsung_gate_clock exynos4210_gate_clks[] __initdata = {
 	GATE_A(wdt, "watchdog", "aclk100", E4210_GATE_IP_PERIR, 14, 0, 0, "watchdog"),
 	GATE_A(rtc, "rtc", "aclk100", E4210_GATE_IP_PERIR, 15, 0, 0, "rtc"),
 	GATE_A(keyif, "keyif", "aclk100", E4210_GATE_IP_PERIR, 16, 0, 0, "keypad"),
+	GATE_A(tmu_apbif, "tmu_apbif", "aclk100",
+	       E4210_GATE_IP_PERIR, 17, 0, 0, "tmu_apbif"),
 	GATE_DA(sclk_fimd1, "exynos4-fb.1", "sclk_fimd1", "div_fimd1",
 			E4210_SRC_MASK_LCD1, 0, CLK_SET_RATE_PARENT, 0, "sclk_fimd"),
 };
@@ -834,6 +836,8 @@ struct samsung_gate_clock exynos4x12_gate_clks[] __initdata = {
 	GATE_A(rtc, "rtc", "aclk100", E4X12_GATE_IP_PERIR, 15, 0, 0, "rtc"),
 	GATE_A(keyif, "keyif", "aclk100",
 			E4X12_GATE_IP_PERIR, 16, 0, 0, "keypad"),
+	GATE_A(tmu_apbif, "tmu_apbif", "aclk100",
+			E4X12_GATE_IP_PERIR, 17, 0, 0, "tmu_apbif"),
 	GATE(sclk_pwm_isp, "sclk_pwm_isp", "div_pwm_isp",
 			E4X12_SRC_MASK_ISP, 0, CLK_SET_RATE_PARENT, 0),
 	GATE(sclk_spi0_isp, "sclk_spi0_isp", "div_spi0_isp_pre",
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit)
  2013-04-19 16:38 [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Lukasz Majewski
  2013-04-19 16:38 ` [PATCH 1/6] clk:exynos4:TMU Thermal Measurement Unit clock added to common clock framework Lukasz Majewski
@ 2013-04-19 16:38 ` Lukasz Majewski
  2013-04-19 17:26   ` Eduardo Valentin
  2013-04-19 18:08   ` Sachin Kamat
  2013-04-19 16:38 ` [PATCH 3/6] thermal:exynos4: TMU device tree support for Exynos4412 targets Lukasz Majewski
                   ` (5 subsequent siblings)
  7 siblings, 2 replies; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-19 16:38 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: Mike Turquette, Zhang Rui, devicetree-discuss, linux-samsung-soc,
	Linux PM list, Amit Daniel Kachhap, Lukasz Majewski,
	Kyungmin Park

This patch modifies exynos_thermal.c file to use clk_disable_unprepare()
and clk_prepare_enable() instead of clk_{enable|disable}.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/thermal/exynos_thermal.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index 46568c0..ba6094c 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -584,7 +584,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
 	int ret = 0, threshold_code, i, trigger_levs = 0;
 
 	mutex_lock(&data->lock);
-	clk_enable(data->clk);
+	clk_prepare_enable(data->clk);
 
 	status = readb(data->base + EXYNOS_TMU_REG_STATUS);
 	if (!status) {
@@ -655,7 +655,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
 				data->base + EXYNOS_TMU_REG_INTCLEAR);
 	}
 out:
-	clk_disable(data->clk);
+	clk_disable_unprepare(data->clk);
 	mutex_unlock(&data->lock);
 
 	return ret;
@@ -668,7 +668,7 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on)
 	unsigned int con, interrupt_en;
 
 	mutex_lock(&data->lock);
-	clk_enable(data->clk);
+	clk_prepare_enable(data->clk);
 
 	con = pdata->reference_voltage << EXYNOS_TMU_REF_VOLTAGE_SHIFT |
 		pdata->gain << EXYNOS_TMU_GAIN_SHIFT;
@@ -693,7 +693,7 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on)
 	writel(interrupt_en, data->base + EXYNOS_TMU_REG_INTEN);
 	writel(con, data->base + EXYNOS_TMU_REG_CONTROL);
 
-	clk_disable(data->clk);
+	clk_disable_unprepare(data->clk);
 	mutex_unlock(&data->lock);
 }
 
@@ -703,12 +703,12 @@ static int exynos_tmu_read(struct exynos_tmu_data *data)
 	int temp;
 
 	mutex_lock(&data->lock);
-	clk_enable(data->clk);
+	clk_prepare_enable(data->clk);
 
 	temp_code = readb(data->base + EXYNOS_TMU_REG_CURRENT_TEMP);
 	temp = code_to_temp(data, temp_code);
 
-	clk_disable(data->clk);
+	clk_disable_unprepare(data->clk);
 	mutex_unlock(&data->lock);
 
 	return temp;
@@ -721,7 +721,7 @@ static void exynos_tmu_work(struct work_struct *work)
 
 	exynos_report_trigger();
 	mutex_lock(&data->lock);
-	clk_enable(data->clk);
+	clk_prepare_enable(data->clk);
 	if (data->soc == SOC_ARCH_EXYNOS)
 		writel(EXYNOS_TMU_CLEAR_RISE_INT |
 				EXYNOS_TMU_CLEAR_FALL_INT,
@@ -729,7 +729,7 @@ static void exynos_tmu_work(struct work_struct *work)
 	else
 		writel(EXYNOS4210_TMU_INTCLEAR_VAL,
 				data->base + EXYNOS_TMU_REG_INTCLEAR);
-	clk_disable(data->clk);
+	clk_disable_unprepare(data->clk);
 	mutex_unlock(&data->lock);
 
 	enable_irq(data->irq);
@@ -985,7 +985,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	data->clk = clk_get(NULL, "tmu_apbif");
+	data->clk = clk_get(&pdev->dev, "tmu_apbif");
 	if (IS_ERR(data->clk)) {
 		dev_err(&pdev->dev, "Failed to get clock\n");
 		return  PTR_ERR(data->clk);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH 3/6] thermal:exynos4: TMU device tree support for Exynos4412 targets
  2013-04-19 16:38 [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Lukasz Majewski
  2013-04-19 16:38 ` [PATCH 1/6] clk:exynos4:TMU Thermal Measurement Unit clock added to common clock framework Lukasz Majewski
  2013-04-19 16:38 ` [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit) Lukasz Majewski
@ 2013-04-19 16:38 ` Lukasz Majewski
  2013-04-19 17:28   ` Eduardo Valentin
  2013-04-22  4:19   ` Sachin Kamat
  2013-04-19 16:38 ` [PATCH 4/6] thermal: Support for TMU regulator defined at device tree Lukasz Majewski
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-19 16:38 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: Mike Turquette, Zhang Rui, devicetree-discuss, linux-samsung-soc,
	Linux PM list, Amit Daniel Kachhap, Lukasz Majewski,
	Kyungmin Park

Device tree support for TMU at Exynos4x12 targets.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 arch/arm/boot/dts/exynos4x12.dtsi |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
index e3380a7..ee920b3 100644
--- a/arch/arm/boot/dts/exynos4x12.dtsi
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -79,4 +79,14 @@
 		interrupts = <0 89 0>;
 		status = "disabled";
 	};
+
+	tmu@100C0000 {
+		compatible = "samsung,exynos4412-tmu";
+		interrupt-parent = <&combiner>;
+		reg = <0x100C0000 0x100>;
+		interrupts = <2 4>;
+		clocks = <&clock 383>;
+		clock-names = "tmu_apbif";
+		status = "disabled";
+	};
 };
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH 4/6] thermal: Support for TMU regulator defined at device tree
  2013-04-19 16:38 [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Lukasz Majewski
                   ` (2 preceding siblings ...)
  2013-04-19 16:38 ` [PATCH 3/6] thermal:exynos4: TMU device tree support for Exynos4412 targets Lukasz Majewski
@ 2013-04-19 16:38 ` Lukasz Majewski
  2013-04-19 17:23   ` Eduardo Valentin
  2013-04-19 16:38 ` [PATCH 5/6] thermal:exynos4: Enable support for Exynos4412 SoCs Lukasz Majewski
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-19 16:38 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: Mike Turquette, Zhang Rui, devicetree-discuss, linux-samsung-soc,
	Linux PM list, Amit Daniel Kachhap, Lukasz Majewski,
	Kyungmin Park

TMU probe function now checks for a device tree defined regulator.
For compatibility reasons it is allowed to probe driver even without
this regulator defined.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/thermal/exynos_thermal.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index ba6094c..e922fa4 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -38,6 +38,7 @@
 #include <linux/cpufreq.h>
 #include <linux/cpu_cooling.h>
 #include <linux/of.h>
+#include <linux/regulator/consumer.h>
 
 #include <plat/cpu.h>
 
@@ -119,6 +120,8 @@
 
 #define EXYNOS_ZONE_COUNT	3
 
+#define EXYNOS_TMU_REGULATOR "vdd_ts"
+
 struct exynos_tmu_data {
 	struct exynos_tmu_platform_data *pdata;
 	struct resource *mem;
@@ -944,6 +947,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 {
 	struct exynos_tmu_data *data;
 	struct exynos_tmu_platform_data *pdata = pdev->dev.platform_data;
+	struct regulator *reg;
 	int ret, i;
 
 	if (!pdata)
@@ -953,6 +957,21 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "No platform init data supplied.\n");
 		return -ENODEV;
 	}
+
+	reg = regulator_get(&pdev->dev, EXYNOS_TMU_REGULATOR);
+	if (!IS_ERR(reg)) {
+		ret = regulator_enable(reg);
+		if (ret) {
+			dev_err(&pdev->dev, "Regulator %s not enabled.\n",
+				EXYNOS_TMU_REGULATOR);
+			return ret;
+		}
+	} else {
+		dev_info(&pdev->dev,
+			 "Regulator %s not defined at device tree.\n",
+			 EXYNOS_TMU_REGULATOR);
+	}
+
 	data = devm_kzalloc(&pdev->dev, sizeof(struct exynos_tmu_data),
 					GFP_KERNEL);
 	if (!data) {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH 5/6] thermal:exynos4: Enable support for Exynos4412 SoCs
  2013-04-19 16:38 [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Lukasz Majewski
                   ` (3 preceding siblings ...)
  2013-04-19 16:38 ` [PATCH 4/6] thermal: Support for TMU regulator defined at device tree Lukasz Majewski
@ 2013-04-19 16:38 ` Lukasz Majewski
  2013-04-19 18:11   ` Sachin Kamat
  2013-04-22  6:25   ` amit kachhap
  2013-04-19 16:38 ` [PATCH 6/6] thermal:exynos4: Add documentation for Exynos SoC thermal bindings Lukasz Majewski
                   ` (2 subsequent siblings)
  7 siblings, 2 replies; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-19 16:38 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: Mike Turquette, Zhang Rui, devicetree-discuss, linux-samsung-soc,
	Linux PM list, Amit Daniel Kachhap, Lukasz Majewski,
	Kyungmin Park

Enable TMU support for Exynos4412 based target with device tree.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/thermal/exynos_thermal.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index e922fa4..f54066d 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -819,6 +819,10 @@ static const struct of_device_id exynos_tmu_match[] = {
 		.data = (void *)EXYNOS4210_TMU_DRV_DATA,
 	},
 	{
+		.compatible = "samsung,exynos4412-tmu",
+		.data = (void *)EXYNOS_TMU_DRV_DATA,
+	},
+	{
 		.compatible = "samsung,exynos5250-tmu",
 		.data = (void *)EXYNOS_TMU_DRV_DATA,
 	},
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH 6/6] thermal:exynos4: Add documentation for Exynos SoC thermal bindings
  2013-04-19 16:38 [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Lukasz Majewski
                   ` (4 preceding siblings ...)
  2013-04-19 16:38 ` [PATCH 5/6] thermal:exynos4: Enable support for Exynos4412 SoCs Lukasz Majewski
@ 2013-04-19 16:38 ` Lukasz Majewski
  2013-04-22  4:55   ` Sachin Kamat
  2013-04-22 16:51 ` [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Kukjin Kim
  2013-04-25 12:30 ` [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support Lukasz Majewski
  7 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-19 16:38 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: Mike Turquette, Zhang Rui, devicetree-discuss, linux-samsung-soc,
	Linux PM list, Amit Daniel Kachhap, Lukasz Majewski,
	Kyungmin Park

Proper description for Exynos4 bindings added to Documentation/devicetree/
bindings

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 .../devicetree/bindings/thermal/exynos-thermal.txt |   22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/exynos-thermal.txt

diff --git a/Documentation/devicetree/bindings/thermal/exynos-thermal.txt b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
new file mode 100644
index 0000000..e994e1e
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
@@ -0,0 +1,22 @@
+* Exynos Thermal
+
+Required properties:
+- compatible : "samsung,exynos4412-tmu"
+- interrupts-parent : The phandle for the interrupt controller
+- reg : Address range of the thermal registers
+- interrupts : Should contain interrupt for thermal system
+- clocks : The main clock for TMU device
+- clocks-names : Thermal system clock name
+- status : Initial state of the device
+
+Example:
+
+	tmu@100C0000 {
+		compatible = "samsung,exynos4412-tmu";
+		interrupt-parent = <&combiner>;
+		reg = <0x100C0000 0x100>;
+		interrupts = <2 4>;
+		clocks = <&clock 383>;
+		clock-names = "tmu_apbif";
+		status = "disabled";
+	};
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* Re: [PATCH 4/6] thermal: Support for TMU regulator defined at device tree
  2013-04-19 16:38 ` [PATCH 4/6] thermal: Support for TMU regulator defined at device tree Lukasz Majewski
@ 2013-04-19 17:23   ` Eduardo Valentin
  2013-04-23  6:23     ` Lukasz Majewski
  0 siblings, 1 reply; 57+ messages in thread
From: Eduardo Valentin @ 2013-04-19 17:23 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui, devicetree-discuss,
	linux-samsung-soc, Linux PM list, Amit Daniel Kachhap,
	Kyungmin Park, eduardo.valentin

On 19-04-2013 12:38, Lukasz Majewski wrote:
> TMU probe function now checks for a device tree defined regulator.
> For compatibility reasons it is allowed to probe driver even without
> this regulator defined.
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>   drivers/thermal/exynos_thermal.c |   19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
>
> diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
> index ba6094c..e922fa4 100644
> --- a/drivers/thermal/exynos_thermal.c
> +++ b/drivers/thermal/exynos_thermal.c
> @@ -38,6 +38,7 @@
>   #include <linux/cpufreq.h>
>   #include <linux/cpu_cooling.h>
>   #include <linux/of.h>
> +#include <linux/regulator/consumer.h>
>
>   #include <plat/cpu.h>
>
> @@ -119,6 +120,8 @@
>
>   #define EXYNOS_ZONE_COUNT	3
>
> +#define EXYNOS_TMU_REGULATOR "vdd_ts"
> +
>   struct exynos_tmu_data {
>   	struct exynos_tmu_platform_data *pdata;
>   	struct resource *mem;
> @@ -944,6 +947,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>   {
>   	struct exynos_tmu_data *data;
>   	struct exynos_tmu_platform_data *pdata = pdev->dev.platform_data;
> +	struct regulator *reg;
>   	int ret, i;
>
>   	if (!pdata)
> @@ -953,6 +957,21 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>   		dev_err(&pdev->dev, "No platform init data supplied.\n");
>   		return -ENODEV;
>   	}
> +
> +	reg = regulator_get(&pdev->dev, EXYNOS_TMU_REGULATOR);
> +	if (!IS_ERR(reg)) {
> +		ret = regulator_enable(reg);
> +		if (ret) {
> +			dev_err(&pdev->dev, "Regulator %s not enabled.\n",
> +				EXYNOS_TMU_REGULATOR);
> +			return ret;
> +		}
> +	} else {
> +		dev_info(&pdev->dev,
> +			 "Regulator %s not defined at device tree.\n",
> +			 EXYNOS_TMU_REGULATOR);
Maybe a dev_warn would fit better?

> +	}
> +
>   	data = devm_kzalloc(&pdev->dev, sizeof(struct exynos_tmu_data),
>   					GFP_KERNEL);
>   	if (!data) {
>


^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit)
  2013-04-19 16:38 ` [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit) Lukasz Majewski
@ 2013-04-19 17:26   ` Eduardo Valentin
  2013-04-19 18:08   ` Sachin Kamat
  1 sibling, 0 replies; 57+ messages in thread
From: Eduardo Valentin @ 2013-04-19 17:26 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui, devicetree-discuss,
	linux-samsung-soc, Linux PM list, Amit Daniel Kachhap,
	Kyungmin Park, eduardo.valentin

On 19-04-2013 12:38, Lukasz Majewski wrote:
> This patch modifies exynos_thermal.c file to use clk_disable_unprepare()
> and clk_prepare_enable() instead of clk_{enable|disable}.
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>   drivers/thermal/exynos_thermal.c |   18 +++++++++---------
>   1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
> index 46568c0..ba6094c 100644
> --- a/drivers/thermal/exynos_thermal.c
> +++ b/drivers/thermal/exynos_thermal.c
> @@ -584,7 +584,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
>   	int ret = 0, threshold_code, i, trigger_levs = 0;
>
>   	mutex_lock(&data->lock);
> -	clk_enable(data->clk);
> +	clk_prepare_enable(data->clk);
>
>   	status = readb(data->base + EXYNOS_TMU_REG_STATUS);
>   	if (!status) {
> @@ -655,7 +655,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
>   				data->base + EXYNOS_TMU_REG_INTCLEAR);
>   	}
>   out:
> -	clk_disable(data->clk);
> +	clk_disable_unprepare(data->clk);
>   	mutex_unlock(&data->lock);
>
>   	return ret;
> @@ -668,7 +668,7 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on)
>   	unsigned int con, interrupt_en;
>
>   	mutex_lock(&data->lock);
> -	clk_enable(data->clk);
> +	clk_prepare_enable(data->clk);
>
>   	con = pdata->reference_voltage << EXYNOS_TMU_REF_VOLTAGE_SHIFT |
>   		pdata->gain << EXYNOS_TMU_GAIN_SHIFT;
> @@ -693,7 +693,7 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on)
>   	writel(interrupt_en, data->base + EXYNOS_TMU_REG_INTEN);
>   	writel(con, data->base + EXYNOS_TMU_REG_CONTROL);
>
> -	clk_disable(data->clk);
> +	clk_disable_unprepare(data->clk);
>   	mutex_unlock(&data->lock);
>   }
>
> @@ -703,12 +703,12 @@ static int exynos_tmu_read(struct exynos_tmu_data *data)
>   	int temp;
>
>   	mutex_lock(&data->lock);
> -	clk_enable(data->clk);
> +	clk_prepare_enable(data->clk);
>
>   	temp_code = readb(data->base + EXYNOS_TMU_REG_CURRENT_TEMP);
>   	temp = code_to_temp(data, temp_code);
>
> -	clk_disable(data->clk);
> +	clk_disable_unprepare(data->clk);
>   	mutex_unlock(&data->lock);
>
>   	return temp;
> @@ -721,7 +721,7 @@ static void exynos_tmu_work(struct work_struct *work)
>
>   	exynos_report_trigger();
>   	mutex_lock(&data->lock);
> -	clk_enable(data->clk);
> +	clk_prepare_enable(data->clk);
>   	if (data->soc == SOC_ARCH_EXYNOS)
>   		writel(EXYNOS_TMU_CLEAR_RISE_INT |
>   				EXYNOS_TMU_CLEAR_FALL_INT,
> @@ -729,7 +729,7 @@ static void exynos_tmu_work(struct work_struct *work)
>   	else
>   		writel(EXYNOS4210_TMU_INTCLEAR_VAL,
>   				data->base + EXYNOS_TMU_REG_INTCLEAR);
> -	clk_disable(data->clk);
> +	clk_disable_unprepare(data->clk);
>   	mutex_unlock(&data->lock);
>
>   	enable_irq(data->irq);
> @@ -985,7 +985,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>   		return ret;
>   	}
>
> -	data->clk = clk_get(NULL, "tmu_apbif");
> +	data->clk = clk_get(&pdev->dev, "tmu_apbif");

This change does not seam to be part of the patch orginal purpose, at 
least not as described in your patch description.

>   	if (IS_ERR(data->clk)) {
>   		dev_err(&pdev->dev, "Failed to get clock\n");
>   		return  PTR_ERR(data->clk);
>

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 3/6] thermal:exynos4: TMU device tree support for Exynos4412 targets
  2013-04-19 16:38 ` [PATCH 3/6] thermal:exynos4: TMU device tree support for Exynos4412 targets Lukasz Majewski
@ 2013-04-19 17:28   ` Eduardo Valentin
  2013-04-23  6:18     ` Lukasz Majewski
  2013-04-22  4:19   ` Sachin Kamat
  1 sibling, 1 reply; 57+ messages in thread
From: Eduardo Valentin @ 2013-04-19 17:28 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui, devicetree-discuss,
	linux-samsung-soc, Linux PM list, Amit Daniel Kachhap,
	Kyungmin Park, eduardo.valentin

On 19-04-2013 12:38, Lukasz Majewski wrote:
> Device tree support for TMU at Exynos4x12 targets.
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>   arch/arm/boot/dts/exynos4x12.dtsi |   10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
> index e3380a7..ee920b3 100644
> --- a/arch/arm/boot/dts/exynos4x12.dtsi
> +++ b/arch/arm/boot/dts/exynos4x12.dtsi
> @@ -79,4 +79,14 @@
>   		interrupts = <0 89 0>;
>   		status = "disabled";
>   	};
> +
> +	tmu@100C0000 {
> +		compatible = "samsung,exynos4412-tmu";


Is this one already documented?

> +		interrupt-parent = <&combiner>;
> +		reg = <0x100C0000 0x100>;
> +		interrupts = <2 4>;
> +		clocks = <&clock 383>;
> +		clock-names = "tmu_apbif";
> +		status = "disabled";
> +	};
>   };
>

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit)
  2013-04-19 16:38 ` [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit) Lukasz Majewski
  2013-04-19 17:26   ` Eduardo Valentin
@ 2013-04-19 18:08   ` Sachin Kamat
  2013-04-23  6:17     ` Lukasz Majewski
  1 sibling, 1 reply; 57+ messages in thread
From: Sachin Kamat @ 2013-04-19 18:08 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui, devicetree-discuss,
	linux-samsung-soc, Linux PM list, Amit Daniel Kachhap,
	Kyungmin Park, eduardo.valentin

On 19 April 2013 22:08, Lukasz Majewski <l.majewski@samsung.com> wrote:
> This patch modifies exynos_thermal.c file to use clk_disable_unprepare()
> and clk_prepare_enable() instead of clk_{enable|disable}.
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---

I have already submitted a similar patch for this:
http://permalink.gmane.org/gmane.linux.power-management.general/33310


-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 5/6] thermal:exynos4: Enable support for Exynos4412 SoCs
  2013-04-19 16:38 ` [PATCH 5/6] thermal:exynos4: Enable support for Exynos4412 SoCs Lukasz Majewski
@ 2013-04-19 18:11   ` Sachin Kamat
  2013-04-19 18:21     ` Tomasz Figa
  2013-04-22  6:25   ` amit kachhap
  1 sibling, 1 reply; 57+ messages in thread
From: Sachin Kamat @ 2013-04-19 18:11 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui, devicetree-discuss,
	linux-samsung-soc, Linux PM list, Amit Daniel Kachhap,
	Kyungmin Park, eduardo.valentin

On 19 April 2013 22:08, Lukasz Majewski <l.majewski@samsung.com> wrote:
> Enable TMU support for Exynos4412 based target with device tree.
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---

I have already submitted a similar patch for doing this:
http://permalink.gmane.org/gmane.linux.power-management.general/33311


-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 5/6] thermal:exynos4: Enable support for Exynos4412 SoCs
  2013-04-19 18:11   ` Sachin Kamat
@ 2013-04-19 18:21     ` Tomasz Figa
  2013-04-19 18:26       ` Sachin Kamat
  0 siblings, 1 reply; 57+ messages in thread
From: Tomasz Figa @ 2013-04-19 18:21 UTC (permalink / raw)
  To: Sachin Kamat
  Cc: Lukasz Majewski, Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss, linux-samsung-soc, Linux PM list,
	Amit Daniel Kachhap, Kyungmin Park, eduardo.valentin

On Friday 19 of April 2013 23:41:29 Sachin Kamat wrote:
> On 19 April 2013 22:08, Lukasz Majewski <l.majewski@samsung.com> wrote:
> > Enable TMU support for Exynos4412 based target with device tree.
> > 
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> 
> I have already submitted a similar patch for doing this:
> http://permalink.gmane.org/gmane.linux.power-management.general/33311

Hmm, looks like we missed this series indeed. You haven't CC'ed linux-
samsung-soc mailing list, though. I guess this is the reason.

Best regards,
Tomasz

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 5/6] thermal:exynos4: Enable support for Exynos4412 SoCs
  2013-04-19 18:21     ` Tomasz Figa
@ 2013-04-19 18:26       ` Sachin Kamat
  0 siblings, 0 replies; 57+ messages in thread
From: Sachin Kamat @ 2013-04-19 18:26 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: Lukasz Majewski, Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss, linux-samsung-soc, Linux PM list,
	Amit Daniel Kachhap, Kyungmin Park, eduardo.valentin

On 19 April 2013 23:51, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> On Friday 19 of April 2013 23:41:29 Sachin Kamat wrote:
>> On 19 April 2013 22:08, Lukasz Majewski <l.majewski@samsung.com> wrote:
>> > Enable TMU support for Exynos4412 based target with device tree.
>> >
>> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
>> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> > ---
>>
>> I have already submitted a similar patch for doing this:
>> http://permalink.gmane.org/gmane.linux.power-management.general/33311
>
> Hmm, looks like we missed this series indeed. You haven't CC'ed linux-
> samsung-soc mailing list, though. I guess this is the reason.

Indeed I missed CCing  linux-samsung-soc mailing list; sorry about that.


-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 3/6] thermal:exynos4: TMU device tree support for Exynos4412 targets
  2013-04-19 16:38 ` [PATCH 3/6] thermal:exynos4: TMU device tree support for Exynos4412 targets Lukasz Majewski
  2013-04-19 17:28   ` Eduardo Valentin
@ 2013-04-22  4:19   ` Sachin Kamat
  2013-04-23  6:19     ` Lukasz Majewski
  1 sibling, 1 reply; 57+ messages in thread
From: Sachin Kamat @ 2013-04-22  4:19 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui, devicetree-discuss,
	linux-samsung-soc, Linux PM list, Amit Daniel Kachhap,
	Kyungmin Park

Hi Lukasz,

On 19 April 2013 22:08, Lukasz Majewski <l.majewski@samsung.com> wrote:
> Device tree support for TMU at Exynos4x12 targets.
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

nit: Subject for these kind of patches should start with "ARM: dts: ..."

Otherwise looks good to me.
> ---
>  arch/arm/boot/dts/exynos4x12.dtsi |   10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
> index e3380a7..ee920b3 100644
> --- a/arch/arm/boot/dts/exynos4x12.dtsi
> +++ b/arch/arm/boot/dts/exynos4x12.dtsi
> @@ -79,4 +79,14 @@
>                 interrupts = <0 89 0>;
>                 status = "disabled";
>         };
> +
> +       tmu@100C0000 {
> +               compatible = "samsung,exynos4412-tmu";
> +               interrupt-parent = <&combiner>;
> +               reg = <0x100C0000 0x100>;
> +               interrupts = <2 4>;
> +               clocks = <&clock 383>;
> +               clock-names = "tmu_apbif";
> +               status = "disabled";
> +       };
>  };
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 6/6] thermal:exynos4: Add documentation for Exynos SoC thermal bindings
  2013-04-19 16:38 ` [PATCH 6/6] thermal:exynos4: Add documentation for Exynos SoC thermal bindings Lukasz Majewski
@ 2013-04-22  4:55   ` Sachin Kamat
  2013-04-23  6:25     ` Lukasz Majewski
  0 siblings, 1 reply; 57+ messages in thread
From: Sachin Kamat @ 2013-04-22  4:55 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui, devicetree-discuss,
	linux-samsung-soc, Linux PM list, Amit Daniel Kachhap,
	Kyungmin Park

Hi Lukasz,

Thanks for adding this. Some comments inline.

On 19 April 2013 22:08, Lukasz Majewski <l.majewski@samsung.com> wrote:
> Proper description for Exynos4 bindings added to Documentation/devicetree/
> bindings
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  .../devicetree/bindings/thermal/exynos-thermal.txt |   22 ++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/thermal/exynos-thermal.txt
>
> diff --git a/Documentation/devicetree/bindings/thermal/exynos-thermal.txt b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
> new file mode 100644
> index 0000000..e994e1e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
> @@ -0,0 +1,22 @@
> +* Exynos Thermal

How about "Exynos Thermal Management Unit (TMU)"?

> +
> +Required properties:
> +- compatible : "samsung,exynos4412-tmu"
Should be one of the following:
"samsung,exynos4210-tmu"
"samsung,exynos4412-tmu"
"samsung,exynos5250-tmu"


> +- interrupts-parent : The phandle for the interrupt controller

s/interrupts-parent /interrupt-parent


> +- reg : Address range of the thermal registers
> +- interrupts : Should contain interrupt for thermal system
> +- clocks : The main clock for TMU device
> +- clocks-names : Thermal system clock name

s/clocks-names /clock-names
You may also choose to add "from common clock binding" for clocks and
clock-names properties above.

> +- status : Initial state of the device
You may remove this as it is quite obvious now. Even if you want to
retain this, it should be under 'Optional properties:'


-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 5/6] thermal:exynos4: Enable support for Exynos4412 SoCs
  2013-04-19 16:38 ` [PATCH 5/6] thermal:exynos4: Enable support for Exynos4412 SoCs Lukasz Majewski
  2013-04-19 18:11   ` Sachin Kamat
@ 2013-04-22  6:25   ` amit kachhap
  2013-04-22  6:35     ` Lukasz Majewski
  2013-04-22  6:40     ` Sachin Kamat
  1 sibling, 2 replies; 57+ messages in thread
From: amit kachhap @ 2013-04-22  6:25 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui, devicetree-discuss,
	linux-samsung-soc, Linux PM list, Kyungmin Park

Hi,

I have one suggestion,

On Fri, Apr 19, 2013 at 10:08 PM, Lukasz Majewski
<l.majewski@samsung.com> wrote:
> Enable TMU support for Exynos4412 based target with device tree.
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  drivers/thermal/exynos_thermal.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
> index e922fa4..f54066d 100644
> --- a/drivers/thermal/exynos_thermal.c
> +++ b/drivers/thermal/exynos_thermal.c
> @@ -819,6 +819,10 @@ static const struct of_device_id exynos_tmu_match[] = {
>                 .data = (void *)EXYNOS4210_TMU_DRV_DATA,
>         },
>         {
> +               .compatible = "samsung,exynos4412-tmu",
> +               .data = (void *)EXYNOS_TMU_DRV_DATA,
> +       },
Instead of adding a new compatible string, "exynos5250-tmu" name can
be re-used in the 4412 DT node file as 4412 and 5250 TMU controller
are same.

Thanks,
Amit Daniel
> +       {
>                 .compatible = "samsung,exynos5250-tmu",
>                 .data = (void *)EXYNOS_TMU_DRV_DATA,
>         },
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 5/6] thermal:exynos4: Enable support for Exynos4412 SoCs
  2013-04-22  6:25   ` amit kachhap
@ 2013-04-22  6:35     ` Lukasz Majewski
  2013-04-22  6:40     ` Sachin Kamat
  1 sibling, 0 replies; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-22  6:35 UTC (permalink / raw)
  To: amit kachhap
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui, devicetree-discuss,
	linux-samsung-soc, Linux PM list, Kyungmin Park

Hi amit,

> Hi,
> 
> I have one suggestion,
> 
> On Fri, Apr 19, 2013 at 10:08 PM, Lukasz Majewski
> <l.majewski@samsung.com> wrote:
> > Enable TMU support for Exynos4412 based target with device tree.
> >
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> >  drivers/thermal/exynos_thermal.c |    4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/thermal/exynos_thermal.c
> > b/drivers/thermal/exynos_thermal.c index e922fa4..f54066d 100644
> > --- a/drivers/thermal/exynos_thermal.c
> > +++ b/drivers/thermal/exynos_thermal.c
> > @@ -819,6 +819,10 @@ static const struct of_device_id
> > exynos_tmu_match[] = { .data = (void *)EXYNOS4210_TMU_DRV_DATA,
> >         },
> >         {
> > +               .compatible = "samsung,exynos4412-tmu",
> > +               .data = (void *)EXYNOS_TMU_DRV_DATA,
> > +       },
> Instead of adding a new compatible string, "exynos5250-tmu" name can
> be re-used in the 4412 DT node file as 4412 and 5250 TMU controller
> are same.

Good point.

> 
> Thanks,
> Amit Daniel
> > +       {
> >                 .compatible = "samsung,exynos5250-tmu",
> >                 .data = (void *)EXYNOS_TMU_DRV_DATA,
> >         },
> > --
> > 1.7.10.4
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-samsung-soc" in the body of a message to
> > majordomo@vger.kernel.org More majordomo info at
> > http://vger.kernel.org/majordomo-info.html



-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 5/6] thermal:exynos4: Enable support for Exynos4412 SoCs
  2013-04-22  6:25   ` amit kachhap
  2013-04-22  6:35     ` Lukasz Majewski
@ 2013-04-22  6:40     ` Sachin Kamat
  1 sibling, 0 replies; 57+ messages in thread
From: Sachin Kamat @ 2013-04-22  6:40 UTC (permalink / raw)
  To: amit kachhap
  Cc: Lukasz Majewski, Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss, linux-samsung-soc, Linux PM list,
	Kyungmin Park

On 22 April 2013 11:55, amit kachhap <amit.kachhap@gmail.com> wrote:
> Hi,
>
> I have one suggestion,
>
> On Fri, Apr 19, 2013 at 10:08 PM, Lukasz Majewski
> <l.majewski@samsung.com> wrote:
>> Enable TMU support for Exynos4412 based target with device tree.
>>
>> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>  drivers/thermal/exynos_thermal.c |    4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
>> index e922fa4..f54066d 100644
>> --- a/drivers/thermal/exynos_thermal.c
>> +++ b/drivers/thermal/exynos_thermal.c
>> @@ -819,6 +819,10 @@ static const struct of_device_id exynos_tmu_match[] = {
>>                 .data = (void *)EXYNOS4210_TMU_DRV_DATA,
>>         },
>>         {
>> +               .compatible = "samsung,exynos4412-tmu",
>> +               .data = (void *)EXYNOS_TMU_DRV_DATA,
>> +       },
> Instead of adding a new compatible string, "exynos5250-tmu" name can
> be re-used in the 4412 DT node file as 4412 and 5250 TMU controller
> are same.

In cases where they are the same, it was generally the previous
version of SoC that was added to the compatible list and re-used in
the higher ones. IIRC, in cases where exynos5 based string was already
defined a separate compatible string was added for exynos4 too (even
if they used same driver data).

-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs
  2013-04-19 16:38 [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Lukasz Majewski
                   ` (5 preceding siblings ...)
  2013-04-19 16:38 ` [PATCH 6/6] thermal:exynos4: Add documentation for Exynos SoC thermal bindings Lukasz Majewski
@ 2013-04-22 16:51 ` Kukjin Kim
  2013-04-23  6:26   ` Lukasz Majewski
  2013-04-25 12:30 ` [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support Lukasz Majewski
  7 siblings, 1 reply; 57+ messages in thread
From: Kukjin Kim @ 2013-04-22 16:51 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui, devicetree-discuss,
	linux-samsung-soc, Linux PM list, Amit Daniel Kachhap

On 04/20/13 01:38, Lukasz Majewski wrote:
> This patch series provide various fixes for TMU block.
> Namely, support for common clock framework and proper regulator VDD_TS has been
> added.
> Moreover device tree definitions and documentation entry are now in place.
>
> Lukasz Majewski (6):
>    clk:exynos4:TMU Thermal Measurement Unit clock added to common clock
>      framework
>    thermal:exynos4: TMU Common clock framework support for TMU (Thermal
>      Monitoring Unit)
>    thermal:exynos4: TMU device tree support for Exynos4412 targets
>    thermal: Support for TMU regulator defined at device tree
>    thermal:exynos4: Enable support for Exynos4412 SoCs
>    thermal:exynos4: Add documentation for Exynos SoC thermal bindings
>
>   .../devicetree/bindings/clock/exynos4-clock.txt    |    1 +
>   .../devicetree/bindings/thermal/exynos-thermal.txt |   22 +++++++++++
>   arch/arm/boot/dts/exynos4x12.dtsi                  |   10 +++++
>   drivers/clk/samsung/clk-exynos4.c                  |    6 ++-
>   drivers/thermal/exynos_thermal.c                   |   41 +++++++++++++++-----
>   5 files changed, 70 insertions(+), 10 deletions(-)
>   create mode 100644 Documentation/devicetree/bindings/thermal/exynos-thermal.txt
>
Lukasz, please address comments from ml.

Others looks good to me.

- Kukjin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit)
  2013-04-19 18:08   ` Sachin Kamat
@ 2013-04-23  6:17     ` Lukasz Majewski
  2013-04-23  7:15       ` Sachin Kamat
  0 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-23  6:17 UTC (permalink / raw)
  To: Sachin Kamat
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Kyungmin Park, eduardo.valentin@ti.com

Hi Sachin,

> On 19 April 2013 22:08, Lukasz Majewski <l.majewski@samsung.com>
> wrote:
> > This patch modifies exynos_thermal.c file to use
> > clk_disable_unprepare() and clk_prepare_enable() instead of
> > clk_{enable|disable}.
> >
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> 
> I have already submitted a similar patch for this:
> http://permalink.gmane.org/gmane.linux.power-management.general/33310
> 
> 

Thanks for pointing to the correct patch.

However, I've got a question:

The patch only changes clock names at exynos_tmu_{probe|remove}.

Correct me if I'm wrong, but shouldn't we also change clock_enable to
clk_prepare_enable at exynos_tmu_read()? (Are we guaranteed, that we
will NOT sleep there?)

-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 3/6] thermal:exynos4: TMU device tree support for Exynos4412 targets
  2013-04-19 17:28   ` Eduardo Valentin
@ 2013-04-23  6:18     ` Lukasz Majewski
  0 siblings, 0 replies; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-23  6:18 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Kyungmin Park

Hi Eduardo,

> On 19-04-2013 12:38, Lukasz Majewski wrote:
> > Device tree support for TMU at Exynos4x12 targets.
> >
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> >   arch/arm/boot/dts/exynos4x12.dtsi |   10 ++++++++++
> >   1 file changed, 10 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/exynos4x12.dtsi
> > b/arch/arm/boot/dts/exynos4x12.dtsi index e3380a7..ee920b3 100644
> > --- a/arch/arm/boot/dts/exynos4x12.dtsi
> > +++ b/arch/arm/boot/dts/exynos4x12.dtsi
> > @@ -79,4 +79,14 @@
> >   		interrupts = <0 89 0>;
> >   		status = "disabled";
> >   	};
> > +
> > +	tmu@100C0000 {
> > +		compatible = "samsung,exynos4412-tmu";
> 
> 
> Is this one already documented?

The last commit in the series provide a documentation.

> 
> > +		interrupt-parent = <&combiner>;
> > +		reg = <0x100C0000 0x100>;
> > +		interrupts = <2 4>;
> > +		clocks = <&clock 383>;
> > +		clock-names = "tmu_apbif";
> > +		status = "disabled";
> > +	};
> >   };
> >



-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 3/6] thermal:exynos4: TMU device tree support for Exynos4412 targets
  2013-04-22  4:19   ` Sachin Kamat
@ 2013-04-23  6:19     ` Lukasz Majewski
  0 siblings, 0 replies; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-23  6:19 UTC (permalink / raw)
  To: Sachin Kamat
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Kyungmin Park

Hi Sachin,

> Hi Lukasz,
> 
> On 19 April 2013 22:08, Lukasz Majewski <l.majewski@samsung.com>
> wrote:
> > Device tree support for TMU at Exynos4x12 targets.
> >
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> 
> nit: Subject for these kind of patches should start with "ARM:
> dts: ..."
> 
Ok, I will correct that.

> Otherwise looks good to me.

Good :-)

> > ---
> >  arch/arm/boot/dts/exynos4x12.dtsi |   10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/exynos4x12.dtsi
> > b/arch/arm/boot/dts/exynos4x12.dtsi index e3380a7..ee920b3 100644
> > --- a/arch/arm/boot/dts/exynos4x12.dtsi
> > +++ b/arch/arm/boot/dts/exynos4x12.dtsi
> > @@ -79,4 +79,14 @@
> >                 interrupts = <0 89 0>;
> >                 status = "disabled";
> >         };
> > +
> > +       tmu@100C0000 {
> > +               compatible = "samsung,exynos4412-tmu";
> > +               interrupt-parent = <&combiner>;
> > +               reg = <0x100C0000 0x100>;
> > +               interrupts = <2 4>;
> > +               clocks = <&clock 383>;
> > +               clock-names = "tmu_apbif";
> > +               status = "disabled";
> > +       };
> >  };
> > --
> > 1.7.10.4
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-samsung-soc" in the body of a message to
> > majordomo@vger.kernel.org More majordomo info at
> > http://vger.kernel.org/majordomo-info.html
> 
> 
> 



-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 4/6] thermal: Support for TMU regulator defined at device tree
  2013-04-19 17:23   ` Eduardo Valentin
@ 2013-04-23  6:23     ` Lukasz Majewski
  2013-04-23 15:01       ` Eduardo Valentin
  0 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-23  6:23 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Kyungmin Park

Hi Eduardo,

> On 19-04-2013 12:38, Lukasz Majewski wrote:
> > TMU probe function now checks for a device tree defined regulator.
> > For compatibility reasons it is allowed to probe driver even without
> > this regulator defined.
> >
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> >   drivers/thermal/exynos_thermal.c |   19 +++++++++++++++++++
> >   1 file changed, 19 insertions(+)
> >
> > diff --git a/drivers/thermal/exynos_thermal.c
> > b/drivers/thermal/exynos_thermal.c index ba6094c..e922fa4 100644
> > --- a/drivers/thermal/exynos_thermal.c
> > +++ b/drivers/thermal/exynos_thermal.c
> > @@ -38,6 +38,7 @@
> >   #include <linux/cpufreq.h>
> >   #include <linux/cpu_cooling.h>
> >   #include <linux/of.h>
> > +#include <linux/regulator/consumer.h>
> >
> >   #include <plat/cpu.h>
> >
> > @@ -119,6 +120,8 @@
> >
> >   #define EXYNOS_ZONE_COUNT	3
> >
> > +#define EXYNOS_TMU_REGULATOR "vdd_ts"
> > +
> >   struct exynos_tmu_data {
> >   	struct exynos_tmu_platform_data *pdata;
> >   	struct resource *mem;
> > @@ -944,6 +947,7 @@ static int exynos_tmu_probe(struct
> > platform_device *pdev) {
> >   	struct exynos_tmu_data *data;
> >   	struct exynos_tmu_platform_data *pdata =
> > pdev->dev.platform_data;
> > +	struct regulator *reg;
> >   	int ret, i;
> >
> >   	if (!pdata)
> > @@ -953,6 +957,21 @@ static int exynos_tmu_probe(struct
> > platform_device *pdev) dev_err(&pdev->dev, "No platform init data
> > supplied.\n"); return -ENODEV;
> >   	}
> > +
> > +	reg = regulator_get(&pdev->dev, EXYNOS_TMU_REGULATOR);
> > +	if (!IS_ERR(reg)) {
> > +		ret = regulator_enable(reg);
> > +		if (ret) {
> > +			dev_err(&pdev->dev, "Regulator %s not
> > enabled.\n",
> > +				EXYNOS_TMU_REGULATOR);
> > +			return ret;
> > +		}
> > +	} else {
> > +		dev_info(&pdev->dev,
> > +			 "Regulator %s not defined at device
> > tree.\n",
> > +			 EXYNOS_TMU_REGULATOR);
> Maybe a dev_warn would fit better?

This is a bit tricky. I first wanted to return -ENODEV when regulator
is not available. Then I understood, that some other SoCs (e.g.
Exynos5) will not work. 

The info here shall give a clear warn signal, that providing a
regulator for VDD_TS is crucial (since by default it can be connected
to other PMIC outputs and when other device puts down this regulator
the TMU will crash and shut down a system). 

> 
> > +	}
> > +
> >   	data = devm_kzalloc(&pdev->dev, sizeof(struct
> > exynos_tmu_data), GFP_KERNEL);
> >   	if (!data) {
> >



-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 6/6] thermal:exynos4: Add documentation for Exynos SoC thermal bindings
  2013-04-22  4:55   ` Sachin Kamat
@ 2013-04-23  6:25     ` Lukasz Majewski
  2013-04-23  7:09       ` Sachin Kamat
  0 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-23  6:25 UTC (permalink / raw)
  To: Sachin Kamat
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Kyungmin Park

Hi Sachin,

> Hi Lukasz,
> 
> Thanks for adding this. Some comments inline.
> 
> On 19 April 2013 22:08, Lukasz Majewski <l.majewski@samsung.com>
> wrote:
> > Proper description for Exynos4 bindings added to
> > Documentation/devicetree/ bindings
> >
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> >  .../devicetree/bindings/thermal/exynos-thermal.txt |   22
> > ++++++++++++++++++++ 1 file changed, 22 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/thermal/exynos-thermal.txt
> >
> > diff --git
> > a/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
> > b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt new
> > file mode 100644 index 0000000..e994e1e --- /dev/null
> > +++ b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
> > @@ -0,0 +1,22 @@
> > +* Exynos Thermal
> 
> How about "Exynos Thermal Management Unit (TMU)"?
> 
> > +
> > +Required properties:
> > +- compatible : "samsung,exynos4412-tmu"
> Should be one of the following:
> "samsung,exynos4210-tmu"
> "samsung,exynos4412-tmu"

So all thee names shall be added? Right?

> "samsung,exynos5250-tmu"
> 

> 
> > +- interrupts-parent : The phandle for the interrupt controller
> 
> s/interrupts-parent /interrupt-parent
> 
> 
> > +- reg : Address range of the thermal registers
> > +- interrupts : Should contain interrupt for thermal system
> > +- clocks : The main clock for TMU device
> > +- clocks-names : Thermal system clock name
> 
> s/clocks-names /clock-names
> You may also choose to add "from common clock binding" for clocks and
> clock-names properties above.
> 
> > +- status : Initial state of the device
> You may remove this as it is quite obvious now. Even if you want to
> retain this, it should be under 'Optional properties:'
> 
> 

Ok, I will correct those names.


-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs
  2013-04-22 16:51 ` [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Kukjin Kim
@ 2013-04-23  6:26   ` Lukasz Majewski
  2013-04-23  7:19     ` Sachin Kamat
  0 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-23  6:26 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: Mike Turquette, Zhang Rui, devicetree-discuss, linux-samsung-soc,
	Linux PM list, Amit Daniel Kachhap

Hi Kukjin,

> On 04/20/13 01:38, Lukasz Majewski wrote:
> > This patch series provide various fixes for TMU block.
> > Namely, support for common clock framework and proper regulator
> > VDD_TS has been added.
> > Moreover device tree definitions and documentation entry are now in
> > place.
> >
> > Lukasz Majewski (6):
> >    clk:exynos4:TMU Thermal Measurement Unit clock added to common
> > clock framework
> >    thermal:exynos4: TMU Common clock framework support for TMU
> > (Thermal Monitoring Unit)
> >    thermal:exynos4: TMU device tree support for Exynos4412 targets
> >    thermal: Support for TMU regulator defined at device tree
> >    thermal:exynos4: Enable support for Exynos4412 SoCs
> >    thermal:exynos4: Add documentation for Exynos SoC thermal
> > bindings
> >
> >   .../devicetree/bindings/clock/exynos4-clock.txt    |    1 +
> >   .../devicetree/bindings/thermal/exynos-thermal.txt |   22
> > +++++++++++ arch/arm/boot/dts/exynos4x12.dtsi                  |
> > 10 +++++ drivers/clk/samsung/clk-exynos4.c                  |    6
> > ++- drivers/thermal/exynos_thermal.c                   |   41
> > +++++++++++++++----- 5 files changed, 70 insertions(+), 10
> > deletions(-) create mode 100644
> > Documentation/devicetree/bindings/thermal/exynos-thermal.txt
> >
> Lukasz, please address comments from ml.
> 

Ok. I'm going to prepare v2

> Others looks good to me.
> 
> - Kukjin



-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 6/6] thermal:exynos4: Add documentation for Exynos SoC thermal bindings
  2013-04-23  6:25     ` Lukasz Majewski
@ 2013-04-23  7:09       ` Sachin Kamat
  0 siblings, 0 replies; 57+ messages in thread
From: Sachin Kamat @ 2013-04-23  7:09 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Kyungmin Park

Hi Lukasz,

On 23 April 2013 11:55, Lukasz Majewski <l.majewski@samsung.com> wrote:
> Hi Sachin,
>
>> Hi Lukasz,
>>
>> Thanks for adding this. Some comments inline.
>>
>> On 19 April 2013 22:08, Lukasz Majewski <l.majewski@samsung.com>
>> wrote:
>> > Proper description for Exynos4 bindings added to
>> > Documentation/devicetree/ bindings
>> >
>> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
>> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> > ---
>> >  .../devicetree/bindings/thermal/exynos-thermal.txt |   22
>> > ++++++++++++++++++++ 1 file changed, 22 insertions(+)
>> >  create mode 100644
>> > Documentation/devicetree/bindings/thermal/exynos-thermal.txt
>> >
>> > diff --git
>> > a/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
>> > b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt new
>> > file mode 100644 index 0000000..e994e1e --- /dev/null
>> > +++ b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
>> > @@ -0,0 +1,22 @@
>> > +* Exynos Thermal
>>
>> How about "Exynos Thermal Management Unit (TMU)"?
>>
>> > +
>> > +Required properties:
>> > +- compatible : "samsung,exynos4412-tmu"
>> Should be one of the following:
>> "samsung,exynos4210-tmu"
>> "samsung,exynos4412-tmu"
>
> So all thee names shall be added? Right?

Yes, you need to add all supported compatible strings.

---
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit)
  2013-04-23  6:17     ` Lukasz Majewski
@ 2013-04-23  7:15       ` Sachin Kamat
  2013-04-23  8:06         ` Lukasz Majewski
  0 siblings, 1 reply; 57+ messages in thread
From: Sachin Kamat @ 2013-04-23  7:15 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Kyungmin Park, eduardo.valentin@ti.com

Hi Lukasz,

On 23 April 2013 11:47, Lukasz Majewski <l.majewski@samsung.com> wrote:
> Hi Sachin,
>
>> On 19 April 2013 22:08, Lukasz Majewski <l.majewski@samsung.com>
>> wrote:
>> > This patch modifies exynos_thermal.c file to use
>> > clk_disable_unprepare() and clk_prepare_enable() instead of
>> > clk_{enable|disable}.
>> >
>> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
>> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> > ---
>>
>> I have already submitted a similar patch for this:
>> http://permalink.gmane.org/gmane.linux.power-management.general/33310
>>
>>
>
> Thanks for pointing to the correct patch.
>
> However, I've got a question:
>
> The patch only changes clock names at exynos_tmu_{probe|remove}.
>
> Correct me if I'm wrong, but shouldn't we also change clock_enable to
> clk_prepare_enable at exynos_tmu_read()? (Are we guaranteed, that we
> will NOT sleep there?)

Since clk_prepare does not do anything, i thought it was sufficient to
have it once in probe and then unprepare in remove.
Do you see a real problem in this implementation. If so I can update
it to use clk_prepare_enable at other places as well.


-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs
  2013-04-23  6:26   ` Lukasz Majewski
@ 2013-04-23  7:19     ` Sachin Kamat
  2013-04-23  8:01       ` Lukasz Majewski
  0 siblings, 1 reply; 57+ messages in thread
From: Sachin Kamat @ 2013-04-23  7:19 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui, devicetree-discuss,
	linux-samsung-soc, Linux PM list

Hi Lukasz,

On 23 April 2013 11:56, Lukasz Majewski <l.majewski@samsung.com> wrote:
> Hi Kukjin,
>
>> On 04/20/13 01:38, Lukasz Majewski wrote:
>> > This patch series provide various fixes for TMU block.
>> > Namely, support for common clock framework and proper regulator
>> > VDD_TS has been added.
>> > Moreover device tree definitions and documentation entry are now in
>> > place.
>> >
>> > Lukasz Majewski (6):
>> >    clk:exynos4:TMU Thermal Measurement Unit clock added to common
>> > clock framework
>> >    thermal:exynos4: TMU Common clock framework support for TMU
>> > (Thermal Monitoring Unit)
>> >    thermal:exynos4: TMU device tree support for Exynos4412 targets
>> >    thermal: Support for TMU regulator defined at device tree
>> >    thermal:exynos4: Enable support for Exynos4412 SoCs
>> >    thermal:exynos4: Add documentation for Exynos SoC thermal
>> > bindings
>> >
>> >   .../devicetree/bindings/clock/exynos4-clock.txt    |    1 +
>> >   .../devicetree/bindings/thermal/exynos-thermal.txt |   22
>> > +++++++++++ arch/arm/boot/dts/exynos4x12.dtsi                  |
>> > 10 +++++ drivers/clk/samsung/clk-exynos4.c                  |    6
>> > ++- drivers/thermal/exynos_thermal.c                   |   41
>> > +++++++++++++++----- 5 files changed, 70 insertions(+), 10
>> > deletions(-) create mode 100644
>> > Documentation/devicetree/bindings/thermal/exynos-thermal.txt
>> >
>> Lukasz, please address comments from ml.
>>
>
> Ok. I'm going to prepare v2

Please respin your v2 on top of my 3 patches to avoid merge conflicts.

-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs
  2013-04-23  7:19     ` Sachin Kamat
@ 2013-04-23  8:01       ` Lukasz Majewski
  0 siblings, 0 replies; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-23  8:01 UTC (permalink / raw)
  To: Sachin Kamat
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui, devicetree-discuss,
	linux-samsung-soc, Linux PM list

Hi Sachin,

> Hi Lukasz,
> 
> On 23 April 2013 11:56, Lukasz Majewski <l.majewski@samsung.com>
> wrote:
> > Hi Kukjin,
> >
> >> On 04/20/13 01:38, Lukasz Majewski wrote:
> >> > This patch series provide various fixes for TMU block.
> >> > Namely, support for common clock framework and proper regulator
> >> > VDD_TS has been added.
> >> > Moreover device tree definitions and documentation entry are now
> >> > in place.
> >> >
> >> > Lukasz Majewski (6):
> >> >    clk:exynos4:TMU Thermal Measurement Unit clock added to common
> >> > clock framework
> >> >    thermal:exynos4: TMU Common clock framework support for TMU
> >> > (Thermal Monitoring Unit)
> >> >    thermal:exynos4: TMU device tree support for Exynos4412
> >> > targets thermal: Support for TMU regulator defined at device tree
> >> >    thermal:exynos4: Enable support for Exynos4412 SoCs
> >> >    thermal:exynos4: Add documentation for Exynos SoC thermal
> >> > bindings
> >> >
> >> >   .../devicetree/bindings/clock/exynos4-clock.txt    |    1 +
> >> >   .../devicetree/bindings/thermal/exynos-thermal.txt |   22
> >> > +++++++++++ arch/arm/boot/dts/exynos4x12.dtsi                  |
> >> > 10 +++++ drivers/clk/samsung/clk-exynos4.c                  |
> >> > 6 ++- drivers/thermal/exynos_thermal.c                   |   41
> >> > +++++++++++++++----- 5 files changed, 70 insertions(+), 10
> >> > deletions(-) create mode 100644
> >> > Documentation/devicetree/bindings/thermal/exynos-thermal.txt
> >> >
> >> Lukasz, please address comments from ml.
> >>
> >
> > Ok. I'm going to prepare v2
> 
> Please respin your v2 on top of my 3 patches to avoid merge conflicts.
> 

No problem.

Yours patches to be applied:

[PATCH 1/1] clk: exynos4: Add clock entries for TMU
[PATCH 1/2] Thermal: exynos: Add clk_{un}prepare APIs
[PATCH 2/2] Thermal: exynos: Add compatible string for exynos4412

Thanks for information.


-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit)
  2013-04-23  7:15       ` Sachin Kamat
@ 2013-04-23  8:06         ` Lukasz Majewski
  2013-04-23  8:42           ` Sachin Kamat
  0 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-23  8:06 UTC (permalink / raw)
  To: Sachin Kamat
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Kyungmin Park, eduardo.valentin@ti.com

Hi Sachin,

> Hi Lukasz,
> 
> On 23 April 2013 11:47, Lukasz Majewski <l.majewski@samsung.com>
> wrote:
> > Hi Sachin,
> >
> >> On 19 April 2013 22:08, Lukasz Majewski <l.majewski@samsung.com>
> >> wrote:
> >> > This patch modifies exynos_thermal.c file to use
> >> > clk_disable_unprepare() and clk_prepare_enable() instead of
> >> > clk_{enable|disable}.
> >> >
> >> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> >> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> >> > ---
> >>
> >> I have already submitted a similar patch for this:
> >> http://permalink.gmane.org/gmane.linux.power-management.general/33310
> >>
> >>
> >
> > Thanks for pointing to the correct patch.
> >
> > However, I've got a question:
> >
> > The patch only changes clock names at exynos_tmu_{probe|remove}.
> >
> > Correct me if I'm wrong, but shouldn't we also change clock_enable
> > to clk_prepare_enable at exynos_tmu_read()? (Are we guaranteed,
> > that we will NOT sleep there?)
> 
> Since clk_prepare does not do anything, i thought it was sufficient to
> have it once in probe and then unprepare in remove.
> Do you see a real problem in this implementation. If so I can update
> it to use clk_prepare_enable at other places as well.
> 
I just wanted to stick to the common clock new API. It seems to me that
exynos_tmu_read() might sleep, but I'm quite novice at TMU :-).

If yours patches work, then we shall apply them.

I will do my best to test yours three patches ASAP on my setup.

-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit)
  2013-04-23  8:06         ` Lukasz Majewski
@ 2013-04-23  8:42           ` Sachin Kamat
  0 siblings, 0 replies; 57+ messages in thread
From: Sachin Kamat @ 2013-04-23  8:42 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Kyungmin Park, eduardo.valentin@ti.com

Hi Lukasz,

On 23 April 2013 13:36, Lukasz Majewski <l.majewski@samsung.com> wrote:

>>
> I just wanted to stick to the common clock new API. It seems to me that
> exynos_tmu_read() might sleep, but I'm quite novice at TMU :-).
>
> If yours patches work, then we shall apply them.
>
> I will do my best to test yours three patches ASAP on my setup.

Thanks. Please let me know if it works for you.


-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH 4/6] thermal: Support for TMU regulator defined at device tree
  2013-04-23  6:23     ` Lukasz Majewski
@ 2013-04-23 15:01       ` Eduardo Valentin
  0 siblings, 0 replies; 57+ messages in thread
From: Eduardo Valentin @ 2013-04-23 15:01 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Eduardo Valentin, Kukjin Kim, Mike Turquette, Zhang Rui,
	devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Kyungmin Park

On 23-04-2013 02:23, Lukasz Majewski wrote:
> Hi Eduardo,
>
>> On 19-04-2013 12:38, Lukasz Majewski wrote:
>>> TMU probe function now checks for a device tree defined regulator.
>>> For compatibility reasons it is allowed to probe driver even without
>>> this regulator defined.
>>>
>>> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>> ---
>>>    drivers/thermal/exynos_thermal.c |   19 +++++++++++++++++++
>>>    1 file changed, 19 insertions(+)
>>>
>>> diff --git a/drivers/thermal/exynos_thermal.c
>>> b/drivers/thermal/exynos_thermal.c index ba6094c..e922fa4 100644
>>> --- a/drivers/thermal/exynos_thermal.c
>>> +++ b/drivers/thermal/exynos_thermal.c
>>> @@ -38,6 +38,7 @@
>>>    #include <linux/cpufreq.h>
>>>    #include <linux/cpu_cooling.h>
>>>    #include <linux/of.h>
>>> +#include <linux/regulator/consumer.h>
>>>
>>>    #include <plat/cpu.h>
>>>
>>> @@ -119,6 +120,8 @@
>>>
>>>    #define EXYNOS_ZONE_COUNT	3
>>>
>>> +#define EXYNOS_TMU_REGULATOR "vdd_ts"
>>> +
>>>    struct exynos_tmu_data {
>>>    	struct exynos_tmu_platform_data *pdata;
>>>    	struct resource *mem;
>>> @@ -944,6 +947,7 @@ static int exynos_tmu_probe(struct
>>> platform_device *pdev) {
>>>    	struct exynos_tmu_data *data;
>>>    	struct exynos_tmu_platform_data *pdata =
>>> pdev->dev.platform_data;
>>> +	struct regulator *reg;
>>>    	int ret, i;
>>>
>>>    	if (!pdata)
>>> @@ -953,6 +957,21 @@ static int exynos_tmu_probe(struct
>>> platform_device *pdev) dev_err(&pdev->dev, "No platform init data
>>> supplied.\n"); return -ENODEV;
>>>    	}
>>> +
>>> +	reg = regulator_get(&pdev->dev, EXYNOS_TMU_REGULATOR);
>>> +	if (!IS_ERR(reg)) {
>>> +		ret = regulator_enable(reg);
>>> +		if (ret) {
>>> +			dev_err(&pdev->dev, "Regulator %s not
>>> enabled.\n",
>>> +				EXYNOS_TMU_REGULATOR);
>>> +			return ret;
>>> +		}
>>> +	} else {
>>> +		dev_info(&pdev->dev,
>>> +			 "Regulator %s not defined at device
>>> tree.\n",
>>> +			 EXYNOS_TMU_REGULATOR);
>> Maybe a dev_warn would fit better?
>
> This is a bit tricky. I first wanted to return -ENODEV when regulator
> is not available. Then I understood, that some other SoCs (e.g.
> Exynos5) will not work.
>
> The info here shall give a clear warn signal, that providing a
> regulator for VDD_TS is crucial (since by default it can be connected
> to other PMIC outputs and when other device puts down this regulator
> the TMU will crash and shut down a system).

OK. I understand your point. Well, it depends on how you want to design 
your driver. This is a clear case for having some sort of required 
feature set bitmap, for instance. Each supported soc for your driver 
would then have a bitmap indicating which features it actually supports. 
Based on the bitmap you make it mandatory on your regulator_get 
treatment. If it is mandatory, then you must clearly return an error 
code. I have done a similar thing for the ti-soc-thermal driver 
(drivers/staging/ti-soc-thermal/).

But again, this is your call, not sure if you want to go for that design 
just for this item,

Still, if you keep the code the way it is, I d request to change your 
message level to dev_warn. And in case you have a way to determine it is 
a mandatory entry, then to dev_err

>
>>
>>> +	}
>>> +
>>>    	data = devm_kzalloc(&pdev->dev, sizeof(struct
>>> exynos_tmu_data), GFP_KERNEL);
>>>    	if (!data) {
>>>
>
>
>

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support
  2013-04-19 16:38 [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Lukasz Majewski
                   ` (6 preceding siblings ...)
  2013-04-22 16:51 ` [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Kukjin Kim
@ 2013-04-25 12:30 ` Lukasz Majewski
  2013-04-25 12:30   ` [PATCH v2 1/4] ARM: dts: thermal: exynos4: TMU device tree support for Exynos4412 targets Lukasz Majewski
                     ` (4 more replies)
  7 siblings, 5 replies; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-25 12:30 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Lukasz Majewski, t.figa, Sachin Kamat,
	Myungjoo Ham

This patch series provide various fixes for TMU block.
First of all it fixes a problem with get_cpu_frequency() lockup at cpu_cooling.c. 

Secondly a proper regulator definition (VDD_TS) has been added.
Moreover device tree definitions and documentation entry are now in place.

Dependencies (those patches shall be applied on top of):
- "clk: exynos4: Add clock entries for TMU"
- "Thermal: exynos: Add clk_{un}prepare APIs"
- "Thermal: exynos: Add compatible string for exynos4412"


Lukasz Majewski (4):
  ARM: dts: thermal: exynos4: TMU device tree support for Exynos4412
    targets
  Thermal: exynos: Support for TMU regulator defined at device tree
  ARM: dts: thermal: exynos4: Add documentation for Exynos SoC thermal
    bindings
  ARM:TMU:fix: Avoid lockup when first frequency table entry is
    CPUFREQ_ENTRY_INVALID

 .../devicetree/bindings/thermal/exynos-thermal.txt |   25 ++++++++++++++++++++
 arch/arm/boot/dts/exynos4x12.dtsi                  |   10 ++++++++
 drivers/thermal/cpu_cooling.c                      |    3 +--
 drivers/thermal/exynos_thermal.c                   |   19 +++++++++++++++
 4 files changed, 55 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/thermal/exynos-thermal.txt

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 57+ messages in thread

* [PATCH v2 1/4] ARM: dts: thermal: exynos4: TMU device tree support for Exynos4412 targets
  2013-04-25 12:30 ` [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support Lukasz Majewski
@ 2013-04-25 12:30   ` Lukasz Majewski
  2013-04-25 15:45     ` Eduardo Valentin
  2013-04-25 12:30   ` [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree Lukasz Majewski
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-25 12:30 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Lukasz Majewski, t.figa, Sachin Kamat,
	Myungjoo Ham, Kyungmin Park

Device tree support for TMU at Exynos4x12 targets.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes for v2:
- None
---
 arch/arm/boot/dts/exynos4x12.dtsi |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
index e3380a7..ee920b3 100644
--- a/arch/arm/boot/dts/exynos4x12.dtsi
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -79,4 +79,14 @@
 		interrupts = <0 89 0>;
 		status = "disabled";
 	};
+
+	tmu@100C0000 {
+		compatible = "samsung,exynos4412-tmu";
+		interrupt-parent = <&combiner>;
+		reg = <0x100C0000 0x100>;
+		interrupts = <2 4>;
+		clocks = <&clock 383>;
+		clock-names = "tmu_apbif";
+		status = "disabled";
+	};
 };
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree
  2013-04-25 12:30 ` [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support Lukasz Majewski
  2013-04-25 12:30   ` [PATCH v2 1/4] ARM: dts: thermal: exynos4: TMU device tree support for Exynos4412 targets Lukasz Majewski
@ 2013-04-25 12:30   ` Lukasz Majewski
  2013-04-25 13:09     ` amit daniel kachhap
  2013-04-25 12:30   ` [PATCH v2 3/4] ARM: dts: thermal: exynos4: Add documentation for Exynos SoC thermal bindings Lukasz Majewski
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-25 12:30 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Lukasz Majewski, t.figa, Sachin Kamat,
	Myungjoo Ham, Kyungmin Park

TMU probe function now checks for a device tree defined regulator.
For compatibility reasons it is allowed to probe driver even without
this regulator defined.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes for v2:
- Change dev_info() to dev_warn()
---
 drivers/thermal/exynos_thermal.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index 3d6e32a..328fe7e 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -38,6 +38,7 @@
 #include <linux/cpufreq.h>
 #include <linux/cpu_cooling.h>
 #include <linux/of.h>
+#include <linux/regulator/consumer.h>
 
 #include <plat/cpu.h>
 
@@ -119,6 +120,8 @@
 
 #define EXYNOS_ZONE_COUNT	3
 
+#define EXYNOS_TMU_REGULATOR "vdd_ts"
+
 struct exynos_tmu_data {
 	struct exynos_tmu_platform_data *pdata;
 	struct resource *mem;
@@ -948,6 +951,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 {
 	struct exynos_tmu_data *data;
 	struct exynos_tmu_platform_data *pdata = pdev->dev.platform_data;
+	struct regulator *reg;
 	int ret, i;
 
 	if (!pdata)
@@ -957,6 +961,21 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "No platform init data supplied.\n");
 		return -ENODEV;
 	}
+
+	reg = regulator_get(&pdev->dev, EXYNOS_TMU_REGULATOR);
+	if (!IS_ERR(reg)) {
+		ret = regulator_enable(reg);
+		if (ret) {
+			dev_err(&pdev->dev, "Regulator %s not enabled.\n",
+				EXYNOS_TMU_REGULATOR);
+			return ret;
+		}
+	} else {
+		dev_warn(&pdev->dev,
+			 "Regulator %s not defined at device tree.\n",
+			 EXYNOS_TMU_REGULATOR);
+	}
+
 	data = devm_kzalloc(&pdev->dev, sizeof(struct exynos_tmu_data),
 					GFP_KERNEL);
 	if (!data) {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH v2 3/4] ARM: dts: thermal: exynos4: Add documentation for Exynos SoC thermal bindings
  2013-04-25 12:30 ` [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support Lukasz Majewski
  2013-04-25 12:30   ` [PATCH v2 1/4] ARM: dts: thermal: exynos4: TMU device tree support for Exynos4412 targets Lukasz Majewski
  2013-04-25 12:30   ` [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree Lukasz Majewski
@ 2013-04-25 12:30   ` Lukasz Majewski
  2013-04-25 15:46     ` Eduardo Valentin
  2013-04-25 12:30   ` [PATCH v2 4/4] ARM:TMU:fix: Avoid lockup when first frequency table entry is CPUFREQ_ENTRY_INVALID Lukasz Majewski
  2013-04-25 15:39   ` [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support Eduardo Valentin
  4 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-25 12:30 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Lukasz Majewski, t.figa, Sachin Kamat,
	Myungjoo Ham, Kyungmin Park

Proper description for Exynos4 bindings added to Documentation/devicetree/
bindings

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes for v2:
- Documentation extension according to ML feedback
---
 .../devicetree/bindings/thermal/exynos-thermal.txt |   25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/exynos-thermal.txt

diff --git a/Documentation/devicetree/bindings/thermal/exynos-thermal.txt b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
new file mode 100644
index 0000000..535fd0e
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
@@ -0,0 +1,25 @@
+* Exynos Thermal Management Unit (TMU)
+
+** Required properties:
+
+- compatible : One of the following:
+	       "samsung,exynos4412-tmu"
+	       "samsung,exynos4210-tmu"
+	       "samsung,exynos5250-tmu"
+- interrupt-parent : The phandle for the interrupt controller
+- reg : Address range of the thermal registers
+- interrupts : Should contain interrupt for thermal system
+- clocks : The main clock for TMU device
+- clock-names : Thermal system clock name
+
+Example:
+
+	tmu@100C0000 {
+		compatible = "samsung,exynos4412-tmu";
+		interrupt-parent = <&combiner>;
+		reg = <0x100C0000 0x100>;
+		interrupts = <2 4>;
+		clocks = <&clock 383>;
+		clock-names = "tmu_apbif";
+		status = "disabled";
+	};
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 57+ messages in thread

* [PATCH v2 4/4] ARM:TMU:fix: Avoid lockup when first frequency table entry is CPUFREQ_ENTRY_INVALID
  2013-04-25 12:30 ` [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support Lukasz Majewski
                     ` (2 preceding siblings ...)
  2013-04-25 12:30   ` [PATCH v2 3/4] ARM: dts: thermal: exynos4: Add documentation for Exynos SoC thermal bindings Lukasz Majewski
@ 2013-04-25 12:30   ` Lukasz Majewski
  2013-04-25 15:11     ` Eduardo Valentin
  2013-04-25 15:39   ` [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support Eduardo Valentin
  4 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-25 12:30 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Lukasz Majewski, t.figa, Sachin Kamat,
	Myungjoo Ham, Kyungmin Park

With the while loop, when i=0 and first entry in the frequency table is
CPUFREQ_ENTRY_INVALID, the code results in an endless loop (since i is not
incremented).

To fix this problem the for loop has been chosen. Incrementing i in the for
end block solves the problem.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Changes for v2:
- New in v2
---
 drivers/thermal/cpu_cooling.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 8dc44cb..df79f5e8 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -124,7 +124,7 @@ static unsigned int get_cpu_frequency(unsigned int cpu, unsigned long level)
 	if (!table)
 		return ret;
 
-	while (table[i].frequency != CPUFREQ_TABLE_END) {
+	for (; table[i].frequency != CPUFREQ_TABLE_END; i++) {
 		if (table[i].frequency == CPUFREQ_ENTRY_INVALID)
 			continue;
 
@@ -138,7 +138,6 @@ static unsigned int get_cpu_frequency(unsigned int cpu, unsigned long level)
 		/*return if level matched and table in descending order*/
 		if (descend && i == level)
 			return table[i].frequency;
-		i++;
 	}
 	i--;
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree
  2013-04-25 12:30   ` [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree Lukasz Majewski
@ 2013-04-25 13:09     ` amit daniel kachhap
  2013-04-25 13:29       ` Lukasz Majewski
  0 siblings, 1 reply; 57+ messages in thread
From: amit daniel kachhap @ 2013-04-25 13:09 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list, t.figa,
	Sachin Kamat, Myungjoo Ham, Kyungmin Park

Hi Lukasz Majewski,

Sorry for late review but I am currently working on restructuring the
whole exynos thermal driver and this support of LDO can be added as
feature as not all socs support this. This is also suggested by
Eduardo. All your other patches looks fine.

Thanks,
Amit Daniel

On Thu, Apr 25, 2013 at 6:00 PM, Lukasz Majewski <l.majewski@samsung.com> wrote:
> TMU probe function now checks for a device tree defined regulator.
> For compatibility reasons it is allowed to probe driver even without
> this regulator defined.
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> Changes for v2:
> - Change dev_info() to dev_warn()
> ---
>  drivers/thermal/exynos_thermal.c |   19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
> index 3d6e32a..328fe7e 100644
> --- a/drivers/thermal/exynos_thermal.c
> +++ b/drivers/thermal/exynos_thermal.c
> @@ -38,6 +38,7 @@
>  #include <linux/cpufreq.h>
>  #include <linux/cpu_cooling.h>
>  #include <linux/of.h>
> +#include <linux/regulator/consumer.h>
>
>  #include <plat/cpu.h>
>
> @@ -119,6 +120,8 @@
>
>  #define EXYNOS_ZONE_COUNT      3
>
> +#define EXYNOS_TMU_REGULATOR "vdd_ts"
> +
>  struct exynos_tmu_data {
>         struct exynos_tmu_platform_data *pdata;
>         struct resource *mem;
> @@ -948,6 +951,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>  {
>         struct exynos_tmu_data *data;
>         struct exynos_tmu_platform_data *pdata = pdev->dev.platform_data;
> +       struct regulator *reg;
>         int ret, i;
>
>         if (!pdata)
> @@ -957,6 +961,21 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>                 dev_err(&pdev->dev, "No platform init data supplied.\n");
>                 return -ENODEV;
>         }
> +
> +       reg = regulator_get(&pdev->dev, EXYNOS_TMU_REGULATOR);
> +       if (!IS_ERR(reg)) {
> +               ret = regulator_enable(reg);
> +               if (ret) {
> +                       dev_err(&pdev->dev, "Regulator %s not enabled.\n",
> +                               EXYNOS_TMU_REGULATOR);
> +                       return ret;
> +               }
> +       } else {
> +               dev_warn(&pdev->dev,
> +                        "Regulator %s not defined at device tree.\n",
> +                        EXYNOS_TMU_REGULATOR);
> +       }
> +
>         data = devm_kzalloc(&pdev->dev, sizeof(struct exynos_tmu_data),
>                                         GFP_KERNEL);
>         if (!data) {
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree
  2013-04-25 13:09     ` amit daniel kachhap
@ 2013-04-25 13:29       ` Lukasz Majewski
  2013-04-25 15:44         ` Eduardo Valentin
  0 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-25 13:29 UTC (permalink / raw)
  To: amit daniel kachhap
  Cc: Kukjin Kim, devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list, t.figa,
	Sachin Kamat, Myungjoo Ham, Kyungmin Park

Hi Amit,

> Hi Lukasz Majewski,
> 
> Sorry for late review but I am currently working on restructuring the
> whole exynos thermal driver and this support of LDO can be added as
> feature as not all socs support this. This is also suggested by
> Eduardo. All your other patches looks fine.

But this is how it is already done. The VDD_TS is optional, so
Exynos5440 and Exynos4210 will not be broken.

This shall preserve the correct behavior of the thermal driver.

> 
> Thanks,
> Amit Daniel
> 
> On Thu, Apr 25, 2013 at 6:00 PM, Lukasz Majewski
> <l.majewski@samsung.com> wrote:
> > TMU probe function now checks for a device tree defined regulator.
> > For compatibility reasons it is allowed to probe driver even without
> > this regulator defined.
> >
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> > Changes for v2:
> > - Change dev_info() to dev_warn()
> > ---
> >  drivers/thermal/exynos_thermal.c |   19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> >
> > diff --git a/drivers/thermal/exynos_thermal.c
> > b/drivers/thermal/exynos_thermal.c index 3d6e32a..328fe7e 100644
> > --- a/drivers/thermal/exynos_thermal.c
> > +++ b/drivers/thermal/exynos_thermal.c
> > @@ -38,6 +38,7 @@
> >  #include <linux/cpufreq.h>
> >  #include <linux/cpu_cooling.h>
> >  #include <linux/of.h>
> > +#include <linux/regulator/consumer.h>
> >
> >  #include <plat/cpu.h>
> >
> > @@ -119,6 +120,8 @@
> >
> >  #define EXYNOS_ZONE_COUNT      3
> >
> > +#define EXYNOS_TMU_REGULATOR "vdd_ts"
> > +
> >  struct exynos_tmu_data {
> >         struct exynos_tmu_platform_data *pdata;
> >         struct resource *mem;
> > @@ -948,6 +951,7 @@ static int exynos_tmu_probe(struct
> > platform_device *pdev) {
> >         struct exynos_tmu_data *data;
> >         struct exynos_tmu_platform_data *pdata =
> > pdev->dev.platform_data;
> > +       struct regulator *reg;
> >         int ret, i;
> >
> >         if (!pdata)
> > @@ -957,6 +961,21 @@ static int exynos_tmu_probe(struct
> > platform_device *pdev) dev_err(&pdev->dev, "No platform init data
> > supplied.\n"); return -ENODEV;
> >         }
> > +
> > +       reg = regulator_get(&pdev->dev, EXYNOS_TMU_REGULATOR);
> > +       if (!IS_ERR(reg)) {
> > +               ret = regulator_enable(reg);
> > +               if (ret) {
> > +                       dev_err(&pdev->dev, "Regulator %s not
> > enabled.\n",
> > +                               EXYNOS_TMU_REGULATOR);
> > +                       return ret;
> > +               }
> > +       } else {
> > +               dev_warn(&pdev->dev,
> > +                        "Regulator %s not defined at device
> > tree.\n",
> > +                        EXYNOS_TMU_REGULATOR);
> > +       }
> > +
> >         data = devm_kzalloc(&pdev->dev, sizeof(struct
> > exynos_tmu_data), GFP_KERNEL);
> >         if (!data) {
> > --
> > 1.7.10.4
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-samsung-soc" in the body of a message to
> > majordomo@vger.kernel.org More majordomo info at
> > http://vger.kernel.org/majordomo-info.html



-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 4/4] ARM:TMU:fix: Avoid lockup when first frequency table entry is CPUFREQ_ENTRY_INVALID
  2013-04-25 12:30   ` [PATCH v2 4/4] ARM:TMU:fix: Avoid lockup when first frequency table entry is CPUFREQ_ENTRY_INVALID Lukasz Majewski
@ 2013-04-25 15:11     ` Eduardo Valentin
  2013-04-25 15:22       ` Lukasz Majewski
  0 siblings, 1 reply; 57+ messages in thread
From: Eduardo Valentin @ 2013-04-25 15:11 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, t.figa, Sachin Kamat, Myungjoo Ham,
	Kyungmin Park, eduardo.valentin

Lukasz,

On 25-04-2013 08:30, Lukasz Majewski wrote:
> With the while loop, when i=0 and first entry in the frequency table is
> CPUFREQ_ENTRY_INVALID, the code results in an endless loop (since i is not
> incremented).
>
> To fix this problem the for loop has been chosen. Incrementing i in the for
> end block solves the problem.
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> Changes for v2:
> - New in v2

This patch wont apply on Rui's tree.

I believe this has been already fixed on Rui's tree (next branch).
Could you please check if the commit below fix your issue:
git.kernel.org/cgit/linux/kernel/git/rzhang/linux.git/commit/?h=thermal&id=fc35b35cbe24ef021ea9acfba21e54da958df747

commit fc35b35cbe24ef021ea9acfba21e54da958df747
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Fri Feb 8 13:09:32 2013 +0800

     Thermal: cpufreq cooling: fix parsing per_cpu cpufreq_frequency_table



> ---
>   drivers/thermal/cpu_cooling.c |    3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
> index 8dc44cb..df79f5e8 100644
> --- a/drivers/thermal/cpu_cooling.c
> +++ b/drivers/thermal/cpu_cooling.c
> @@ -124,7 +124,7 @@ static unsigned int get_cpu_frequency(unsigned int cpu, unsigned long level)
>   	if (!table)
>   		return ret;
>
> -	while (table[i].frequency != CPUFREQ_TABLE_END) {
> +	for (; table[i].frequency != CPUFREQ_TABLE_END; i++) {
>   		if (table[i].frequency == CPUFREQ_ENTRY_INVALID)
>   			continue;
>
> @@ -138,7 +138,6 @@ static unsigned int get_cpu_frequency(unsigned int cpu, unsigned long level)
>   		/*return if level matched and table in descending order*/
>   		if (descend && i == level)
>   			return table[i].frequency;
> -		i++;
>   	}
>   	i--;
>
>


^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 4/4] ARM:TMU:fix: Avoid lockup when first frequency table entry is CPUFREQ_ENTRY_INVALID
  2013-04-25 15:11     ` Eduardo Valentin
@ 2013-04-25 15:22       ` Lukasz Majewski
  2013-04-25 15:39         ` Eduardo Valentin
  0 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-25 15:22 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Kukjin Kim, devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Tomasz Figa, Sachin Kamat, Myungjoo Ham,
	Kyungmin Park

Hi Eduardo,

> Lukasz,
> 
> On 25-04-2013 08:30, Lukasz Majewski wrote:
> > With the while loop, when i=0 and first entry in the frequency
> > table is CPUFREQ_ENTRY_INVALID, the code results in an endless loop
> > (since i is not incremented).
> >
> > To fix this problem the for loop has been chosen. Incrementing i in
> > the for end block solves the problem.
> >
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> > Changes for v2:
> > - New in v2
> 
> This patch wont apply on Rui's tree.
> 
> I believe this has been already fixed on Rui's tree (next branch).
> Could you please check if the commit below fix your issue:
> git.kernel.org/cgit/linux/kernel/git/rzhang/linux.git/commit/?h=thermal&id=fc35b35cbe24ef021ea9acfba21e54da958df747
> 
> commit fc35b35cbe24ef021ea9acfba21e54da958df747
> Author: Zhang Rui <rui.zhang@intel.com>
> Date:   Fri Feb 8 13:09:32 2013 +0800
> 
>      Thermal: cpufreq cooling: fix parsing per_cpu
> cpufreq_frequency_table
> 

Thanks for pointing out. It seems, that this function fixes this
problem.

As a side note, is this problem fixed at stable kernels?

> 
> 
> > ---
> >   drivers/thermal/cpu_cooling.c |    3 +--
> >   1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/thermal/cpu_cooling.c
> > b/drivers/thermal/cpu_cooling.c index 8dc44cb..df79f5e8 100644
> > --- a/drivers/thermal/cpu_cooling.c
> > +++ b/drivers/thermal/cpu_cooling.c
> > @@ -124,7 +124,7 @@ static unsigned int get_cpu_frequency(unsigned
> > int cpu, unsigned long level) if (!table)
> >   		return ret;
> >
> > -	while (table[i].frequency != CPUFREQ_TABLE_END) {
> > +	for (; table[i].frequency != CPUFREQ_TABLE_END; i++) {
> >   		if (table[i].frequency == CPUFREQ_ENTRY_INVALID)
> >   			continue;
> >
> > @@ -138,7 +138,6 @@ static unsigned int get_cpu_frequency(unsigned
> > int cpu, unsigned long level) /*return if level matched and table
> > in descending order*/ if (descend && i == level)
> >   			return table[i].frequency;
> > -		i++;
> >   	}
> >   	i--;
> >
> >



-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 4/4] ARM:TMU:fix: Avoid lockup when first frequency table entry is CPUFREQ_ENTRY_INVALID
  2013-04-25 15:22       ` Lukasz Majewski
@ 2013-04-25 15:39         ` Eduardo Valentin
  0 siblings, 0 replies; 57+ messages in thread
From: Eduardo Valentin @ 2013-04-25 15:39 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Eduardo Valentin, Kukjin Kim, devicetree-discuss@lists.ozlabs.org,
	Zhang Rui, linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, Tomasz Figa, Sachin Kamat, Myungjoo Ham,
	Kyungmin Park

On 25-04-2013 11:22, Lukasz Majewski wrote:
> Hi Eduardo,
>
>> Lukasz,
>>
>> On 25-04-2013 08:30, Lukasz Majewski wrote:
>>> With the while loop, when i=0 and first entry in the frequency
>>> table is CPUFREQ_ENTRY_INVALID, the code results in an endless loop
>>> (since i is not incremented).
>>>
>>> To fix this problem the for loop has been chosen. Incrementing i in
>>> the for end block solves the problem.
>>>
>>> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>> ---
>>> Changes for v2:
>>> - New in v2
>>
>> This patch wont apply on Rui's tree.
>>
>> I believe this has been already fixed on Rui's tree (next branch).
>> Could you please check if the commit below fix your issue:
>> git.kernel.org/cgit/linux/kernel/git/rzhang/linux.git/commit/?h=thermal&id=fc35b35cbe24ef021ea9acfba21e54da958df747
>>
>> commit fc35b35cbe24ef021ea9acfba21e54da958df747
>> Author: Zhang Rui <rui.zhang@intel.com>
>> Date:   Fri Feb 8 13:09:32 2013 +0800
>>
>>       Thermal: cpufreq cooling: fix parsing per_cpu
>> cpufreq_frequency_table
>>
>
> Thanks for pointing out. It seems, that this function fixes this
> problem.

OK.

>
> As a side note, is this problem fixed at stable kernels?

Good question, probably not!

>
>>
>>
>>> ---
>>>    drivers/thermal/cpu_cooling.c |    3 +--
>>>    1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/thermal/cpu_cooling.c
>>> b/drivers/thermal/cpu_cooling.c index 8dc44cb..df79f5e8 100644
>>> --- a/drivers/thermal/cpu_cooling.c
>>> +++ b/drivers/thermal/cpu_cooling.c
>>> @@ -124,7 +124,7 @@ static unsigned int get_cpu_frequency(unsigned
>>> int cpu, unsigned long level) if (!table)
>>>    		return ret;
>>>
>>> -	while (table[i].frequency != CPUFREQ_TABLE_END) {
>>> +	for (; table[i].frequency != CPUFREQ_TABLE_END; i++) {
>>>    		if (table[i].frequency == CPUFREQ_ENTRY_INVALID)
>>>    			continue;
>>>
>>> @@ -138,7 +138,6 @@ static unsigned int get_cpu_frequency(unsigned
>>> int cpu, unsigned long level) /*return if level matched and table
>>> in descending order*/ if (descend && i == level)
>>>    			return table[i].frequency;
>>> -		i++;
>>>    	}
>>>    	i--;
>>>
>>>
>
>
>

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support
  2013-04-25 12:30 ` [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support Lukasz Majewski
                     ` (3 preceding siblings ...)
  2013-04-25 12:30   ` [PATCH v2 4/4] ARM:TMU:fix: Avoid lockup when first frequency table entry is CPUFREQ_ENTRY_INVALID Lukasz Majewski
@ 2013-04-25 15:39   ` Eduardo Valentin
  2013-04-25 16:28     ` Lukasz Majewski
  4 siblings, 1 reply; 57+ messages in thread
From: Eduardo Valentin @ 2013-04-25 15:39 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, t.figa, Sachin Kamat, Myungjoo Ham,
	eduardo.valentin

Hello Lukasz,

On 25-04-2013 08:30, Lukasz Majewski wrote:
> This patch series provide various fixes for TMU block.
> First of all it fixes a problem with get_cpu_frequency() lockup at cpu_cooling.c.
>
> Secondly a proper regulator definition (VDD_TS) has been added.
> Moreover device tree definitions and documentation entry are now in place.
>
> Dependencies (those patches shall be applied on top of):
> - "clk: exynos4: Add clock entries for TMU"

Is this one same as  [1/6] clk:exynos4:TMU Thermal Measurement Unit 
clock added to common clock framework in your previous series?

> - "Thermal: exynos: Add clk_{un}prepare APIs"
Same as
thermal:exynos4: TMU Common clock framework support for TMU (Thermal 
Monitoring Unit)
in your previous series?

> - "Thermal: exynos: Add compatible string for exynos4412"
>
This should be same as thermal:exynos4: Enable support for Exynos4412 
SoCs in your previous series?


>
> Lukasz Majewski (4):
>    ARM: dts: thermal: exynos4: TMU device tree support for Exynos4412
>      targets
>    Thermal: exynos: Support for TMU regulator defined at device tree
>    ARM: dts: thermal: exynos4: Add documentation for Exynos SoC thermal
>      bindings
>    ARM:TMU:fix: Avoid lockup when first frequency table entry is
>      CPUFREQ_ENTRY_INVALID

The above, as stated at the patch may not be needed.

>
>   .../devicetree/bindings/thermal/exynos-thermal.txt |   25 ++++++++++++++++++++
>   arch/arm/boot/dts/exynos4x12.dtsi                  |   10 ++++++++
>   drivers/thermal/cpu_cooling.c                      |    3 +--
>   drivers/thermal/exynos_thermal.c                   |   19 +++++++++++++++
>   4 files changed, 55 insertions(+), 2 deletions(-)
>   create mode 100644 Documentation/devicetree/bindings/thermal/exynos-thermal.txt
>


^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree
  2013-04-25 13:29       ` Lukasz Majewski
@ 2013-04-25 15:44         ` Eduardo Valentin
  2013-04-25 16:29           ` Lukasz Majewski
  2013-04-29  4:35           ` amit daniel kachhap
  0 siblings, 2 replies; 57+ messages in thread
From: Eduardo Valentin @ 2013-04-25 15:44 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: amit daniel kachhap, Kukjin Kim,
	devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list, t.figa,
	Sachin Kamat, Myungjoo Ham, Kyungmin Park, eduardo.valentin

Amit, Lukasz,

On 25-04-2013 09:29, Lukasz Majewski wrote:
> Hi Amit,
>
>> Hi Lukasz Majewski,
>>
>> Sorry for late review but I am currently working on restructuring the
>> whole exynos thermal driver and this support of LDO can be added as
>> feature as not all socs support this. This is also suggested by
>> Eduardo. All your other patches looks fine.
>
> But this is how it is already done. The VDD_TS is optional, so
> Exynos5440 and Exynos4210 will not be broken.
>
> This shall preserve the correct behavior of the thermal driver.
>

If you guys plan to move to feature based approach, like suggested in 
V1, then Id recommend adding a /* TODO: */ entry in your driver.

Amit, are you including this LDO support on your rework?

>>
>> Thanks,
>> Amit Daniel
>>
>> On Thu, Apr 25, 2013 at 6:00 PM, Lukasz Majewski
>> <l.majewski@samsung.com> wrote:
>>> TMU probe function now checks for a device tree defined regulator.
>>> For compatibility reasons it is allowed to probe driver even without
>>> this regulator defined.
>>>
>>> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>> ---
>>> Changes for v2:
>>> - Change dev_info() to dev_warn()
>>> ---
>>>   drivers/thermal/exynos_thermal.c |   19 +++++++++++++++++++
>>>   1 file changed, 19 insertions(+)
>>>
>>> diff --git a/drivers/thermal/exynos_thermal.c
>>> b/drivers/thermal/exynos_thermal.c index 3d6e32a..328fe7e 100644
>>> --- a/drivers/thermal/exynos_thermal.c
>>> +++ b/drivers/thermal/exynos_thermal.c
>>> @@ -38,6 +38,7 @@
>>>   #include <linux/cpufreq.h>
>>>   #include <linux/cpu_cooling.h>
>>>   #include <linux/of.h>
>>> +#include <linux/regulator/consumer.h>
>>>
>>>   #include <plat/cpu.h>
>>>
>>> @@ -119,6 +120,8 @@
>>>
>>>   #define EXYNOS_ZONE_COUNT      3
>>>
>>> +#define EXYNOS_TMU_REGULATOR "vdd_ts"
>>> +
>>>   struct exynos_tmu_data {
>>>          struct exynos_tmu_platform_data *pdata;
>>>          struct resource *mem;
>>> @@ -948,6 +951,7 @@ static int exynos_tmu_probe(struct
>>> platform_device *pdev) {
>>>          struct exynos_tmu_data *data;
>>>          struct exynos_tmu_platform_data *pdata =
>>> pdev->dev.platform_data;
>>> +       struct regulator *reg;
>>>          int ret, i;
>>>
>>>          if (!pdata)
>>> @@ -957,6 +961,21 @@ static int exynos_tmu_probe(struct
>>> platform_device *pdev) dev_err(&pdev->dev, "No platform init data
>>> supplied.\n"); return -ENODEV;
>>>          }
>>> +
>>> +       reg = regulator_get(&pdev->dev, EXYNOS_TMU_REGULATOR);
>>> +       if (!IS_ERR(reg)) {
>>> +               ret = regulator_enable(reg);
>>> +               if (ret) {
>>> +                       dev_err(&pdev->dev, "Regulator %s not
>>> enabled.\n",
>>> +                               EXYNOS_TMU_REGULATOR);
>>> +                       return ret;
>>> +               }
>>> +       } else {
>>> +               dev_warn(&pdev->dev,
>>> +                        "Regulator %s not defined at device
>>> tree.\n",
>>> +                        EXYNOS_TMU_REGULATOR);
>>> +       }
>>> +
>>>          data = devm_kzalloc(&pdev->dev, sizeof(struct
>>> exynos_tmu_data), GFP_KERNEL);
>>>          if (!data) {
>>> --
>>> 1.7.10.4
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe
>>> linux-samsung-soc" in the body of a message to
>>> majordomo@vger.kernel.org More majordomo info at
>>> http://vger.kernel.org/majordomo-info.html
>
>
>


^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 1/4] ARM: dts: thermal: exynos4: TMU device tree support for Exynos4412 targets
  2013-04-25 12:30   ` [PATCH v2 1/4] ARM: dts: thermal: exynos4: TMU device tree support for Exynos4412 targets Lukasz Majewski
@ 2013-04-25 15:45     ` Eduardo Valentin
  2013-04-29  4:57       ` amit daniel kachhap
  0 siblings, 1 reply; 57+ messages in thread
From: Eduardo Valentin @ 2013-04-25 15:45 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, t.figa, Sachin Kamat, Myungjoo Ham,
	Kyungmin Park, eduardo.valentin

On 25-04-2013 08:30, Lukasz Majewski wrote:
> Device tree support for TMU at Exynos4x12 targets.
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

This patch looks good to me:
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
> ---
> Changes for v2:
> - None
> ---
>   arch/arm/boot/dts/exynos4x12.dtsi |   10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
> index e3380a7..ee920b3 100644
> --- a/arch/arm/boot/dts/exynos4x12.dtsi
> +++ b/arch/arm/boot/dts/exynos4x12.dtsi
> @@ -79,4 +79,14 @@
>   		interrupts = <0 89 0>;
>   		status = "disabled";
>   	};
> +
> +	tmu@100C0000 {
> +		compatible = "samsung,exynos4412-tmu";
> +		interrupt-parent = <&combiner>;
> +		reg = <0x100C0000 0x100>;
> +		interrupts = <2 4>;
> +		clocks = <&clock 383>;
> +		clock-names = "tmu_apbif";
> +		status = "disabled";
> +	};
>   };
>


^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 3/4] ARM: dts: thermal: exynos4: Add documentation for Exynos SoC thermal bindings
  2013-04-25 12:30   ` [PATCH v2 3/4] ARM: dts: thermal: exynos4: Add documentation for Exynos SoC thermal bindings Lukasz Majewski
@ 2013-04-25 15:46     ` Eduardo Valentin
  2013-04-29  5:01       ` amit daniel kachhap
  0 siblings, 1 reply; 57+ messages in thread
From: Eduardo Valentin @ 2013-04-25 15:46 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Kukjin Kim, devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, t.figa, Sachin Kamat, Myungjoo Ham,
	Kyungmin Park, eduardo.valentin

On 25-04-2013 08:30, Lukasz Majewski wrote:
> Proper description for Exynos4 bindings added to Documentation/devicetree/
> bindings
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

I am fine with this one too.

Reviewed-by: Eduardo Valentin <eduardo.valentin@ti.com>

> ---
> Changes for v2:
> - Documentation extension according to ML feedback
> ---
>   .../devicetree/bindings/thermal/exynos-thermal.txt |   25 ++++++++++++++++++++
>   1 file changed, 25 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/thermal/exynos-thermal.txt
>
> diff --git a/Documentation/devicetree/bindings/thermal/exynos-thermal.txt b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
> new file mode 100644
> index 0000000..535fd0e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
> @@ -0,0 +1,25 @@
> +* Exynos Thermal Management Unit (TMU)
> +
> +** Required properties:
> +
> +- compatible : One of the following:
> +	       "samsung,exynos4412-tmu"
> +	       "samsung,exynos4210-tmu"
> +	       "samsung,exynos5250-tmu"
> +- interrupt-parent : The phandle for the interrupt controller
> +- reg : Address range of the thermal registers
> +- interrupts : Should contain interrupt for thermal system
> +- clocks : The main clock for TMU device
> +- clock-names : Thermal system clock name
> +
> +Example:
> +
> +	tmu@100C0000 {
> +		compatible = "samsung,exynos4412-tmu";
> +		interrupt-parent = <&combiner>;
> +		reg = <0x100C0000 0x100>;
> +		interrupts = <2 4>;
> +		clocks = <&clock 383>;
> +		clock-names = "tmu_apbif";
> +		status = "disabled";
> +	};
>

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support
  2013-04-25 15:39   ` [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support Eduardo Valentin
@ 2013-04-25 16:28     ` Lukasz Majewski
  2013-04-26  5:05       ` Sachin Kamat
  0 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-25 16:28 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Kukjin Kim, devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list,
	Amit Daniel Kachhap, t.figa, Sachin Kamat, Myungjoo Ham

Hi Eduardo,

> Hello Lukasz,
> 
> On 25-04-2013 08:30, Lukasz Majewski wrote:
> > This patch series provide various fixes for TMU block.
> > First of all it fixes a problem with get_cpu_frequency() lockup at
> > cpu_cooling.c.
> >
> > Secondly a proper regulator definition (VDD_TS) has been added.
> > Moreover device tree definitions and documentation entry are now in
> > place.
> >
> > Dependencies (those patches shall be applied on top of):
> > - "clk: exynos4: Add clock entries for TMU"
> 
> Is this one same as  [1/6] clk:exynos4:TMU Thermal Measurement Unit 
> clock added to common clock framework in your previous series?

Yes, this is a similar patch. However I've changed more clocks to
clk_prepare_enable (clk_unprepare_disable). I've spoken about this with
Sachin recently.

> 
> > - "Thermal: exynos: Add clk_{un}prepare APIs"
> Same as
> thermal:exynos4: TMU Common clock framework support for TMU (Thermal 
> Monitoring Unit)
> in your previous series?

Yes.

> 
> > - "Thermal: exynos: Add compatible string for exynos4412"
> >
> This should be same as thermal:exynos4: Enable support for Exynos4412 
> SoCs in your previous series?

Yes.

> 
> 
> >
> > Lukasz Majewski (4):
> >    ARM: dts: thermal: exynos4: TMU device tree support for
> > Exynos4412 targets
> >    Thermal: exynos: Support for TMU regulator defined at device tree
> >    ARM: dts: thermal: exynos4: Add documentation for Exynos SoC
> > thermal bindings
> >    ARM:TMU:fix: Avoid lockup when first frequency table entry is
> >      CPUFREQ_ENTRY_INVALID
> 
> The above, as stated at the patch may not be needed.
> 
> >
> >   .../devicetree/bindings/thermal/exynos-thermal.txt |   25
> > ++++++++++++++++++++
> > arch/arm/boot/dts/exynos4x12.dtsi                  |   10 ++++++++
> > drivers/thermal/cpu_cooling.c                      |    3 +--
> > drivers/thermal/exynos_thermal.c                   |   19
> > +++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-)
> > create mode 100644
> > Documentation/devicetree/bindings/thermal/exynos-thermal.txt
> >
> 



-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree
  2013-04-25 15:44         ` Eduardo Valentin
@ 2013-04-25 16:29           ` Lukasz Majewski
  2013-04-27  0:50             ` Zhang Rui
  2013-04-29  4:35           ` amit daniel kachhap
  1 sibling, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-25 16:29 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: amit daniel kachhap, Kukjin Kim,
	devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list, t.figa,
	Sachin Kamat, Myungjoo Ham, Kyungmin Park

Hi Eduardo,

> Amit, Lukasz,
> 
> On 25-04-2013 09:29, Lukasz Majewski wrote:
> > Hi Amit,
> >  
> >> Hi Lukasz Majewski,
> >>
> >> Sorry for late review but I am currently working on restructuring
> >> the whole exynos thermal driver and this support of LDO can be
> >> added as feature as not all socs support this. This is also
> >> suggested by Eduardo. All your other patches looks fine.  
> >
> > But this is how it is already done. The VDD_TS is optional, so
> > Exynos5440 and Exynos4210 will not be broken.
> >
> > This shall preserve the correct behavior of the thermal driver.
> >  
> 
> If you guys plan to move to feature based approach, like suggested in 
> V1, then Id recommend adding a /* TODO: */ entry in your driver.

Ok, nice idea.

> 
> Amit, are you including this LDO support on your rework?



-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support
  2013-04-25 16:28     ` Lukasz Majewski
@ 2013-04-26  5:05       ` Sachin Kamat
  2013-04-26  6:39         ` Lukasz Majewski
  0 siblings, 1 reply; 57+ messages in thread
From: Sachin Kamat @ 2013-04-26  5:05 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Eduardo Valentin, Kukjin Kim, devicetree-discuss@lists.ozlabs.org,
	Zhang Rui, linux-samsung-soc@vger.kernel.org, Linux PM list,
	t.figa, Myungjoo Ham

 Hi Eduardo,

On 25 April 2013 21:58, Lukasz Majewski <l.majewski@samsung.com> wrote:
> Hi Eduardo,
>
>> Hello Lukasz,
>>
>> On 25-04-2013 08:30, Lukasz Majewski wrote:
>> > This patch series provide various fixes for TMU block.
>> > First of all it fixes a problem with get_cpu_frequency() lockup at
>> > cpu_cooling.c.
>> >
>> > Secondly a proper regulator definition (VDD_TS) has been added.
>> > Moreover device tree definitions and documentation entry are now in
>> > place.
>> >
>> > Dependencies (those patches shall be applied on top of):
>> > - "clk: exynos4: Add clock entries for TMU"
>>
>> Is this one same as  [1/6] clk:exynos4:TMU Thermal Measurement Unit
>> clock added to common clock framework in your previous series?

The one sent by Lukasz has been dropped as an equivalent patch sent by
me is already under review.

>
> Yes, this is a similar patch. However I've changed more clocks to
> clk_prepare_enable (clk_unprepare_disable). I've spoken about this with
> Sachin recently.

The above description is actually for the below patch. Lukasz will
test and see if additional changes are needed.
If so he will send an incremental patch to address it.

>
>>
>> > - "Thermal: exynos: Add clk_{un}prepare APIs"
>> Same as
>> thermal:exynos4: TMU Common clock framework support for TMU (Thermal
>> Monitoring Unit)
>> in your previous series?
>

>
>>
>> > - "Thermal: exynos: Add compatible string for exynos4412"

These 2 have been merged in the thermal next tree.

>> >
>> This should be same as thermal:exynos4: Enable support for Exynos4412
>> SoCs in your previous series?
>
> Yes.
>

-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support
  2013-04-26  5:05       ` Sachin Kamat
@ 2013-04-26  6:39         ` Lukasz Majewski
  2013-04-26  6:45           ` Sachin Kamat
  0 siblings, 1 reply; 57+ messages in thread
From: Lukasz Majewski @ 2013-04-26  6:39 UTC (permalink / raw)
  To: Sachin Kamat
  Cc: Eduardo Valentin, Kukjin Kim, devicetree-discuss@lists.ozlabs.org,
	Zhang Rui, linux-samsung-soc@vger.kernel.org, Linux PM list,
	t.figa, Myungjoo Ham

Hi Sachin,

> >
> > Yes, this is a similar patch. However I've changed more clocks to
> > clk_prepare_enable (clk_unprepare_disable). I've spoken about this
> > with Sachin recently.  
> 
> The above description is actually for the below patch. Lukasz will
> test and see if additional changes are needed.
> If so he will send an incremental patch to address it.

>From tests, which I've done so far, TMU is working correctly.

-- 
Best regards,

Lukasz Majewski

Samsung R&D Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support
  2013-04-26  6:39         ` Lukasz Majewski
@ 2013-04-26  6:45           ` Sachin Kamat
  0 siblings, 0 replies; 57+ messages in thread
From: Sachin Kamat @ 2013-04-26  6:45 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Eduardo Valentin, Kukjin Kim, devicetree-discuss@lists.ozlabs.org,
	Zhang Rui, linux-samsung-soc@vger.kernel.org, Linux PM list,
	t.figa, Myungjoo Ham

Hi Lukasz,

On 26 April 2013 12:09, Lukasz Majewski <l.majewski@samsung.com> wrote:
> Hi Sachin,
>
>> >
>> > Yes, this is a similar patch. However I've changed more clocks to
>> > clk_prepare_enable (clk_unprepare_disable). I've spoken about this
>> > with Sachin recently.
>>
>> The above description is actually for the below patch. Lukasz will
>> test and see if additional changes are needed.
>> If so he will send an incremental patch to address it.
>
> From tests, which I've done so far, TMU is working correctly.

Thanks for the confirmation.


-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree
  2013-04-25 16:29           ` Lukasz Majewski
@ 2013-04-27  0:50             ` Zhang Rui
  2013-04-29  4:38               ` amit daniel kachhap
  0 siblings, 1 reply; 57+ messages in thread
From: Zhang Rui @ 2013-04-27  0:50 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Eduardo Valentin, amit daniel kachhap, Kukjin Kim,
	devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list, t.figa,
	Sachin Kamat, Myungjoo Ham, Kyungmin Park

Hi, all,

what is the status now?
which one is preferred, this one or the one from Amit's patch set?

thanks,
rui


On Thu, 2013-04-25 at 18:29 +0200, Lukasz Majewski wrote:
> Hi Eduardo,
> 
> > Amit, Lukasz,
> > 
> > On 25-04-2013 09:29, Lukasz Majewski wrote:
> > > Hi Amit,
> > >  
> > >> Hi Lukasz Majewski,
> > >>
> > >> Sorry for late review but I am currently working on restructuring
> > >> the whole exynos thermal driver and this support of LDO can be
> > >> added as feature as not all socs support this. This is also
> > >> suggested by Eduardo. All your other patches looks fine.  
> > >
> > > But this is how it is already done. The VDD_TS is optional, so
> > > Exynos5440 and Exynos4210 will not be broken.
> > >
> > > This shall preserve the correct behavior of the thermal driver.
> > >  
> > 
> > If you guys plan to move to feature based approach, like suggested in 
> > V1, then Id recommend adding a /* TODO: */ entry in your driver.
> 
> Ok, nice idea.
> 
> > 
> > Amit, are you including this LDO support on your rework?
> 
> 
> 

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree
  2013-04-25 15:44         ` Eduardo Valentin
  2013-04-25 16:29           ` Lukasz Majewski
@ 2013-04-29  4:35           ` amit daniel kachhap
  1 sibling, 0 replies; 57+ messages in thread
From: amit daniel kachhap @ 2013-04-29  4:35 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Lukasz Majewski, Kukjin Kim, devicetree-discuss@lists.ozlabs.org,
	Zhang Rui, linux-samsung-soc@vger.kernel.org, Linux PM list,
	t.figa, Sachin Kamat, Myungjoo Ham, Kyungmin Park

Hi Lukasz/Eduardo,

On Thu, Apr 25, 2013 at 9:14 PM, Eduardo Valentin
<eduardo.valentin@ti.com> wrote:
> Amit, Lukasz,
>
>
> On 25-04-2013 09:29, Lukasz Majewski wrote:
>>
>> Hi Amit,
>>
>>> Hi Lukasz Majewski,
>>>
>>> Sorry for late review but I am currently working on restructuring the
>>> whole exynos thermal driver and this support of LDO can be added as
>>> feature as not all socs support this. This is also suggested by
>>> Eduardo. All your other patches looks fine.
>>
>>
>> But this is how it is already done. The VDD_TS is optional, so
>> Exynos5440 and Exynos4210 will not be broken.
>>
>> This shall preserve the correct behavior of the thermal driver.
Yes lukasz I saw your code that vdd_ts is optional but adding
regulator support in submitted TMU V2 re-structured is more easier and
even regulator_get function call can be avoided. If you are ok I can
re-submit your patch series with regulator support present.
>>
>
> If you guys plan to move to feature based approach, like suggested in V1,
> then Id recommend adding a /* TODO: */ entry in your driver.
>
> Amit, are you including this LDO support on your rework?

I just submitted the re-structured patches without the LDO support. I
will add the regulator support in a new patch.

Thanks,
Amit Daniel
>
>
>>>
>>> Thanks,
>>> Amit Daniel
>>>
>>> On Thu, Apr 25, 2013 at 6:00 PM, Lukasz Majewski
>>> <l.majewski@samsung.com> wrote:
>>>>
>>>> TMU probe function now checks for a device tree defined regulator.
>>>> For compatibility reasons it is allowed to probe driver even without
>>>> this regulator defined.
>>>>
>>>> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
>>>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>>>> ---
>>>> Changes for v2:
>>>> - Change dev_info() to dev_warn()
>>>> ---
>>>>   drivers/thermal/exynos_thermal.c |   19 +++++++++++++++++++
>>>>   1 file changed, 19 insertions(+)
>>>>
>>>> diff --git a/drivers/thermal/exynos_thermal.c
>>>> b/drivers/thermal/exynos_thermal.c index 3d6e32a..328fe7e 100644
>>>> --- a/drivers/thermal/exynos_thermal.c
>>>> +++ b/drivers/thermal/exynos_thermal.c
>>>> @@ -38,6 +38,7 @@
>>>>   #include <linux/cpufreq.h>
>>>>   #include <linux/cpu_cooling.h>
>>>>   #include <linux/of.h>
>>>> +#include <linux/regulator/consumer.h>
>>>>
>>>>   #include <plat/cpu.h>
>>>>
>>>> @@ -119,6 +120,8 @@
>>>>
>>>>   #define EXYNOS_ZONE_COUNT      3
>>>>
>>>> +#define EXYNOS_TMU_REGULATOR "vdd_ts"
>>>> +
>>>>   struct exynos_tmu_data {
>>>>          struct exynos_tmu_platform_data *pdata;
>>>>          struct resource *mem;
>>>> @@ -948,6 +951,7 @@ static int exynos_tmu_probe(struct
>>>> platform_device *pdev) {
>>>>          struct exynos_tmu_data *data;
>>>>          struct exynos_tmu_platform_data *pdata =
>>>> pdev->dev.platform_data;
>>>> +       struct regulator *reg;
>>>>          int ret, i;
>>>>
>>>>          if (!pdata)
>>>> @@ -957,6 +961,21 @@ static int exynos_tmu_probe(struct
>>>> platform_device *pdev) dev_err(&pdev->dev, "No platform init data
>>>> supplied.\n"); return -ENODEV;
>>>>          }
>>>> +
>>>> +       reg = regulator_get(&pdev->dev, EXYNOS_TMU_REGULATOR);
>>>> +       if (!IS_ERR(reg)) {
>>>> +               ret = regulator_enable(reg);
>>>> +               if (ret) {
>>>> +                       dev_err(&pdev->dev, "Regulator %s not
>>>> enabled.\n",
>>>> +                               EXYNOS_TMU_REGULATOR);
>>>> +                       return ret;
>>>> +               }
>>>> +       } else {
>>>> +               dev_warn(&pdev->dev,
>>>> +                        "Regulator %s not defined at device
>>>> tree.\n",
>>>> +                        EXYNOS_TMU_REGULATOR);
>>>> +       }
>>>> +
>>>>          data = devm_kzalloc(&pdev->dev, sizeof(struct
>>>> exynos_tmu_data), GFP_KERNEL);
>>>>          if (!data) {
>>>> --
>>>> 1.7.10.4
>>>>
>>>> --
>>>> To unsubscribe from this list: send the line "unsubscribe
>>>> linux-samsung-soc" in the body of a message to
>>>> majordomo@vger.kernel.org More majordomo info at
>>>> http://vger.kernel.org/majordomo-info.html
>>
>>
>>
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree
  2013-04-27  0:50             ` Zhang Rui
@ 2013-04-29  4:38               ` amit daniel kachhap
  0 siblings, 0 replies; 57+ messages in thread
From: amit daniel kachhap @ 2013-04-29  4:38 UTC (permalink / raw)
  To: Zhang Rui
  Cc: Lukasz Majewski, Eduardo Valentin, Kukjin Kim,
	devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list, t.figa,
	Sachin Kamat, Myungjoo Ham, Kyungmin Park

On Sat, Apr 27, 2013 at 6:20 AM, Zhang Rui <rui.zhang@intel.com> wrote:
> Hi, all,
>
> what is the status now?
> which one is preferred, this one or the one from Amit's patch set?
Hi Rui,

I have still not submitted LDO support in the TMU driver. I will
re-base Lukasz patches on top of my patch series and submit shortly as
his changes are also important.

Thanks,
Amit Daniel


>
> thanks,
> rui
>
>
> On Thu, 2013-04-25 at 18:29 +0200, Lukasz Majewski wrote:
>> Hi Eduardo,
>>
>> > Amit, Lukasz,
>> >
>> > On 25-04-2013 09:29, Lukasz Majewski wrote:
>> > > Hi Amit,
>> > >
>> > >> Hi Lukasz Majewski,
>> > >>
>> > >> Sorry for late review but I am currently working on restructuring
>> > >> the whole exynos thermal driver and this support of LDO can be
>> > >> added as feature as not all socs support this. This is also
>> > >> suggested by Eduardo. All your other patches looks fine.
>> > >
>> > > But this is how it is already done. The VDD_TS is optional, so
>> > > Exynos5440 and Exynos4210 will not be broken.
>> > >
>> > > This shall preserve the correct behavior of the thermal driver.
>> > >
>> >
>> > If you guys plan to move to feature based approach, like suggested in
>> > V1, then Id recommend adding a /* TODO: */ entry in your driver.
>>
>> Ok, nice idea.
>>
>> >
>> > Amit, are you including this LDO support on your rework?
>>
>>
>>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 1/4] ARM: dts: thermal: exynos4: TMU device tree support for Exynos4412 targets
  2013-04-25 15:45     ` Eduardo Valentin
@ 2013-04-29  4:57       ` amit daniel kachhap
  0 siblings, 0 replies; 57+ messages in thread
From: amit daniel kachhap @ 2013-04-29  4:57 UTC (permalink / raw)
  To: Kukjin Kim, Lukasz Majewski
  Cc: devicetree-discuss@lists.ozlabs.org, Zhang Rui,
	linux-samsung-soc@vger.kernel.org, Linux PM list, t.figa,
	Sachin Kamat, Myungjoo Ham, Kyungmin Park, Eduardo Valentin

Hi,

On Thu, Apr 25, 2013 at 9:15 PM, Eduardo Valentin
<eduardo.valentin@ti.com> wrote:
> On 25-04-2013 08:30, Lukasz Majewski wrote:
>>
>> Device tree support for TMU at Exynos4x12 targets.
>>
>> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>
>
> This patch looks good to me:
> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>

This patch looks nice but I guess this patch should go via Kukjin
Kim's samsung tree.
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>

Thanks,
Amit Daniel
>
>> ---
>> Changes for v2:
>> - None
>> ---
>>   arch/arm/boot/dts/exynos4x12.dtsi |   10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/exynos4x12.dtsi
>> b/arch/arm/boot/dts/exynos4x12.dtsi
>> index e3380a7..ee920b3 100644
>> --- a/arch/arm/boot/dts/exynos4x12.dtsi
>> +++ b/arch/arm/boot/dts/exynos4x12.dtsi
>> @@ -79,4 +79,14 @@
>>                 interrupts = <0 89 0>;
>>                 status = "disabled";
>>         };
>> +
>> +       tmu@100C0000 {
>> +               compatible = "samsung,exynos4412-tmu";
>> +               interrupt-parent = <&combiner>;
>> +               reg = <0x100C0000 0x100>;
>> +               interrupts = <2 4>;
>> +               clocks = <&clock 383>;
>> +               clock-names = "tmu_apbif";
>> +               status = "disabled";
>> +       };
>>   };
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 57+ messages in thread

* Re: [PATCH v2 3/4] ARM: dts: thermal: exynos4: Add documentation for Exynos SoC thermal bindings
  2013-04-25 15:46     ` Eduardo Valentin
@ 2013-04-29  5:01       ` amit daniel kachhap
  0 siblings, 0 replies; 57+ messages in thread
From: amit daniel kachhap @ 2013-04-29  5:01 UTC (permalink / raw)
  To: Eduardo Valentin, Zhang Rui
  Cc: Lukasz Majewski, Kukjin Kim, devicetree-discuss@lists.ozlabs.org,
	linux-samsung-soc@vger.kernel.org, Linux PM list, t.figa,
	Sachin Kamat, Myungjoo Ham, Kyungmin Park

Hi Rui,

On Thu, Apr 25, 2013 at 9:16 PM, Eduardo Valentin
<eduardo.valentin@ti.com> wrote:
> On 25-04-2013 08:30, Lukasz Majewski wrote:
>>
>> Proper description for Exynos4 bindings added to Documentation/devicetree/
>> bindings
>>
>> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>
>
> I am fine with this one too.
>
> Reviewed-by: Eduardo Valentin <eduardo.valentin@ti.com>

This patch looks fine and can be merged.
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>

Thanks,
Amit Daniel
>
>
>> ---
>> Changes for v2:
>> - Documentation extension according to ML feedback
>> ---
>>   .../devicetree/bindings/thermal/exynos-thermal.txt |   25
>> ++++++++++++++++++++
>>   1 file changed, 25 insertions(+)
>>   create mode 100644
>> Documentation/devicetree/bindings/thermal/exynos-thermal.txt
>>
>> diff --git a/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
>> b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
>> new file mode 100644
>> index 0000000..535fd0e
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/thermal/exynos-thermal.txt
>> @@ -0,0 +1,25 @@
>> +* Exynos Thermal Management Unit (TMU)
>> +
>> +** Required properties:
>> +
>> +- compatible : One of the following:
>> +              "samsung,exynos4412-tmu"
>> +              "samsung,exynos4210-tmu"
>> +              "samsung,exynos5250-tmu"
>> +- interrupt-parent : The phandle for the interrupt controller
>> +- reg : Address range of the thermal registers
>> +- interrupts : Should contain interrupt for thermal system
>> +- clocks : The main clock for TMU device
>> +- clock-names : Thermal system clock name
>> +
>> +Example:
>> +
>> +       tmu@100C0000 {
>> +               compatible = "samsung,exynos4412-tmu";
>> +               interrupt-parent = <&combiner>;
>> +               reg = <0x100C0000 0x100>;
>> +               interrupts = <2 4>;
>> +               clocks = <&clock 383>;
>> +               clock-names = "tmu_apbif";
>> +               status = "disabled";
>> +       };
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 57+ messages in thread

end of thread, other threads:[~2013-04-29  5:01 UTC | newest]

Thread overview: 57+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-19 16:38 [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Lukasz Majewski
2013-04-19 16:38 ` [PATCH 1/6] clk:exynos4:TMU Thermal Measurement Unit clock added to common clock framework Lukasz Majewski
2013-04-19 16:38 ` [PATCH 2/6] thermal:exynos4: TMU Common clock framework support for TMU (Thermal Monitoring Unit) Lukasz Majewski
2013-04-19 17:26   ` Eduardo Valentin
2013-04-19 18:08   ` Sachin Kamat
2013-04-23  6:17     ` Lukasz Majewski
2013-04-23  7:15       ` Sachin Kamat
2013-04-23  8:06         ` Lukasz Majewski
2013-04-23  8:42           ` Sachin Kamat
2013-04-19 16:38 ` [PATCH 3/6] thermal:exynos4: TMU device tree support for Exynos4412 targets Lukasz Majewski
2013-04-19 17:28   ` Eduardo Valentin
2013-04-23  6:18     ` Lukasz Majewski
2013-04-22  4:19   ` Sachin Kamat
2013-04-23  6:19     ` Lukasz Majewski
2013-04-19 16:38 ` [PATCH 4/6] thermal: Support for TMU regulator defined at device tree Lukasz Majewski
2013-04-19 17:23   ` Eduardo Valentin
2013-04-23  6:23     ` Lukasz Majewski
2013-04-23 15:01       ` Eduardo Valentin
2013-04-19 16:38 ` [PATCH 5/6] thermal:exynos4: Enable support for Exynos4412 SoCs Lukasz Majewski
2013-04-19 18:11   ` Sachin Kamat
2013-04-19 18:21     ` Tomasz Figa
2013-04-19 18:26       ` Sachin Kamat
2013-04-22  6:25   ` amit kachhap
2013-04-22  6:35     ` Lukasz Majewski
2013-04-22  6:40     ` Sachin Kamat
2013-04-19 16:38 ` [PATCH 6/6] thermal:exynos4: Add documentation for Exynos SoC thermal bindings Lukasz Majewski
2013-04-22  4:55   ` Sachin Kamat
2013-04-23  6:25     ` Lukasz Majewski
2013-04-23  7:09       ` Sachin Kamat
2013-04-22 16:51 ` [PATCH 0/6] thermal:exynos4: Thermal Measurement Unit fixes for Samsung SoCs Kukjin Kim
2013-04-23  6:26   ` Lukasz Majewski
2013-04-23  7:19     ` Sachin Kamat
2013-04-23  8:01       ` Lukasz Majewski
2013-04-25 12:30 ` [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support Lukasz Majewski
2013-04-25 12:30   ` [PATCH v2 1/4] ARM: dts: thermal: exynos4: TMU device tree support for Exynos4412 targets Lukasz Majewski
2013-04-25 15:45     ` Eduardo Valentin
2013-04-29  4:57       ` amit daniel kachhap
2013-04-25 12:30   ` [PATCH v2 2/4] Thermal: exynos: Support for TMU regulator defined at device tree Lukasz Majewski
2013-04-25 13:09     ` amit daniel kachhap
2013-04-25 13:29       ` Lukasz Majewski
2013-04-25 15:44         ` Eduardo Valentin
2013-04-25 16:29           ` Lukasz Majewski
2013-04-27  0:50             ` Zhang Rui
2013-04-29  4:38               ` amit daniel kachhap
2013-04-29  4:35           ` amit daniel kachhap
2013-04-25 12:30   ` [PATCH v2 3/4] ARM: dts: thermal: exynos4: Add documentation for Exynos SoC thermal bindings Lukasz Majewski
2013-04-25 15:46     ` Eduardo Valentin
2013-04-29  5:01       ` amit daniel kachhap
2013-04-25 12:30   ` [PATCH v2 4/4] ARM:TMU:fix: Avoid lockup when first frequency table entry is CPUFREQ_ENTRY_INVALID Lukasz Majewski
2013-04-25 15:11     ` Eduardo Valentin
2013-04-25 15:22       ` Lukasz Majewski
2013-04-25 15:39         ` Eduardo Valentin
2013-04-25 15:39   ` [PATCH v2 0/4] Thermal:exynos: Thermal Measurement Unit fix and Samsung SoCs support Eduardo Valentin
2013-04-25 16:28     ` Lukasz Majewski
2013-04-26  5:05       ` Sachin Kamat
2013-04-26  6:39         ` Lukasz Majewski
2013-04-26  6:45           ` Sachin Kamat

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).