* [PATCH for 3.9 0/2] thermal: Marvell SoC thermal formula fixes
@ 2013-03-22 12:23 ` Ezequiel Garcia
0 siblings, 0 replies; 14+ messages in thread
From: Ezequiel Garcia @ 2013-03-22 12:23 UTC (permalink / raw)
To: linux-pm, linux-arm-kernel
Cc: Jason Cooper, Lior Amsalem, Zhang Rui, Nobuhiro Iwamatsu,
Thomas Petazzoni, Gregory Clement, Sebastian Hesselbarth,
Andrew Lunn, Ezequiel Garcia
This is a small patchset that fixes thermal sensor formulas for Kirkwood
and Dove thermal driver. The old formulas had been taken from 88AP510 public
datasheets which appears to be slightly wrong.
The current formula comes from Marvell internal documentation
and has been confirmed by Lior Amsalem.
This has been tested on a Kirkwood board (Openblocks A6) only.
If at all possible, I would like to have the Dove fix tested
before this is merged.
Please note that this fix was previously part of a bigger thermal
patchset [1]. I've taken this out so it can be applied on v3.9 first.
[1] http://www.spinics.net/lists/arm-kernel/msg231697.html
Ezequiel Garcia (2):
thermal: kirkwood: Fix thermal sensor formula
thermal: dove: Fix thermal sensor formula
drivers/thermal/dove_thermal.c | 7 ++++---
drivers/thermal/kirkwood_thermal.c | 8 ++++----
2 files changed, 8 insertions(+), 7 deletions(-)
--
1.7.8.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH for 3.9 0/2] thermal: Marvell SoC thermal formula fixes
@ 2013-03-22 12:23 ` Ezequiel Garcia
0 siblings, 0 replies; 14+ messages in thread
From: Ezequiel Garcia @ 2013-03-22 12:23 UTC (permalink / raw)
To: linux-arm-kernel
This is a small patchset that fixes thermal sensor formulas for Kirkwood
and Dove thermal driver. The old formulas had been taken from 88AP510 public
datasheets which appears to be slightly wrong.
The current formula comes from Marvell internal documentation
and has been confirmed by Lior Amsalem.
This has been tested on a Kirkwood board (Openblocks A6) only.
If at all possible, I would like to have the Dove fix tested
before this is merged.
Please note that this fix was previously part of a bigger thermal
patchset [1]. I've taken this out so it can be applied on v3.9 first.
[1] http://www.spinics.net/lists/arm-kernel/msg231697.html
Ezequiel Garcia (2):
thermal: kirkwood: Fix thermal sensor formula
thermal: dove: Fix thermal sensor formula
drivers/thermal/dove_thermal.c | 7 ++++---
drivers/thermal/kirkwood_thermal.c | 8 ++++----
2 files changed, 8 insertions(+), 7 deletions(-)
--
1.7.8.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/2] thermal: kirkwood: Fix thermal sensor formula
2013-03-22 12:23 ` Ezequiel Garcia
@ 2013-03-22 12:23 ` Ezequiel Garcia
-1 siblings, 0 replies; 14+ messages in thread
From: Ezequiel Garcia @ 2013-03-22 12:23 UTC (permalink / raw)
To: linux-pm, linux-arm-kernel
Cc: Jason Cooper, Lior Amsalem, Zhang Rui, Nobuhiro Iwamatsu,
Thomas Petazzoni, Gregory Clement, Sebastian Hesselbarth,
Andrew Lunn, Ezequiel Garcia
The currently formula has been taken from the 88AP510 SoC datasheet,
which is not exactly correct. The correct value for the temperature
in Celcius of the sensor present in this SoC is:
Celsius = (322-reg)/1.3625
Signed-off-by: Lior Amsalem <alior@marvell.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
drivers/thermal/kirkwood_thermal.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
index 65cb4f0..84b331f 100644
--- a/drivers/thermal/kirkwood_thermal.c
+++ b/drivers/thermal/kirkwood_thermal.c
@@ -49,13 +49,13 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
}
/*
- * Calculate temperature. See Section 8.10.1 of the 88AP510,
- * datasheet, which has the same sensor.
- * Documentation/arm/Marvell/README
+ * Calculate temperature. According to Marvell internal
+ * documentation the formula for this is:
+ * Celsius = (322-reg)/1.3625
*/
reg = (reg >> KIRKWOOD_THERMAL_TEMP_OFFSET) &
KIRKWOOD_THERMAL_TEMP_MASK;
- *temp = ((2281638UL - (7298*reg)) / 10);
+ *temp = ((3220000000UL - (10000000UL * reg)) / 13625);
return 0;
}
--
1.7.8.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 1/2] thermal: kirkwood: Fix thermal sensor formula
@ 2013-03-22 12:23 ` Ezequiel Garcia
0 siblings, 0 replies; 14+ messages in thread
From: Ezequiel Garcia @ 2013-03-22 12:23 UTC (permalink / raw)
To: linux-arm-kernel
The currently formula has been taken from the 88AP510 SoC datasheet,
which is not exactly correct. The correct value for the temperature
in Celcius of the sensor present in this SoC is:
Celsius = (322-reg)/1.3625
Signed-off-by: Lior Amsalem <alior@marvell.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
drivers/thermal/kirkwood_thermal.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
index 65cb4f0..84b331f 100644
--- a/drivers/thermal/kirkwood_thermal.c
+++ b/drivers/thermal/kirkwood_thermal.c
@@ -49,13 +49,13 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
}
/*
- * Calculate temperature. See Section 8.10.1 of the 88AP510,
- * datasheet, which has the same sensor.
- * Documentation/arm/Marvell/README
+ * Calculate temperature. According to Marvell internal
+ * documentation the formula for this is:
+ * Celsius = (322-reg)/1.3625
*/
reg = (reg >> KIRKWOOD_THERMAL_TEMP_OFFSET) &
KIRKWOOD_THERMAL_TEMP_MASK;
- *temp = ((2281638UL - (7298*reg)) / 10);
+ *temp = ((3220000000UL - (10000000UL * reg)) / 13625);
return 0;
}
--
1.7.8.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/2] thermal: dove: Fix thermal sensor formula
2013-03-22 12:23 ` Ezequiel Garcia
@ 2013-03-22 12:23 ` Ezequiel Garcia
-1 siblings, 0 replies; 14+ messages in thread
From: Ezequiel Garcia @ 2013-03-22 12:23 UTC (permalink / raw)
To: linux-pm, linux-arm-kernel
Cc: Jason Cooper, Lior Amsalem, Zhang Rui, Nobuhiro Iwamatsu,
Thomas Petazzoni, Gregory Clement, Sebastian Hesselbarth,
Andrew Lunn, Ezequiel Garcia
The currently formula has been taken from the 88AP510 SoC datasheet,
which is not exactly correct. The correct value for the temperature
in Celcius of the sensor present in this SoC is:
Celsius = (322-reg)/1.3625
Signed-off-by: Lior Amsalem <alior@marvell.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
Tested by compilation only.
drivers/thermal/dove_thermal.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
index 7b0bfa0..ddd73a5 100644
--- a/drivers/thermal/dove_thermal.c
+++ b/drivers/thermal/dove_thermal.c
@@ -107,12 +107,13 @@ static int dove_get_temp(struct thermal_zone_device *thermal,
}
/*
- * Calculate temperature. See Section 8.10.1 of 88AP510,
- * Documentation/arm/Marvell/README
+ * Calculate temperature. According to Marvell internal
+ * documentation the formula for this is:
+ * Celsius = (322-reg)/1.3625
*/
reg = readl_relaxed(priv->sensor);
reg = (reg >> DOVE_THERMAL_TEMP_OFFSET) & DOVE_THERMAL_TEMP_MASK;
- *temp = ((2281638UL - (7298*reg)) / 10);
+ *temp = ((3220000000UL - (10000000UL * reg)) / 13625);
return 0;
}
--
1.7.8.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/2] thermal: dove: Fix thermal sensor formula
@ 2013-03-22 12:23 ` Ezequiel Garcia
0 siblings, 0 replies; 14+ messages in thread
From: Ezequiel Garcia @ 2013-03-22 12:23 UTC (permalink / raw)
To: linux-arm-kernel
The currently formula has been taken from the 88AP510 SoC datasheet,
which is not exactly correct. The correct value for the temperature
in Celcius of the sensor present in this SoC is:
Celsius = (322-reg)/1.3625
Signed-off-by: Lior Amsalem <alior@marvell.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
Tested by compilation only.
drivers/thermal/dove_thermal.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
index 7b0bfa0..ddd73a5 100644
--- a/drivers/thermal/dove_thermal.c
+++ b/drivers/thermal/dove_thermal.c
@@ -107,12 +107,13 @@ static int dove_get_temp(struct thermal_zone_device *thermal,
}
/*
- * Calculate temperature. See Section 8.10.1 of 88AP510,
- * Documentation/arm/Marvell/README
+ * Calculate temperature. According to Marvell internal
+ * documentation the formula for this is:
+ * Celsius = (322-reg)/1.3625
*/
reg = readl_relaxed(priv->sensor);
reg = (reg >> DOVE_THERMAL_TEMP_OFFSET) & DOVE_THERMAL_TEMP_MASK;
- *temp = ((2281638UL - (7298*reg)) / 10);
+ *temp = ((3220000000UL - (10000000UL * reg)) / 13625);
return 0;
}
--
1.7.8.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH for 3.9 0/2] thermal: Marvell SoC thermal formula fixes
2013-03-22 12:23 ` Ezequiel Garcia
@ 2013-03-25 8:17 ` Zhang Rui
-1 siblings, 0 replies; 14+ messages in thread
From: Zhang Rui @ 2013-03-25 8:17 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: linux-pm, linux-arm-kernel, Jason Cooper, Lior Amsalem,
Nobuhiro Iwamatsu, Thomas Petazzoni, Gregory Clement,
Sebastian Hesselbarth, Andrew Lunn
Hi,
Ezequiel, thanks for your patch.
On Fri, 2013-03-22 at 09:23 -0300, Ezequiel Garcia wrote:
> This is a small patchset that fixes thermal sensor formulas for Kirkwood
> and Dove thermal driver. The old formulas had been taken from 88AP510 public
> datasheets which appears to be slightly wrong.
>
> The current formula comes from Marvell internal documentation
> and has been confirmed by Lior Amsalem.
>
> This has been tested on a Kirkwood board (Openblocks A6) only.
> If at all possible, I would like to have the Dove fix tested
> before this is merged.
>
> Please note that this fix was previously part of a bigger thermal
> patchset [1]. I've taken this out so it can be applied on v3.9 first.
>
> [1] http://www.spinics.net/lists/arm-kernel/msg231697.html
>
> Ezequiel Garcia (2):
> thermal: kirkwood: Fix thermal sensor formula
> thermal: dove: Fix thermal sensor formula
>
Nobuhiro and Andrew,
what do you think of these patches?
As I have no idea of the hardware details, I need your comments before
applying them.
thanks,
rui
> drivers/thermal/dove_thermal.c | 7 ++++---
> drivers/thermal/kirkwood_thermal.c | 8 ++++----
> 2 files changed, 8 insertions(+), 7 deletions(-)
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH for 3.9 0/2] thermal: Marvell SoC thermal formula fixes
@ 2013-03-25 8:17 ` Zhang Rui
0 siblings, 0 replies; 14+ messages in thread
From: Zhang Rui @ 2013-03-25 8:17 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
Ezequiel, thanks for your patch.
On Fri, 2013-03-22 at 09:23 -0300, Ezequiel Garcia wrote:
> This is a small patchset that fixes thermal sensor formulas for Kirkwood
> and Dove thermal driver. The old formulas had been taken from 88AP510 public
> datasheets which appears to be slightly wrong.
>
> The current formula comes from Marvell internal documentation
> and has been confirmed by Lior Amsalem.
>
> This has been tested on a Kirkwood board (Openblocks A6) only.
> If at all possible, I would like to have the Dove fix tested
> before this is merged.
>
> Please note that this fix was previously part of a bigger thermal
> patchset [1]. I've taken this out so it can be applied on v3.9 first.
>
> [1] http://www.spinics.net/lists/arm-kernel/msg231697.html
>
> Ezequiel Garcia (2):
> thermal: kirkwood: Fix thermal sensor formula
> thermal: dove: Fix thermal sensor formula
>
Nobuhiro and Andrew,
what do you think of these patches?
As I have no idea of the hardware details, I need your comments before
applying them.
thanks,
rui
> drivers/thermal/dove_thermal.c | 7 ++++---
> drivers/thermal/kirkwood_thermal.c | 8 ++++----
> 2 files changed, 8 insertions(+), 7 deletions(-)
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH for 3.9 0/2] thermal: Marvell SoC thermal formula fixes
2013-03-25 8:17 ` Zhang Rui
@ 2013-03-25 8:50 ` Andrew Lunn
-1 siblings, 0 replies; 14+ messages in thread
From: Andrew Lunn @ 2013-03-25 8:50 UTC (permalink / raw)
To: Zhang Rui
Cc: Ezequiel Garcia, linux-pm, linux-arm-kernel, Jason Cooper,
Lior Amsalem, Nobuhiro Iwamatsu, Thomas Petazzoni,
Gregory Clement, Sebastian Hesselbarth, Andrew Lunn
On Mon, Mar 25, 2013 at 04:17:36PM +0800, Zhang Rui wrote:
> Hi,
>
> Ezequiel, thanks for your patch.
>
> On Fri, 2013-03-22 at 09:23 -0300, Ezequiel Garcia wrote:
> > This is a small patchset that fixes thermal sensor formulas for Kirkwood
> > and Dove thermal driver. The old formulas had been taken from 88AP510 public
> > datasheets which appears to be slightly wrong.
> >
> > The current formula comes from Marvell internal documentation
> > and has been confirmed by Lior Amsalem.
> >
> > This has been tested on a Kirkwood board (Openblocks A6) only.
> > If at all possible, I would like to have the Dove fix tested
> > before this is merged.
> >
> > Please note that this fix was previously part of a bigger thermal
> > patchset [1]. I've taken this out so it can be applied on v3.9 first.
> >
> > [1] http://www.spinics.net/lists/arm-kernel/msg231697.html
> >
> > Ezequiel Garcia (2):
> > thermal: kirkwood: Fix thermal sensor formula
> > thermal: dove: Fix thermal sensor formula
> >
>
> Nobuhiro and Andrew,
>
> what do you think of these patches?
> As I have no idea of the hardware details, I need your comments before
> applying them.
I have no access to the internal documentation, so i cannot say if
this formula is correct or not. However, Lior Amsalem should be in the
know.
Acked-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH for 3.9 0/2] thermal: Marvell SoC thermal formula fixes
@ 2013-03-25 8:50 ` Andrew Lunn
0 siblings, 0 replies; 14+ messages in thread
From: Andrew Lunn @ 2013-03-25 8:50 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Mar 25, 2013 at 04:17:36PM +0800, Zhang Rui wrote:
> Hi,
>
> Ezequiel, thanks for your patch.
>
> On Fri, 2013-03-22 at 09:23 -0300, Ezequiel Garcia wrote:
> > This is a small patchset that fixes thermal sensor formulas for Kirkwood
> > and Dove thermal driver. The old formulas had been taken from 88AP510 public
> > datasheets which appears to be slightly wrong.
> >
> > The current formula comes from Marvell internal documentation
> > and has been confirmed by Lior Amsalem.
> >
> > This has been tested on a Kirkwood board (Openblocks A6) only.
> > If at all possible, I would like to have the Dove fix tested
> > before this is merged.
> >
> > Please note that this fix was previously part of a bigger thermal
> > patchset [1]. I've taken this out so it can be applied on v3.9 first.
> >
> > [1] http://www.spinics.net/lists/arm-kernel/msg231697.html
> >
> > Ezequiel Garcia (2):
> > thermal: kirkwood: Fix thermal sensor formula
> > thermal: dove: Fix thermal sensor formula
> >
>
> Nobuhiro and Andrew,
>
> what do you think of these patches?
> As I have no idea of the hardware details, I need your comments before
> applying them.
I have no access to the internal documentation, so i cannot say if
this formula is correct or not. However, Lior Amsalem should be in the
know.
Acked-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/2] thermal: kirkwood: Fix thermal sensor formula
2013-03-22 12:23 ` Ezequiel Garcia
@ 2013-03-26 14:24 ` Zhang Rui
-1 siblings, 0 replies; 14+ messages in thread
From: Zhang Rui @ 2013-03-26 14:24 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: linux-pm, linux-arm-kernel, Jason Cooper, Lior Amsalem,
Nobuhiro Iwamatsu, Thomas Petazzoni, Gregory Clement,
Sebastian Hesselbarth, Andrew Lunn
On Fri, 2013-03-22 at 09:23 -0300, Ezequiel Garcia wrote:
> The currently formula has been taken from the 88AP510 SoC datasheet,
> which is not exactly correct. The correct value for the temperature
> in Celcius of the sensor present in this SoC is:
>
> Celsius = (322-reg)/1.3625
>
> Signed-off-by: Lior Amsalem <alior@marvell.com>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
applied to thermal -next.
thanks,
rui
> ---
> drivers/thermal/kirkwood_thermal.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
> index 65cb4f0..84b331f 100644
> --- a/drivers/thermal/kirkwood_thermal.c
> +++ b/drivers/thermal/kirkwood_thermal.c
> @@ -49,13 +49,13 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
> }
>
> /*
> - * Calculate temperature. See Section 8.10.1 of the 88AP510,
> - * datasheet, which has the same sensor.
> - * Documentation/arm/Marvell/README
> + * Calculate temperature. According to Marvell internal
> + * documentation the formula for this is:
> + * Celsius = (322-reg)/1.3625
> */
> reg = (reg >> KIRKWOOD_THERMAL_TEMP_OFFSET) &
> KIRKWOOD_THERMAL_TEMP_MASK;
> - *temp = ((2281638UL - (7298*reg)) / 10);
> + *temp = ((3220000000UL - (10000000UL * reg)) / 13625);
>
> return 0;
> }
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/2] thermal: kirkwood: Fix thermal sensor formula
@ 2013-03-26 14:24 ` Zhang Rui
0 siblings, 0 replies; 14+ messages in thread
From: Zhang Rui @ 2013-03-26 14:24 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 2013-03-22 at 09:23 -0300, Ezequiel Garcia wrote:
> The currently formula has been taken from the 88AP510 SoC datasheet,
> which is not exactly correct. The correct value for the temperature
> in Celcius of the sensor present in this SoC is:
>
> Celsius = (322-reg)/1.3625
>
> Signed-off-by: Lior Amsalem <alior@marvell.com>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
applied to thermal -next.
thanks,
rui
> ---
> drivers/thermal/kirkwood_thermal.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
> index 65cb4f0..84b331f 100644
> --- a/drivers/thermal/kirkwood_thermal.c
> +++ b/drivers/thermal/kirkwood_thermal.c
> @@ -49,13 +49,13 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
> }
>
> /*
> - * Calculate temperature. See Section 8.10.1 of the 88AP510,
> - * datasheet, which has the same sensor.
> - * Documentation/arm/Marvell/README
> + * Calculate temperature. According to Marvell internal
> + * documentation the formula for this is:
> + * Celsius = (322-reg)/1.3625
> */
> reg = (reg >> KIRKWOOD_THERMAL_TEMP_OFFSET) &
> KIRKWOOD_THERMAL_TEMP_MASK;
> - *temp = ((2281638UL - (7298*reg)) / 10);
> + *temp = ((3220000000UL - (10000000UL * reg)) / 13625);
>
> return 0;
> }
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/2] thermal: dove: Fix thermal sensor formula
2013-03-22 12:23 ` Ezequiel Garcia
@ 2013-03-26 14:24 ` Zhang Rui
-1 siblings, 0 replies; 14+ messages in thread
From: Zhang Rui @ 2013-03-26 14:24 UTC (permalink / raw)
To: Ezequiel Garcia
Cc: linux-pm, linux-arm-kernel, Jason Cooper, Lior Amsalem,
Nobuhiro Iwamatsu, Thomas Petazzoni, Gregory Clement,
Sebastian Hesselbarth, Andrew Lunn
On Fri, 2013-03-22 at 09:23 -0300, Ezequiel Garcia wrote:
> The currently formula has been taken from the 88AP510 SoC datasheet,
> which is not exactly correct. The correct value for the temperature
> in Celcius of the sensor present in this SoC is:
>
> Celsius = (322-reg)/1.3625
>
> Signed-off-by: Lior Amsalem <alior@marvell.com>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
applied to thermal -next.
thanks,
rui
> ---
> Tested by compilation only.
>
> drivers/thermal/dove_thermal.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
> index 7b0bfa0..ddd73a5 100644
> --- a/drivers/thermal/dove_thermal.c
> +++ b/drivers/thermal/dove_thermal.c
> @@ -107,12 +107,13 @@ static int dove_get_temp(struct thermal_zone_device *thermal,
> }
>
> /*
> - * Calculate temperature. See Section 8.10.1 of 88AP510,
> - * Documentation/arm/Marvell/README
> + * Calculate temperature. According to Marvell internal
> + * documentation the formula for this is:
> + * Celsius = (322-reg)/1.3625
> */
> reg = readl_relaxed(priv->sensor);
> reg = (reg >> DOVE_THERMAL_TEMP_OFFSET) & DOVE_THERMAL_TEMP_MASK;
> - *temp = ((2281638UL - (7298*reg)) / 10);
> + *temp = ((3220000000UL - (10000000UL * reg)) / 13625);
>
> return 0;
> }
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 2/2] thermal: dove: Fix thermal sensor formula
@ 2013-03-26 14:24 ` Zhang Rui
0 siblings, 0 replies; 14+ messages in thread
From: Zhang Rui @ 2013-03-26 14:24 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 2013-03-22 at 09:23 -0300, Ezequiel Garcia wrote:
> The currently formula has been taken from the 88AP510 SoC datasheet,
> which is not exactly correct. The correct value for the temperature
> in Celcius of the sensor present in this SoC is:
>
> Celsius = (322-reg)/1.3625
>
> Signed-off-by: Lior Amsalem <alior@marvell.com>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
applied to thermal -next.
thanks,
rui
> ---
> Tested by compilation only.
>
> drivers/thermal/dove_thermal.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
> index 7b0bfa0..ddd73a5 100644
> --- a/drivers/thermal/dove_thermal.c
> +++ b/drivers/thermal/dove_thermal.c
> @@ -107,12 +107,13 @@ static int dove_get_temp(struct thermal_zone_device *thermal,
> }
>
> /*
> - * Calculate temperature. See Section 8.10.1 of 88AP510,
> - * Documentation/arm/Marvell/README
> + * Calculate temperature. According to Marvell internal
> + * documentation the formula for this is:
> + * Celsius = (322-reg)/1.3625
> */
> reg = readl_relaxed(priv->sensor);
> reg = (reg >> DOVE_THERMAL_TEMP_OFFSET) & DOVE_THERMAL_TEMP_MASK;
> - *temp = ((2281638UL - (7298*reg)) / 10);
> + *temp = ((3220000000UL - (10000000UL * reg)) / 13625);
>
> return 0;
> }
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2013-03-26 14:25 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-22 12:23 [PATCH for 3.9 0/2] thermal: Marvell SoC thermal formula fixes Ezequiel Garcia
2013-03-22 12:23 ` Ezequiel Garcia
2013-03-22 12:23 ` [PATCH 1/2] thermal: kirkwood: Fix thermal sensor formula Ezequiel Garcia
2013-03-22 12:23 ` Ezequiel Garcia
2013-03-26 14:24 ` Zhang Rui
2013-03-26 14:24 ` Zhang Rui
2013-03-22 12:23 ` [PATCH 2/2] thermal: dove: " Ezequiel Garcia
2013-03-22 12:23 ` Ezequiel Garcia
2013-03-26 14:24 ` Zhang Rui
2013-03-26 14:24 ` Zhang Rui
2013-03-25 8:17 ` [PATCH for 3.9 0/2] thermal: Marvell SoC thermal formula fixes Zhang Rui
2013-03-25 8:17 ` Zhang Rui
2013-03-25 8:50 ` Andrew Lunn
2013-03-25 8:50 ` Andrew Lunn
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.