Intel Moorestown Platform Thermal Driver
From 67d01c75ead0af5565d649e234e3f8c085871016 Mon Sep 17 00:00:00 2001
From: Kalhan Trisal <[email protected]>
Date: Mon, 6 Jul 2009 16:50:08 -0400
Subject: [PATCH] Intel Moorestown Platform thermal driver
Moorestown Platform has EMC1403 chip which support three thermal devices, one thermal zone is used by the EMC1403 chip itself and second is used by processor and third one is used for platform (skin temperature).Driver support poll and interrupt mode,min/max/crit configuration can be done using sysfs interface.
The driver also support interrupt mode when the temperature crosses the threshold configured value the min/max/crit. ALERT/THERM interrupt will be triggered and driver register its callback with GPE driver, and send the events to OSPM power management to take action. OSPM will take action and set the new threshold values till it doesnot get ALERT/THERM events.temp1 is used for configuring internal EMC1403 chip diode, temp2 is used to configure processor diode and temp3 is used to configure the platform diode.
The interrupt mode code has dependency MRST GPIO/GPE/OSPM drivers. Interupt code is under FLAG once these drivers are accepted the FLAG will be enabled and this part of functionality will also work.
--- drivers/hwmon/Kconfig | 10 + drivers/hwmon/Makefile | 1 + drivers/hwmon/mrst_thermal.c | 732 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 743 insertions(+), 0 deletions(-) create mode 100755 drivers/hwmon/mrst_thermal.c
drivers/hwmon/Kconfig +10 -0
@@ -1017,6 +1017,16 @@ config SENSORS_APPLESMC Say Y here if you have an applicable laptop and want to experience the awesome power of applesmc. +config SENSORS_MRST_THERMAL + tristate "Moorestown Thermal" +# depends on I2C_MRST && GPE && GPIO_MAX7315 && MSTWN_POWER_MGMT + help + If you say yes here you get support for the SMSC Devices + EMC1403 temperature monitoring chip. + + Threshold values can be configured using sysfs. + Data from the different diode are accessible via sysfs. + config HWMON_DEBUG_CHIP bool "Hardware Monitoring Chip debugging messages" default n
drivers/hwmon/Makefile +1 -0
@@ -89,6 +89,7 @@ obj-$(CONFIG_SENSORS_VT8231) += vt8231.o obj-$(CONFIG_SENSORS_W83627EHF) += w83627ehf.o obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o obj-$(CONFIG_SENSORS_W83L786NG) += w83l786ng.o +obj-$(CONFIG_SENSORS_MRST_THERMAL) += mrst_thermal.o ifeq ($(CONFIG_HWMON_DEBUG_CHIP),y) EXTRA_CFLAGS += -DDEBUG
drivers/hwmon/mrst_thermal.c new file +732 -0
732 lines not on this page · raw message
Signature · 7 lines
1.6.0.6 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 5 lines · Kalhan Trisal
Moorestown Platform has EMC1403 chip which support three thermal devices, one thermal zone is used by the EMC1403 chip itself and second is used by processor and third one is used for platform (skin temperature).Driver support poll and interrupt mode,min/max/crit configuration can be done using sysfs interface.
If it is a generic chip, why does the driver name makes it sound like it is moorestown-specific? Wouldn't it make more sense for this to be named the emc1403 driver, instead?
Signature · 9 lines
"One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Henrique
I thought about that but then the interrupt logic is very much specific to Moorestown platform. I am comfortable in renaming the driver to emc1403.
Thanks
Kalhan
-----Original Message-----
From: Henrique de Moraes Holschuh [mailto:[email protected]]
Sent: Monday, July 06, 2009 9:34 PM
To: Trisal, Kalhan
Cc: [email protected]; [email protected]
Subject: Re: [lm-sensors] Intel Moorestown Platform Thermal Driver
Quoted 5 lines · Kalhan Trisal
Moorestown Platform has EMC1403 chip which support three thermal devices, one thermal zone is used by the EMC1403 chip itself and second is used by processor and third one is used for platform (skin temperature).Driver support poll and interrupt mode,min/max/crit configuration can be done using sysfs interface.
If it is a generic chip, why does the driver name makes it sound like it is moorestown-specific? Wouldn't it make more sense for this to be named the emc1403 driver, instead?
Signature · 9 lines
"One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 2 lines · Kalhan
Hi Henrique
I thought about that but then the interrupt logic is very much specific to Moorestown platform. I am comfortable in renaming the driver to emc1403.
Can it be made to work with DMI matches so that it enables the interrupt logic on moorestown, and uses a generic approach otherwise?
Either that, or split it in two files, one with the moorestown specific stuff, the other with the generic chip driver?
Anyway, if it is too difficult to do that or it doesn't make much sense because nobody else uses the emc1403, the fact that it has moorestown-specific stuff in it does excuse the name... but in that case, I'd call it moorestown_hwmon or something, to avoid clashes.
Signature · 9 lines
"One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
I have renamed the driver with emc1403 driver as the driver is generic enough to be used for emc1403 chip. The interrupt part is kept inside the flag so that code gets enabled only when Power management in the Moorestown platform is enabled.
-----Original Message-----
From: Henrique de Moraes Holschuh [mailto:[email protected]]
Sent: Tuesday, July 07, 2009 8:20 PM
To: Trisal, Kalhan
Cc: [email protected]; [email protected]
Subject: Re: [lm-sensors] Intel Moorestown Platform Thermal Driver
Quoted 2 lines · Kalhan
Hi Henrique
I thought about that but then the interrupt logic is very much specific to Moorestown platform. I am comfortable in renaming the driver to emc1403.
Can it be made to work with DMI matches so that it enables the interrupt logic on moorestown, and uses a generic approach otherwise?
Either that, or split it in two files, one with the moorestown specific stuff, the other with the generic chip driver?
Anyway, if it is too difficult to do that or it doesn't make much sense because nobody else uses the emc1403, the fact that it has moorestown-specific stuff in it does excuse the name... but in that case, I'd call it moorestown_hwmon or something, to avoid clashes.
Signature · 9 lines
"One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 2 lines · Kalhan
I have renamed the driver with emc1403 driver as the driver is generic enough to be used for emc1403 chip. The interrupt part is kept inside the flag so that code gets enabled only when Power management in the Moorestown platform is enabled.
Hi,
Yes, but currently this is a #ifdef, besides the #ifdef there also should be a runtime check to only switch to interrupt based operation when actually running on a Moorestown platform, iow we want the *same* kernel to be able to run on both an emc1403 on some generic machine (so in polling mode only) and on a Moorestown platform (and use the interrupt stuff there).
Regards,
Hans
Quoted 14 lines
-----Original Message-----
From: Henrique de Moraes Holschuh [mailto:[email protected]]
Sent: Tuesday, July 07, 2009 8:20 PM
To: Trisal, Kalhan
Cc: [email protected]; [email protected]
Subject: Re: [lm-sensors] Intel Moorestown Platform Thermal DriverQuoted 2 lines · Kalhan
Hi Henrique
I thought about that but then the interrupt logic is very much specific to Moorestown platform. I am comfortable in renaming the driver to emc1403.Can it be made to work with DMI matches so that it enables the interrupt logic on moorestown, and uses a generic approach otherwise?
Quoted 8 lines
Either that, or split it in two files, one with the moorestown specific stuff, the other with the generic chip driver?
Anyway, if it is too difficult to do that or it doesn't make much sense because nobody else uses the emc1403, the fact that it has moorestown-specific stuff in it does excuse the name... but in that case, I'd call it
moorestown_hwmonor something, to avoid clashes.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors