Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit d63897c

Browse files
sumeetpawnikarzhenmingx
authored andcommitted
Thermal: cloverview support to K3.10
Port K3.4 thermal code for cloverview platform to K3.10 Following changes are ported: a9f8652 EM/THERMAL: Sysfs to read,override values mapped to states fcf62aa EM/THERMAL: Add platform thermal driver for BYT-M bd54515 BYT-M: add key buttons support based on non-ACPI ec driver d42d794 psh: Remove the driver source file 456475d OSNIB: Moved OSNIB driver to external driver folder a2fef50 OSIP: Moved osip driver to external_driver folder a5a6fcb EM/THERMAL: Reverting msic die slope/intercept. 872aaa2 Revert "psh: Remove the driver source file" a984b4a psh: Remove the driver source file 3211da2 intel_msic_gpio: Remove the driver source file 1796947 EM/THERMAL: Add new ear and mic zones for VB b00a44e EM/THERMAL: Add SoC cooling device 1f3f0c1 BYT-M/EC: add EC driver(non ACPI) support for BYT-M ee39e96 Modem NVRAM driver 4e89c4a EM/THERMAL: Modify slope and inercept for thermal sensors f9ae71f EM/THERMAL: Predicting skin temperature accurately. 3edf760 crystal_cove: provide similar interfaces with earlier platforms 772f9f4 Merge remote-tracking branch 'aosp/android-3.4' into HEAD be601e9 EM/THERMAL: Add Platform Thermal driver for BYT ff8f9c9 x86: intel-mid: remove compilation warnings from CTP's device_libs files b9f3bf1 thermal: shorten too long mcast group name 61fd027 Change kernel intel_scu_ipc_command calls to rpmsg calls b069aa4 EM/THERMAL: Negative temperature handling in thermal. fa0e689 msic_gpio: add intel msic gpio support for CLV 1586ea0 EM/THERMAL: Changing msic die temp equation. 37fca05 OSNIB: add support for BYT using CMOS 99dcbb7 crystalcove_pwrsrc: Enable Power source detection driver b0ee84f0 pmic_charger: handle the USBDET interrupt on CTP for USB connect/disconnect 0e5ba36 platform/x86: fix section mismatches fcc4149 EM/THERMAL[Port from k3.0]: Klockwork fix in thermal_sys.c 2298248 flis: port FLIS driver to K3.4 ce0a9d5 intel_psh_ipc: add PSH IPC support for Merrifield Platform dbfbda7 EM/THERMAL[Port from K3.0]: Add SoC Thermal driver 3cf105b EM/THERMAL[Port from K3.0]: Thermal driver for MRFLD 4642d8c EM/THERMAL[Port from K3.0]: Add get-set methods for slope interface 83a7507 EM/THERMAL[Port from K3.0]: Add slope/intercept sysfs interfaces 892f28b EM/THERMAL: Update Thermal driver's init call 2fc592f Updating Thermal driver for battery/charger changes 0237d0b OSIP: UMIP: Add OSIP and UMIP driver for Intel SoC 02efffb scu_ipc: Adding IPC,PMIC,MIP,FW,IPCUTIL driver 75734aa remoteproc: intel_mid_remoteproc framework (WIP) 9c7b942 INTEL-MID: re-structure arch/x86/platform/mrst a335750 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 61e5191 Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86 917ee75 platform/x86: Add driver for Apple gmux device 2390481 Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip f11f999 toshiba_acpi: Refuse to load on machines with buggy INFO implementations 6a92c36 thermal: add support for thermal sensor present on SPEAr13xx machines f39eaa6 platform, x86: Kill off Moorestown 0266e49 platform-x86: intel_mid_thermal: turn off thermistor voltage by default 420138a platform-x86: intel_mid_thermal: convert to use Intel MSIC API 3fca3d3 platform-x86: intel_mid_thermal: add msic_thermal alias 7ec48ce platform/x86: drop deprecated asus_acpi driver 73d99a2 platform-drivers-x86: convert drivers/platform/x86/* to use module_platform_driver() 2d24c49 Fujitsu tablet extras driver c215ab9 x86: Add amilo-rfkill driver for some Fujitsu-Siemens Amilo laptops 1b7ccab x86/mid/thermal: Turn off thermistor 6348307 x86/mid/thermal: Add msic_thermal alias 0f48d34 x86/mid/thermal: Convert to use Intel MSIC API 33e9970 x86/mid: Kill off Moorestown 2d58d7e thermal: Rename generate_netlink_event 78542e1 Platform: Samsung Q10 backlight driver 03f8952 platform-drivers-x86: intel_mid_thermal: fix memory leak 31f5396 thermal: make THERMAL_HWMON implementation fully internal 239dca9 platform-x86: intel_mid_thermal: Fix memory leak cb8b646 platform/x86: Fix Makefile for intel_mid_powerbtn bb3ce20 platform/oaktrail: ACPI EC Extra driver for Oaktrail 253a006 platform-x86: intel_mid_thermal: Fix coding style 99b38b4 platform/x86: add MXM WMI driver. 25985ed Fix common misspellings 2d70b73 Platform: add Samsung Laptop platform driver 47ae435 platform-driver-x86: intel_mid_thermal: fix unterminated platform_device_id table b229ece asus-nb-wmi: Asus Notebooks WMI Driver e12e6d9 eeepc-wmi: asus generic asus-wmi.ko module 5b799d4 asus-wmi: move generic code to asus-wmi f017fbe medfield: Add Thermal Driver 820787f Enable Dell All-In-One volume up/down keys 8eec8a1 intel_mid_powerbtn: add power button driver for Medfield platform (#3) 89ca117 OLPC XO-1.5 ebook switch driver efcfed9 Move hp_accel to drivers/platform/x86 af06216 ACPI: Fix build for CONFIG_NET unset 52cfd50 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 156d821 Merge branch 'misc' into release 4cb1872 thermal: Add event notification to thermal framework 5369c02 intel_scu_ipc: Utility driver for intel scu ipc 5b275ce thermal: make ops constant 35f0ce0 IBM Real-Time "SMI Free" mode driver -v7 260586d Add OLPC XO-1 rfkill driver bd9fc3a Move hdaps driver to platform/x86 75b2d09 ideapad-laptop: Fix Makefile 57ac3b0 ideapad: Change the driver name to ideapad-laptop 58ac7aa Add Lenovo ideapad driver 8950778 gpio: Add PMIC GPIO block support c715a38 rar: Move the RAR driver into the right place as its now clean aa7ffc0 x86 platform driver: intelligent power sharing driver 9a58a33 IPC driver for Intel Mobile Internet Device (MID) platforms ee027e4 eeepc-wmi: new driver for WMI based hotkeys on Eee PC laptops 529aa8c classmate-laptop: add support for Classmate PC ACPI devices 243e1ef Merge branch 'toshiba-bt' into release d12d8ba X86 drivers: Introduce msi-wmi driver 42b4e9e Toshiba Bluetooth Enabling driver (RFKill handler v3) 9caeb53 topstar-laptop: add new driver for hotkeys support on Topstar N01 e86435e acerhdf: Acer Aspire One fan control 2e33b23 Merge branch 'dell-wmi' into release 0b3f610 dell-wmi: new driver for hotkey control 03a971a thermal: support forcing support for passive cooling b1569e9 ACPI: move thermal trip handling to generic thermal layer 6503e5d thermal: use integers rather than strings for thermal values cad7312 dell-laptop: move to drivers/platform/x86/ from drivers/misc/ b4f9fe1 ACPI: move wmi, asus_acpi, toshiba_acpi to drivers/platform/x86 41b16dc create drivers/platform/x86/ from drivers/misc/ 16d7523 thermal: Create CONFIG_THERMAL_HWMON=n ff16cab thermal: re-name thermal.c to thermal_sys.c e68b16a thermal: add hwmon sysfs I/F 9ec732f thermal: add new get_crit_temp callback 63c4ec9 thermal: add the support for building the generic thermal as a module 5f1a3f2 acpi thermal trip points increased to 12 a0dd25b ACPI: thermal: buildfix for CONFIG_THERMAL=n 041d4bb ACPI: CELSIUS_TO_KELVIN fixup 203d3d4 the generic thermal sysfs driver Signed-off-by: Sumeet Pawnikar <[email protected]>
1 parent 3393d53 commit d63897c

File tree

8 files changed

+1093
-576
lines changed

8 files changed

+1093
-576
lines changed

Diff for: arch/x86/include/asm/intel_mid_thermal.h

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#ifndef __INTEL_MID_THERMAL_H__
2+
#define __INTEL_MID_THERMAL_H__
3+
4+
#include <linux/thermal.h>
5+
6+
#define BPTHERM_NAME "bptherm"
7+
#define SKIN0_NAME "skin0"
8+
#define SKIN1_NAME "skin1"
9+
#define MSIC_DIE_NAME "msicdie"
10+
#define MSIC_SYS_NAME "sys"
11+
#define SYSTHERM2 "systherm2"
12+
/**
13+
* struct intel_mid_thermal_sensor - intel_mid_thermal sensor information
14+
* @name: name of the sensor
15+
* @index: index number of sensor
16+
* @slope: slope used for temp calculation
17+
* @intercept: intercept used for temp calculation
18+
* @adc_channel: adc channel id|flags
19+
* @direct: If true then direct conversion is used.
20+
* @priv: private sensor data
21+
* @temp_correlation: temp correlation function
22+
*/
23+
struct intel_mid_thermal_sensor {
24+
char name[THERMAL_NAME_LENGTH];
25+
int index;
26+
long slope;
27+
long intercept;
28+
int adc_channel;
29+
bool direct;
30+
void *priv;
31+
int (*temp_correlation)(void *info, long temp, long *res);
32+
};
33+
34+
/**
35+
* struct soc_throttle_data - SoC level power limits for thermal throttling
36+
* @power_limit: power limit value
37+
* @floor_freq: The CPU frequency may not go below this value
38+
*/
39+
struct soc_throttle_data {
40+
int power_limit;
41+
int floor_freq;
42+
};
43+
44+
/**
45+
* struct intel_mid_thermal_platform_data - Platform data for
46+
* intel mid thermal driver
47+
*
48+
* @num_sensors: Maximum number of sensors supported
49+
* @sensors: sensor info
50+
* @soc_cooling: True or false
51+
*/
52+
struct intel_mid_thermal_platform_data {
53+
int num_sensors;
54+
struct intel_mid_thermal_sensor *sensors;
55+
bool soc_cooling;
56+
};
57+
58+
/**
59+
* struct skin1_private_info - skin1 sensor private data
60+
*
61+
* @dependent: dependency on other sensors
62+
0 - no dependency,
63+
> 0 - depends on other sensors
64+
* @sensors: dependent sensor address.
65+
*/
66+
struct skin1_private_info {
67+
int dependent;
68+
struct intel_mid_thermal_sensor **sensors;
69+
};
70+
71+
/* skin0 sensor temperature correlation function*/
72+
int skin0_temp_correlation(void *info, long temp, long *res);
73+
/* skin1 sensor temperature correlation function*/
74+
int skin1_temp_correlation(void *info, long temp, long *res);
75+
/* bptherm sensor temperature correlation function*/
76+
int bptherm_temp_correlation(void *info, long temp, long *res);
77+
#endif

Diff for: arch/x86/platform/intel-mid/device_libs/platform_msic_thermal.c

+170-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,179 @@
1717
#include <linux/platform_device.h>
1818
#include <linux/mfd/intel_msic.h>
1919
#include <asm/intel-mid.h>
20+
#include <asm/intel_mid_gpadc.h>
21+
#include <asm/intel_mid_thermal.h>
22+
#include <linux/platform_data/intel_mid_remoteproc.h>
2023
#include "platform_msic.h"
2124
#include "platform_msic_thermal.h"
2225

26+
/* ctp thermal sensor list */
27+
static struct intel_mid_thermal_sensor ctp_sensors[] = {
28+
{
29+
.name = SKIN0_NAME,
30+
.index = 0,
31+
.slope = 410,
32+
.intercept = 16808,
33+
.adc_channel = 0x04 | CH_NEED_VREF | CH_NEED_VCALIB,
34+
.temp_correlation = skin0_temp_correlation,
35+
.direct = false,
36+
},
37+
{
38+
.name = SKIN1_NAME,
39+
.index = 1,
40+
.slope = 665,
41+
.intercept = 8375,
42+
.adc_channel = 0x04 | CH_NEED_VREF | CH_NEED_VCALIB,
43+
.temp_correlation = skin0_temp_correlation,
44+
.direct = false,
45+
},
46+
{
47+
.name = MSIC_DIE_NAME,
48+
.index = 2,
49+
.slope = 368,
50+
.intercept = 219560,
51+
.adc_channel = 0x03 | CH_NEED_VCALIB,
52+
.direct = true,
53+
},
54+
{
55+
.name = BPTHERM_NAME,
56+
.index = 3,
57+
.slope = 788,
58+
.intercept = 5065,
59+
.adc_channel = 0x09 | CH_NEED_VREF | CH_NEED_VCALIB,
60+
.temp_correlation = bptherm_temp_correlation,
61+
.direct = false,
62+
},
63+
64+
};
65+
66+
/* mfld thermal sensor list */
67+
static struct intel_mid_thermal_sensor mfld_sensors[] = {
68+
{
69+
.name = SKIN0_NAME,
70+
.index = 0,
71+
.slope = 851,
72+
.intercept = 2800,
73+
.adc_channel = 0x08 | CH_NEED_VREF | CH_NEED_VCALIB,
74+
.temp_correlation = skin0_temp_correlation,
75+
.direct = false,
76+
},
77+
{
78+
.name = SKIN1_NAME,
79+
.index = 1,
80+
.slope = 806,
81+
.intercept = 1800,
82+
.adc_channel = 0x08 | CH_NEED_VREF | CH_NEED_VCALIB,
83+
.temp_correlation = skin1_temp_correlation,
84+
.direct = false,
85+
},
86+
{
87+
.name = MSIC_SYS_NAME,
88+
.index = 2,
89+
.slope = 0,
90+
.intercept = 0,
91+
.adc_channel = 0x0A | CH_NEED_VREF | CH_NEED_VCALIB,
92+
.direct = false,
93+
},
94+
{
95+
.name = MSIC_DIE_NAME,
96+
.index = 3,
97+
.slope = 368,
98+
.intercept = 219560,
99+
.adc_channel = 0x03 | CH_NEED_VCALIB,
100+
.direct = true,
101+
},
102+
103+
};
104+
105+
/* LEX thermal sensor list */
106+
static struct intel_mid_thermal_sensor lex_sensors[] = {
107+
{
108+
.name = SKIN0_NAME,
109+
.index = 0,
110+
.slope = 851,
111+
.intercept = 2800,
112+
.adc_channel = 0x08 | CH_NEED_VREF | CH_NEED_VCALIB,
113+
.temp_correlation = skin0_temp_correlation,
114+
.direct = false,
115+
},
116+
{
117+
.name = SKIN1_NAME,
118+
.index = 1,
119+
.slope = 806,
120+
.intercept = 1800,
121+
.adc_channel = 0x08 | CH_NEED_VREF | CH_NEED_VCALIB,
122+
.temp_correlation = skin1_temp_correlation,
123+
.direct = false,
124+
},
125+
{
126+
.name = MSIC_SYS_NAME,
127+
.index = 2,
128+
.slope = 0,
129+
.intercept = 0,
130+
.adc_channel = 0x0A | CH_NEED_VREF | CH_NEED_VCALIB,
131+
.direct = false,
132+
},
133+
{
134+
.name = MSIC_DIE_NAME,
135+
.index = 3,
136+
.slope = 368,
137+
.intercept = 219560,
138+
.adc_channel = 0x03 | CH_NEED_VCALIB,
139+
.direct = true,
140+
},
141+
142+
};
143+
144+
145+
static struct intel_mid_thermal_platform_data pdata[] = {
146+
[mfld_thermal] = {
147+
.num_sensors = 4,
148+
.sensors = mfld_sensors,
149+
.soc_cooling = false,
150+
},
151+
[ctp_thermal] = {
152+
.num_sensors = 4,
153+
.sensors = ctp_sensors,
154+
.soc_cooling = true,
155+
},
156+
[lex_thermal] = {
157+
.num_sensors = 4,
158+
.sensors = lex_sensors,
159+
.soc_cooling = false,
160+
},
161+
};
162+
23163
void __init *msic_thermal_platform_data(void *info)
24164
{
25-
return msic_generic_platform_data(info, INTEL_MSIC_BLOCK_THERMAL);
165+
struct platform_device *pdev;
166+
167+
pdev = platform_device_alloc(MSIC_THERM_DEV_NAME, -1);
168+
if (!pdev) {
169+
pr_err("out of memory for SFI platform dev %s\n",
170+
MSIC_THERM_DEV_NAME);
171+
return NULL;
172+
}
173+
174+
if (platform_device_add(pdev)) {
175+
pr_err("failed to add thermal platform device\n");
176+
platform_device_put(pdev);
177+
return NULL;
178+
}
179+
180+
if (INTEL_MID_BOARD(2, PHONE, CLVTP, VB, PRO) ||
181+
INTEL_MID_BOARD(2, PHONE, CLVTP, VB, ENG))
182+
pdev->dev.platform_data = &pdata[vb_thermal];
183+
else if (INTEL_MID_BOARD(1, PHONE, CLVTP) ||
184+
(INTEL_MID_BOARD(1, TABLET, CLVT)))
185+
pdev->dev.platform_data = &pdata[ctp_thermal];
186+
else if (INTEL_MID_BOARD(2, PHONE, MFLD, LEX, ENG) ||
187+
(INTEL_MID_BOARD(2, PHONE, MFLD, LEX, PRO)))
188+
pdev->dev.platform_data = &pdata[lex_thermal];
189+
else
190+
pdev->dev.platform_data = &pdata[mfld_thermal];
191+
192+
register_rpmsg_service("rpmsg_mid_thermal", RPROC_SCU, RP_MSIC_THERMAL);
193+
194+
return 0;
26195
}

