Skip to contentSkip to conversation

Thermal driver for EMC1403

lm-sensors Kalhan Trisal 2 participants 3 messages Jul 15, 2009 – Jul 16, 2009 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

From 91f6d1d006741bb07a2e6603452b503a840c5c4d Mon Sep 17 00:00:00 2001
From: Kalhan Trisal <[email protected]>
Date: Wed, 15 Jul 2009 20:38:15 -0400
Subject: [PATCH] Thermal driver for EMC1403 chip

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/MAX7315/OSPM drivers.Flag is added to differentiate the generic functional with Moorestown specific.

Signed-off-by Kalhan Trisal <kalhan.trisal at intel.com>
---
 drivers/hwmon/Kconfig     |   10 +
 drivers/hwmon/Makefile    |    1 +
 drivers/hwmon/emc1403.c   |  738 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/intel_mid.h |    8 +
 4 files changed, 757 insertions(+), 0 deletions(-)
 create mode 100755 drivers/hwmon/emc1403.c
drivers/hwmon/Kconfig +10 -0
index 2d50166..c1e8be0 100644
@@ -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_EMC1403
+	tristate "SMSC EMC1403 Thermal"
+	depends on I2C_MRST 
+	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
index b793dce..b547757 100644
@@ -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_EMC1403)	+= emc1403.o
 
 ifeq ($(CONFIG_HWMON_DEBUG_CHIP),y)
 EXTRA_CFLAGS += -DDEBUG
drivers/hwmon/emc1403.c new file +738 -0

738 lines not on this page · raw message

include/linux/intel_mid.h +8 -0
index f64fb3c..5eb983c 100755
@@ -90,12 +90,20 @@ enum eospm_events {
 	OSPM_EVENT_CMD_ERROR,
 	OSPM_EVENT_AUDIO_BUF_EMPTY,
 	OSPM_EVENT_AUDIO_BUF_FULL,
+	OSPM_EVENT_THERMAL_AUX0,
+	OSPM_EVENT_THERMAL_AUX1,
+	OSPM_EVENT_THERMAL_CRITICAL,
+	OSPM_EVENT_THERMAL_DEV_FAULT,
 	__OSPM_EVENT_COUNT,
 };
 
 #define AUDIO_SUBSYTEM_ID	25
 #define MID_S0I1_STATE  	1
 #define MID_S0I3_STATE  	3
+/* Thermal device Id */
+#define TEMP_DEV_ID1     40
+#define TEMP_DEV_ID2     41
+#define TEMP_DEV_ID3     42
 
 /* First 32 (0-31) originators are subsystems
    Next 8 (0-7) are cmd IDs */
Signature · 7 lines
1.6.0.6


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw

Hi Kalhan,

Quoted 12 lines · Kalhan Trisal

From 91f6d1d006741bb07a2e6603452b503a840c5c4d Mon Sep 17 00:00:00 2001
From: Kalhan Trisal <[email protected]>
Date: Wed, 15 Jul 2009 20:38:15 -0400
Subject: [PATCH] Thermal driver for EMC1403 chip

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/MAX7315/OSPM drivers.Flag is added to differentiate the generic functional with Moorestown specific.

Signed-off-by Kalhan Trisal <kalhan.trisal at intel.com>
Quoted 7 lines
---
 drivers/hwmon/Kconfig     |   10 +
 drivers/hwmon/Makefile    |    1 +
 drivers/hwmon/emc1403.c   |  738 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/intel_mid.h |    8 +
 4 files changed, 757 insertions(+), 0 deletions(-)
 create mode 100755 drivers/hwmon/emc1403.c

You sent the patch to me but I do not have the time to review your driver. You will have to find somebody else, sorry.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#2 lore raw
In reply to Kalhan Trisal

Based on my previous with discussion with Henrique I submitted the patch again.

Thanks
Kalhan

-----Original Message-----
From: Jean Delvare [mailto:[email protected]]
Sent: Thursday, July 16, 2009 1:38 AM
To: Trisal, Kalhan
Cc: [email protected]
Subject: Re: Thermal driver for EMC1403

Hi Kalhan,

Quoted 12 lines · Kalhan Trisal

From 91f6d1d006741bb07a2e6603452b503a840c5c4d Mon Sep 17 00:00:00 2001
From: Kalhan Trisal <[email protected]>
Date: Wed, 15 Jul 2009 20:38:15 -0400
Subject: [PATCH] Thermal driver for EMC1403 chip

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/MAX7315/OSPM drivers.Flag is added to differentiate the generic functional with Moorestown specific.

Signed-off-by Kalhan Trisal <kalhan.trisal at intel.com>
Quoted 7 lines
---
 drivers/hwmon/Kconfig     |   10 +
 drivers/hwmon/Makefile    |    1 +
 drivers/hwmon/emc1403.c   |  738 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/intel_mid.h |    8 +
 4 files changed, 757 insertions(+), 0 deletions(-)
 create mode 100755 drivers/hwmon/emc1403.c

You sent the patch to me but I do not have the time to review your driver. You will have to find somebody else, sorry.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors