summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2013-01-09 16:36:16 +0100
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2013-01-09 16:36:16 +0100
commit4aa5a91d37aad0f186f0e5b4863340c7d640d083 (patch)
treee28ef0b6948ebfb6a3956fd60eeb1c43622a3a5e
parent65119fd57aeb0b52bfb30d19c052256f8fb08e6e (diff)
hwmon: lm95245: add local temp and remote critical shutdown temp hooks
In order to allow tighter integration with external thermal throttling code add local temperature and remote critical shutdown temperature hooks. Rename the existing hooks for clarity.
-rw-r--r--drivers/hwmon/lm95245.c20
-rw-r--r--include/linux/lm95245.h6
2 files changed, 20 insertions, 6 deletions
diff --git a/drivers/hwmon/lm95245.c b/drivers/hwmon/lm95245.c
index 24e50f5c157c..cea5048b1ba7 100644
--- a/drivers/hwmon/lm95245.c
+++ b/drivers/hwmon/lm95245.c
@@ -254,11 +254,17 @@ void thermal_get_temp(struct device *dev, int *temp, int index)
data->regs[index + OFFSET_LOW_UNSIGNED]);
}
-void lm95245_thermal_get_temp(struct device *dev, int *temp)
+void lm95245_get_local_temp(struct device *dev, int *temp)
+{
+ thermal_get_temp(dev, temp, INDEX_LOCAL_TEMP);
+}
+EXPORT_SYMBOL(lm95245_get_local_temp);
+
+void lm95245_get_remote_temp(struct device *dev, int *temp)
{
thermal_get_temp(dev, temp, INDEX_REMOTE_TEMP);
}
-EXPORT_SYMBOL(lm95245_thermal_get_temp);
+EXPORT_SYMBOL(lm95245_get_remote_temp);
static ssize_t show_input(struct device *dev, struct device_attribute *attr,
char *buf)
@@ -299,11 +305,17 @@ void thermal_set_limit(struct device *dev, int val, int index)
mutex_unlock(&data->update_lock);
}
-void lm95245_thermal_set_limit(struct device *dev, int val)
+void lm95245_set_remote_os_limit(struct device *dev, int val)
{
thermal_set_limit(dev, val, INDEX_REMOTE_OS_LIMIT);
}
-EXPORT_SYMBOL(lm95245_thermal_set_limit);
+EXPORT_SYMBOL(lm95245_set_remote_os_limit);
+
+void lm95245_set_remote_critical_limit(struct device *dev, int val)
+{
+ thermal_set_limit(dev, val, INDEX_REMOTE_TCRIT_LIMIT);
+}
+EXPORT_SYMBOL(lm95245_set_remote_critical_limit);
static ssize_t set_limit(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
diff --git a/include/linux/lm95245.h b/include/linux/lm95245.h
index cdc6846a901f..1b0ddbd82759 100644
--- a/include/linux/lm95245.h
+++ b/include/linux/lm95245.h
@@ -28,7 +28,9 @@ struct lm95245_platform_data {
void (*probe_callback)(struct device *dev);
};
-void lm95245_thermal_get_temp(struct device *dev, int *temp);
-void lm95245_thermal_set_limit(struct device *dev, int temp);
+void lm95245_get_local_temp(struct device *dev, int *temp);
+void lm95245_get_remote_temp(struct device *dev, int *temp);
+void lm95245_set_remote_os_limit(struct device *dev, int temp);
+void lm95245_set_remote_critical_limit(struct device *dev, int temp);
#endif /* _LINUX_LM95245_H */