platform/kernel/linux-rpi.git
14 months agoplatform/x86: mlx-platform: Add dependency on PCI to Kconfig
Vadim Pasternak [Tue, 29 Aug 2023 13:37:48 +0000 (13:37 +0000)]
platform/x86: mlx-platform: Add dependency on PCI to Kconfig

Add dependency on PCI to avoid 'mlx-platform' compilation error in case
CONFIG_PCI is not set.

Failed on i386:
CONFIG_ACPI=y
CONFIG_ISA=y

Error In function 'mlxplat_pci_fpga_device_init':
implicit declaration of function 'pci_request_region':
 6204 |         err = pci_request_region(pci_dev, 0, res_name);
      |               ^~~~~~~~~~~~~~~~~~
      |               pci_request_regions

Fixes: 1316e0af2dc0 ("platform: mellanox: mlx-platform: Introduce ACPI init flow")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/20230829133748.58208-2-vadimp@nvidia.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform/x86: ideapad-laptop: Add support for keyboard backlights using KBLC ACPI...
Stuart Hayhurst [Sun, 27 Aug 2023 16:19:41 +0000 (17:19 +0100)]
platform/x86: ideapad-laptop: Add support for keyboard backlights using KBLC ACPI symbol

Newer Lenovo laptops seem to use the KBLC symbol to control the backlight
Add support for handling the keyboard backlight on these devices

Signed-off-by: Stuart Hayhurst <stuart.a.hayhurst@gmail.com>
Link: https://lore.kernel.org/r/20230827161940.485200-1-stuart.a.hayhurst@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform/x86/amd/pmc: Fix build error with randconfig
Shyam Sundar S K [Sat, 26 Aug 2023 16:12:13 +0000 (21:42 +0530)]
platform/x86/amd/pmc: Fix build error with randconfig

on x86_64:

CONFIG_SUSPEND is not set
CONFIG_PM is not set

this leads to build failure of the AMD PMC driver. Add a 'depends on'
in the Kconfig.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Closes: https://lore.kernel.org/lkml/5181685c-29d8-22a4-a2d7-682f26e2e031@infradead.org/
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/20230826161213.3180194-1-Shyam-sundar.S-k@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform/x86/amd/pmf: Fix a missing cleanup path
Mario Limonciello [Wed, 23 Aug 2023 18:54:21 +0000 (13:54 -0500)]
platform/x86/amd/pmf: Fix a missing cleanup path

On systems that support slider notifications but don't otherwise support
granular slider the SPS cleanup path doesn't run.

This means that loading/unloading/loading leads to failures because
the sysfs files don't get setup properly when reloaded.

Add the missing cleanup path.

Fixes: 33c9ab5b493a ("platform/x86/amd/pmf: Notify OS power slider update")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20230823185421.23959-1-mario.limonciello@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agowatchdog: simatic: Use idiomatic selection of P2SB
Andy Shevchenko [Tue, 22 Aug 2023 14:18:59 +0000 (17:18 +0300)]
watchdog: simatic: Use idiomatic selection of P2SB

While it's pretty much theoretical to be otherwise, make sure
that P2SB is selected only for X86. This is idiomatic dependency
which is used by all others who select it. Use it for Simatic
as well.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230822141859.2139630-1-andriy.shevchenko@linux.intel.com
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform/x86: p2sb: Make the Kconfig symbol hidden
Andy Shevchenko [Tue, 22 Aug 2023 14:25:14 +0000 (17:25 +0300)]
platform/x86: p2sb: Make the Kconfig symbol hidden

The P2SB is used purely as a library and all users must select it with

depends on PCI
select P2SB if X86

statement. Without this the combination of different configuration
options may lead to build failures.

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230822142514.2140897-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoDocumentation/ABI: Add new attribute for mlxreg-io sysfs interfaces
Vadim Pasternak [Tue, 22 Aug 2023 11:34:51 +0000 (11:34 +0000)]
Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces

Add documentation for the new attributes:
- CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min".
- JTAG capability: "jtag_cap", indicating the available method of
  CPLD/FPGA devices field update.
- System lid status: "lid_open".
- Reset caused by long press of power button: "reset_long_pwr_pb".
- Reset caused by switch board DC-DC converter device failure:
  "reset_swb_dc_dc_pwr_fail".

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-17-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: nvsw-sn2201: change fans i2c busses.
Michael Shych [Tue, 22 Aug 2023 11:34:50 +0000 (11:34 +0000)]
platform: mellanox: nvsw-sn2201: change fans i2c busses.

Define the exact i2c bus (adapter number) of fans on the SN2201 system.
This will cause fan's EEPROMs be connected already from nvsw-sn2201
platform driver and not from user space after receiving udev events.

Signed-off-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-16-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: mlxreg-hotplug: Extend condition for notification callback processing
Vadim Pasternak [Tue, 22 Aug 2023 11:34:49 +0000 (11:34 +0000)]
platform: mellanox: mlxreg-hotplug: Extend condition for notification callback processing

Allow processing of notification callback in routine
mlxreg_hotplug_device_create() in case hotplug object is configured
with action "MLXREG_HOTPLUG_DEVICE_NO_ACTION" in case no I2C parent bus
is specified.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-15-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: Add initial support for PCIe based programming logic device
Vadim Pasternak [Tue, 22 Aug 2023 11:34:48 +0000 (11:34 +0000)]
platform: mellanox: Add initial support for PCIe based programming logic device

Extend driver to support logic implemented by FPGA device connected
through PCIe bus.

The motivation two support new generation of Nvidia COME module
equipped with Lattice LFD2NX-40 FPGA device.

In order to support new Nvidia COME module FPGA device driver
initialization flow is modified. In case FPGA device is detected,
system resources are to be mapped to this device, otherwise system
resources are to be mapped same as it has been done before for Lattice
LPC based CPLD.

FPGA device is associated with three PCIe devices:
- PCIe-LPC bridge for main register space access.
- PCIe-I2C bridge for I2C controller access.
- PCIe-JTAG bridge for JTAG access.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-14-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: mlx-platform: Get interrupt line through ACPI
Vadim Pasternak [Tue, 22 Aug 2023 11:34:47 +0000 (11:34 +0000)]
platform: mellanox: mlx-platform: Get interrupt line through ACPI

Add support for getting system interrupt line from ACPI table.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-13-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: mlx-platform: Introduce ACPI init flow
Vadim Pasternak [Tue, 22 Aug 2023 11:34:46 +0000 (11:34 +0000)]
platform: mellanox: mlx-platform: Introduce ACPI init flow

Introduce support for ACPI initialization flow - add ACPI match hook.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-12-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: mlx-platform: Prepare driver to allow probing through ACPI infras...
Vadim Pasternak [Tue, 22 Aug 2023 11:34:45 +0000 (11:34 +0000)]
platform: mellanox: mlx-platform: Prepare driver to allow probing through ACPI infrastructure

Currently driver is activated through DMI hooks.
Prepare driver to allow activation also through ACPI trigger.

Modify mlxplat_init()/mlxplat_exit() routines.
Add mlxplat_probe()/mlxplat_remove() routines and "mlxplat_driver"
structure.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-11-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: mlx-platform: Add reset callback
Vadim Pasternak [Tue, 22 Aug 2023 11:34:44 +0000 (11:34 +0000)]
platform: mellanox: mlx-platform: Add reset callback

On L1 switches reset should include special actions against CPLD device
for performing graceful operations.
For that purpose, special PLATFORM_RESET# signal should be indicated.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-10-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: Cosmetic changes
Vadim Pasternak [Tue, 22 Aug 2023 11:34:43 +0000 (11:34 +0000)]
platform: mellanox: Cosmetic changes

Fix routines and labels names by s/topolgy/topology.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-9-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: mlx-platform: Modify power off callback
Vadim Pasternak [Tue, 22 Aug 2023 11:34:42 +0000 (11:34 +0000)]
platform: mellanox: mlx-platform: Modify power off callback

Extend platform power off callback with kernel_halt() call.

When powering off, the process involves setting a halt bit in the
register space, which is then activated after a certain delay and
power off auxiliary power. By invoking `kernel_halt()` within this
timeframe, the intention is to facilitate a clean system power-off
sequence.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-8-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: mlx-platform: add support for additional CPLD
Vadim Pasternak [Tue, 22 Aug 2023 11:34:41 +0000 (11:34 +0000)]
platform: mellanox: mlx-platform: add support for additional CPLD

Extend to support 5-th CPLD version, PN and minimal version registers.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-7-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: mlx-platform: Add reset cause attribute
Vadim Pasternak [Tue, 22 Aug 2023 11:34:40 +0000 (11:34 +0000)]
platform: mellanox: mlx-platform: Add reset cause attribute

Extend IO registers description for some system types with reset cause
attribute "reset_swb_dc_dc_pwr_fail" to indicate reset caused by switch
board DC-DC power failure.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-6-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: mlx-platform: Modify health and power hotplug action
Vadim Pasternak [Tue, 22 Aug 2023 11:34:39 +0000 (11:34 +0000)]
platform: mellanox: mlx-platform: Modify health and power hotplug action

Set explicitly hotplug event action for health and power signals for
L1 switch as "MLXREG_HOTPLUG_DEVICE_NO_ACTION" in order to allow
processing of notification callback even I2C parent bus is not
specified.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-5-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: Modify reset causes description
Vadim Pasternak [Tue, 22 Aug 2023 11:34:38 +0000 (11:34 +0000)]
platform: mellanox: Modify reset causes description

For system of classes VMOD0005, VMOD0010:
- remove "reset_from_comex", since this cause doesn't define specific
  reason.
- add more specific reason "reset_sw_reset", which is set along with
  removed "reset_from_comex".

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-4-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: Add field upgrade capability register
Vadim Pasternak [Tue, 22 Aug 2023 11:34:37 +0000 (11:34 +0000)]
platform: mellanox: Add field upgrade capability register

Add new register to indicate the method of FPGA/CPLD field upgrade
supported on the specific system.
Currently two masks are available:
b00 - field upgrade through LPC gateway (new method introduced to
      accelerate field upgrade process).
b11 - field upgrade through CPU GPIO pins (old method).

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-3-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: Add new attributes
Vadim Pasternak [Tue, 22 Aug 2023 11:34:36 +0000 (11:34 +0000)]
platform: mellanox: Add new attributes

Add new attribute:
"lid_open" - to indicate system intrusion detection.
"reset_long_pwr_pb" - to indicate that system has been reset due to
long press of power button.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agomlxbf-bootctl: Support sysfs entries for MFG fields
David Thompson [Mon, 21 Aug 2023 18:39:39 +0000 (14:39 -0400)]
mlxbf-bootctl: Support sysfs entries for MFG fields

This patch extends the mlxbf-bootctl driver's sysfs entries
to support read and write access for the manufacturing (MFG)
fields in the board-level EEPROM.  The MFG fields are set
once during the board manufacturing phase, and then the MFG
fields are write-protected.

Signed-off-by: David Thompson <davthompson@nvidia.com>
Reviewed-by: Shravan Kumar Ramani <shravankr@nvidia.com>
Link: https://lore.kernel.org/r/20230821183939.3229-1-davthompson@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform/x86/amd/pmc: Move PMC driver to separate directory
Shyam Sundar S K [Fri, 11 Aug 2023 11:21:13 +0000 (16:51 +0530)]
platform/x86/amd/pmc: Move PMC driver to separate directory

With latest commits having PMC code spread across multiple files, it would
be easier to maintain them in a separate directory under amd/pmc.

Co-developed-by: Sanket Goswami <Sanket.Goswami@amd.com>
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20230811112116.2279419-2-Shyam-sundar.S-k@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoMerge remote-tracking branch 'pdx86/fixes' into pdx86/for-next
Hans de Goede [Wed, 23 Aug 2023 15:30:50 +0000 (17:30 +0200)]
Merge remote-tracking branch 'pdx86/fixes' into pdx86/for-next

Merge pdx86/fixes into pdx86/for-next because there are some
pdx86 patches pending for the next release which build on top
of some of the fixes.

14 months agoplatform/mellanox: Fix mlxbf-tmfifo not handling all virtio CONSOLE notifications
Shih-Yi Chen [Mon, 21 Aug 2023 15:06:27 +0000 (11:06 -0400)]
platform/mellanox: Fix mlxbf-tmfifo not handling all virtio CONSOLE notifications

rshim console does not show all entries of dmesg.

Fixed by setting MLXBF_TM_TX_LWM_IRQ for every CONSOLE notification.

Signed-off-by: Shih-Yi Chen <shihyic@nvidia.com>
Reviewed-by: Liming Sung <limings@nvidia.com>
Reviewed-by: David Thompson <davthompson@nvidia.com>
Link: https://lore.kernel.org/r/20230821150627.26075-1-shihyic@nvidia.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform/x86: hp-bioscfg: Update steps order list elements are evaluated
Jorge Lopez [Mon, 21 Aug 2023 14:42:05 +0000 (09:42 -0500)]
platform/x86: hp-bioscfg: Update steps order list elements are evaluated

Update steps how order list elements data and elements size are
evaluated.

Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230821144205.13529-1-jorge.lopez2@hp.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform/x86: asus-wmi: Fix support for showing middle fan RPM
Luke D. Jones [Tue, 15 Aug 2023 01:42:09 +0000 (13:42 +1200)]
platform/x86: asus-wmi: Fix support for showing middle fan RPM

After the addition of the mid fan custom curve functionality various
incorrect behaviour was uncovered. This commit fixes these areas.

- Ensure mid fan attributes actually use the correct fan ID
- Correction to a bit mask for selecting the correct fan data
- Refactor the curve show/store functions to be cleaner and
  match each others layout

Fixes: 536fce82d729 ("platform/x86: asus-wmi: add support for showing middle fan RPM")
Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20230815014209.44903-1-luke@ljones.dev
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform/x86/amd/pmf: Use str_on_off() helper
Andy Shevchenko [Fri, 11 Aug 2023 13:13:30 +0000 (16:13 +0300)]
platform/x86/amd/pmf: Use str_on_off() helper

We have a common helper to represent a boolean value as "on"/"off"
string. Use it for the sake of the unified style.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Link: https://lore.kernel.org/r/20230811131330.71263-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform/x86: thinkpad_acpi: Switch to memdup_user_nul() helper
Ruan Jinjie [Thu, 10 Aug 2023 12:20:12 +0000 (20:20 +0800)]
platform/x86: thinkpad_acpi: Switch to memdup_user_nul() helper

Use memdup_user_nul() helper instead of open-coding to simplify the code.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230810122012.2110410-1-ruanjinjie@huawei.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform/x86: ideapad-laptop: Add support for new hotkeys found on ThinkBook 14s...
André Apitzsch [Sat, 19 Aug 2023 07:12:15 +0000 (09:12 +0200)]
platform/x86: ideapad-laptop: Add support for new hotkeys found on ThinkBook 14s Yoga ITL

The Lenovo Thinkbook 14s Yoga ITL has 4 new symbols/shortcuts on their
F9-F11 and PrtSc keys:

F9:    Has a symbol of a head with a headset, the manual says "Service key"
F10:   Has a symbol of a telephone horn which has been picked up from the
       receiver, the manual says: "Answer incoming calls"
F11:   Has a symbol of a telephone horn which is resting on the receiver,
       the manual says: "Reject incoming calls"
PrtSc: Has a symbol of a siccor and a dashed ellipse, the manual says:
       "Open the Windows 'Snipping' Tool app"

This commit adds support for these 4 new hkey events.

Signed-off-by: André Apitzsch <git@apitzsch.eu>
Link: https://lore.kernel.org/r/20230819-lenovo_keys-v1-1-9d34eac88e0a@apitzsch.eu
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform/x86: lenovo-ymc: Add Lenovo Yoga 7 14ACN6 to ec_trigger_quirk_dmi_table
Swapnil Devesh [Fri, 18 Aug 2023 12:39:47 +0000 (18:09 +0530)]
platform/x86: lenovo-ymc: Add Lenovo Yoga 7 14ACN6 to ec_trigger_quirk_dmi_table

This adds my laptop Lenovo Yoga 7 14ACN6, with Product Name: 82N7
(from `dmidecode -t1 | grep "Product Name"`) to
the ec_trigger_quirk_dmi_table, have tested that this is required
for the YMC driver to work correctly on this model.

Signed-off-by: Swapnil Devesh <me@sidevesh.com>
Reviewed-by: Gergő Köteles <soyer@irl.hu>
Link: https://lore.kernel.org/r/18a08a8b173.895ef3b250414.1213194126082324071@sidevesh.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoMerge remote-tracking branch 'pdx86/platform-drivers-x86-simatic-ipc' into review...
Hans de Goede [Mon, 14 Aug 2023 14:37:19 +0000 (16:37 +0200)]
Merge remote-tracking branch 'pdx86/platform-drivers-x86-simatic-ipc' into review-hans

14 months agowatchdog: simatic: add PCI dependency
Arnd Bergmann [Mon, 14 Aug 2023 07:38:50 +0000 (09:38 +0200)]
watchdog: simatic: add PCI dependency

The simatic-ipc driver no longer depends on PCI, but its watchdog portion
still needs it, otherwise P2SB runs into a build  failure:

WARNING: unmet direct dependencies detected for P2SB
  Depends on [n]: PCI [=n] && X86 [=y]
  Selected by [m]:
  - SIEMENS_SIMATIC_IPC_WDT [=m] && WATCHDOG [=y] && SIEMENS_SIMATIC_IPC [=y]

drivers/platform/x86/p2sb.c:121:3: error: call to undeclared function 'pci_bus_write_config_dword'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                pci_bus_write_config_dword(bus, devfn_p2sb, P2SBC, 0);

Add back the minimum dependendency to make it build in random
configurations again.

Fixes: b72da71ce24b ("platform/x86: simatic-ipc: drop PCI runtime depends and header")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230814073924.1066390-1-arnd@kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoMAINTAINERS: Add entries for Siemens IPC modules
Gerd Haeussler [Mon, 14 Aug 2023 07:31:14 +0000 (09:31 +0200)]
MAINTAINERS: Add entries for Siemens IPC modules

There are different IPC driver modules in the kernel that are actively
maintained by Siemens but not yet listed in the MAINTAINERS file.
Add the missing entries.

Signed-off-by: Gerd Haeussler <gerd.haeussler.ext@siemens.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230814073114.2885-1-haeussler.gerd@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform/x86: lenovo-ymc: Only bind on machines with a convertible DMI chassis-type
Hans de Goede [Sat, 12 Aug 2023 14:48:18 +0000 (16:48 +0200)]
platform/x86: lenovo-ymc: Only bind on machines with a convertible DMI chassis-type

The lenovo-ymc driver is causing the keyboard + touchpad to stop working
on some regular laptop models such as the Lenovo ThinkBook 13s G2 ITL 20V9.

The problem is that there are YMC WMI GUID methods in the ACPI tables
of these laptops, despite them not being Yogas and lenovo-ymc loading
causes libinput to see a SW_TABLET_MODE switch with state 1.

This in turn causes libinput to ignore events from the builtin keyboard
and touchpad, since it filters those out for a Yoga in tablet mode.

Similar issues with false-positive SW_TABLET_MODE=1 reporting have
been seen with the intel-hid driver.

Copy the intel-hid driver approach to fix this and only bind to the WMI
device on machines where the DMI chassis-type indicates the machine
is a convertible.

Add a 'force' module parameter to allow overriding the chassis-type check
so that users can easily test if the YMC interface works on models which
report an unexpected chassis-type.

Fixes: e82882cdd241 ("platform/x86: Add driver for Yoga Tablet Mode switch")
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2229373
Cc: André Apitzsch <git@apitzsch.eu>
Cc: stable@vger.kernel.org
Tested-by: Andrew Kallmeyer <kallmeyeras@gmail.com>
Tested-by: Gergő Köteles <soyer@irl.hu>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230812144818.383230-1-hdegoede@redhat.com
14 months agoplatform: mellanox: Change register offset addresses
Vadim Pasternak [Sun, 13 Aug 2023 08:37:35 +0000 (08:37 +0000)]
platform: mellanox: Change register offset addresses

Move debug register offsets to different location due to hardware changes.

Fixes: dd635e33b5c9 ("platform: mellanox: Introduce support of new Nvidia L1 switch")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20230813083735.39090-5-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: mlx-platform: Modify graceful shutdown callback and power down...
Vadim Pasternak [Sun, 13 Aug 2023 08:37:34 +0000 (08:37 +0000)]
platform: mellanox: mlx-platform: Modify graceful shutdown callback and power down mask

Use kernel_power_off() instead of kernel_halt() to pass through
machine_power_off() -> pm_power_off(), otherwise axillary power does
not go off.

Change "power down" bitmask.

Fixes: dd635e33b5c9 ("platform: mellanox: Introduce support of new Nvidia L1 switch")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20230813083735.39090-4-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: mlx-platform: Fix signals polarity and latch mask
Vadim Pasternak [Sun, 13 Aug 2023 08:37:33 +0000 (08:37 +0000)]
platform: mellanox: mlx-platform: Fix signals polarity and latch mask

Change polarity of chassis health and power signals and fix latch reset
mask for L1 switch.

Fixes: dd635e33b5c9 ("platform: mellanox: Introduce support of new Nvidia L1 switch")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20230813083735.39090-3-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoplatform: mellanox: Fix order in exit flow
Vadim Pasternak [Sun, 13 Aug 2023 08:37:32 +0000 (08:37 +0000)]
platform: mellanox: Fix order in exit flow

Fix exit flow order: call mlxplat_post_exit() after
mlxplat_i2c_main_exit() in order to unregister main i2c driver before
to "mlxplat" driver.

Fixes: 0170f616f496 ("platform: mellanox: Split initialization procedure")
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20230813083735.39090-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agoMerge remote-tracking branch 'intel-speed-select/intel-sst' into review-hans
Hans de Goede [Thu, 10 Aug 2023 09:13:00 +0000 (11:13 +0200)]
Merge remote-tracking branch 'intel-speed-select/intel-sst' into review-hans

14 months agomlxbf-bootctl: Support setting the ARM boot state to "OS up"
Asmaa Mnebhi [Wed, 9 Aug 2023 16:28:57 +0000 (12:28 -0400)]
mlxbf-bootctl: Support setting the ARM boot state to "OS up"

The BlueField has internal registers to store the ARM boot states.
Support setting the BlueField ARM boot state to "OS up".

Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20230809162857.21243-3-asmaa@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
14 months agomlxbf-bootctl: Support the large icmc write/read
Asmaa Mnebhi [Wed, 9 Aug 2023 16:28:56 +0000 (12:28 -0400)]
mlxbf-bootctl: Support the large icmc write/read

Enable reading and writing the size of the memory region associated
with the large ICM carveout.
The max size of the large ICM carveout is 1TB, has a granularity
of 128MB and will be passed and printed in hex. The size unit is MB.

Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20230809162857.21243-2-asmaa@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/siemens: simatic-ipc-batt: fix logical error for BX-59A
xingtong.wu [Wed, 2 Aug 2023 17:35:15 +0000 (01:35 +0800)]
platform/x86/siemens: simatic-ipc-batt: fix logical error for BX-59A

The variable "priv.devmode" is missing from if statement that leads
to a logical error. Add the missing variable to the if condition.

Fixes: c56beff20375 ("platform/x86/siemens: simatic-ipc-batt: add support for module BX-59A")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308010001.BGYCSQrl-lkp@intel.com/
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: xingtong.wu <xingtong.wu@siemens.com>
Link: https://lore.kernel.org/r/20430802173844.2483-1-xingtong_wu@163.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/siemens: simatic-ipc: fix logical error for BX-59A
xingtong.wu [Wed, 2 Aug 2023 17:35:15 +0000 (01:35 +0800)]
platform/x86/siemens: simatic-ipc: fix logical error for BX-59A

The variable "ledmode" is missing from if statement that leads to
a logical error. Add the missing variable to the if condition.

Fixes: b8af77951941 ("platform/x86/siemens: simatic-ipc: add new models BX-56A/BX-59A")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202307312322.Aa8upHWK-lkp@intel.com/
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: xingtong.wu <xingtong.wu@siemens.com>
Link: https://lore.kernel.org/r/20430802173515.2363-2-xingtong_wu@163.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/siemens: simatic-ipc-batt: fix wrong pointer pass to PTR_ERR()
Yang Yingliang [Wed, 9 Aug 2023 08:12:27 +0000 (16:12 +0800)]
platform/x86/siemens: simatic-ipc-batt: fix wrong pointer pass to PTR_ERR()

Fix wrong pointer pass to PTR_ERR() if devm_gpiod_get_index() fails.

Fixes: 917f54340794 ("platform/x86: simatic-ipc: add CMOS battery monitoring")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230809081227.1221267-1-yangyingliang@huawei.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: ISST: Reduce noise for missing numa information in logs
Srinivas Pandruvada [Tue, 8 Aug 2023 17:43:59 +0000 (10:43 -0700)]
platform/x86: ISST: Reduce noise for missing numa information in logs

On platforms with no numa support and with several CPUs, logs have lots
of noise for message "Fail to get numa node for CPU:.."

Change pr_info() to pr_info_once() as one print is enough to show the
issue.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20230808174359.50602-1-srinivas.pandruvada@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: msi-ec: Fix the build
Jean Delvare [Sat, 5 Aug 2023 08:10:10 +0000 (10:10 +0200)]
platform/x86: msi-ec: Fix the build

The msi-ec driver fails to build for me (gcc 7.5):

  CC [M]  drivers/platform/x86/msi-ec.o
drivers/platform/x86/msi-ec.c:72:6: error: initializer element is not constant
    { SM_ECO_NAME,     0xc2 },
      ^~~~~~~~~~~
drivers/platform/x86/msi-ec.c:72:6: note: (near initialization for ‘CONF0.shift_mode.modes[0].name’)
drivers/platform/x86/msi-ec.c:73:6: error: initializer element is not constant
    { SM_COMFORT_NAME, 0xc1 },
      ^~~~~~~~~~~~~~~
drivers/platform/x86/msi-ec.c:73:6: note: (near initialization for ‘CONF0.shift_mode.modes[1].name’)
drivers/platform/x86/msi-ec.c:74:6: error: initializer element is not constant
    { SM_SPORT_NAME,   0xc0 },
      ^~~~~~~~~~~~~
drivers/platform/x86/msi-ec.c:74:6: note: (near initialization for ‘CONF0.shift_mode.modes[2].name’)
(...)

Don't try to be smart, just use defines for the constant strings. The
compiler will recognize it's the same string and will store it only
once in the data section anyway.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Fixes: 392cacf2aa10 ("platform/x86: Add new msi-ec driver")
Cc: stable@vger.kernel.org
Cc: Nikita Kravets <teackot@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Mark Gross <markgross@kernel.org>
Link: https://lore.kernel.org/r/20230805101010.54d49e91@endymion.delvare
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: dell-sysman: Fix reference leak
Armin Wolf [Sat, 5 Aug 2023 05:36:10 +0000 (07:36 +0200)]
platform/x86: dell-sysman: Fix reference leak

If a duplicate attribute is found using kset_find_obj(),
a reference to that attribute is returned. This means
that we need to dispose it accordingly. Use kobject_put()
to dispose the duplicate attribute in such a case.

Compile-tested only.

Fixes: e8a60aa7404b ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20230805053610.7106-1-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agotools/power/x86/intel-speed-select: v1.17 release
Srinivas Pandruvada [Tue, 8 Aug 2023 21:37:02 +0000 (14:37 -0700)]
tools/power/x86/intel-speed-select: v1.17 release

This version addresses issues with:
- CPU count display for power domain != 0
- Support more than 8 sockets
- Error on max CPU count exceeds in one request
- Prevent trying CPU 0 hotplug for kernel version 6.5 or later
- Change mem-frequency display to max-mem-frequency

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
15 months agotools/power/x86/intel-speed-select: Change mem-frequency display name
Srinivas Pandruvada [Wed, 9 Aug 2023 15:53:04 +0000 (08:53 -0700)]
tools/power/x86/intel-speed-select: Change mem-frequency display name

The mem-frequency displayed by each profile is not the actual memory
frequency of DIMMs, but the maximum the CPU can support.

Change the mem-frequency field to max-mem-frequency.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
15 months agotools/power/x86/intel-speed-select: Prevent CPU 0 offline
Srinivas Pandruvada [Tue, 8 Aug 2023 21:12:01 +0000 (14:12 -0700)]
tools/power/x86/intel-speed-select: Prevent CPU 0 offline

Kernel 6.5 version deprecated CPU 0 hotplug. This will cause all
requests to fail to offline CPU 0. Check version number of kernel
and ignore CPU 0 hotplug request with debug aid to use cgroup
isolation feature for CPU 0.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
15 months agotools/power/x86/intel-speed-select: Error on CPU count exceed in request
Srinivas Pandruvada [Tue, 8 Aug 2023 20:08:03 +0000 (13:08 -0700)]
tools/power/x86/intel-speed-select: Error on CPU count exceed in request

There is a limit on number of CPUs in one request. This is set to 256.
Currently tool silently ignores request for count over 256. Give an
error message to indicate this.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
15 months agotools/power/x86/intel-speed-select: Support more than 8 sockets.
Frank Ramsay [Thu, 20 Jul 2023 16:08:03 +0000 (11:08 -0500)]
tools/power/x86/intel-speed-select: Support more than 8 sockets.

MAX_PACKAGE_COUNT limits the intel-speed-select to systems with 8 sockets or fewer.
On a system with more than 8 sockets intel-speed-select silently ignores everything
beyond the 8th socket, rendering the tool useless for those systems.

Increase MAX_PACKAGE_COUNT to support systems with up to 32 sockets.

Signed-off-by: Frank Ramsay <frank.ramsay@hpe.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
15 months agotools/power/x86/intel-speed-select: Fix CPU count display
Srinivas Pandruvada [Thu, 15 Jun 2023 23:18:15 +0000 (16:18 -0700)]
tools/power/x86/intel-speed-select: Fix CPU count display

Fix CPU count display for power domain != 0. In the function
punit_id is always 0, so it never incremented cpu count for power
domain id != 0.

Update punit_id after call to update_punit_cpu_info() to what is
actually received from the kernel.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
15 months agoplatform/x86: hp-bioscfg: Use kmemdup() to replace kmalloc + memcpy
Li Zetao [Thu, 3 Aug 2023 03:20:27 +0000 (11:20 +0800)]
platform/x86: hp-bioscfg: Use kmemdup() to replace kmalloc + memcpy

There are some warnings reported by coccinelle:

./drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:317:35-42:
WARNING opportunity for kmemdup
./drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:270:40-47:
WARNING opportunity for kmemdup
./drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:233:36-43:
WARNING opportunity for kmemdup

Use kmemdup rather than duplicating its implementation.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230803032027.3044851-1-lizetao1@huawei.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: hp-bioscfg: Remove duplicate use of variable in inner loop
Jorge Lopez [Mon, 31 Jul 2023 20:31:41 +0000 (15:31 -0500)]
platform/x86: hp-bioscfg: Remove duplicate use of variable in inner loop

Replace use of same variable in inner loop.

Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230731203141.30044-9-jorge.lopez2@hp.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: hp-bioscfg: Change how password encoding size is evaluated
Jorge Lopez [Mon, 31 Jul 2023 20:31:40 +0000 (15:31 -0500)]
platform/x86: hp-bioscfg: Change how password encoding size is evaluated

Update steps how password encoding size is evaluated

Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230731203141.30044-8-jorge.lopez2@hp.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: hp-bioscfg: Change how enum possible values size is evaluated
Jorge Lopez [Mon, 31 Jul 2023 20:31:39 +0000 (15:31 -0500)]
platform/x86: hp-bioscfg: Change how enum possible values size is evaluated

Updates steps how enum possible values size is evaluated

Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230731203141.30044-7-jorge.lopez2@hp.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: hp-bioscfg: Change how order list size is evaluated
Jorge Lopez [Mon, 31 Jul 2023 20:31:38 +0000 (15:31 -0500)]
platform/x86: hp-bioscfg: Change how order list size is evaluated

Update steps how order list size is evaluated

Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230731203141.30044-6-jorge.lopez2@hp.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: hp-bioscfg: Change how prerequisites size is evaluated
Jorge Lopez [Mon, 31 Jul 2023 20:31:37 +0000 (15:31 -0500)]
platform/x86: hp-bioscfg: Change how prerequisites size is evaluated

Update steps taken to evaluate prerequisites size value

Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230731203141.30044-5-jorge.lopez2@hp.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: hp-bioscfg: Replace the word HACK from source code
Jorge Lopez [Mon, 31 Jul 2023 20:31:36 +0000 (15:31 -0500)]
platform/x86: hp-bioscfg: Replace the word HACK from source code

Replace the word 'HACK' with 'step' from source code

Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230731203141.30044-4-jorge.lopez2@hp.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: hp-bioscfg: Fix uninitialized variable errors
Jorge Lopez [Mon, 31 Jul 2023 20:31:35 +0000 (15:31 -0500)]
platform/x86: hp-bioscfg: Fix uninitialized variable errors

Fix uninitialized variable errors.

Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230731203141.30044-3-jorge.lopez2@hp.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: hp-bioscfg: Fix memory leaks in attribute packages
Jorge Lopez [Mon, 31 Jul 2023 20:31:34 +0000 (15:31 -0500)]
platform/x86: hp-bioscfg: Fix memory leaks in attribute packages

Address memory leaks while handling elements in packages.

Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230731203141.30044-2-jorge.lopez2@hp.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: wmi-bmof: Update MAINTAINERS entry
Armin Wolf [Sun, 30 Jul 2023 20:45:50 +0000 (22:45 +0200)]
platform/x86: wmi-bmof: Update MAINTAINERS entry

The WMI Binary MOF driver is important for the development
of modern WMI drivers, i am willing to maintain it.
Also fix the mailing list address.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20230730204550.3402-3-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: wmi-bmof: Simplify read_bmof()
Armin Wolf [Sun, 30 Jul 2023 20:45:49 +0000 (22:45 +0200)]
platform/x86: wmi-bmof: Simplify read_bmof()

Replace offset handling code with a single call
to memory_read_from_buffer() to simplify read_bmof().

Tested on a ASUS PRIME B650-PLUS.

Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Tested-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20230730204550.3402-2-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: wmi-bmof: Use device_create_bin_file()
Armin Wolf [Sun, 30 Jul 2023 20:45:48 +0000 (22:45 +0200)]
platform/x86: wmi-bmof: Use device_create_bin_file()

Use device_create_bin_file() instead of sysfs_create_bin_file()
to avoid having to access the device kobject.

Tested on a ASUS PRIME B650-PLUS.

Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Tested-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20230730204550.3402-1-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoMerge tag 'ib-pdx86-simatic-v6.6-2' into review-hans
Hans de Goede [Mon, 31 Jul 2023 14:05:44 +0000 (16:05 +0200)]
Merge tag 'ib-pdx86-simatic-v6.6-2' into review-hans

Immutable branch between pdx86 simatic branch and LED due for the v6.6 merge window

ib-pdx86-simatic-v6.6-2: v6.5-rc1 + ib-pdx86-simatic-v6.6 +
more recent pdx86 simatic-ipc patches for merging into
the LED subsystem for v6.6.

15 months agoACPI: scan: Create platform device for CS35L56
Simon Trimmer [Fri, 28 Jul 2023 11:13:45 +0000 (12:13 +0100)]
ACPI: scan: Create platform device for CS35L56

The ACPI device CSC3556 is a Cirrus Logic CS35L56 mono amplifier which
is used in multiples, and can be connected either to I2C or SPI.

There will be multiple instances under the same Device() node. Add it
to ignore_serial_bus_ids and handle it in the serial-multi-instantiate
driver.

There can be a 5th I2cSerialBusV2, but this is an alias address and doesn't
represent a real device. Ignore this by having a dummy 5th entry in the
serial-multi-instantiate instance list with the name of a non-existent
driver, on the same pattern as done for bsg2150.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20230728111345.7224-1-rf@opensource.cirrus.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/amd/pmf: Fix unsigned comparison with less than zero
Yang Li [Thu, 27 Jul 2023 01:43:15 +0000 (09:43 +0800)]
platform/x86/amd/pmf: Fix unsigned comparison with less than zero

The return value from the call to amd_pmf_get_pprof_modes() is int.
However, the return value is being assigned to an unsigned char
variable 'mode', so making 'mode' an int.

silence the warning:
./drivers/platform/x86/amd/pmf/sps.c:183:5-9: WARNING: Unsigned expression compared with zero: mode < 0

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5995
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230727014315.51375-1-yang.lee@linux.alibaba.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/siemens: simatic-ipc-batt: add support for module BX-59A
xingtong.wu [Mon, 31 Jul 2023 07:21:48 +0000 (15:21 +0800)]
platform/x86/siemens: simatic-ipc-batt: add support for module BX-59A

This is used for the Siemens Simatic IPC BX-59A, which
can monitor the voltage of the CMOS battery with two bits
that indicate low or empty state

Signed-off-by: xingtong.wu <xingtong.wu@siemens.com>
Link: https://lore.kernel.org/r/20230731072148.4781-1-xingtong_wu@163.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/siemens: simatic-ipc: add new models BX-56A/BX-59A
xingtong.wu [Mon, 31 Jul 2023 07:14:24 +0000 (15:14 +0800)]
platform/x86/siemens: simatic-ipc: add new models BX-56A/BX-59A

This adds support for the Siemens Simatic IPC models BX-56A/BX-59A,
led/watchdog/battery on these models are same, actual drivers for
models will be sent in separate patches.

Signed-off-by: xingtong.wu <xingtong.wu@siemens.com>
Link: https://lore.kernel.org/r/20230731071424.4663-2-xingtong_wu@163.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/siemens: Kconfig: adjust help text
Henning Schild [Tue, 25 Jul 2023 09:31:13 +0000 (11:31 +0200)]
platform/x86/siemens: Kconfig: adjust help text

There was a copy and paste mistake where the module name was not
correct.

Fixes: 917f54340794 ("platform/x86: simatic-ipc: add CMOS battery monitoring")
Signed-off-by: Henning Schild <henning.schild@siemens.com>
Link: https://lore.kernel.org/r/20230725093113.9739-3-henning.schild@siemens.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/siemens: simatic-ipc-batt: fix bat reading in BX_21A
xingtong.wu [Fri, 28 Jul 2023 08:36:51 +0000 (10:36 +0200)]
platform/x86/siemens: simatic-ipc-batt: fix bat reading in BX_21A

There was a case missing in a switch statement which lead to that model
not actually reading the GPIOs. That switch statement got simplified
now. Additionally on that model we need to initialize one pin
differently. As a drive-by finding also add a missing newline.

Fixes: 917f54340794 ("platform/x86: simatic-ipc: add CMOS battery monitoring")
Reported-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: xingtong.wu <xingtong.wu@siemens.com>
Signed-off-by: Henning Schild <henning.schild@siemens.com>
Link: https://lore.kernel.org/r/20230728083651.19747-1-henning.schild@siemens.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: Move all simatic ipc drivers to the subdirectory siemens
Henning Schild [Wed, 19 Jul 2023 15:35:18 +0000 (17:35 +0200)]
platform/x86: Move all simatic ipc drivers to the subdirectory siemens

With more files around move everything to a subdirectory. Users will
only see the several options once they enable the main one.

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Henning Schild <henning.schild@siemens.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230719153518.13073-4-henning.schild@siemens.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoleds: simatic-ipc-leds: default config switch to platform switch
Henning Schild [Wed, 19 Jul 2023 15:35:17 +0000 (17:35 +0200)]
leds: simatic-ipc-leds: default config switch to platform switch

If a user did choose to enable Siemens Simatic platform support they
likely want the LED drivers to be enabled without having to flip more
config switches. So we make the LED drivers config switch default to
the platform driver switches value.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230719153518.13073-3-henning.schild@siemens.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agowatchdog: make Siemens Simatic watchdog driver default on platform
Henning Schild [Wed, 19 Jul 2023 15:35:16 +0000 (17:35 +0200)]
watchdog: make Siemens Simatic watchdog driver default on platform

If a user did choose to enable Siemens Simatic platform support they
likely want that driver to be enabled without having to flip more config
switches. So we make the watchdog driver config switch default to the
platform driver switches value.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230719153518.13073-2-henning.schild@siemens.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: hp-bioscfg: fix error reporting in hp_add_other_attributes()
Dan Carpenter [Tue, 18 Jul 2023 07:06:26 +0000 (10:06 +0300)]
platform/x86: hp-bioscfg: fix error reporting in hp_add_other_attributes()

Return a negative error code instead of returning success.

Fixes: a34fc329b189 ("platform/x86: hp-bioscfg: bioscfg")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/138641cc-52c0-41a5-8176-ad01c7e28c67@moroto.mountain
Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: hp-bioscfg: prevent a small buffer overflow
Dan Carpenter [Tue, 18 Jul 2023 07:05:34 +0000 (10:05 +0300)]
platform/x86: hp-bioscfg: prevent a small buffer overflow

This function escapes certain special characters like \n.  So if the
last character in the string is a '\n' then it gets changed into two
characters '\' and '\n'.  But maybe we only have space for the '\' so
we need to check for that.

The "conv_dst_size" variable is always less than or to equal the "size"
variable.  It's easier to just check "conv_dst_size" instead of checking
both.

Fixes: a34fc329b189 ("platform/x86: hp-bioscfg: bioscfg")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/b4950310-e65f-412f-8d2b-90bb074a6572@moroto.mountain
Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: hp-bioscfg: fix a signedness bug in hp_wmi_perform_query()
Dan Carpenter [Tue, 18 Jul 2023 07:05:05 +0000 (10:05 +0300)]
platform/x86: hp-bioscfg: fix a signedness bug in hp_wmi_perform_query()

The error handling won't work if "mid" is unsigned.  "ret" is used to
store negative error codes and declaring it as a u32 won't cause a bug
but it's ugly.  The "actual_outsize" variable is a number between 0-4096
so it can be declared as int as well.

Fixes: 69ea03e38f24 ("platform/x86: hp-bioscfg: biosattr-interface")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/ad0a6ad9-099b-40a4-ae91-b9dca622ff4e@moroto.mountain
Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: system76: Handle new KBLED ACPI methods
Tim Crawford [Wed, 19 Jul 2023 18:13:24 +0000 (12:13 -0600)]
platform/x86: system76: Handle new KBLED ACPI methods

System76 EC since system76/ec@9ac513128ad9 detects if the keyboard is
white or RGB backlit via `RGBKB-DET#` at run-time instead of being set
at compile-time. As part of this, the brightness of white-only backlit
keyboards was also changed to behave more like the RGB-backlit
keyboards: a value between 0 and 255 instead of a firmware-defined
level.

The EC ACPI methods in coreboot have been updated for this new
functionality only, removing the old behavior.

This should preserve behavior as we roll out new firmware with these
changes included and users update to it.

Link: https://github.com/system76/ec/pull/357
Link: https://review.coreboot.org/c/coreboot/+/76152
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Link: https://lore.kernel.org/r/20230719181324.47035-1-tcrawford@system76.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform: Explicitly include correct DT includes
Rob Herring [Fri, 14 Jul 2023 17:49:09 +0000 (11:49 -0600)]
platform: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20230714174909.4062739-1-robh@kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: huawei-wmi: Silence ambient light sensor
Konstantin Shelekhin [Sat, 22 Jul 2023 15:59:20 +0000 (18:59 +0300)]
platform/x86: huawei-wmi: Silence ambient light sensor

Currently huawei-wmi causes a lot of spam in dmesg on my
Huawei MateBook X Pro 2022:

  ...
  [36409.328463] input input9: Unknown key pressed, code: 0x02c1
  [36411.335104] input input9: Unknown key pressed, code: 0x02c1
  [36412.338674] input input9: Unknown key pressed, code: 0x02c1
  [36414.848564] input input9: Unknown key pressed, code: 0x02c1
  [36416.858706] input input9: Unknown key pressed, code: 0x02c1
  ...

Fix that by ignoring events generated by ambient light sensor.

This issue was reported on GitHub and resolved with the following merge
request:

  https://github.com/aymanbagabas/Huawei-WMI/pull/70

I've contacted the mainter of this repo and he gave me the "go ahead" to
send this patch to the maling list.

Signed-off-by: Konstantin Shelekhin <k.shelekhin@ftml.net>
Link: https://lore.kernel.org/r/20230722155922.173856-1-k.shelekhin@ftml.net
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100
Maxim Mikityanskiy [Fri, 21 Jul 2023 14:54:23 +0000 (17:54 +0300)]
platform/x86: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100

Only the HW rfkill state is toggled on laptops with quirks->ec_read_only
(so far only MSI Wind U90/U100). There are, however, a few issues with
the implementation:

1. The initial HW state is always unblocked, regardless of the actual
   state on boot, because msi_init_rfkill only sets the SW state,
   regardless of ec_read_only.

2. The initial SW state corresponds to the actual state on boot, but it
   can't be changed afterwards, because set_device_state returns
   -EOPNOTSUPP. It confuses the userspace, making Wi-Fi and/or Bluetooth
   unusable if it was blocked on boot, and breaking the airplane mode if
   the rfkill was unblocked on boot.

Address the above issues by properly initializing the HW state on
ec_read_only laptops and by allowing the userspace to toggle the SW
state. Don't set the SW state ourselves and let the userspace fully
control it. Toggling the SW state is a no-op, however, it allows the
userspace to properly toggle the airplane mode. The actual SW radio
disablement is handled by the corresponding rtl818x_pci and btusb
drivers that have their own rfkills.

Tested on MSI Wind U100 Plus, BIOS ver 1.0G, EC ver 130.

Fixes: 0816392b97d4 ("msi-laptop: merge quirk tables to one")
Fixes: 0de6575ad0a8 ("msi-laptop: Add MSI Wind U90/U100 support")
Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Link: https://lore.kernel.org/r/20230721145423.161057-1-maxtram95@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: asus-wmi: Fix setting RGB mode on some TUF laptops
Kristian Angelov [Thu, 20 Jul 2023 15:29:50 +0000 (18:29 +0300)]
platform/x86: asus-wmi: Fix setting RGB mode on some TUF laptops

This patch fixes setting the cmd values to 0xb3 and 0xb4.
This is necessary on some TUF laptops in order to set the RGB mode.

Closes: https://lore.kernel.org/platform-driver-x86/443078148.491022.1677576298133@nm83.abv.bg
Signed-off-by: Kristian Angelov <kristiana2000@abv.bg>
Reviewed-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/ZLlS7o6UdTUBkyqa@wyvern.localdomain
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: think-lmi: Use kfree_sensitive instead of kfree
Wang Ming [Mon, 17 Jul 2023 10:11:02 +0000 (18:11 +0800)]
platform/x86: think-lmi: Use kfree_sensitive instead of kfree

key might contain private part of the key, so better use
kfree_sensitive to free it.

Signed-off-by: Wang Ming <machel@vivo.com>
Link: https://lore.kernel.org/r/20230717101114.18966-1-machel@vivo.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/intel/hid: Add HP Dragonfly G2 to VGBS DMI quirks
Maxim Mikityanskiy [Sun, 16 Jul 2023 18:32:13 +0000 (21:32 +0300)]
platform/x86/intel/hid: Add HP Dragonfly G2 to VGBS DMI quirks

HP Elite Dragonfly G2 (a convertible laptop/tablet) has a reliable VGBS
method. If VGBS is not called on boot, the firmware sends an initial
0xcd event shortly after calling the BTNL method, but only if the device
is booted in the laptop mode. However, if the device is booted in the
tablet mode and VGBS is not called, there is no initial 0xcc event, and
the input device for SW_TABLET_MODE is not registered up until the user
turns the device into the laptop mode.

Call VGBS on boot on this device to get the initial state of
SW_TABLET_MODE in a reliable way.

Tested with BIOS 1.13.1.

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Link: https://lore.kernel.org/r/20230716183213.64173-1-maxtram95@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: intel: hid: Always call BTNL ACPI method
Hans de Goede [Sat, 15 Jul 2023 18:15:16 +0000 (20:15 +0200)]
platform/x86: intel: hid: Always call BTNL ACPI method

On a HP Elite Dragonfly G2 the 0xcc and 0xcd events for SW_TABLET_MODE
are only send after the BTNL ACPI method has been called.

Likely more devices need this, so make the BTNL ACPI method unconditional
instead of only doing it on devices with a 5 button array.

Note this also makes the intel_button_array_enable() call in probe()
unconditional, that function does its own priv->array check. This makes
the intel_button_array_enable() call in probe() consistent with the calls
done on suspend/resume which also rely on the priv->array check inside
the function.

Reported-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Closes: https://lore.kernel.org/platform-driver-x86/20230712175023.31651-1-maxtram95@gmail.com/
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230715181516.5173-1-hdegoede@redhat.com
15 months agoplatform/x86/amd/pmf: Notify OS power slider update
Shyam Sundar S K [Fri, 14 Jul 2023 14:44:35 +0000 (20:14 +0530)]
platform/x86/amd/pmf: Notify OS power slider update

APMF fn8 can notify EC about the OS slider position change. Add this
capability to the PMF driver so that it can call the APMF fn8 based on
the changes in the Platform profile events.

Co-developed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20230714144435.1239776-2-Shyam-sundar.S-k@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/amd/pmf: reduce verbosity of apmf_get_system_params
Shyam Sundar S K [Fri, 14 Jul 2023 14:44:34 +0000 (20:14 +0530)]
platform/x86/amd/pmf: reduce verbosity of apmf_get_system_params

apmf_get_system_params() failure is not a critical event, reduce its
verbosity from dev_err to dev_dbg.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20230714144435.1239776-1-Shyam-sundar.S-k@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: serial-multi-instantiate: Auto detect IRQ resource for CSC3551
David Xu [Thu, 13 Jul 2023 13:35:28 +0000 (21:35 +0800)]
platform/x86: serial-multi-instantiate: Auto detect IRQ resource for CSC3551

The current code assumes that the CSC3551(multiple cs35l41) always have
its interrupt pin connected to GPIO thus the IRQ can be acquired with
acpi_dev_gpio_irq_get. However on some newer laptop models this is no
longer the case as they have the CSC3551's interrupt pin connected to
APIC. This causes smi_i2c_probe to fail on these machines.

To support these machines, a new macro IRQ_RESOURCE_AUTO was introduced
for cs35l41 smi_node, and smi_get_irq function was modified so it tries
to get GPIO irq resource first and if failed, tries to get
APIC irq resource for cs35l41.

This patch affects only the cs35l41's probing and brings no negative
influence on machines that indeed have the cs35l41's interrupt pin
connected to GPIO.

Signed-off-by: David Xu <xuwd1@hotmail.com>
Link: https://lore.kernel.org/r/SY4P282MB18350CD8288687B87FFD2243E037A@SY4P282MB1835.AUSP282.PROD.OUTLOOK.COM
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/amd: pmc: Use release_mem_region() to undo request_mem_region_muxed()
Hans de Goede [Tue, 11 Jul 2023 09:59:20 +0000 (11:59 +0200)]
platform/x86/amd: pmc: Use release_mem_region() to undo request_mem_region_muxed()

Muxed (mem) regions will wait in request_mem_region_muxed() if the region
is busy (in use by another consumer) during the call.

In order to wake-up possibly waiting other consumers of the region,
it must be released by a release_mem_region() call, which will actually
wake up any waiters.

release_mem_region() also frees the resource created by
request_mem_region_muxed(), avoiding the need for the unmatched kfree().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20230711095920.264308-1-hdegoede@redhat.com
15 months agoplatform/x86: touchscreen_dmi.c: small changes for Archos 101 Cesium Educ tablet
Thomas GENTY [Fri, 14 Jul 2023 10:51:17 +0000 (12:51 +0200)]
platform/x86: touchscreen_dmi.c: small changes for Archos 101 Cesium Educ tablet

Fix the axes and add home button support as suggested by Hans de Goede.

Signed-off-by: Thomas GENTY <tomlohave@gmail.com>
Link: https://lore.kernel.org/r/20230714105117.192938-1-tomlohave@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: Add SEL-3350 platform driver
Robert Joslyn [Thu, 13 Jul 2023 03:48:52 +0000 (20:48 -0700)]
platform/x86: Add SEL-3350 platform driver

Add a driver for Schweitzer Engineering Laboratories SEL-3350 computers
front LEDs and power supplies. LED and power supply status is provided
by the Intel SoC GPIO.

Signed-off-by: Robert Joslyn <robert.joslyn@redrectangle.org>
Link: https://lore.kernel.org/r/20230713035714.807819-1-robert.joslyn@redrectangle.org
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agodoc: TPMI: Add debugfs documentation
Srinivas Pandruvada [Wed, 12 Jul 2023 22:59:50 +0000 (15:59 -0700)]
doc: TPMI: Add debugfs documentation

Describe fields in the TPMI debugfs folder.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230712225950.171326-4-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/intel/tpmi: Add debugfs interface
Srinivas Pandruvada [Wed, 12 Jul 2023 22:59:49 +0000 (15:59 -0700)]
platform/x86/intel/tpmi: Add debugfs interface

Add debugfs interface for debugging TPMI configuration and register
contents. This shows PFS (PM Feature structure) for each TPMI device.

For each feature, show full register contents and allow to modify
register at an offset.

This debugfs interface is not present on locked down kernel with no
DEVMEM access and without CAP_SYS_RAWIO permission.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230712225950.171326-3-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86/intel/tpmi: Read feature control status
Srinivas Pandruvada [Wed, 12 Jul 2023 22:59:48 +0000 (15:59 -0700)]
platform/x86/intel/tpmi: Read feature control status

Some of the PM features can be locked or disabled. In that case, write
interface can be locked.

This status is read via a mailbox. There is one TPMI ID which provides
base address for interface and data register for mail box operation.
The mailbox operations is defined in the TPMI specification. Refer to
https://github.com/intel/tpmi_power_management/ for TPMI specifications.

An API is exposed to feature drivers to read feature control status.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230712225950.171326-2-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoMerge tag 'ib-pdx86-simatic-v6.6' into review-hans
Hans de Goede [Fri, 14 Jul 2023 13:21:53 +0000 (15:21 +0200)]
Merge tag 'ib-pdx86-simatic-v6.6' into review-hans

Immutable branch between pdx86 simatic branch and LED due for the v6.6 merge window

v6.5-rc1 + recent pdx86 simatic-ipc patches for
merging into the LED subsystem for v6.6.

15 months agoplatform/x86: simatic-ipc: use extra module loading for watchdog
Henning Schild [Thu, 13 Jul 2023 14:48:32 +0000 (16:48 +0200)]
platform/x86: simatic-ipc: use extra module loading for watchdog

We recently introduced a way to name additional modules to load for each
device. Use that instead of wdtmode to load the watchdog module. This
patch does not change behaviour, it is just style.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Link: https://lore.kernel.org/r/20230713144832.26473-4-henning.schild@siemens.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
15 months agoplatform/x86: simatic-ipc: add auto-loading of hwmon modules
Henning Schild [Thu, 13 Jul 2023 14:48:31 +0000 (16:48 +0200)]
platform/x86: simatic-ipc: add auto-loading of hwmon modules

In order to know which hwmon modules to load one would have to usually
first probe from user-land i.e. with sensors-detect and create a config
for each machine. But here we know exactly what machines we are dealing
with, so we can request those howmon modules without user-mode detection
and config files.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Link: https://lore.kernel.org/r/20230713144832.26473-3-henning.schild@siemens.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>