Diff for: arch/x86/platform/intel-mid/device_libs/platform_msic_thermal.h

+9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
#ifndef _PLATFORM_MSIC_THERMAL_H_
1313
#define _PLATFORM_MSIC_THERMAL_H_
1414

15+
#define MSIC_THERM_DEV_NAME "msic_thermal"
16+
1517
extern void __init *msic_thermal_platform_data(void *info)
1618
__attribute__((weak));
19+
enum {
20+
mfld_thermal,
21+
ctp_thermal,
22+
lex_thermal,
23+
vb_thermal,
24+
};
25+
1726
#endif

Diff for: drivers/platform/x86/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ obj-$(CONFIG_TOSHIBA_BT_RFKILL) += toshiba_bluetooth.o
3939
obj-$(CONFIG_INTEL_SCU_IPC) += intel_scu_ipc.o intel_scu_pmic.o intel_scu_mip.o intel_scu_fw_update.o
4040
obj-$(CONFIG_INTEL_SCU_IPC_UTIL) += intel_scu_ipcutil.o
4141
obj-$(CONFIG_INTEL_SCU_FLIS) += intel_scu_flis.o
42-
obj-$(CONFIG_INTEL_MFLD_THERMAL) += intel_mid_thermal.o
4342
obj-$(CONFIG_INTEL_IPS) += intel_ips.o
4443
obj-$(CONFIG_GPIO_INTEL_PMIC) += intel_pmic_gpio.o
4544
obj-$(CONFIG_XO1_RFKILL) += xo1-rfkill.o

0 commit comments

Comments
 (0)