Skip to content

Commit 899fbc3

Browse files
committed
Merge tag 'platform-drivers-x86-v4.19-1' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform driver updates from Andy Shevchenko: - The driver for Silead touchscreen configurations has been renamed from silead_dmi to touchscreen_dmi since it starts supporting other touchscreens which require some DMI quirks It also gets expanded to cover cases for Chuwi Vi10, ONDA V891W, Connect Tablet 9, Onda V820w, and Cube KNote i1101 tablets. - Another bunch of changes is related to Mellanox platform code to allow user space to communicate with Mellanox for system control and monitoring purposes. The driver notifies user on hotplug device signal receiving. - ASUS WMI drivers recognize lid flip action on UX360, and correctly toggles airplane mode LED. In addition the keyboard backlight toggle gets support. - ThinkPad ACPI driver enables support for calculator key (on at least P52). It also has been fixed to support three characters model designators, which are used for modern laptops. Earlier the battery, marked as BAT1, on ThinkPad laptops has not been configured properly, which is fixed. On the opposite the multi-battery configurations now probed correctly. - Dell SMBIOS driver starts working on some Dell servers which do not support token interface. The regression with backlight detection has also been fixed. In order to support dock mode on some laptops, Intel virtual button driver has been fixed. The last but not least is the fix to Intel HID driver due to changes in Dell systems that prevented to use power button. * tag 'platform-drivers-x86-v4.19-1' of git://git.infradead.org/linux-platform-drivers-x86: (47 commits) platform/x86: acer-wmi: Silence "unsupported" message a bit platform/x86: intel_punit_ipc: fix build errors platform/x86: ideapad: Add Y520-15IKBM and Y720-15IKBM to no_hw_rfkill platform/x86: asus-nb-wmi: Add keymap entry for lid flip action on UX360 platform/x86: acer-wmi: refactor function has_cap platform/x86: thinkpad_acpi: Fix multi-battery bug platform/x86: thinkpad_acpi: extend battery quirk coverage platform/x86: touchscreen_dmi: Add info for the Cube KNote i1101 tablet platform/x86: mlx-platform: Fix copy-paste error in mlxplat_init() platform/x86: mlx-platform: Remove unused define platform/x86: mlx-platform: Change mlxreg-io configuration for MSN274x systems Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces platform/x86: mlx-platform: Allow mlxreg-io driver activation for more systems platform/x86: mlx-platform: Add ASIC hotplug device configuration platform/mellanox: mlxreg-hotplug: Add hotplug hwmon uevent notification platform/mellanox: mlxreg-hotplug: Improve mechanism of ASIC health discovery platform/x86: mlx-platform: Add mlxreg-fan platform driver activation platform/x86: dell-laptop: Fix backlight detection platform/x86: toshiba_acpi: Fix defined but not used build warnings platform/x86: thinkpad_acpi: Support battery quirk ...
2 parents 2edd73a + 9bd5196 commit 899fbc3

27 files changed

