Skip to content

Commit 5516745

Browse files
committed
Merge tag 'platform-drivers-x86-v5.3-1' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform driver updates from Andy Shevchenko: "Gathered a bunch of x86 platform driver changes. It's rather big, since includes two big refactors and completely new driver: - ASUS WMI driver got a big refactoring in order to support the TUF Gaming laptops. Besides that, the regression with backlight being permanently off on various EeePC laptops has been fixed. - Accelerometer on HP ProBook 450 G0 shows wrong measurements due to X axis being inverted. This has been fixed. - Intel PMC core driver has been extended to be ACPI enumerated if the DSDT provides device with _HID "INT33A1". This allows to convert the driver to be pure platform and support new hardware purely based on ACPI DSDT. - From now on the Intel Speed Select Technology is supported thru a corresponding driver. This driver provides an access to the features of the ISST, such as Performance Profile, Core Power, Base frequency and Turbo Frequency. - Mellanox platform drivers has been refactored and now extended to support more systems, including new coming ones. - The OLPC XO-1.75 platform is now supported. - CB4063 Beckhoff Automation board is using PMC clocks, provided via pmc_atom driver, for ethernet controllers in a way that they can't be managed by the clock driver. The quirk has been extended to cover this case. - Touchscreen on Chuwi Hi10 Plus tablet has been enabled. Meanwhile the information of Chuwi Hi10 Air has been fixed to cover more models based on the same platform. - Xiaomi notebooks have WMI interface enabled. Thus, the driver to support it has been provided. It required some extension of the generic WMI library, which allows to propagate opaque context to the ->probe() of the individual drivers. This release includes debugfs clean up from Greg KH for several drivers that drop return code check and make debugfs absence or failure non-fatal. Also miscellaneous fixes here and there, mostly for Acer WMI and various Intel drivers" * tag 'platform-drivers-x86-v5.3-1' of git://git.infradead.org/linux-platform-drivers-x86: (74 commits) platform/x86: Fix PCENGINES_APU2 Kconfig warning tools/power/x86/intel-speed-select: Add .gitignore file platform/x86: mlx-platform: Fix error handling in mlxplat_init() platform/x86: intel_pmc_core: Attach using APCI HID "INT33A1" platform/x86: intel_pmc_core: transform Pkg C-state residency from TSC ticks into microseconds platform/x86: asus-wmi: Use dev_get_drvdata() Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces platform/x86: mlx-platform: Add more reset cause attributes platform/x86: mlx-platform: Modify DMI matching order platform/x86: mlx-platform: Add regmap structure for the next generation systems platform/x86: mlx-platform: Change API for i2c-mlxcpld driver activation platform/x86: mlx-platform: Move regmap initialization before all drivers activation MAINTAINERS: Update for Intel Speed Select Technology tools/power/x86: A tool to validate Intel Speed Select commands platform/x86: ISST: Restore state on resume platform/x86: ISST: Add Intel Speed Select PUNIT MSR interface platform/x86: ISST: Add Intel Speed Select mailbox interface via MSRs platform/x86: ISST: Add Intel Speed Select mailbox interface via PCI platform/x86: ISST: Add Intel Speed Select mmio interface platform/x86: ISST: Add IOCTL to Translate Linux logical CPU to PUNIT CPU number ...
2 parents fde7dc6 + 7d67c8a commit 5516745

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+6591
-643
lines changed

Documentation/ABI/stable/sysfs-driver-mlxreg-io

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,23 @@ Description: These files show the system reset cause, as following: ComEx
120120
the last reset cause.
121121

122122
The files are read only.
123+
124+
Date: June 2019
125+
KernelVersion: 5.3
126+
Contact: Vadim Pasternak <vadimpmellanox.com>
127+
Description: These files show the system reset cause, as following:
128+
COMEX thermal shutdown; wathchdog power off or reset was derived
129+
by one of the next components: COMEX, switch board or by Small Form
130+
Factor mezzanine, reset requested from ASIC, reset cuased by BIOS
131+
reload. Value 1 in file means this is reset cause, 0 - otherwise.
132+
Only one of the above causes could be 1 at the same time, representing
133+
only last reset cause.
134+
135+
The files are read only.
136+
137+
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_comex_thermal
138+
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_comex_wd
139+
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_from_asic
140+
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_reload_bios
141+
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_sff_wd
142+
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_swb_wd

Documentation/ABI/testing/sysfs-platform-asus-wmi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,13 @@ KernelVersion: 3.5
3636
Contact: "AceLan Kao" <[email protected]>
3737
Description:
3838
Resume on lid open. 1 means on, 0 means off.
39+
40+
What: /sys/devices/platform/<platform>/fan_mode
41+
Date: Apr 2019
42+
KernelVersion: 5.2
43+
Contact: "Yurii Pavlovskyi" <[email protected]>
44+
Description:
45+
Fan boost mode:
46+
* 0 - normal,
47+
* 1 - overboost,
48+
* 2 - silent
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
OLPC XO-1.75 Embedded Controller
2+
3+
Required properties:
4+
- compatible: Should be "olpc,xo1.75-ec".
5+
- cmd-gpios: gpio specifier of the CMD pin
6+
7+
The embedded controller requires the SPI controller driver to signal readiness
8+
to receive a transfer (that is, when TX FIFO contains the response data) by
9+
strobing the ACK pin with the ready signal. See the "ready-gpios" property of the
10+
SSP binding as documented in:
11+
<Documentation/devicetree/bindings/spi/spi-pxa2xx.txt>.
12+
13+
Example:
14+
&ssp3 {
15+
spi-slave;
16+
ready-gpios = <&gpio 125 GPIO_ACTIVE_HIGH>;
17+
18+
slave {
19+
compatible = "olpc,xo1.75-ec";
20+
spi-cpha;
21+
cmd-gpios = <&gpio 155 GPIO_ACTIVE_HIGH>;
22+
};
23+
};

Documentation/ioctl/ioctl-number.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,4 @@ Code Seq#(hex) Include File Comments
348348
0xF6 all LTTng Linux Trace Toolkit Next Generation
349349
350350
0xFD all linux/dm-ioctl.h
351+
0xFE all linux/isst_if.h

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8246,6 +8246,14 @@ S: Supported
82468246
F: drivers/infiniband/hw/i40iw/
82478247
F: include/uapi/rdma/i40iw-abi.h
82488248

8249+
INTEL SPEED SELECT TECHNOLOGY
8250+
M: Srinivas Pandruvada <[email protected]>
8251+
8252+
S: Maintained
8253+
F: drivers/platform/x86/intel_speed_select_if/
8254+
F: tools/power/x86/intel-speed-select/
8255+
F: include/uapi/linux/isst_if.h
8256+
82498257
INTEL TELEMETRY DRIVER
82508258
M: Rajneesh Bhardwaj <[email protected]>
82518259
M: "David E. Box" <[email protected]>

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2733,6 +2733,7 @@ config OLPC
27332733
select OF
27342734
select OF_PROMTREE
27352735
select IRQ_DOMAIN
2736+
select OLPC_EC
27362737
---help---
27372738
Add support for detecting the unique features of the OLPC
27382739
XO hardware.

arch/x86/include/asm/olpc.h

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
struct olpc_platform_t {
1010
int flags;
1111
uint32_t boardrev;
12-
int ecver;
1312
};
1413

1514
#define OLPC_F_PRESENT 0x01
1615
#define OLPC_F_DCON 0x02
17-
#define OLPC_F_EC_WIDE_SCI 0x04
1816

1917
#ifdef CONFIG_OLPC
2018

@@ -64,13 +62,6 @@ static inline int olpc_board_at_least(uint32_t rev)
6462
return olpc_platform_info.boardrev >= rev;
6563
}
6664

67-
extern void olpc_ec_wakeup_set(u16 value);
68-
extern void olpc_ec_wakeup_clear(u16 value);
69-
extern bool olpc_ec_wakeup_available(void);
70-
71-
extern int olpc_ec_mask_write(u16 bits);
72-
extern int olpc_ec_sci_query(u16 *sci_value);
73-
7465
#else
7566

7667
static inline int machine_is_olpc(void)
@@ -83,14 +74,6 @@ static inline int olpc_has_dcon(void)
8374
return 0;
8475
}
8576

86-
static inline void olpc_ec_wakeup_set(u16 value) { }
87-
static inline void olpc_ec_wakeup_clear(u16 value) { }
88-
89-
static inline bool olpc_ec_wakeup_available(void)
90-
{
91-
return false;
92-
}
93-
9477
#endif
9578

9679
#ifdef CONFIG_OLPC_XO1_PM
@@ -101,20 +84,6 @@ extern void olpc_xo1_pm_wakeup_clear(u16 value);
10184

10285
extern int pci_olpc_init(void);
10386

104-
/* SCI source values */
105-
106-
#define EC_SCI_SRC_EMPTY 0x00
107-
#define EC_SCI_SRC_GAME 0x01
108-
#define EC_SCI_SRC_BATTERY 0x02
109-
#define EC_SCI_SRC_BATSOC 0x04
110-
#define EC_SCI_SRC_BATERR 0x08
111-
#define EC_SCI_SRC_EBOOK 0x10 /* XO-1 only */
112-
#define EC_SCI_SRC_WLAN 0x20 /* XO-1 only */
113-
#define EC_SCI_SRC_ACPWR 0x40
114-
#define EC_SCI_SRC_BATCRIT 0x80
115-
#define EC_SCI_SRC_GPWAKE 0x100 /* XO-1.5 only */
116-
#define EC_SCI_SRC_ALL 0x1FF
117-
11887
/* GPIO assignments */
11988

12089
#define OLPC_GPIO_MIC_AC 1

arch/x86/platform/olpc/olpc.c

Lines changed: 18 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
struct olpc_platform_t olpc_platform_info;
2727
EXPORT_SYMBOL_GPL(olpc_platform_info);
2828

29-
/* EC event mask to be applied during suspend (defining wakeup sources). */
30-
static u16 ec_wakeup_mask;
31-
3229
/* what the timeout *should* be (in ms) */
3330
#define EC_BASE_TIMEOUT 20
3431

@@ -182,83 +179,6 @@ static int olpc_xo1_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 *outbuf,
182179
return ret;
183180
}
184181

