* [PATCH 2/2] ACPI: show temperature in millidegree Celsius
2008-02-25 21:31 ` [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree Zhang, Rui
@ 2008-02-27 0:37 ` Zhang, Rui
-1 siblings, 0 replies; 12+ messages in thread
From: Zhang, Rui @ 2008-02-27 0:37 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, lm-sensors
Show the temperature in Millidegree Celsius.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
drivers/acpi/thermal.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
Index: linux-2.6/drivers/acpi/thermal.c
===================================================================
--- linux-2.6.orig/drivers/acpi/thermal.c
+++ linux-2.6/drivers/acpi/thermal.c
@@ -879,6 +879,8 @@ static void acpi_thermal_check(void *dat
}
/* sys I/F for generic thermal sysfs support */
+#define KELVIN_TO_MILLICELSIUS(t) (KELVIN_TO_CELSIUS(t) * 1000)
+
static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
{
struct acpi_thermal *tz = thermal->devdata;
@@ -886,7 +888,7 @@ static int thermal_get_temp(struct therm
if (!tz)
return -EINVAL;
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
}
static const char enabled[] = "kernel";
@@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct
if (tz->trips.critical.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.critical.temperature));
trip--;
}
if (tz->trips.hot.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.hot.temperature));
trip--;
}
if (tz->trips.passive.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.passive.temperature));
trip--;
}
@@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
tz->trips.active[i].flags.valid; i++) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.active[i].temperature));
trip--;
}
^ permalink raw reply [flat|nested] 12+ messages in thread* [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree
@ 2008-02-27 0:37 ` Zhang, Rui
0 siblings, 0 replies; 12+ messages in thread
From: Zhang, Rui @ 2008-02-27 0:37 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, lm-sensors
Show the temperature in Millidegree Celsius.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
drivers/acpi/thermal.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
Index: linux-2.6/drivers/acpi/thermal.c
=================================--- linux-2.6.orig/drivers/acpi/thermal.c
+++ linux-2.6/drivers/acpi/thermal.c
@@ -879,6 +879,8 @@ static void acpi_thermal_check(void *dat
}
/* sys I/F for generic thermal sysfs support */
+#define KELVIN_TO_MILLICELSIUS(t) (KELVIN_TO_CELSIUS(t) * 1000)
+
static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
{
struct acpi_thermal *tz = thermal->devdata;
@@ -886,7 +888,7 @@ static int thermal_get_temp(struct therm
if (!tz)
return -EINVAL;
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
}
static const char enabled[] = "kernel";
@@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct
if (tz->trips.critical.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.critical.temperature));
trip--;
}
if (tz->trips.hot.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.hot.temperature));
trip--;
}
if (tz->trips.passive.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.passive.temperature));
trip--;
}
@@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
tz->trips.active[i].flags.valid; i++) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.active[i].temperature));
trip--;
}
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 2/2] ACPI: show temperature in millidegree Celsius
2008-02-27 0:37 ` [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree Zhang, Rui
@ 2008-02-27 10:13 ` Alexey Starikovskiy
-1 siblings, 0 replies; 12+ messages in thread
From: Alexey Starikovskiy @ 2008-02-27 10:13 UTC (permalink / raw)
To: Zhang, Rui; +Cc: linux-acpi, lm-sensors, Len Brown
Rui,
As I remember, ACPI returns temperature in 10ths of degree. If you are
going to report it in 1000ths of degree,
there is no reason to round them to degree.
Regards,
Alex.
Zhang, Rui wrote:
> Show the temperature in Millidegree Celsius.
>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
> drivers/acpi/thermal.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> Index: linux-2.6/drivers/acpi/thermal.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/thermal.c
> +++ linux-2.6/drivers/acpi/thermal.c
> @@ -879,6 +879,8 @@ static void acpi_thermal_check(void *dat
> }
>
> /* sys I/F for generic thermal sysfs support */
> +#define KELVIN_TO_MILLICELSIUS(t) (KELVIN_TO_CELSIUS(t) * 1000)
> +
> static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
> {
> struct acpi_thermal *tz = thermal->devdata;
> @@ -886,7 +888,7 @@ static int thermal_get_temp(struct therm
> if (!tz)
> return -EINVAL;
>
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
> }
>
> static const char enabled[] = "kernel";
> @@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct
>
> if (tz->trips.critical.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.critical.temperature));
> trip--;
> }
>
> if (tz->trips.hot.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.hot.temperature));
> trip--;
> }
>
> if (tz->trips.passive.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.passive.temperature));
> trip--;
> }
> @@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct
> for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
> tz->trips.active[i].flags.valid; i++) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.active[i].temperature));
> trip--;
> }
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree
@ 2008-02-27 10:13 ` Alexey Starikovskiy
0 siblings, 0 replies; 12+ messages in thread
From: Alexey Starikovskiy @ 2008-02-27 10:13 UTC (permalink / raw)
To: Zhang, Rui; +Cc: linux-acpi, lm-sensors, Len Brown
Rui,
As I remember, ACPI returns temperature in 10ths of degree. If you are
going to report it in 1000ths of degree,
there is no reason to round them to degree.
Regards,
Alex.
Zhang, Rui wrote:
> Show the temperature in Millidegree Celsius.
>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
> drivers/acpi/thermal.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> Index: linux-2.6/drivers/acpi/thermal.c
> =================================> --- linux-2.6.orig/drivers/acpi/thermal.c
> +++ linux-2.6/drivers/acpi/thermal.c
> @@ -879,6 +879,8 @@ static void acpi_thermal_check(void *dat
> }
>
> /* sys I/F for generic thermal sysfs support */
> +#define KELVIN_TO_MILLICELSIUS(t) (KELVIN_TO_CELSIUS(t) * 1000)
> +
> static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
> {
> struct acpi_thermal *tz = thermal->devdata;
> @@ -886,7 +888,7 @@ static int thermal_get_temp(struct therm
> if (!tz)
> return -EINVAL;
>
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
> }
>
> static const char enabled[] = "kernel";
> @@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct
>
> if (tz->trips.critical.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.critical.temperature));
> trip--;
> }
>
> if (tz->trips.hot.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.hot.temperature));
> trip--;
> }
>
> if (tz->trips.passive.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.passive.temperature));
> trip--;
> }
> @@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct
> for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
> tz->trips.active[i].flags.valid; i++) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.active[i].temperature));
> trip--;
> }
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 2/2] ACPI: show temperature in millidegree Celsius
2008-02-27 10:13 ` [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree Alexey Starikovskiy
@ 2008-02-27 23:51 ` Zhang, Rui
-1 siblings, 0 replies; 12+ messages in thread
From: Zhang, Rui @ 2008-02-27 23:51 UTC (permalink / raw)
To: Alexey Starikovskiy; +Cc: Len Brown, linux-acpi, lm-sensors
On Wed, 2008-02-27 at 18:13 +0800, Alexey Starikovskiy wrote:
> Rui,
>
> As I remember, ACPI returns temperature in 10ths of degree. If you are
> going to report it in 1000ths of degree,
> there is no reason to round them to degree.
>
Show the temperature in Millidegree Celsius.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
drivers/acpi/thermal.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
Index: linux-2.6/drivers/acpi/thermal.c
===================================================================
--- linux-2.6.orig/drivers/acpi/thermal.c
+++ linux-2.6/drivers/acpi/thermal.c
@@ -879,6 +879,8 @@ static void acpi_thermal_check(void *dat
}
/* sys I/F for generic thermal sysfs support */
+#define KELVIN_TO_MILLICELSIUS(t) (t * 100 - 273200)
+
static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
{
struct acpi_thermal *tz = thermal->devdata;
@@ -886,7 +888,7 @@ static int thermal_get_temp(struct therm
if (!tz)
return -EINVAL;
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
}
static const char enabled[] = "kernel";
@@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct
if (tz->trips.critical.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.critical.temperature));
trip--;
}
if (tz->trips.hot.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.hot.temperature));
trip--;
}
if (tz->trips.passive.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.passive.temperature));
trip--;
}
@@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
tz->trips.active[i].flags.valid; i++) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.active[i].temperature));
trip--;
}
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree
@ 2008-02-27 23:51 ` Zhang, Rui
0 siblings, 0 replies; 12+ messages in thread
From: Zhang, Rui @ 2008-02-27 23:51 UTC (permalink / raw)
To: Alexey Starikovskiy; +Cc: Len Brown, linux-acpi, lm-sensors
On Wed, 2008-02-27 at 18:13 +0800, Alexey Starikovskiy wrote:
> Rui,
>
> As I remember, ACPI returns temperature in 10ths of degree. If you are
> going to report it in 1000ths of degree,
> there is no reason to round them to degree.
>
Show the temperature in Millidegree Celsius.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
drivers/acpi/thermal.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
Index: linux-2.6/drivers/acpi/thermal.c
=================================--- linux-2.6.orig/drivers/acpi/thermal.c
+++ linux-2.6/drivers/acpi/thermal.c
@@ -879,6 +879,8 @@ static void acpi_thermal_check(void *dat
}
/* sys I/F for generic thermal sysfs support */
+#define KELVIN_TO_MILLICELSIUS(t) (t * 100 - 273200)
+
static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
{
struct acpi_thermal *tz = thermal->devdata;
@@ -886,7 +888,7 @@ static int thermal_get_temp(struct therm
if (!tz)
return -EINVAL;
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
}
static const char enabled[] = "kernel";
@@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct
if (tz->trips.critical.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.critical.temperature));
trip--;
}
if (tz->trips.hot.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.hot.temperature));
trip--;
}
if (tz->trips.passive.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.passive.temperature));
trip--;
}
@@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
tz->trips.active[i].flags.valid; i++) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.active[i].temperature));
trip--;
}
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 2/2] ACPI: show temperature in millidegree Celsius
2008-02-27 23:51 ` [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree Zhang, Rui
@ 2008-02-28 21:00 ` Jean Delvare
-1 siblings, 0 replies; 12+ messages in thread
From: Jean Delvare @ 2008-02-28 21:00 UTC (permalink / raw)
To: Zhang, Rui; +Cc: Alexey Starikovskiy, linux-acpi, lm-sensors, Len Brown
Hi Rui,
On Thu, 28 Feb 2008 07:51:30 +0800, Zhang, Rui wrote:
>
> On Wed, 2008-02-27 at 18:13 +0800, Alexey Starikovskiy wrote:
> > Rui,
> >
> > As I remember, ACPI returns temperature in 10ths of degree. If you are
> > going to report it in 1000ths of degree,
> > there is no reason to round them to degree.
> >
>
> Show the temperature in Millidegree Celsius.
>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
> drivers/acpi/thermal.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> Index: linux-2.6/drivers/acpi/thermal.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/thermal.c
> +++ linux-2.6/drivers/acpi/thermal.c
> @@ -879,6 +879,8 @@ static void acpi_thermal_check(void *dat
> }
>
> /* sys I/F for generic thermal sysfs support */
> +#define KELVIN_TO_MILLICELSIUS(t) (t * 100 - 273200)
> +
> static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
> {
> struct acpi_thermal *tz = thermal->devdata;
> @@ -886,7 +888,7 @@ static int thermal_get_temp(struct therm
> if (!tz)
> return -EINVAL;
>
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
> }
>
> static const char enabled[] = "kernel";
> @@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct
>
> if (tz->trips.critical.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.critical.temperature));
> trip--;
> }
>
> if (tz->trips.hot.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.hot.temperature));
> trip--;
> }
>
> if (tz->trips.passive.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.passive.temperature));
> trip--;
> }
> @@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct
> for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
> tz->trips.active[i].flags.valid; i++) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.active[i].temperature));
> trip--;
> }
Yes, I like this one much better, thanks.
Acked-by: Jean Delvare <khali@linux-fr.org>
--
Jean Delvare
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree
@ 2008-02-28 21:00 ` Jean Delvare
0 siblings, 0 replies; 12+ messages in thread
From: Jean Delvare @ 2008-02-28 21:00 UTC (permalink / raw)
To: Zhang, Rui; +Cc: Alexey Starikovskiy, linux-acpi, lm-sensors, Len Brown
Hi Rui,
On Thu, 28 Feb 2008 07:51:30 +0800, Zhang, Rui wrote:
>
> On Wed, 2008-02-27 at 18:13 +0800, Alexey Starikovskiy wrote:
> > Rui,
> >
> > As I remember, ACPI returns temperature in 10ths of degree. If you are
> > going to report it in 1000ths of degree,
> > there is no reason to round them to degree.
> >
>
> Show the temperature in Millidegree Celsius.
>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
> drivers/acpi/thermal.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> Index: linux-2.6/drivers/acpi/thermal.c
> =================================> --- linux-2.6.orig/drivers/acpi/thermal.c
> +++ linux-2.6/drivers/acpi/thermal.c
> @@ -879,6 +879,8 @@ static void acpi_thermal_check(void *dat
> }
>
> /* sys I/F for generic thermal sysfs support */
> +#define KELVIN_TO_MILLICELSIUS(t) (t * 100 - 273200)
> +
> static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
> {
> struct acpi_thermal *tz = thermal->devdata;
> @@ -886,7 +888,7 @@ static int thermal_get_temp(struct therm
> if (!tz)
> return -EINVAL;
>
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
> }
>
> static const char enabled[] = "kernel";
> @@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct
>
> if (tz->trips.critical.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.critical.temperature));
> trip--;
> }
>
> if (tz->trips.hot.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.hot.temperature));
> trip--;
> }
>
> if (tz->trips.passive.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.passive.temperature));
> trip--;
> }
> @@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct
> for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
> tz->trips.active[i].flags.valid; i++) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.active[i].temperature));
> trip--;
> }
Yes, I like this one much better, thanks.
Acked-by: Jean Delvare <khali@linux-fr.org>
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] ACPI: show temperature in millidegree Celsius
2008-02-27 23:51 ` [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree Zhang, Rui
@ 2008-03-12 4:28 ` Len Brown
-1 siblings, 0 replies; 12+ messages in thread
From: Len Brown @ 2008-03-12 4:28 UTC (permalink / raw)
To: Zhang, Rui; +Cc: Alexey Starikovskiy, linux-acpi, lm-sensors
Applied.
thanks,
-Len
On Wednesday 27 February 2008, Zhang, Rui wrote:
>
> On Wed, 2008-02-27 at 18:13 +0800, Alexey Starikovskiy wrote:
> > Rui,
> >
> > As I remember, ACPI returns temperature in 10ths of degree. If you are
> > going to report it in 1000ths of degree,
> > there is no reason to round them to degree.
> >
>
> Show the temperature in Millidegree Celsius.
>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
> drivers/acpi/thermal.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> Index: linux-2.6/drivers/acpi/thermal.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/thermal.c
> +++ linux-2.6/drivers/acpi/thermal.c
> @@ -879,6 +879,8 @@ static void acpi_thermal_check(void *dat
> }
>
> /* sys I/F for generic thermal sysfs support */
> +#define KELVIN_TO_MILLICELSIUS(t) (t * 100 - 273200)
> +
> static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
> {
> struct acpi_thermal *tz = thermal->devdata;
> @@ -886,7 +888,7 @@ static int thermal_get_temp(struct therm
> if (!tz)
> return -EINVAL;
>
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
> }
>
> static const char enabled[] = "kernel";
> @@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct
>
> if (tz->trips.critical.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.critical.temperature));
> trip--;
> }
>
> if (tz->trips.hot.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.hot.temperature));
> trip--;
> }
>
> if (tz->trips.passive.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.passive.temperature));
> trip--;
> }
> @@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct
> for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
> tz->trips.active[i].flags.valid; i++) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.active[i].temperature));
> trip--;
> }
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" 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] 12+ messages in thread* Re: [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree
@ 2008-03-12 4:28 ` Len Brown
0 siblings, 0 replies; 12+ messages in thread
From: Len Brown @ 2008-03-12 4:28 UTC (permalink / raw)
To: Zhang, Rui; +Cc: Alexey Starikovskiy, linux-acpi, lm-sensors
Applied.
thanks,
-Len
On Wednesday 27 February 2008, Zhang, Rui wrote:
>
> On Wed, 2008-02-27 at 18:13 +0800, Alexey Starikovskiy wrote:
> > Rui,
> >
> > As I remember, ACPI returns temperature in 10ths of degree. If you are
> > going to report it in 1000ths of degree,
> > there is no reason to round them to degree.
> >
>
> Show the temperature in Millidegree Celsius.
>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
> drivers/acpi/thermal.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> Index: linux-2.6/drivers/acpi/thermal.c
> =================================> --- linux-2.6.orig/drivers/acpi/thermal.c
> +++ linux-2.6/drivers/acpi/thermal.c
> @@ -879,6 +879,8 @@ static void acpi_thermal_check(void *dat
> }
>
> /* sys I/F for generic thermal sysfs support */
> +#define KELVIN_TO_MILLICELSIUS(t) (t * 100 - 273200)
> +
> static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
> {
> struct acpi_thermal *tz = thermal->devdata;
> @@ -886,7 +888,7 @@ static int thermal_get_temp(struct therm
> if (!tz)
> return -EINVAL;
>
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
> }
>
> static const char enabled[] = "kernel";
> @@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct
>
> if (tz->trips.critical.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.critical.temperature));
> trip--;
> }
>
> if (tz->trips.hot.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.hot.temperature));
> trip--;
> }
>
> if (tz->trips.passive.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.passive.temperature));
> trip--;
> }
> @@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct
> for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
> tz->trips.active[i].flags.valid; i++) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.active[i].temperature));
> trip--;
> }
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/2] ACPI: show temperature in millidegree Celsius
@ 2008-02-25 21:31 ` Zhang, Rui
0 siblings, 0 replies; 12+ messages in thread
From: Zhang, Rui @ 2008-02-25 21:31 UTC (permalink / raw)
To: linux-acpi, lm-sensors
Cc: Hans de Goede, Jean Delvare, Matthew Garrett, Thomas Renninger,
Thomas, Sujith, Mark M. Hoffman, Henrique de Moraes Holschuh,
Len Brown, Richard Hughes, Zhang, Rui
Show the temperature in Millidegree Celsius.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
drivers/acpi/thermal.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
Index: linux-2.6.25-rc2/drivers/acpi/thermal.c
===================================================================
--- linux-2.6.25-rc2.orig/drivers/acpi/thermal.c 2008-02-25 22:43:29.000000000 -0500
+++ linux-2.6.25-rc2/drivers/acpi/thermal.c 2008-02-26 01:11:08.000000000 -0500
@@ -879,6 +879,8 @@
}
/* sys I/F for generic thermal sysfs support */
+#define KELVIN_TO_MILLICELSIUS(t) (KELVIN_TO_CELSIUS(t) * 1000)
+
static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
{
struct acpi_thermal *tz = thermal->devdata;
@@ -886,7 +888,7 @@
if (!tz)
return -EINVAL;
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
}
static const char enabled[] = "kernel";
@@ -980,21 +982,21 @@
if (tz->trips.critical.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.critical.temperature));
trip--;
}
if (tz->trips.hot.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.hot.temperature));
trip--;
}
if (tz->trips.passive.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.passive.temperature));
trip--;
}
@@ -1002,7 +1004,7 @@
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
tz->trips.active[i].flags.valid; i++) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.active[i].temperature));
trip--;
}
@@ -1121,7 +1123,7 @@
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
tz->trips.active[i].flags.valid; i++, trips++);
- tz->thermal_zone = thermal_zone_device_register("ACPI thermal zone",
+ tz->thermal_zone = thermal_zone_device_register("ACPI",
trips, tz, &acpi_thermal_zone_ops);
if (!tz->thermal_zone)
return -ENODEV;
^ permalink raw reply [flat|nested] 12+ messages in thread* [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree
@ 2008-02-25 21:31 ` Zhang, Rui
0 siblings, 0 replies; 12+ messages in thread
From: Zhang, Rui @ 2008-02-25 21:31 UTC (permalink / raw)
To: linux-acpi, lm-sensors
Cc: Hans de Goede, Jean Delvare, Matthew Garrett, Thomas Renninger,
Thomas, Sujith, Mark M. Hoffman, Henrique de Moraes Holschuh,
Len Brown, Richard Hughes, Zhang, Rui
Show the temperature in Millidegree Celsius.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
drivers/acpi/thermal.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
Index: linux-2.6.25-rc2/drivers/acpi/thermal.c
=================================--- linux-2.6.25-rc2.orig/drivers/acpi/thermal.c 2008-02-25 22:43:29.000000000 -0500
+++ linux-2.6.25-rc2/drivers/acpi/thermal.c 2008-02-26 01:11:08.000000000 -0500
@@ -879,6 +879,8 @@
}
/* sys I/F for generic thermal sysfs support */
+#define KELVIN_TO_MILLICELSIUS(t) (KELVIN_TO_CELSIUS(t) * 1000)
+
static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
{
struct acpi_thermal *tz = thermal->devdata;
@@ -886,7 +888,7 @@
if (!tz)
return -EINVAL;
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
}
static const char enabled[] = "kernel";
@@ -980,21 +982,21 @@
if (tz->trips.critical.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.critical.temperature));
trip--;
}
if (tz->trips.hot.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.hot.temperature));
trip--;
}
if (tz->trips.passive.flags.valid) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.passive.temperature));
trip--;
}
@@ -1002,7 +1004,7 @@
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
tz->trips.active[i].flags.valid; i++) {
if (!trip)
- return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+ return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
tz->trips.active[i].temperature));
trip--;
}
@@ -1121,7 +1123,7 @@
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
tz->trips.active[i].flags.valid; i++, trips++);
- tz->thermal_zone = thermal_zone_device_register("ACPI thermal zone",
+ tz->thermal_zone = thermal_zone_device_register("ACPI",
trips, tz, &acpi_thermal_zone_ops);
if (!tz->thermal_zone)
return -ENODEV;
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-03-12 4:29 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-27 0:37 [PATCH 2/2] ACPI: show temperature in millidegree Celsius Zhang, Rui
2008-02-27 0:37 ` [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree Zhang, Rui
2008-02-27 10:13 ` [PATCH 2/2] ACPI: show temperature in millidegree Celsius Alexey Starikovskiy
2008-02-27 10:13 ` [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree Alexey Starikovskiy
2008-02-27 23:51 ` [PATCH 2/2] ACPI: show temperature in millidegree Celsius Zhang, Rui
2008-02-27 23:51 ` [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree Zhang, Rui
2008-02-28 21:00 ` [PATCH 2/2] ACPI: show temperature in millidegree Celsius Jean Delvare
2008-02-28 21:00 ` [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree Jean Delvare
2008-03-12 4:28 ` [PATCH 2/2] ACPI: show temperature in millidegree Celsius Len Brown
2008-03-12 4:28 ` [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree Len Brown
-- strict thread matches above, loose matches on Subject: below --
2008-02-25 21:31 [PATCH 2/2] ACPI: show temperature in millidegree Celsius Zhang, Rui
2008-02-25 21:31 ` [lm-sensors] [PATCH 2/2] ACPI: show temperature in millidegree Zhang, Rui
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.