mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management updates from Zhang Rui:
"There are not too many changes this time, except two new platform
thermal drivers, ti-soc-thermal driver and x86_pkg_temp_thermal
driver, and a couple of small fixes.
Highlights:
- move the ti-soc-thermal driver out of the staging tree to the
thermal tree.
- introduce the x86_pkg_temp_thermal driver. This driver registers
CPU digital temperature package level sensor as a thermal zone.
- small fixes/cleanups including removing redundant use of
platform_set_drvdata() and of_match_ptr for all platform thermal
drivers"
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (34 commits)
thermal: cpu_cooling: fix stub function
thermal: ti-soc-thermal: use standard GPIO DT bindings
thermal: MAINTAINERS: Add git tree path for SoC specific updates
thermal: fix x86_pkg_temp_thermal.c build and Kconfig
Thermal: Documentation for x86 package temperature thermal driver
Thermal: CPU Package temperature thermal
thermal: consider emul_temperature while computing trend
thermal: ti-soc-thermal: add DT example for DRA752 chip
thermal: ti-soc-thermal: add dra752 chip to device table
thermal: ti-soc-thermal: add thermal data for DRA752 chips
thermal: ti-soc-thermal: remove usage of IS_ERR_OR_NULL
thermal: ti-soc-thermal: freeze FSM while computing trend
thermal: ti-soc-thermal: remove external heat while extrapolating hotspot
thermal: ti-soc-thermal: update DT reference for OMAP5430
x86, mcheck, therm_throt: Process package thresholds
thermal: cpu_cooling: fix 'descend' check in get_property()
Thermal: spear: Remove redundant use of of_match_ptr
Thermal: kirkwood: Remove redundant use of of_match_ptr
Thermal: dove: Remove redundant use of of_match_ptr
Thermal: armada: Remove redundant use of of_match_ptr
...
This commit is contained in:
@@ -17,8 +17,9 @@ Required properties:
|
||||
- interrupts : this entry should indicate which interrupt line
|
||||
the talert signal is routed to;
|
||||
Specific:
|
||||
- ti,tshut-gpio : this entry should be used to inform which GPIO
|
||||
line the tshut signal is routed to;
|
||||
- gpios : this entry should be used to inform which GPIO
|
||||
line the tshut signal is routed to. The informed GPIO will
|
||||
be treated as an IRQ;
|
||||
- regs : this entry must also be specified and it is specific
|
||||
to each bandgap version, because the mapping may change from
|
||||
soc to soc, apart of depending on available features.
|
||||
@@ -37,7 +38,7 @@ bandgap {
|
||||
0x4a002378 0x18>;
|
||||
compatible = "ti,omap4460-bandgap";
|
||||
interrupts = <0 126 4>; /* talert */
|
||||
ti,tshut-gpio = <86>;
|
||||
gpios = <&gpio3 22 0>; /* tshut */
|
||||
};
|
||||
|
||||
OMAP4470:
|
||||
@@ -47,7 +48,7 @@ bandgap {
|
||||
0x4a002378 0x18>;
|
||||
compatible = "ti,omap4470-bandgap";
|
||||
interrupts = <0 126 4>; /* talert */
|
||||
ti,tshut-gpio = <86>;
|
||||
gpios = <&gpio3 22 0>; /* tshut */
|
||||
};
|
||||
|
||||
OMAP5430:
|
||||
@@ -59,3 +60,15 @@ bandgap {
|
||||
compatible = "ti,omap5430-bandgap";
|
||||
interrupts = <0 126 4>; /* talert */
|
||||
};
|
||||
|
||||
DRA752:
|
||||
bandgap {
|
||||
reg = <0x4a0021e0 0xc
|
||||
0x4a00232c 0xc
|
||||
0x4a002380 0x2c
|
||||
0x4a0023C0 0x3c
|
||||
0x4a002564 0x8
|
||||
0x4a002574 0x50>;
|
||||
compatible = "ti,dra752-bandgap";
|
||||
interrupts = <0 126 4>; /* talert */
|
||||
};
|
||||
47
Documentation/thermal/x86_pkg_temperature_thermal
Normal file
47
Documentation/thermal/x86_pkg_temperature_thermal
Normal file
@@ -0,0 +1,47 @@
|
||||
Kernel driver: x86_pkg_temp_thermal
|
||||
===================
|
||||
|
||||
Supported chips:
|
||||
* x86: with package level thermal management
|
||||
(Verify using: CPUID.06H:EAX[bit 6] =1)
|
||||
|
||||
Authors: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
|
||||
|
||||
Reference
|
||||
---
|
||||
Intel® 64 and IA-32 Architectures Software Developer’s Manual (Jan, 2013):
|
||||
Chapter 14.6: PACKAGE LEVEL THERMAL MANAGEMENT
|
||||
|
||||
Description
|
||||
---------
|
||||
|
||||
This driver register CPU digital temperature package level sensor as a thermal
|
||||
zone with maximum two user mode configurable trip points. Number of trip points
|
||||
depends on the capability of the package. Once the trip point is violated,
|
||||
user mode can receive notification via thermal notification mechanism and can
|
||||
take any action to control temperature.
|
||||
|
||||
|
||||
Threshold management
|
||||
--------------------
|
||||
Each package will register as a thermal zone under /sys/class/thermal.
|
||||
Example:
|
||||
/sys/class/thermal/thermal_zone1
|
||||
|
||||
This contains two trip points:
|
||||
- trip_point_0_temp
|
||||
- trip_point_1_temp
|
||||
|
||||
User can set any temperature between 0 to TJ-Max temperature. Temperature units
|
||||
are in milli-degree Celsius. Refer to "Documentation/thermal/sysfs-api.txt" for
|
||||
thermal sys-fs details.
|
||||
|
||||
Any value other than 0 in these trip points, can trigger thermal notifications.
|
||||
Setting 0, stops sending thermal notifications.
|
||||
|
||||
Thermal notifications: To get kobject-uevent notifications, set the thermal zone
|
||||
policy to "user_space". For example: echo -n "user_space" > policy
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8159,6 +8159,7 @@ M: Zhang Rui <rui.zhang@intel.com>
|
||||
M: Eduardo Valentin <eduardo.valentin@ti.com>
|
||||
L: linux-pm@vger.kernel.org
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal.git
|
||||
Q: https://patchwork.kernel.org/project/linux-pm/list/
|
||||
S: Supported
|
||||
F: drivers/thermal/
|
||||
@@ -8183,8 +8184,8 @@ F: drivers/platform/x86/thinkpad_acpi.c
|
||||
TI BANDGAP AND THERMAL DRIVER
|
||||
M: Eduardo Valentin <eduardo.valentin@ti.com>
|
||||
L: linux-pm@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/staging/omap-thermal/
|
||||
S: Supported
|
||||
F: drivers/thermal/ti-soc-thermal/
|
||||
|
||||
TI FLASH MEDIA INTERFACE DRIVER
|
||||
M: Alex Dubov <oakad@yahoo.com>
|
||||
|
||||
@@ -214,6 +214,13 @@ void mce_log_therm_throt_event(__u64 status);
|
||||
/* Interrupt Handler for core thermal thresholds */
|
||||
extern int (*platform_thermal_notify)(__u64 msr_val);
|
||||
|
||||
/* Interrupt Handler for package thermal thresholds */
|
||||
extern int (*platform_thermal_package_notify)(__u64 msr_val);
|
||||
|
||||
/* Callback support of rate control, return true, if
|
||||
* callback has rate control */
|
||||
extern bool (*platform_thermal_package_rate_control)(void);
|
||||
|
||||
#ifdef CONFIG_X86_THERMAL_VECTOR
|
||||
extern void mcheck_intel_therm_init(void);
|
||||
#else
|
||||
|
||||
@@ -55,12 +55,24 @@ struct thermal_state {
|
||||
struct _thermal_state package_power_limit;
|
||||
struct _thermal_state core_thresh0;
|
||||
struct _thermal_state core_thresh1;
|
||||
struct _thermal_state pkg_thresh0;
|
||||
struct _thermal_state pkg_thresh1;
|
||||
};
|
||||
|
||||
/* Callback to handle core threshold interrupts */
|
||||
int (*platform_thermal_notify)(__u64 msr_val);
|
||||
EXPORT_SYMBOL(platform_thermal_notify);
|
||||
|
||||
/* Callback to handle core package threshold_interrupts */
|
||||
int (*platform_thermal_package_notify)(__u64 msr_val);
|
||||
EXPORT_SYMBOL_GPL(platform_thermal_package_notify);
|
||||
|
||||
/* Callback support of rate control, return true, if
|
||||
* callback has rate control */
|
||||
bool (*platform_thermal_package_rate_control)(void);
|
||||
EXPORT_SYMBOL_GPL(platform_thermal_package_rate_control);
|
||||
|
||||
|
||||
static DEFINE_PER_CPU(struct thermal_state, thermal_state);
|
||||
|
||||
static atomic_t therm_throt_en = ATOMIC_INIT(0);
|
||||
@@ -195,19 +207,25 @@ static int therm_throt_process(bool new_event, int event, int level)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int thresh_event_valid(int event)
|
||||
static int thresh_event_valid(int level, int event)
|
||||
{
|
||||
struct _thermal_state *state;
|
||||
unsigned int this_cpu = smp_processor_id();
|
||||
struct thermal_state *pstate = &per_cpu(thermal_state, this_cpu);
|
||||
u64 now = get_jiffies_64();
|
||||
|
||||
state = (event == 0) ? &pstate->core_thresh0 : &pstate->core_thresh1;
|
||||
if (level == PACKAGE_LEVEL)
|
||||
state = (event == 0) ? &pstate->pkg_thresh0 :
|
||||
&pstate->pkg_thresh1;
|
||||
else
|
||||
state = (event == 0) ? &pstate->core_thresh0 :
|
||||
&pstate->core_thresh1;
|
||||
|
||||
if (time_before64(now, state->next_check))
|
||||
return 0;
|
||||
|
||||
state->next_check = now + CHECK_INTERVAL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -322,6 +340,39 @@ device_initcall(thermal_throttle_init_device);
|
||||
|
||||
#endif /* CONFIG_SYSFS */
|
||||
|
||||
static void notify_package_thresholds(__u64 msr_val)
|
||||
{
|
||||
bool notify_thres_0 = false;
|
||||
bool notify_thres_1 = false;
|
||||
|
||||
if (!platform_thermal_package_notify)
|
||||
return;
|
||||
|
||||
/* lower threshold check */
|
||||
if (msr_val & THERM_LOG_THRESHOLD0)
|
||||
notify_thres_0 = true;
|
||||
/* higher threshold check */
|
||||
if (msr_val & THERM_LOG_THRESHOLD1)
|
||||
notify_thres_1 = true;
|
||||
|
||||
if (!notify_thres_0 && !notify_thres_1)
|
||||
return;
|
||||
|
||||
if (platform_thermal_package_rate_control &&
|
||||
platform_thermal_package_rate_control()) {
|
||||
/* Rate control is implemented in callback */
|
||||
platform_thermal_package_notify(msr_val);
|
||||
return;
|
||||
}
|
||||
|
||||
/* lower threshold reached */
|
||||
if (notify_thres_0 && thresh_event_valid(PACKAGE_LEVEL, 0))
|
||||
platform_thermal_package_notify(msr_val);
|
||||
/* higher threshold reached */
|
||||
if (notify_thres_1 && thresh_event_valid(PACKAGE_LEVEL, 1))
|
||||
platform_thermal_package_notify(msr_val);
|
||||
}
|
||||
|
||||
static void notify_thresholds(__u64 msr_val)
|
||||
{
|
||||
/* check whether the interrupt handler is defined;
|
||||
@@ -331,10 +382,12 @@ static void notify_thresholds(__u64 msr_val)
|
||||
return;
|
||||
|
||||
/* lower threshold reached */
|
||||
if ((msr_val & THERM_LOG_THRESHOLD0) && thresh_event_valid(0))
|
||||
if ((msr_val & THERM_LOG_THRESHOLD0) &&
|
||||
thresh_event_valid(CORE_LEVEL, 0))
|
||||
platform_thermal_notify(msr_val);
|
||||
/* higher threshold reached */
|
||||
if ((msr_val & THERM_LOG_THRESHOLD1) && thresh_event_valid(1))
|
||||
if ((msr_val & THERM_LOG_THRESHOLD1) &&
|
||||
thresh_event_valid(CORE_LEVEL, 1))
|
||||
platform_thermal_notify(msr_val);
|
||||
}
|
||||
|
||||
@@ -360,6 +413,8 @@ static void intel_thermal_interrupt(void)
|
||||
|
||||
if (this_cpu_has(X86_FEATURE_PTS)) {
|
||||
rdmsrl(MSR_IA32_PACKAGE_THERM_STATUS, msr_val);
|
||||
/* check violations of package thermal thresholds */
|
||||
notify_package_thresholds(msr_val);
|
||||
therm_throt_process(msr_val & PACKAGE_THERM_STATUS_PROCHOT,
|
||||
THERMAL_THROTTLING_EVENT,
|
||||
PACKAGE_LEVEL);
|
||||
|
||||
@@ -120,8 +120,6 @@ source "drivers/staging/gdm72xx/Kconfig"
|
||||
|
||||
source "drivers/staging/csr/Kconfig"
|
||||
|
||||
source "drivers/staging/ti-soc-thermal/Kconfig"
|
||||
|
||||
source "drivers/staging/silicom/Kconfig"
|
||||
|
||||
source "drivers/staging/ced1401/Kconfig"
|
||||
|
||||
@@ -53,7 +53,6 @@ obj-$(CONFIG_ANDROID) += android/
|
||||
obj-$(CONFIG_USB_WPAN_HCD) += ozwpan/
|
||||
obj-$(CONFIG_WIMAX_GDM72XX) += gdm72xx/
|
||||
obj-$(CONFIG_CSR_WIFI) += csr/
|
||||
obj-$(CONFIG_TI_SOC_THERMAL) += ti-soc-thermal/
|
||||
obj-$(CONFIG_NET_VENDOR_SILICOM) += silicom/
|
||||
obj-$(CONFIG_CED1401) += ced1401/
|
||||
obj-$(CONFIG_DRM_IMX) += imx-drm/
|
||||
|
||||
@@ -169,4 +169,19 @@ config INTEL_POWERCLAMP
|
||||
enforce idle time which results in more package C-state residency. The
|
||||
user interface is exposed via generic thermal framework.
|
||||
|
||||
config X86_PKG_TEMP_THERMAL
|
||||
tristate "X86 package temperature thermal driver"
|
||||
depends on X86_THERMAL_VECTOR
|
||||
select THERMAL_GOV_USER_SPACE
|
||||
default m
|
||||
help
|
||||
Enable this to register CPU digital sensor for package temperature as
|
||||
thermal zone. Each package will have its own thermal zone. There are
|
||||
two trip points which can be set by user to get notifications via thermal
|
||||
notification methods.
|
||||
|
||||
menu "Texas Instruments thermal drivers"
|
||||
source "drivers/thermal/ti-soc-thermal/Kconfig"
|
||||
endmenu
|
||||
|
||||
endif
|
||||
|
||||
@@ -23,4 +23,5 @@ obj-$(CONFIG_DB8500_THERMAL) += db8500_thermal.o
|
||||
obj-$(CONFIG_ARMADA_THERMAL) += armada_thermal.o
|
||||
obj-$(CONFIG_DB8500_CPUFREQ_COOLING) += db8500_cpufreq_cooling.o
|
||||
obj-$(CONFIG_INTEL_POWERCLAMP) += intel_powerclamp.o
|
||||
|
||||
obj-$(CONFIG_X86_PKG_TEMP_THERMAL) += x86_pkg_temp_thermal.o
|
||||
obj-$(CONFIG_TI_SOC_THERMAL) += ti-soc-thermal/
|
||||
|
||||
@@ -200,7 +200,6 @@ static int armada_thermal_exit(struct platform_device *pdev)
|
||||
platform_get_drvdata(pdev);
|
||||
|
||||
thermal_zone_device_unregister(armada_thermal);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -211,7 +210,7 @@ static struct platform_driver armada_thermal_driver = {
|
||||
.driver = {
|
||||
.name = "armada_thermal",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = of_match_ptr(armada_thermal_id_table),
|
||||
.of_match_table = armada_thermal_id_table,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ static int get_property(unsigned int cpu, unsigned long input,
|
||||
continue;
|
||||
|
||||
/* get the frequency order */
|
||||
if (freq != CPUFREQ_ENTRY_INVALID && descend != -1)
|
||||
if (freq != CPUFREQ_ENTRY_INVALID && descend == -1)
|
||||
descend = !!(freq > table[i].frequency);
|
||||
|
||||
freq = table[i].frequency;
|
||||
|
||||
@@ -134,16 +134,11 @@ static int dove_thermal_probe(struct platform_device *pdev)
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!res) {
|
||||
dev_err(&pdev->dev, "Failed to get platform resource\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
priv->sensor = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(priv->sensor))
|
||||
return PTR_ERR(priv->sensor);
|
||||
@@ -178,7 +173,6 @@ static int dove_thermal_exit(struct platform_device *pdev)
|
||||
platform_get_drvdata(pdev);
|
||||
|
||||
thermal_zone_device_unregister(dove_thermal);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -191,7 +185,7 @@ static struct platform_driver dove_thermal_driver = {
|
||||
.driver = {
|
||||
.name = "dove_thermal",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = of_match_ptr(dove_thermal_id_table),
|
||||
.of_match_table = dove_thermal_id_table,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -997,7 +997,6 @@ static int exynos_tmu_probe(struct platform_device *pdev)
|
||||
|
||||
return 0;
|
||||
err_clk:
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
clk_unprepare(data->clk);
|
||||
return ret;
|
||||
}
|
||||
@@ -1012,8 +1011,6 @@ static int exynos_tmu_remove(struct platform_device *pdev)
|
||||
|
||||
clk_unprepare(data->clk);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,16 +75,11 @@ static int kirkwood_thermal_probe(struct platform_device *pdev)
|
||||
struct kirkwood_thermal_priv *priv;
|
||||
struct resource *res;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!res) {
|
||||
dev_err(&pdev->dev, "Failed to get platform resource\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
priv->sensor = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(priv->sensor))
|
||||
return PTR_ERR(priv->sensor);
|
||||
@@ -108,7 +103,6 @@ static int kirkwood_thermal_exit(struct platform_device *pdev)
|
||||
platform_get_drvdata(pdev);
|
||||
|
||||
thermal_zone_device_unregister(kirkwood_thermal);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -121,7 +115,7 @@ static struct platform_driver kirkwood_thermal_driver = {
|
||||
.driver = {
|
||||
.name = "kirkwood_thermal",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = of_match_ptr(kirkwood_thermal_id_table),
|
||||
.of_match_table = kirkwood_thermal_id_table,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -389,11 +389,6 @@ static int rcar_thermal_probe(struct platform_device *pdev)
|
||||
* platform has IRQ support.
|
||||
* Then, drier use common register
|
||||
*/
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, mres++);
|
||||
if (!res) {
|
||||
dev_err(dev, "Could not get platform resource\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
|
||||
dev_name(dev), common);
|
||||
@@ -405,6 +400,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
|
||||
/*
|
||||
* rcar_has_irq_support() will be enabled
|
||||
*/
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, mres++);
|
||||
common->base = devm_ioremap_resource(dev, res);
|
||||
if (IS_ERR(common->base))
|
||||
return PTR_ERR(common->base);
|
||||
@@ -458,7 +454,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
|
||||
|
||||
platform_set_drvdata(pdev, common);
|
||||
|
||||
dev_info(dev, "%d sensor proved\n", i);
|
||||
dev_info(dev, "%d sensor probed\n", i);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -487,8 +483,6 @@ static int rcar_thermal_remove(struct platform_device *pdev)
|
||||
rcar_thermal_irq_disable(priv);
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
pm_runtime_put_sync(dev);
|
||||
pm_runtime_disable(dev);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ static int spear_thermal_probe(struct platform_device *pdev)
|
||||
struct thermal_zone_device *spear_thermal = NULL;
|
||||
struct spear_thermal_dev *stdev;
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct resource *stres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
struct resource *res;
|
||||
int ret = 0, val;
|
||||
|
||||
if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
|
||||
@@ -112,11 +112,6 @@ static int spear_thermal_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!stres) {
|
||||
dev_err(&pdev->dev, "memory resource missing\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
stdev = devm_kzalloc(&pdev->dev, sizeof(*stdev), GFP_KERNEL);
|
||||
if (!stdev) {
|
||||
dev_err(&pdev->dev, "kzalloc fail\n");
|
||||
@@ -124,12 +119,10 @@ static int spear_thermal_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
/* Enable thermal sensor */
|
||||
stdev->thermal_base = devm_ioremap(&pdev->dev, stres->start,
|
||||
resource_size(stres));
|
||||
if (!stdev->thermal_base) {
|
||||
dev_err(&pdev->dev, "ioremap failed\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
stdev->thermal_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(stdev->thermal_base))
|
||||
return PTR_ERR(stdev->thermal_base);
|
||||
|
||||
stdev->clk = devm_clk_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(stdev->clk)) {
|
||||
@@ -174,7 +167,6 @@ static int spear_thermal_exit(struct platform_device *pdev)
|
||||
struct spear_thermal_dev *stdev = spear_thermal->devdata;
|
||||
|
||||
thermal_zone_device_unregister(spear_thermal);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
/* Disable SPEAr Thermal Sensor */
|
||||
actual_mask = readl_relaxed(stdev->thermal_base);
|
||||
@@ -198,7 +190,7 @@ static struct platform_driver spear_thermal_driver = {
|
||||
.name = "spear_thermal",
|
||||
.owner = THIS_MODULE,
|
||||
.pm = &spear_thermal_pm_ops,
|
||||
.of_match_table = of_match_ptr(spear_thermal_id_table),
|
||||
.of_match_table = spear_thermal_id_table,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <linux/idr.h>
|
||||
#include <linux/thermal.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <linux/string.h>
|
||||
#include <net/netlink.h>
|
||||
#include <net/genetlink.h>
|
||||
|
||||
@@ -155,7 +156,8 @@ int get_tz_trend(struct thermal_zone_device *tz, int trip)
|
||||
{
|
||||
enum thermal_trend trend;
|
||||
|
||||
if (!tz->ops->get_trend || tz->ops->get_trend(tz, trip, &trend)) {
|
||||
if (tz->emul_temperature || !tz->ops->get_trend ||
|
||||
tz->ops->get_trend(tz, trip, &trend)) {
|
||||
if (tz->temperature > tz->last_temperature)
|
||||
trend = THERMAL_TREND_RAISING;
|
||||
else if (tz->temperature < tz->last_temperature)
|
||||
@@ -713,10 +715,13 @@ policy_store(struct device *dev, struct device_attribute *attr,
|
||||
int ret = -EINVAL;
|
||||
struct thermal_zone_device *tz = to_thermal_zone(dev);
|
||||
struct thermal_governor *gov;
|
||||
char name[THERMAL_NAME_LENGTH];
|
||||
|
||||
snprintf(name, sizeof(name), "%s", buf);
|
||||
|
||||
mutex_lock(&thermal_governor_lock);
|
||||
|
||||
gov = __find_governor(buf);
|
||||
gov = __find_governor(strim(name));
|
||||
if (!gov)
|
||||
goto exit;
|
||||
|
||||
@@ -1624,7 +1629,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
|
||||
if (!ops || !ops->get_temp)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (trips > 0 && !ops->get_trip_type)
|
||||
if (trips > 0 && (!ops->get_trip_type || !ops->get_trip_temp))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
tz = kzalloc(sizeof(struct thermal_zone_device), GFP_KERNEL);
|
||||
|
||||
@@ -46,3 +46,15 @@ config OMAP5_THERMAL
|
||||
|
||||
This includes alert interrupts generation and also the TSHUT
|
||||
support.
|
||||
|
||||
config DRA752_THERMAL
|
||||
bool "Texas Instruments DRA752 thermal support"
|
||||
depends on TI_SOC_THERMAL
|
||||
depends on SOC_DRA7XX
|
||||
help
|
||||
If you say yes here you get thermal support for the Texas Instruments
|
||||
DRA752 SoC family. The current chip supported are:
|
||||
- DRA752
|
||||
|
||||
This includes alert interrupts generation and also the TSHUT
|
||||
support.
|
||||
@@ -1,5 +1,6 @@
|
||||
obj-$(CONFIG_TI_SOC_THERMAL) += ti-soc-thermal.o
|
||||
ti-soc-thermal-y := ti-bandgap.o
|
||||
ti-soc-thermal-$(CONFIG_TI_THERMAL) += ti-thermal-common.o
|
||||
ti-soc-thermal-$(CONFIG_DRA752_THERMAL) += dra752-thermal-data.o
|
||||
ti-soc-thermal-$(CONFIG_OMAP4_THERMAL) += omap4-thermal-data.o
|
||||
ti-soc-thermal-$(CONFIG_OMAP5_THERMAL) += omap5-thermal-data.o
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user