185-
void olpc_ec_wakeup_set(u16 value)
186-
{
187-
ec_wakeup_mask |= value;
188-
}
189-
EXPORT_SYMBOL_GPL(olpc_ec_wakeup_set);
190-
191-
void olpc_ec_wakeup_clear(u16 value)
192-
{
193-
ec_wakeup_mask &= ~value;
194-
}
195-
EXPORT_SYMBOL_GPL(olpc_ec_wakeup_clear);
196-
197-
/*
198-
* Returns true if the compile and runtime configurations allow for EC events
199-
* to wake the system.
200-
*/
201-
bool olpc_ec_wakeup_available(void)
202-
{
203-
if (!machine_is_olpc())
204-
return false;
205-
206-
/*
207-
* XO-1 EC wakeups are available when olpc-xo1-sci driver is
208-
* compiled in
209-
*/
210-
#ifdef CONFIG_OLPC_XO1_SCI
211-
if (olpc_platform_info.boardrev < olpc_board_pre(0xd0)) /* XO-1 */
212-
return true;
213-
#endif
214-
215-
/*
216-
* XO-1.5 EC wakeups are available when olpc-xo15-sci driver is
217-
* compiled in
218-
*/
219-
#ifdef CONFIG_OLPC_XO15_SCI
220-
if (olpc_platform_info.boardrev >= olpc_board_pre(0xd0)) /* XO-1.5 */
221-
return true;
222-
#endif
223-
224-
return false;
225-
}
226-
EXPORT_SYMBOL_GPL(olpc_ec_wakeup_available);
227-
228-
int olpc_ec_mask_write(u16 bits)
229-
{
230-
if (olpc_platform_info.flags & OLPC_F_EC_WIDE_SCI) {
231-
__be16 ec_word = cpu_to_be16(bits);
232-
return olpc_ec_cmd(EC_WRITE_EXT_SCI_MASK, (void *) &ec_word, 2,
233-
NULL, 0);
234-
} else {
235-
unsigned char ec_byte = bits & 0xff;
236-
return olpc_ec_cmd(EC_WRITE_SCI_MASK, &ec_byte, 1, NULL, 0);
237-
}
238-
}
239-
EXPORT_SYMBOL_GPL(olpc_ec_mask_write);
240-
241-
int olpc_ec_sci_query(u16 *sci_value)
242-
{
243-
int ret;
244-
245-
if (olpc_platform_info.flags & OLPC_F_EC_WIDE_SCI) {
246-
__be16 ec_word;
247-
ret = olpc_ec_cmd(EC_EXT_SCI_QUERY,
248-
NULL, 0, (void *) &ec_word, 2);
249-
if (ret == 0)
250-
*sci_value = be16_to_cpu(ec_word);
251-
} else {
252-
unsigned char ec_byte;
253-
ret = olpc_ec_cmd(EC_SCI_QUERY, NULL, 0, &ec_byte, 1);
254-
if (ret == 0)
255-
*sci_value = ec_byte;
256-
}
257-
258-
return ret;
259-
}
260-
EXPORT_SYMBOL_GPL(olpc_ec_sci_query);
261-
262182
static bool __init check_ofw_architecture(struct device_node *root)
263183
{
264184
const char *olpc_arch;
@@ -292,6 +212,10 @@ static bool __init platform_detect(void)
292212
if (success) {
293213
olpc_platform_info.boardrev = get_board_revision(root);
294214
olpc_platform_info.flags |= OLPC_F_PRESENT;
215+
216+
pr_info("OLPC board revision %s%X\n",
217+
((olpc_platform_info.boardrev & 0xf) < 8) ? "pre" : "",
218+
olpc_platform_info.boardrev >> 4);
295219
}
296220

297221
of_node_put(root);
@@ -311,27 +235,8 @@ static int __init add_xo1_platform_devices(void)
311235
return PTR_ERR_OR_ZERO(pdev);
312236
}
313237

314-
static int olpc_xo1_ec_probe(struct platform_device *pdev)
315-
{
316-
/* get the EC revision */
317-
olpc_ec_cmd(EC_FIRMWARE_REV, NULL, 0,
318-
(unsigned char *) &olpc_platform_info.ecver, 1);
319-
320-
/* EC version 0x5f adds support for wide SCI mask */
321-
if (olpc_platform_info.ecver >= 0x5f)
322-
olpc_platform_info.flags |= OLPC_F_EC_WIDE_SCI;
323-
324-
pr_info("OLPC board revision %s%X (EC=%x)\n",
325-
((olpc_platform_info.boardrev & 0xf) < 8) ? "pre" : "",
326-
olpc_platform_info.boardrev >> 4,
327-
olpc_platform_info.ecver);
328-
329-
return 0;
330-
}
331238
static int olpc_xo1_ec_suspend(struct platform_device *pdev)
332239
{
333-
olpc_ec_mask_write(ec_wakeup_mask);
334-
335240
/*
336241
* Squelch SCIs while suspended. This is a fix for
337242
* <http://dev.laptop.org/ticket/1835>.
@@ -355,15 +260,27 @@ static int olpc_xo1_ec_resume(struct platform_device *pdev)
355260
}
356261

357262
static struct olpc_ec_driver ec_xo1_driver = {
358-
.probe = olpc_xo1_ec_probe,
359263
.suspend = olpc_xo1_ec_suspend,
360264
.resume = olpc_xo1_ec_resume,
361265
.ec_cmd = olpc_xo1_ec_cmd,
266+
#ifdef CONFIG_OLPC_XO1_SCI
267+
/*
268+
* XO-1 EC wakeups are available when olpc-xo1-sci driver is
269+
* compiled in
270+
*/
271+
.wakeup_available = true,
272+
#endif
362273
};
363274

364275
static struct olpc_ec_driver ec_xo1_5_driver = {
365-
.probe = olpc_xo1_ec_probe,
366276
.ec_cmd = olpc_xo1_ec_cmd,
277+
#ifdef CONFIG_OLPC_XO1_5_SCI
278+
/*
279+
* XO-1.5 EC wakeups are available when olpc-xo15-sci driver is
280+
* compiled in
281+
*/
282+
.wakeup_available = true,
283+
#endif
367284
};
368285

369286
static int __init olpc_init(void)

arch/x86/platform/olpc/olpc_dt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static u32 __init olpc_dt_get_board_revision(void)
216216
return be32_to_cpu(rev);
217217
}
218218

219-
int olpc_dt_compatible_match(phandle node, const char *compat)
219+
static int __init olpc_dt_compatible_match(phandle node, const char *compat)
220220
{
221221
char buf[64], *p;
222222
int plen, len;

drivers/hid/hid-asus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ static bool asus_kbd_wmi_led_control_present(struct hid_device *hdev)
393393
if (!IS_ENABLED(CONFIG_ASUS_WMI))
394394
return false;
395395

396-
ret = asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS2,
396+
ret = asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS,
397397
ASUS_WMI_DEVID_KBD_BACKLIGHT, 0, &value);
398398
hid_dbg(hdev, "WMI backlight check: rc %d value %x", ret, value);
399399
if (ret)

drivers/platform/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ source "drivers/platform/goldfish/Kconfig"
1111
source "drivers/platform/chrome/Kconfig"
1212

1313
source "drivers/platform/mellanox/Kconfig"
14+
15+
source "drivers/platform/olpc/Kconfig"

drivers/platform/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
obj-$(CONFIG_X86) += x86/
77
obj-$(CONFIG_MELLANOX_PLATFORM) += mellanox/
88
obj-$(CONFIG_MIPS) += mips/
9-
obj-$(CONFIG_OLPC) += olpc/
9+
obj-$(CONFIG_OLPC_EC) += olpc/
1010
obj-$(CONFIG_GOLDFISH) += goldfish/
1111
obj-$(CONFIG_CHROME_PLATFORMS) += chrome/

drivers/platform/olpc/Kconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
config OLPC_EC
2+
select REGULATOR
3+
bool
4+
5+
menuconfig OLPC_XO175
6+
bool "Platform support for OLPC XO 1.75 hardware"
7+
depends on ARCH_MMP || COMPILE_TEST
8+
help
9+
Say Y here to get to see options for the ARM-based OLPC platform.
10+
This option alone does not add any kernel code.
11+
12+
Unless you have an OLPC XO laptop, you will want to say N.
13+
14+
if OLPC_XO175
15+
16+
config OLPC_XO175_EC
17+
tristate "OLPC XO 1.75 Embedded Controller"
18+
depends on SPI_SLAVE
19+
depends on INPUT
20+
depends on POWER_SUPPLY
21+
select OLPC_EC
22+
help
23+
Include support for the OLPC XO Embedded Controller (EC). The EC
24+
provides various platform services, including support for the power,
25+
button, restart, shutdown and battery charging status.
26+
27+
Unless you have an OLPC XO laptop, you will want to say N.
28+
29+
endif # OLPC_XO175

drivers/platform/olpc/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
#
33
# OLPC XO platform-specific drivers
44
#
5-
obj-$(CONFIG_OLPC) += olpc-ec.o
5+
obj-$(CONFIG_OLPC_EC) += olpc-ec.o
6+
obj-$(CONFIG_OLPC_XO175_EC) += olpc-xo175-ec.o

0 commit comments

Comments
 (0)