+1738
-419
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/
2+
asic_health
3+
4+
Date: June 2018
5+
KernelVersion: 4.19
6+
Contact: Vadim Pasternak <vadimpmellanox.com>
7+
Description: This file shows ASIC health status. The possible values are:
8+
0 - health failed, 2 - health OK, 3 - ASIC in booting state.
9+
10+
The files are read only.
11+
12+
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/
13+
cpld1_version
14+
cpld2_version
15+
16+
Date: June 2018
17+
KernelVersion: 4.19
18+
Contact: Vadim Pasternak <vadimpmellanox.com>
19+
Description: These files show with which CPLD versions have been burned
20+
on carrier and switch boards.
21+
22+
The files are read only.
23+
24+
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/select_iio
25+
Date: June 2018
26+
KernelVersion: 4.19
27+
Contact: Vadim Pasternak <vadimpmellanox.com>
28+
Description: This file allows iio devices selection.
29+
30+
Attribute select_iio can be written with 0 or with 1. It
31+
selects which one of iio devices can be accessed.
32+
33+
The file is read/write.
34+
35+
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/psu1_on
36+
/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/psu2_on
37+
/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/pwr_cycle
38+
/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/pwr_down
39+
Date: June 2018
40+
KernelVersion: 4.19
41+
Contact: Vadim Pasternak <vadimpmellanox.com>
42+
Description: These files allow asserting system power cycling, switching
43+
power supply units on and off and system's main power domain
44+
shutdown.
45+
Expected behavior:
46+
When pwr_cycle is written 1: auxiliary power domain will go
47+
down and after short period (about 1 second) up.
48+
When psu1_on or psu2_on is written 1, related unit will be
49+
disconnected from the power source, when written 0 - connected.
50+
If both are written 1 - power supplies main power domain will
51+
go down.
52+
When pwr_down is written 1, system's main power domain will go
53+
down.
54+
55+
The files are write only.
56+
57+
What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/
58+
reset_aux_pwr_or_ref
59+
reset_asic_thermal
60+
reset_hotswap_or_halt
61+
reset_hotswap_or_wd
62+
reset_fw_reset
63+
reset_long_pb
64+
reset_main_pwr_fail
65+
reset_short_pb
66+
reset_sw_reset
67+
Date: June 2018
68+
KernelVersion: 4.19
69+
Contact: Vadim Pasternak <vadimpmellanox.com>
70+
Description: These files show the system reset cause, as following: power
71+
auxiliary outage or power refresh, ASIC thermal shutdown, halt,
72+
hotswap, watchdog, firmware reset, long press power button,
73+
short press power button, software reset. Value 1 in file means
74+
this is reset cause, 0 - otherwise. Only one of the above
75+
causes could be 1 at the same time, representing only last
76+
reset cause.
77+
78+
The files are read only.

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13207,7 +13207,7 @@ L: [email protected]
1320713207
1320813208
S: Maintained
1320913209
F: drivers/input/touchscreen/silead.c
13210-
F: drivers/platform/x86/silead_dmi.c
13210+
F: drivers/platform/x86/touchscreen_dmi.c
1321113211

1321213212
SILICON MOTION SM712 FRAME BUFFER DRIVER
1321313213
M: Sudip Mukherjee <[email protected]>

drivers/platform/mellanox/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,15 @@ config MLXREG_HOTPLUG
2323
This driver handles hot-plug events for the power suppliers, power
2424
cables and fans on the wide range Mellanox IB and Ethernet systems.
2525

26+
config MLXREG_IO
27+
tristate "Mellanox platform register access driver support"
28+
depends on REGMAP
29+
depends on HWMON
30+
help
31+
This driver allows access to Mellanox programmable device register
32+
space through sysfs interface. The sets of registers for sysfs access
33+
are defined per system type bases and include the registers related
34+
to system resets operation, system reset causes monitoring and some
35+
kinds of mux selection.
36+
2637
endif # MELLANOX_PLATFORM

drivers/platform/mellanox/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
# Mellanox Platform-Specific Drivers
55
#
66
obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o
7+
obj-$(CONFIG_MLXREG_IO) += mlxreg-io.o

drivers/platform/mellanox/mlxreg-hotplug.c

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@
5050
#define MLXREG_HOTPLUG_MASK_OFF 2
5151
#define MLXREG_HOTPLUG_AGGR_MASK_OFF 1
5252

53-
/* ASIC health parameters. */
54-
#define MLXREG_HOTPLUG_HEALTH_MASK 0x02
55-
#define MLXREG_HOTPLUG_RST_CNTR 3
53+
/* ASIC good health mask. */
54+
#define MLXREG_HOTPLUG_GOOD_HEALTH_MASK 0x02
5655

5756
#define MLXREG_HOTPLUG_ATTRS_MAX 24
5857
#define MLXREG_HOTPLUG_NOT_ASSERT 3
@@ -103,6 +102,9 @@ static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv,
103102
{
104103
struct mlxreg_core_hotplug_platform_data *pdata;
105104

105+
/* Notify user by sending hwmon uevent. */
106+
kobject_uevent(&priv->hwmon->kobj, KOBJ_CHANGE);
107+
106108
/*
107109
* Return if adapter number is negative. It could be in case hotplug
108110
* event is not associated with hotplug device.
@@ -134,8 +136,13 @@ static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv,
134136
return 0;
135137
}
136138

137-
static void mlxreg_hotplug_device_destroy(struct mlxreg_core_data *data)
139+
static void
140+
mlxreg_hotplug_device_destroy(struct mlxreg_hotplug_priv_data *priv,
141+
struct mlxreg_core_data *data)
138142
{
143+
/* Notify user by sending hwmon uevent. */
144+
kobject_uevent(&priv->hwmon->kobj, KOBJ_CHANGE);
145+
139146
if (data->hpdev.client) {
140147
i2c_unregister_device(data->hpdev.client);
141148
data->hpdev.client = NULL;
@@ -278,14 +285,14 @@ mlxreg_hotplug_work_helper(struct mlxreg_hotplug_priv_data *priv,
278285
data = item->data + bit;
279286
if (regval & BIT(bit)) {
280287
if (item->inversed)
281-
mlxreg_hotplug_device_destroy(data);
288+
mlxreg_hotplug_device_destroy(priv, data);
282289
else
283290
mlxreg_hotplug_device_create(priv, data);
284291
} else {
285292
if (item->inversed)
286293
mlxreg_hotplug_device_create(priv, data);
287294
else
288-
mlxreg_hotplug_device_destroy(data);
295+
mlxreg_hotplug_device_destroy(priv, data);
289296
}
290297
}
291298

@@ -325,21 +332,40 @@ mlxreg_hotplug_health_work_helper(struct mlxreg_hotplug_priv_data *priv,
325332
goto out;
326333

327334
regval &= data->mask;
328-
item->cache = regval;
329-
if (regval == MLXREG_HOTPLUG_HEALTH_MASK) {
330-
if ((data->health_cntr++ == MLXREG_HOTPLUG_RST_CNTR) ||
331-
!priv->after_probe) {
335+
336+
if (item->cache == regval)
337+
goto ack_event;
338+
339+
/*
340+
* ASIC health indication is provided through two bits. Bits
341+
* value 0x2 indicates that ASIC reached the good health, value
342+
* 0x0 indicates ASIC the bad health or dormant state and value
343+
* 0x3 indicates the booting state. During ASIC reset it should
344+
* pass the following states: dormant -> booting -> good.
345+
*/
346+
if (regval == MLXREG_HOTPLUG_GOOD_HEALTH_MASK) {
347+
if (!data->attached) {
348+
/*
349+
* ASIC is in steady state. Connect associated
350+
* device, if configured.
351+
*/
332352
mlxreg_hotplug_device_create(priv, data);
333353
data->attached = true;
334354
}
335355
} else {
336356
if (data->attached) {
337-
mlxreg_hotplug_device_destroy(data);
357+
/*
358+
* ASIC health is failed after ASIC has been
359+
* in steady state. Disconnect associated
360+
* device, if it has been connected.
361+
*/
362+
mlxreg_hotplug_device_destroy(priv, data);
338363
data->attached = false;
339364
data->health_cntr = 0;
340365
}
341366
}
342-
367+
item->cache = regval;
368+
ack_event:
343369
/* Acknowledge event. */
344370
ret = regmap_write(priv->regmap, data->reg +
345371
MLXREG_HOTPLUG_EVENT_OFF, 0);
@@ -551,7 +577,7 @@ static void mlxreg_hotplug_unset_irq(struct mlxreg_hotplug_priv_data *priv)
551577
/* Remove all the attached devices in group. */
552578
count = item->count;
553579
for (j = 0; j < count; j++, data++)
554-
mlxreg_hotplug_device_destroy(data);
580+
mlxreg_hotplug_device_destroy(priv, data);
555581
}
556582
}
557583

@@ -616,10 +642,6 @@ static int mlxreg_hotplug_probe(struct platform_device *pdev)
616642
disable_irq(priv->irq);
617643
spin_lock_init(&priv->lock);
618644
INIT_DELAYED_WORK(&priv->dwork_irq, mlxreg_hotplug_work_handler);
619-
/* Perform initial interrupts setup. */
620-
mlxreg_hotplug_set_irq(priv);
621-
622-
priv->after_probe = true;
623645
dev_set_drvdata(&pdev->dev, priv);
624646

625647
err = mlxreg_hotplug_attr_init(priv);
@@ -637,6 +659,10 @@ static int mlxreg_hotplug_probe(struct platform_device *pdev)
637659
return PTR_ERR(priv->hwmon);
638660
}
639661

662+
/* Perform initial interrupts setup. */
663+
mlxreg_hotplug_set_irq(priv);
664+
priv->after_probe = true;
665+
640666
return 0;
641667
}
642668

0 commit comments

Comments
 (0)