summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-24 13:03:51 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-24 13:03:51 -0700
commitd972604f6f87478212f012af5560c4fd4bb2b01d (patch)
tree47f043843ccbf0ee609aeb13267a76ed9c26f9fd /drivers
parent57bb8e37d71eac45b6ea9180698a9cc3db945e26 (diff)
parentd7a4303b8d1fa6f60b73ed91317a51764a2a412c (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management updates from Zhang Rui: - Add Daniel Lezcano as the reviewer of thermal framework and SoC driver changes (Daniel Lezcano). - Fix a bug in intel_dts_soc_thermal driver, which does not translate IO-APIC GSI (Global System Interrupt) into Linux irq number (Hans de Goede). - For device tree bindings, allow cooling devices sharing same trip point with same contribution value to share cooling map (Viresh Kumar). * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: dt-bindings: thermal: Allow multiple devices to share cooling map MAINTAINERS: Add Daniel Lezcano as designated reviewer for thermal Thermal: Intel SoC DTS: Translate IO-APIC GSI number to linux irq number
Diffstat (limited to 'drivers')
-rw-r--r--drivers/thermal/Kconfig2
-rw-r--r--drivers/thermal/intel_soc_dts_thermal.c26
2 files changed, 24 insertions, 4 deletions
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 82979880f985..0e69edc77d18 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -360,7 +360,7 @@ config INTEL_SOC_DTS_IOSF_CORE
config INTEL_SOC_DTS_THERMAL
tristate "Intel SoCs DTS thermal driver"
- depends on X86 && PCI
+ depends on X86 && PCI && ACPI
select INTEL_SOC_DTS_IOSF_CORE
select THERMAL_WRITABLE_TRIPS
help
diff --git a/drivers/thermal/intel_soc_dts_thermal.c b/drivers/thermal/intel_soc_dts_thermal.c
index c27868b2c6af..1e47511a6bd5 100644
--- a/drivers/thermal/intel_soc_dts_thermal.c
+++ b/drivers/thermal/intel_soc_dts_thermal.c
@@ -15,6 +15,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include <linux/acpi.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <asm/cpu_device_id.h>
@@ -31,6 +32,7 @@ MODULE_PARM_DESC(crit_offset,
/* IRQ 86 is a fixed APIC interrupt for BYT DTS Aux threshold notifications */
#define BYT_SOC_DTS_APIC_IRQ 86
+static int soc_dts_thres_gsi;
static int soc_dts_thres_irq;
static struct intel_soc_dts_sensors *soc_dts;
@@ -65,7 +67,21 @@ static int __init intel_soc_thermal_init(void)
return err;
}
- soc_dts_thres_irq = (int)match_cpu->driver_data;
+ soc_dts_thres_gsi = (int)match_cpu->driver_data;
+ if (soc_dts_thres_gsi) {
+ /*
+ * Note the flags here MUST match the firmware defaults, rather
+ * then the request_irq flags, otherwise we get an EBUSY error.
+ */
+ soc_dts_thres_irq = acpi_register_gsi(NULL, soc_dts_thres_gsi,
+ ACPI_LEVEL_SENSITIVE,
+ ACPI_ACTIVE_LOW);
+ if (soc_dts_thres_irq < 0) {
+ pr_warn("intel_soc_dts: Could not get IRQ for GSI %d, err %d\n",
+ soc_dts_thres_gsi, soc_dts_thres_irq);
+ soc_dts_thres_irq = 0;
+ }
+ }
if (soc_dts_thres_irq) {
err = request_threaded_irq(soc_dts_thres_irq, NULL,
@@ -90,8 +106,10 @@ static int __init intel_soc_thermal_init(void)
return 0;
error_trips:
- if (soc_dts_thres_irq)
+ if (soc_dts_thres_irq) {
free_irq(soc_dts_thres_irq, soc_dts);
+ acpi_unregister_gsi(soc_dts_thres_gsi);
+ }
intel_soc_dts_iosf_exit(soc_dts);
return err;
@@ -99,8 +117,10 @@ error_trips:
static void __exit intel_soc_thermal_exit(void)
{
- if (soc_dts_thres_irq)
+ if (soc_dts_thres_irq) {
free_irq(soc_dts_thres_irq, soc_dts);
+ acpi_unregister_gsi(soc_dts_thres_gsi);
+ }
intel_soc_dts_iosf_exit(soc_dts);
}