diff options
25 files changed, 2205 insertions, 736 deletions
diff --git a/Documentation/thermal/cpu-cooling-api.txt b/Documentation/thermal/cpu-cooling-api.txt new file mode 100644 index 000000000000..fca24c931ec8 --- /dev/null +++ b/Documentation/thermal/cpu-cooling-api.txt | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | CPU cooling APIs How To | ||
| 2 | =================================== | ||
| 3 | |||
| 4 | Written by Amit Daniel Kachhap <amit.kachhap@linaro.org> | ||
| 5 | |||
| 6 | Updated: 12 May 2012 | ||
| 7 | |||
| 8 | Copyright (c) 2012 Samsung Electronics Co., Ltd(http://www.samsung.com) | ||
| 9 | |||
| 10 | 0. Introduction | ||
| 11 | |||
| 12 | The generic cpu cooling(freq clipping) provides registration/unregistration APIs | ||
| 13 | to the caller. The binding of the cooling devices to the trip point is left for | ||
| 14 | the user. The registration APIs returns the cooling device pointer. | ||
| 15 | |||
| 16 | 1. cpu cooling APIs | ||
| 17 | |||
| 18 | 1.1 cpufreq registration/unregistration APIs | ||
| 19 | 1.1.1 struct thermal_cooling_device *cpufreq_cooling_register( | ||
| 20 | struct cpumask *clip_cpus) | ||
| 21 | |||
| 22 | This interface function registers the cpufreq cooling device with the name | ||
| 23 | "thermal-cpufreq-%x". This api can support multiple instances of cpufreq | ||
| 24 | cooling devices. | ||
| 25 | |||
| 26 | clip_cpus: cpumask of cpus where the frequency constraints will happen. | ||
| 27 | |||
| 28 | 1.1.2 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) | ||
| 29 | |||
| 30 | This interface function unregisters the "thermal-cpufreq-%x" cooling device. | ||
| 31 | |||
| 32 | cdev: Cooling device pointer which has to be unregistered. | ||
diff --git a/Documentation/hwmon/exynos4_tmu b/Documentation/thermal/exynos_thermal index c3c6b41db607..2b46f67b1ccb 100644 --- a/Documentation/hwmon/exynos4_tmu +++ b/Documentation/thermal/exynos_thermal | |||
| @@ -46,36 +46,7 @@ The threshold levels are defined as follows: | |||
| 46 | The threshold and each trigger_level are set | 46 | The threshold and each trigger_level are set |
| 47 | through the corresponding registers. | 47 | through the corresponding registers. |
| 48 | 48 | ||
| 49 | When an interrupt occurs, this driver notify user space of | 49 | When an interrupt occurs, this driver notify kernel thermal framework |
| 50 | one of four threshold levels for the interrupt | 50 | with the function exynos4_report_trigger. |
| 51 | through kobject_uevent_env and sysfs_notify functions. | ||
| 52 | Although an interrupt condition for level_0 can be set, | 51 | Although an interrupt condition for level_0 can be set, |
| 53 | it is not notified to user space through sysfs_notify function. | 52 | it can be used to synchronize the cooling action. |
| 54 | |||
| 55 | Sysfs Interface | ||
| 56 | --------------- | ||
| 57 | name name of the temperature sensor | ||
| 58 | RO | ||
| 59 | |||
| 60 | temp1_input temperature | ||
| 61 | RO | ||
| 62 | |||
| 63 | temp1_max temperature for level_1 interrupt | ||
| 64 | RO | ||
| 65 | |||
| 66 | temp1_crit temperature for level_2 interrupt | ||
| 67 | RO | ||
| 68 | |||
| 69 | temp1_emergency temperature for level_3 interrupt | ||
| 70 | RO | ||
| 71 | |||
| 72 | temp1_max_alarm alarm for level_1 interrupt | ||
| 73 | RO | ||
| 74 | |||
| 75 | temp1_crit_alarm | ||
| 76 | alarm for level_2 interrupt | ||
| 77 | RO | ||
| 78 | |||
| 79 | temp1_emergency_alarm | ||
| 80 | alarm for level_3 interrupt | ||
| 81 | RO | ||
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt index c087dbcf3535..ca1a1a34970e 100644 --- a/Documentation/thermal/sysfs-api.txt +++ b/Documentation/thermal/sysfs-api.txt | |||
| @@ -84,7 +84,8 @@ temperature) and throttle appropriate devices. | |||
| 84 | 84 | ||
| 85 | 1.3 interface for binding a thermal zone device with a thermal cooling device | 85 | 1.3 interface for binding a thermal zone device with a thermal cooling device |
| 86 | 1.3.1 int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, | 86 | 1.3.1 int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, |
| 87 | int trip, struct thermal_cooling_device *cdev); | 87 | int trip, struct thermal_cooling_device *cdev, |
| 88 | unsigned long upper, unsigned long lower); | ||
| 88 | 89 | ||
| 89 | This interface function bind a thermal cooling device to the certain trip | 90 | This interface function bind a thermal cooling device to the certain trip |
| 90 | point of a thermal zone device. | 91 | point of a thermal zone device. |
| @@ -93,6 +94,12 @@ temperature) and throttle appropriate devices. | |||
| 93 | cdev: thermal cooling device | 94 | cdev: thermal cooling device |
| 94 | trip: indicates which trip point the cooling devices is associated with | 95 | trip: indicates which trip point the cooling devices is associated with |
| 95 | in this thermal zone. | 96 | in this thermal zone. |
| 97 | upper:the Maximum cooling state for this trip point. | ||
| 98 | THERMAL_NO_LIMIT means no upper limit, | ||
| 99 | and the cooling device can be in max_state. | ||
| 100 | lower:the Minimum cooling state can be used for this trip point. | ||
| 101 | THERMAL_NO_LIMIT means no lower limit, | ||
| 102 | and the cooling device can be in cooling state 0. | ||
| 96 | 103 | ||
| 97 | 1.3.2 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz, | 104 | 1.3.2 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz, |
| 98 | int trip, struct thermal_cooling_device *cdev); | 105 | int trip, struct thermal_cooling_device *cdev); |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 7edaccce6640..a51df9681319 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
| @@ -71,9 +71,6 @@ enum ec_command { | |||
| 71 | #define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */ | 71 | #define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */ |
| 72 | #define ACPI_EC_MSI_UDELAY 550 /* Wait 550us for MSI EC */ | 72 | #define ACPI_EC_MSI_UDELAY 550 /* Wait 550us for MSI EC */ |
| 73 | 73 | ||
| 74 | #define ACPI_EC_STORM_THRESHOLD 8 /* number of false interrupts | ||
| 75 | per one transaction */ | ||
| 76 | |||
| 77 | enum { | 74 | enum { |
| 78 | EC_FLAGS_QUERY_PENDING, /* Query is pending */ | 75 | EC_FLAGS_QUERY_PENDING, /* Query is pending */ |
| 79 | EC_FLAGS_GPE_STORM, /* GPE storm detected */ | 76 | EC_FLAGS_GPE_STORM, /* GPE storm detected */ |
| @@ -87,6 +84,15 @@ static unsigned int ec_delay __read_mostly = ACPI_EC_DELAY; | |||
| 87 | module_param(ec_delay, uint, 0644); | 84 | module_param(ec_delay, uint, 0644); |
| 88 | MODULE_PARM_DESC(ec_delay, "Timeout(ms) waited until an EC command completes"); | 85 | MODULE_PARM_DESC(ec_delay, "Timeout(ms) waited until an EC command completes"); |
| 89 | 86 | ||
| 87 | /* | ||
| 88 | * If the number of false interrupts per one transaction exceeds | ||
| 89 | * this threshold, will think there is a GPE storm happened and | ||
| 90 | * will disable the GPE for normal transaction. | ||
| 91 | */ | ||
| 92 | static unsigned int ec_storm_threshold __read_mostly = 8; | ||
| 93 | module_param(ec_storm_threshold, uint, 0644); | ||
| 94 | MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm"); | ||
| 95 | |||
| 90 | /* If we find an EC via the ECDT, we need to keep a ptr to its context */ | 96 | /* If we find an EC via the ECDT, we need to keep a ptr to its context */ |
| 91 | /* External interfaces use first EC only, so remember */ | 97 | /* External interfaces use first EC only, so remember */ |
| 92 | typedef int (*acpi_ec_query_func) (void *data); | 98 | typedef int (*acpi_ec_query_func) (void *data); |
| @@ -319,7 +325,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t) | |||
| 319 | msleep(1); | 325 | msleep(1); |
| 320 | /* It is safe to enable the GPE outside of the transaction. */ | 326 | /* It is safe to enable the GPE outside of the transaction. */ |
| 321 | acpi_enable_gpe(NULL, ec->gpe); | 327 | acpi_enable_gpe(NULL, ec->gpe); |
| 322 | } else if (t->irq_count > ACPI_EC_STORM_THRESHOLD) { | 328 | } else if (t->irq_count > ec_storm_threshold) { |
| 323 | pr_info(PREFIX "GPE storm detected, " | 329 | pr_info(PREFIX "GPE storm detected, " |
| 324 | "transactions will use polling mode\n"); | 330 | "transactions will use polling mode\n"); |
| 325 | set_bit(EC_FLAGS_GPE_STORM, &ec->flags); | 331 | set_bit(EC_FLAGS_GPE_STORM, &ec->flags); |
| @@ -924,6 +930,17 @@ static int ec_flag_msi(const struct dmi_system_id *id) | |||
| 924 | return 0; | 930 | return 0; |
| 925 | } | 931 | } |
| 926 | 932 | ||
| 933 | |||
