Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal
Pull thermal management fixes from Eduardo Valentin: "Specifics: - adding Lukasz as maintainer of samsung thermal driver. - driver fixes: exynos and int430x. - one fix in the exynos cpufreq driver related to cpu cooling (acked by cpufreq maintainer). - fix default sysfs attributes of cooling devices Note: I am sending this pull on Rui's behalf while he fixes issues in his Linux box" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal: thermal: Make sysfs attributes of cooling devices default attributes Thermal/int340x: Fix memleak for aux trip MAINTAINERS: Add entry for SAMSUNG THERMAL DRIVER cpufreq: exynos: Use simple approach to asses if cpu cooling can be used thermal: exynos: Fix wrong control of power down detection mode for Exynos7
This commit is contained in:
commit
5b3b5921ba
|
@ -8480,6 +8480,14 @@ S: Supported
|
|||
L: netdev@vger.kernel.org
|
||||
F: drivers/net/ethernet/samsung/sxgbe/
|
||||
|
||||
SAMSUNG THERMAL DRIVER
|
||||
M: Lukasz Majewski <l.majewski@samsung.com>
|
||||
L: linux-pm@vger.kernel.org
|
||||
L: linux-samsung-soc@vger.kernel.org
|
||||
S: Supported
|
||||
T: https://github.com/lmajewski/linux-samsung-thermal.git
|
||||
F: drivers/thermal/samsung/
|
||||
|
||||
SAMSUNG USB2 PHY DRIVER
|
||||
M: Kamil Debski <k.debski@samsung.com>
|
||||
L: linux-kernel@vger.kernel.org
|
||||
|
|
|
@ -159,7 +159,7 @@ static struct cpufreq_driver exynos_driver = {
|
|||
|
||||
static int exynos_cpufreq_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *cpus, *np;
|
||||
struct device_node *cpu0;
|
||||
int ret = -EINVAL;
|
||||
|
||||
exynos_info = kzalloc(sizeof(*exynos_info), GFP_KERNEL);
|
||||
|
@ -206,28 +206,19 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
|
|||
if (ret)
|
||||
goto err_cpufreq_reg;
|
||||
|
||||
cpus = of_find_node_by_path("/cpus");
|
||||
if (!cpus) {
|
||||
pr_err("failed to find cpus node\n");
|
||||
cpu0 = of_get_cpu_node(0, NULL);
|
||||
if (!cpu0) {
|
||||
pr_err("failed to find cpu0 node\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
np = of_get_next_child(cpus, NULL);
|
||||
if (!np) {
|
||||
pr_err("failed to find cpus child node\n");
|
||||
of_node_put(cpus);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (of_find_property(np, "#cooling-cells", NULL)) {
|
||||
cdev = of_cpufreq_cooling_register(np,
|
||||
if (of_find_property(cpu0, "#cooling-cells", NULL)) {
|
||||
cdev = of_cpufreq_cooling_register(cpu0,
|
||||
cpu_present_mask);
|
||||
if (IS_ERR(cdev))
|
||||
pr_err("running cpufreq without cooling device: %ld\n",
|
||||
PTR_ERR(cdev));
|
||||
}
|
||||
of_node_put(np);
|
||||
of_node_put(cpus);
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
|
|||
trip_cnt, GFP_KERNEL);
|
||||
if (!int34x_thermal_zone->aux_trips) {
|
||||
ret = -ENOMEM;
|
||||
goto free_mem;
|
||||
goto err_trip_alloc;
|
||||
}
|
||||
trip_mask = BIT(trip_cnt) - 1;
|
||||
int34x_thermal_zone->aux_trip_nr = trip_cnt;
|
||||
|
@ -248,14 +248,15 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
|
|||
0, 0);
|
||||
if (IS_ERR(int34x_thermal_zone->zone)) {
|
||||
ret = PTR_ERR(int34x_thermal_zone->zone);
|
||||
goto free_lpat;
|
||||
goto err_thermal_zone;
|
||||
}
|
||||
|
||||
return int34x_thermal_zone;
|
||||
|
||||
free_lpat:
|
||||
err_thermal_zone:
|
||||
acpi_lpat_free_conversion_table(int34x_thermal_zone->lpat_table);
|
||||
free_mem:
|
||||
kfree(int34x_thermal_zone->aux_trips);
|
||||
err_trip_alloc:
|
||||
kfree(int34x_thermal_zone);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
@ -266,6 +267,7 @@ void int340x_thermal_zone_remove(struct int34x_thermal_zone
|
|||
{
|
||||
thermal_zone_device_unregister(int34x_thermal_zone->zone);
|
||||
acpi_lpat_free_conversion_table(int34x_thermal_zone->lpat_table);
|
||||
kfree(int34x_thermal_zone->aux_trips);
|
||||
kfree(int34x_thermal_zone);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(int340x_thermal_zone_remove);
|
||||
|
|
|
@ -682,6 +682,7 @@ static void exynos7_tmu_control(struct platform_device *pdev, bool on)
|
|||
|
||||
if (on) {
|
||||
con |= (1 << EXYNOS_TMU_CORE_EN_SHIFT);
|
||||
con |= (1 << EXYNOS7_PD_DET_EN_SHIFT);
|
||||
interrupt_en =
|
||||
(of_thermal_is_trip_valid(tz, 7)
|
||||
<< EXYNOS7_TMU_INTEN_RISE7_SHIFT) |
|
||||
|
@ -704,9 +705,9 @@ static void exynos7_tmu_control(struct platform_device *pdev, bool on)
|
|||
interrupt_en << EXYNOS_TMU_INTEN_FALL0_SHIFT;
|
||||
} else {
|
||||
con &= ~(1 << EXYNOS_TMU_CORE_EN_SHIFT);
|
||||
con &= ~(1 << EXYNOS7_PD_DET_EN_SHIFT);
|
||||
interrupt_en = 0; /* Disable all interrupts */
|
||||
}
|
||||
con |= 1 << EXYNOS7_PD_DET_EN_SHIFT;
|
||||
|
||||
writel(interrupt_en, data->base + EXYNOS7_TMU_REG_INTEN);
|
||||
writel(con, data->base + EXYNOS_TMU_REG_CONTROL);
|
||||
|
|
|
@ -899,6 +899,22 @@ thermal_cooling_device_trip_point_show(struct device *dev,
|
|||
return sprintf(buf, "%d\n", instance->trip);
|
||||
}
|
||||
|
||||
static struct attribute *cooling_device_attrs[] = {
|
||||
&dev_attr_cdev_type.attr,
|
||||
&dev_attr_max_state.attr,
|
||||
&dev_attr_cur_state.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct attribute_group cooling_device_attr_group = {
|
||||
.attrs = cooling_device_attrs,
|
||||
};
|
||||
|
||||
static const struct attribute_group *cooling_device_attr_groups[] = {
|
||||
&cooling_device_attr_group,
|
||||
NULL,
|
||||
};
|
||||
|
||||
/* Device management */
|
||||
|
||||
/**
|
||||
|
@ -1130,6 +1146,7 @@ __thermal_cooling_device_register(struct device_node *np,
|
|||
cdev->ops = ops;
|
||||
cdev->updated = false;
|
||||
cdev->device.class = &thermal_class;
|
||||
cdev->device.groups = cooling_device_attr_groups;
|
||||
cdev->devdata = devdata;
|
||||
dev_set_name(&cdev->device, "cooling_device%d", cdev->id);
|
||||
result = device_register(&cdev->device);
|
||||
|
@ -1139,21 +1156,6 @@ __thermal_cooling_device_register(struct device_node *np,
|
|||
return ERR_PTR(result);
|
||||
}
|
||||
|
||||
/* sys I/F */
|
||||
if (type) {
|
||||
result = device_create_file(&cdev->device, &dev_attr_cdev_type);
|
||||
if (result)
|
||||
goto unregister;
|
||||
}
|
||||
|
||||
result = device_create_file(&cdev->device, &dev_attr_max_state);
|
||||
if (result)
|
||||
goto unregister;
|
||||
|
||||
result = device_create_file(&cdev->device, &dev_attr_cur_state);
|
||||
if (result)
|
||||
goto unregister;
|
||||
|
||||
/* Add 'this' new cdev to the global cdev list */
|
||||
mutex_lock(&thermal_list_lock);
|
||||
list_add(&cdev->node, &thermal_cdev_list);
|
||||
|
@ -1163,11 +1165,6 @@ __thermal_cooling_device_register(struct device_node *np,
|
|||
bind_cdev(cdev);
|
||||
|
||||
return cdev;
|
||||
|
||||
unregister:
|
||||
release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id);
|
||||
device_unregister(&cdev->device);
|
||||
return ERR_PTR(result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue