History

thermal: db8500: Finalize device tree conversion

At some point there was an attempt to convert the DB8500 thermal sensor to device tree: a probe path was added and the device tree was augmented for the Snowball board. The switchover was never completed: instead the thermal devices came from from the PRCMU MFD device and the probe on the Snowball was confused as another set of configuration appeared from the device tree. Move over to a device-tree only approach, as we fixed up the device trees.

Linus Walleij committed 7 years ago

Commit cb063a81 parent dd89d824 files · +17 −97Browse files

Unified · Split

4 files
  1. drivers/mfd/db8500-prcmu.c +1 −52
  2. drivers/thermal/Kconfig +1 −1
  3. drivers/thermal/db8500_thermal.c +15 −15
  4. include/linux/platform_data/db8500_thermal.h +0 −29
drivers/mfd/db8500-prcmu.c+1−52
@@ -36,7 +36,6 @@ · 35 unmodified lines
3636 #include <linux/regulator/db8500-prcmu.h>
3737 #include <linux/regulator/machine.h>
3838 #include <linux/platform_data/ux500_wdt.h>
39−#include <linux/platform_data/db8500_thermal.h>
4039 #include "dbx500-prcmu-regs.h"
4140
4241 /* Index of different voltages to be used when accessing AVSData */
@@ -2984,53 +2983,6 @@ static struct ux500_wdt_data db8500_wdt_pdata = { · 2941 unmodified lines
29842983 .timeout = 600, /* 10 minutes */
29852984 .has_28_bits_resolution = true,
29862985 };
2987−/*
2988− * Thermal Sensor
2989− */
2990−
2991−static struct resource db8500_thsens_resources[] = {
2992− {
2993− .name = "IRQ_HOTMON_LOW",
2994− .start = IRQ_PRCMU_HOTMON_LOW,
2995− .end = IRQ_PRCMU_HOTMON_LOW,
2996− .flags = IORESOURCE_IRQ,
2997− },
2998− {
2999− .name = "IRQ_HOTMON_HIGH",
3000− .start = IRQ_PRCMU_HOTMON_HIGH,
3001− .end = IRQ_PRCMU_HOTMON_HIGH,
3002− .flags = IORESOURCE_IRQ,
3003− },
3004−};
3005−
3006−static struct db8500_thsens_platform_data db8500_thsens_data = {
3007− .trip_points[0] = {
3008− .temp = 70000,
3009− .type = THERMAL_TRIP_ACTIVE,
3010− .cdev_name = {
3011− [0] = "thermal-cpufreq-0",
3012− },
3013− },
3014− .trip_points[1] = {
3015− .temp = 75000,
3016− .type = THERMAL_TRIP_ACTIVE,
3017− .cdev_name = {
3018− [0] = "thermal-cpufreq-0",
3019− },
3020− },
3021− .trip_points[2] = {
3022− .temp = 80000,
3023− .type = THERMAL_TRIP_ACTIVE,
3024− .cdev_name = {
3025− [0] = "thermal-cpufreq-0",
3026− },
3027− },
3028− .trip_points[3] = {
3029− .temp = 85000,
3030− .type = THERMAL_TRIP_CRITICAL,
3031− },
3032− .num_trips = 4,
3033−};
30342986
30352987 static const struct mfd_cell common_prcmu_devs[] = {
30362988 {
@@ -3054,10 +3006,7 @@ static const struct mfd_cell db8500_prcmu_devs[] = { · 17 unmodified lines
30543006 },
30553007 {
30563008 .name = "db8500-thermal",
3057− .num_resources = ARRAY_SIZE(db8500_thsens_resources),
3058− .resources = db8500_thsens_resources,
3059− .platform_data = &db8500_thsens_data,
3060− .pdata_size = sizeof(db8500_thsens_data),
3009+ .of_compatible = "stericsson,db8500-thermal",
30613010 },
30623011 };
30633012
drivers/thermal/Kconfig+1−1
@@ -310,7 +310,7 @@ config DOVE_THERMAL · 309 unmodified lines
310310
311311 config DB8500_THERMAL
312312 tristate "DB8500 thermal management"
313− depends on MFD_DB8500_PRCMU
313+ depends on MFD_DB8500_PRCMU && OF
314314 default y
315315 help
316316 Adds DB8500 thermal management implementation according to the thermal
drivers/thermal/db8500_thermal.c+15−15
@@ -13,13 +13,24 @@ · 12 unmodified lines
1313 #include <linux/mfd/dbx500-prcmu.h>
1414 #include <linux/module.h>
1515 #include <linux/of.h>
16−#include <linux/platform_data/db8500_thermal.h>
1716 #include <linux/platform_device.h>
1817 #include <linux/slab.h>
1918 #include <linux/thermal.h>
2019
2120 #define PRCMU_DEFAULT_MEASURE_TIME 0xFFF
2221 #define PRCMU_DEFAULT_LOW_TEMP 0
22+#define COOLING_DEV_MAX 8
23+
24+struct db8500_trip_point {
25+ unsigned long temp;
26+ enum thermal_trip_type type;
27+ char cdev_name[COOLING_DEV_MAX][THERMAL_NAME_LENGTH];
28+};
29+
30+struct db8500_thsens_platform_data {
31+ struct db8500_trip_point trip_points[THERMAL_MAX_TRIPS];
32+ int num_trips;
33+};
2334
2435 struct db8500_thermal_zone {
2536 struct thermal_zone_device *therm_dev;
@@ -301,7 +312,6 @@ static void db8500_thermal_work(struct work_struct *work) · 275 unmodified lines
301312 dev_dbg(&pzone->therm_dev->device, "thermal work finished.\n");
302313 }
303314
304−#ifdef CONFIG_OF
305315 static struct db8500_thsens_platform_data*
306316 db8500_thermal_parse_dt(struct platform_device *pdev)
307317 {
@@ -370,13 +380,6 @@ err_parse_dt: · 62 unmodified lines
370380 dev_err(&pdev->dev, "Parsing device tree data error.\n");
371381 return NULL;
372382 }
373−#else
374−static inline struct db8500_thsens_platform_data*
375− db8500_thermal_parse_dt(struct platform_device *pdev)
376−{
377− return NULL;
378−}
379−#endif
380383
381384 static int db8500_thermal_probe(struct platform_device *pdev)
382385 {
@@ -386,11 +389,10 @@ static int db8500_thermal_probe(struct platform_device *pdev) · 3 unmodified lines
386389 int low_irq, high_irq, ret = 0;
387390 unsigned long dft_low, dft_high;
388391
389− if (np)
390− ptrips = db8500_thermal_parse_dt(pdev);
391− else
392− ptrips = dev_get_platdata(&pdev->dev);
392+ if (!np)
393+ return -EINVAL;
393394
395+ ptrips = db8500_thermal_parse_dt(pdev);
394396 if (!ptrips)
395397 return -EINVAL;
396398
@@ -498,13 +500,11 @@ static int db8500_thermal_resume(struct platform_device *pdev) · 101 unmodified lines
498500 return 0;
499501 }
500502
501−#ifdef CONFIG_OF
502503 static const struct of_device_id db8500_thermal_match[] = {
503504 { .compatible = "stericsson,db8500-thermal" },
504505 {},
505506 };
506507 MODULE_DEVICE_TABLE(of, db8500_thermal_match);
507−#endif
508508
509509 static struct platform_driver db8500_thermal_driver = {
510510 .driver = {
include/linux/platform_data/db8500_thermal.h+0−29
@@ -1,29 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-or-later */
2−/*
3− * db8500_thermal.h - DB8500 Thermal Management Implementation
4− *
5− * Copyright (C) 2012 ST-Ericsson
6− * Copyright (C) 2012 Linaro Ltd.
7− *
8− * Author: Hongbo Zhang <hongbo.zhang@linaro.com>
9− */
10−
11−#ifndef _DB8500_THERMAL_H_
12−#define _DB8500_THERMAL_H_
13−
14−#include <linux/thermal.h>
15−
16−#define COOLING_DEV_MAX 8
17−
18−struct db8500_trip_point {
19− unsigned long temp;
20− enum thermal_trip_type type;
21− char cdev_name[COOLING_DEV_MAX][THERMAL_NAME_LENGTH];
22−};
23−
24−struct db8500_thsens_platform_data {
25− struct db8500_trip_point trip_points[THERMAL_MAX_TRIPS];
26− int num_trips;
27−};
28−
29−#endif /* _DB8500_THERMAL_H_ */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t