Re: [PATCH] platform/surface: aggregator: fix a bit test

2021-04-20 Thread Maximilian Luz
test robot Signed-off-by: Dan Carpenter Thanks! Reviewed-by: Maximilian Luz --- drivers/platform/surface/aggregator/controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/c

[PATCH] HID: surface-hid: Fix integer endian conversion

2021-04-11 Thread Maximilian Luz
struct. Reported-by: kernel test robot Fixes: b05ff1002a5c ("HID: Add support for Surface Aggregator Module HID transport") Signed-off-by: Maximilian Luz --- drivers/hid/surface-hid/surface_hid_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/s

[PATCH v2 2/2] power: supply: Add AC driver for Surface Aggregator Module

2021-04-05 Thread Maximilian Luz
. This commit introduces a new SSAM client device driver to support AC status/information via the aforementioned interface on said Surface models. Signed-off-by: Maximilian Luz --- Changes in v2: - Use devm_power_supply_register() - Specify .supplied_to - Fix constness of property arrays - Drop

[PATCH v2 1/2] power: supply: Add battery driver for Surface Aggregator Module

2021-04-05 Thread Maximilian Luz
not changed. This commit introduces a new SSAM client device driver to support battery status/information via the aforementioned interface on said Surface models. It is in parts based on the standard ACPI battery driver. Signed-off-by: Maximilian Luz --- Changes in v2: - Use

[PATCH v2 0/2] power: supply: Add battery and AC drivers for Surface devices

2021-04-05 Thread Maximilian Luz
merged into the for-next branch of the platform-drivers-x86 tree and is available as immutable tag at git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git tags/platform-drivers-x86-surface-aggregator-v5.13-1 Maximilian Luz (2): power: supply: Add battery driver

[PATCH] platform/surface: aggregator_registry: Give devices time to set up when connecting

2021-04-05 Thread Maximilian Luz
id of some locking. Signed-off-by: Maximilian Luz --- .../surface/surface_aggregator_registry.c | 98 --- 1 file changed, 40 insertions(+), 58 deletions(-) diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_

Re: [PATCH 1/2] power: supply: Add battery driver for Surface Aggregator Module

2021-04-05 Thread Maximilian Luz
Hi, On 4/5/21 11:32 PM, Sebastian Reichel wrote: [...] +static void spwr_battery_unregister(struct spwr_battery_device *bat) +{ + ssam_notifier_unregister(bat->sdev->ctrl, >notif); + cancel_delayed_work_sync(>update_work); + device_remove_file(>psy->dev, _attr); +

Re: [PATCH 2/2] power: supply: Add AC driver for Surface Aggregator Module

2021-04-05 Thread Maximilian Luz
Hi, On 4/5/21 5:47 PM, Sebastian Reichel wrote: Hi, On Tue, Mar 09, 2021 at 01:05:30AM +0100, Maximilian Luz wrote: On newer Microsoft Surface models (specifically 7th-generation, i.e. Surface Pro 7, Surface Book 3, Surface Laptop 3, and Surface Laptop Go), battery and AC status/information

Re: [PATCH 1/2] power: supply: Add battery driver for Surface Aggregator Module

2021-04-05 Thread Maximilian Luz
Hi, On 4/5/21 5:37 PM, Sebastian Reichel wrote: Hi, On Tue, Mar 09, 2021 at 01:05:29AM +0100, Maximilian Luz wrote: On newer Microsoft Surface models (specifically 7th-generation, i.e. Surface Pro 7, Surface Book 3, Surface Laptop 3, and Surface Laptop Go), battery and AC status/information

Re: [PATCH 0/2] HID: Add support for Surface Aggregator Module HID transport

2021-03-27 Thread Maximilian Luz
On 3/10/21 11:53 PM, Maximilian Luz wrote: This series adds support for the Surface System Aggregator Module (SSAM) HID transport subsystem. The SSAM is an embedded controller, found on 5th- and later generation Microsoft Surface devices. On some of these devices (specifically Surface Laptops 1

Re: [PATCH 0/2] power: supply: Add battery and AC drivers for Surface devices

2021-03-27 Thread Maximilian Luz
On 3/9/21 1:05 AM, Maximilian Luz wrote: This series provides battery and AC drivers for Microsoft Surface devices, where this information is provided via an embedded controller (the Surface System Aggregator Module, SSAM) instead of the usual ACPI interface. Specifically, 7th generation

Re: [PATCH] platform/surface: clean up a variable in surface_dtx_read()

2021-03-26 Thread Maximilian Luz
On 3/26/21 1:28 PM, Dan Carpenter wrote: The ">ddev->lock" and ">lock" are the same thing. Let's use ">lock" consistently. Signed-off-by: Dan Carpenter Good catch, thanks! Reviewed-by: Maximilian Luz --- drivers/platform/surface/surface_dtx.c

Re: [PATCH 0/2] power: supply: Add battery and AC drivers for Surface devices

2021-03-17 Thread Maximilian Luz
On 3/17/21 6:39 PM, Hans de Goede wrote: Hi, On 3/9/21 1:05 AM, Maximilian Luz wrote: This series provides battery and AC drivers for Microsoft Surface devices, where this information is provided via an embedded controller (the Surface System Aggregator Module, SSAM) instead of the usual ACPI

Re: [PATCH] PCI: PM: Do not read power state in pci_enable_device_flags()

2021-03-16 Thread Maximilian Luz
that case, but use pci_update_current_state() covering platform PM too for that. Link: https://lore.kernel.org/lkml/20210314000439.3138941-1-luzmaximil...@gmail.com/ Reported-by: Maximilian Luz Tested-by: Maximilian Luz Signed-off-by: Rafael J. Wysocki --- Max, I've added a T-by from you e

Re: [PATCH v2] PCI: Run platform power transition on initial D0 entry

2021-03-16 Thread Maximilian Luz
On 3/16/21 2:36 PM, Rafael J. Wysocki wrote: On Mon, Mar 15, 2021 at 7:28 PM Maximilian Luz wrote: On 3/15/21 4:34 PM, Rafael J. Wysocki wrote: On Sun, Mar 14, 2021 at 1:06 AM Maximilian Luz wrote: On some devices and platforms, the initial platform (e.g. ACPI) power state is not in sync

Re: [PATCH v2] PCI: Run platform power transition on initial D0 entry

2021-03-15 Thread Maximilian Luz
On 3/15/21 4:34 PM, Rafael J. Wysocki wrote: On Sun, Mar 14, 2021 at 1:06 AM Maximilian Luz wrote: On some devices and platforms, the initial platform (e.g. ACPI) power state is not in sync with the power state of the PCI device. This seems like it is, for all intents and purposes, an issue

[PATCH v2] PCI: Run platform power transition on initial D0 entry

2021-03-13 Thread Maximilian Luz
sition() (should) both have checks on the current state. So in case either state is up to date, the corresponding transition should still evaluate to a no-op. The only notable difference made by the suggested replacement is pci_resume_bus() being called for devices where runtime D3cold is enabl

[PATCH 1/2] HID: Add support for Surface Aggregator Module HID transport

2021-03-10 Thread Maximilian Luz
) are connected via the generic HID subsystem (TC=0x15) of the Surface System Aggregator Module (SSAM). This subsystem provides a generic HID transport layer, support for which is implemented by this driver. Co-developed-by: Blaž Hrastnik Signed-off-by: Blaž Hrastnik Signed-off-by: Maximilian Luz

[PATCH 2/2] HID: surface-hid: Add support for legacy keyboard interface

2021-03-10 Thread Maximilian Luz
-LED output-reports and a single read-only feature-report are supported. Signed-off-by: Maximilian Luz --- Note: This patch depends on the platform/surface: Add Surface Aggregator device registry series. More specifically patch platform/surface: Set up Surface Aggregator device

[PATCH 0/2] HID: Add support for Surface Aggregator Module HID transport

2021-03-10 Thread Maximilian Luz
/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?h=for-next=fc622b3d36e6d91330fb21506b9ad1e3206a4dde Maximilian Luz (2): HID: Add support for Surface Aggregator Module HID transport HID: surface-hid: Add support for legacy keyboard interface MAINTAINERS

[PATCH] platform/surface: aggregator_registry: Add support for Surface Pro 7+

2021-03-09 Thread Maximilian Luz
The Surface Pro 7+ is essentially a refresh of the Surface Pro 7 with updated hardware and a new WSID identifier. Signed-off-by: Maximilian Luz --- drivers/platform/surface/surface_aggregator_registry.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/platform

[PATCH 0/2] power: supply: Add battery and AC drivers for Surface devices

2021-03-08 Thread Maximilian Luz
/commit/?h=for-next=fc622b3d36e6d91330fb21506b9ad1e3206a4dde Maximilian Luz (2): power: supply: Add battery driver for Surface Aggregator Module power: supply: Add AC driver for Surface Aggregator Module MAINTAINERS| 8 + drivers/power/supply/Kconfig

[PATCH 2/2] power: supply: Add AC driver for Surface Aggregator Module

2021-03-08 Thread Maximilian Luz
. This commit introduces a new SSAM client device driver to support AC status/information via the aforementioned interface on said Surface models. Signed-off-by: Maximilian Luz --- Note: This patch depends on the platform/surface: Add Surface Aggregator device registry series. More

[PATCH 1/2] power: supply: Add battery driver for Surface Aggregator Module

2021-03-08 Thread Maximilian Luz
not changed. This commit introduces a new SSAM client device driver to support battery status/information via the aforementioned interface on said Surface models. It is in parts based on the standard ACPI battery driver. Signed-off-by: Maximilian Luz --- Note: This patch depends on the platform

[PATCH 3/3] docs: driver-api: Add Surface DTX driver documentation

2021-03-08 Thread Maximilian Luz
Add documentation for the user-space interface of the Surface DTX (detachment system) driver, used on Microsoft Surface Book series devices. Signed-off-by: Maximilian Luz --- .../surface_aggregator/clients/dtx.rst| 718 ++ .../surface_aggregator/clients/index.rst

[PATCH 1/3] platform/surface: Add DTX driver

2021-03-08 Thread Maximilian Luz
). An implementation of such a user-space daemon, allowing configuration of detachment behavior via scripts (e.g. safely unmounting USB devices connected to the base before continuing) can be found at [1]. [1]: https://github.com/linux-surface/surface-dtx-daemon Signed-off-by: Maximilian Luz

[PATCH 0/3] platform/surface: Add DTX detachment system driver

2021-03-08 Thread Maximilian Luz
in patch 3. Regards, Max Maximilian Luz (3): platform/surface: Add DTX driver platform/surface: dtx: Add support for native SSAM devices docs: driver-api: Add Surface DTX driver documentation .../surface_aggregator/clients/dtx.rst| 718 + .../surface_aggregator/clients

[PATCH 2/3] platform/surface: dtx: Add support for native SSAM devices

2021-03-08 Thread Maximilian Luz
Add support for native SSAM devices to the DTX driver. This allows support for the Surface Book 3, on which the DTX device is not present in ACPI. Signed-off-by: Maximilian Luz --- drivers/platform/surface/Kconfig | 4 ++ drivers/platform/surface/surface_dtx.c | 90

Re: [PATCH] Revert "pinctrl: intel: Split intel_pinctrl_add_padgroups() for better maintenance"

2021-03-08 Thread Maximilian Luz
On 3/8/21 5:46 PM, Andy Shevchenko wrote: On Mon, Mar 8, 2021 at 6:44 PM Maximilian Luz wrote: On 3/8/21 5:31 PM, Andy Shevchenko wrote: On Mon, Mar 08, 2021 at 05:35:59PM +0200, Andy Shevchenko wrote: On Mon, Mar 08, 2021 at 04:25:05PM +0100, Maximilian Luz wrote: Following commit

Re: [PATCH] Revert "pinctrl: intel: Split intel_pinctrl_add_padgroups() for better maintenance"

2021-03-08 Thread Maximilian Luz
On 3/8/21 5:42 PM, Andy Shevchenko wrote: On Mon, Mar 8, 2021 at 6:34 PM Maximilian Luz wrote: On 3/8/21 4:35 PM, Andy Shevchenko wrote: On Mon, Mar 08, 2021 at 04:25:05PM +0100, Maximilian Luz wrote: Following commit 036e126c72eb ("pinctrl: intel: Split intel_pinctrl_add_padg

Re: [PATCH] Revert "pinctrl: intel: Split intel_pinctrl_add_padgroups() for better maintenance"

2021-03-08 Thread Maximilian Luz
On 3/8/21 5:31 PM, Andy Shevchenko wrote: On Mon, Mar 08, 2021 at 05:35:59PM +0200, Andy Shevchenko wrote: On Mon, Mar 08, 2021 at 04:25:05PM +0100, Maximilian Luz wrote: Following commit 036e126c72eb ("pinctrl: intel: Split intel_pinctrl_add_padgroups() for better mainte

Re: [PATCH] Revert "pinctrl: intel: Split intel_pinctrl_add_padgroups() for better maintenance"

2021-03-08 Thread Maximilian Luz
On 3/8/21 4:35 PM, Andy Shevchenko wrote: On Mon, Mar 08, 2021 at 04:25:05PM +0100, Maximilian Luz wrote: Following commit 036e126c72eb ("pinctrl: intel: Split intel_pinctrl_add_padgroups() for better maintenance"), gpiochip_get_desc() is broken on some Kaby Lake R devices (sp

[PATCH] Revert "pinctrl: intel: Split intel_pinctrl_add_padgroups() for better maintenance"

2021-03-08 Thread Maximilian Luz
ed in ACPI and have been accessible previously). Due to this, gpiod_get() fails with -ENOENT. Reverting this commit fixes that issue and the GPIOs in question are accessible again. Signed-off-by: Maximilian Luz --- There is probably a better option than straight up reverting this, so consider

[PATCH] platform/surface: aggregator: Make SSAM_DEFINE_SYNC_REQUEST_x define static functions

2021-03-04 Thread Maximilian Luz
ot Fixes: 510c8114fc74 ("platform/surface: Add platform profile driver") Signed-off-by: Maximilian Luz --- .../driver-api/surface_aggregator/client.rst | 4 +- .../platform/surface/aggregator/controller.c | 10 +-- .../surface/surface_aggregator_registry.c | 2 +- .../surface/surface

[PATCH v3 6/6] platform/surface: aggregator_registry: Add HID subsystem devices

2021-02-12 Thread Maximilian Luz
Add HID subsystem (TC=0x15) devices. These devices need to be registered for 7th-generation Surface models. On previous generations, these devices are either provided as platform devices via ACPI (Surface Laptop 1 and 2) or implemented as standard USB device. Signed-off-by: Maximilian Luz

[PATCH v3 5/6] platform/surface: aggregator_registry: Add DTX device

2021-02-12 Thread Maximilian Luz
Add the detachment system (DTX) SSAM device for the Surface Book 3. This device is accessible under the base (TC=0x11) subsystem. Signed-off-by: Maximilian Luz --- drivers/platform/surface/surface_aggregator_registry.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/platform

[PATCH v3 4/6] platform/surface: aggregator_registry: Add platform profile device

2021-02-12 Thread Maximilian Luz
Add the SSAM platform profile device to the SSAM device registry. This device is accessible under the thermal subsystem (TC=0x03) and needs to be registered for all Surface models. Signed-off-by: Maximilian Luz --- .../surface/surface_aggregator_registry.c | 15 +++ 1 file

[PATCH v3 3/6] platform/surface: aggregator_registry: Add battery subsystem devices

2021-02-12 Thread Maximilian Luz
interface via the Surface ACPI Notify (SAN) driver. Signed-off-by: Maximilian Luz --- .../surface/surface_aggregator_registry.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface

[PATCH v3 2/6] platform/surface: aggregator_registry: Add base device hub

2021-02-12 Thread Maximilian Luz
is detached and should thus be removed and added in sync with the base. To facilitate this, we introduce a virtual base device hub, which automatically removes or adds the devices registered under it. Signed-off-by: Maximilian Luz --- Changes in v3: - Fix use of lockdep_assert_held

[PATCH v3 0/6] platform/surface: Add Surface Aggregator device registry

2021-02-12 Thread Maximilian Luz
to be hard-coded, so I'm open for ideas on how this could be improved. Changes in v2: - Fix Kconfig dependency Changes in v3: - Fix use of lockdep_assert_held() Maximilian Luz (6): platform/surface: Set up Surface Aggregator device registry platform/surface: aggregator_registry: Add base

[PATCH v3 1/6] platform/surface: Set up Surface Aggregator device registry

2021-02-12 Thread Maximilian Luz
extendable, e.g. via firmware node properties. Note that this commit only provides the basis for the platform hub and registry, and does not add any content to it. The registry will be expanded in subsequent commits. Signed-off-by: Maximilian Luz --- Changes in v2: - Fix Kconfig dependency

[PATCH v2 4/4] platform/surface: Add platform profile driver

2021-02-11 Thread Maximilian Luz
fan noise and in turn sacrifices performance of the discrete GPU found on Surface Books. Its full performance can only be unlocked on the 'performance' profile. Signed-off-by: Maximilian Luz --- MAINTAINERS | 6 + drivers/platform/surface/Kconfig

[PATCH v2 3/4] ACPI: platform: Add balanced-performance platform profile

2021-02-11 Thread Maximilian Luz
-- Battery Saver low-power Recommended balanced Better Performancebalanced-performance Best Performance performance Suggested-by: Hans de Goede Signed-off-by: Maximilian Luz --- .../ABI/testing/sysfs-platform_profile | 18 +++--- drivers

[PATCH v2 2/4] ACPI: platform: Fix file references in comment

2021-02-11 Thread Maximilian Luz
The referenced files are named slightly different. Replace '-' with '_' and drop the .rst ending. Signed-off-by: Maximilian Luz --- include/linux/platform_profile.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/linux/platform_profile.h b/include/linux

[PATCH v2 1/4] ACPI: platform: Hide ACPI_PLATFORM_PROFILE option

2021-02-11 Thread Maximilian Luz
The ACPI_PLATFORM_PROFILE option essentially provides a library and not really an independent module. Thus it seems to be more user-friendly to hide this option and simply make drivers depending on it select it. Suggested-by: Hans de Goede Signed-off-by: Maximilian Luz --- drivers/acpi/Kconfig

[PATCH v2 0/4] platform/surface: Add platform profile driver for Surface devices

2021-02-11 Thread Maximilian Luz
or the ACPI platform profile implementation: - Fix some references to documentation in a comment. - Hide CONFIG_ACPI_PLATFORM_PROFILE Maximilian Luz (4): ACPI: platform: Hide ACPI_PLATFORM_PROFILE option ACPI: platform: Fix file references in comment ACPI: platform: Add balanced-performa

[PATCH v2 2/6] platform/surface: aggregator_registry: Add base device hub

2021-02-11 Thread Maximilian Luz
is detached and should thus be removed and added in sync with the base. To facilitate this, we introduce a virtual base device hub, which automatically removes or adds the devices registered under it. Signed-off-by: Maximilian Luz --- .../surface/surface_aggregator_registry.c | 261

[PATCH v2 5/6] platform/surface: aggregator_registry: Add DTX device

2021-02-11 Thread Maximilian Luz
Add the detachment system (DTX) SSAM device for the Surface Book 3. This device is accessible under the base (TC=0x11) subsystem. Signed-off-by: Maximilian Luz --- drivers/platform/surface/surface_aggregator_registry.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/platform

[PATCH v2 6/6] platform/surface: aggregator_registry: Add HID subsystem devices

2021-02-11 Thread Maximilian Luz
Add HID subsystem (TC=0x15) devices. These devices need to be registered for 7th-generation Surface models. On previous generations, these devices are either provided as platform devices via ACPI (Surface Laptop 1 and 2) or implemented as standard USB device. Signed-off-by: Maximilian Luz

[PATCH v2 4/6] platform/surface: aggregator_registry: Add platform profile device

2021-02-11 Thread Maximilian Luz
Add the SSAM platform profile device to the SSAM device registry. This device is accessible under the thermal subsystem (TC=0x03) and needs to be registered for all Surface models. Signed-off-by: Maximilian Luz --- .../surface/surface_aggregator_registry.c | 15 +++ 1 file

[PATCH v2 3/6] platform/surface: aggregator_registry: Add battery subsystem devices

2021-02-11 Thread Maximilian Luz
interface via the Surface ACPI Notify (SAN) driver. Signed-off-by: Maximilian Luz --- .../surface/surface_aggregator_registry.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface

[PATCH v2 1/6] platform/surface: Set up Surface Aggregator device registry

2021-02-11 Thread Maximilian Luz
extendable, e.g. via firmware node properties. Note that this commit only provides the basis for the platform hub and registry, and does not add any content to it. The registry will be expanded in subsequent commits. Signed-off-by: Maximilian Luz --- Changes in v2: - Fix Kconfig dependency

[PATCH v2 0/6] platform/surface: Add Surface Aggregator device registry

2021-02-11 Thread Maximilian Luz
to be hard-coded, so I'm open for ideas on how this could be improved. Changes in v2: - Fix Kconfig dependency Maximilian Luz (6): platform/surface: Set up Surface Aggregator device registry platform/surface: aggregator_registry: Add base device hub platform/surface: aggregator_registry: Add

Re: [PATCH] platform/surface: Add platform profile driver

2021-02-11 Thread Maximilian Luz
On 2/11/21 5:31 PM, Hans de Goede wrote: Hi, On 2/11/21 5:17 PM, Maximilian Luz wrote: On 2/11/21 4:56 PM, Hans de Goede wrote: Hi, On 2/8/21 10:38 PM, Maximilian Luz wrote: On 2/8/21 9:27 PM, Hans de Goede wrote: +static int convert_ssam_to_profile(struct ssam_device *sdev

Re: [PATCH] platform/surface: Add platform profile driver

2021-02-11 Thread Maximilian Luz
On 2/11/21 4:56 PM, Hans de Goede wrote: Hi, On 2/8/21 10:38 PM, Maximilian Luz wrote: On 2/8/21 9:27 PM, Hans de Goede wrote: +static int convert_ssam_to_profile(struct ssam_device *sdev, enum ssam_tmp_profile p) +{ +    switch (p) { +    case SSAM_TMP_PROFILE_NORMAL

[PATCH v2] platform/surface: aggregator: Fix access of unaligned value

2021-02-11 Thread Maximilian Luz
. Reported-by: kernel-test-robot Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem") Signed-off-by: Maximilian Luz --- Changes in v2: - Use payload.len instead of getting the frame length directly. Note that payload.len equals the frame length and is already cor

Re: [PATCH] platform/surface: aggregator: Fix access of unaligned value

2021-02-11 Thread Maximilian Luz
On 2/11/21 11:22 AM, Andy Shevchenko wrote: On Thu, Feb 11, 2021 at 12:04:11AM +0100, Maximilian Luz wrote: The raw message frame length is unaligned and explicitly marked as little endian. It should not be accessed without the appropriatte accessor functions. Fix this. Reviewed-by: Andy

Re: [PATCH] PCI: Run platform power transition on initial D0 entry

2021-02-10 Thread Maximilian Luz
On 2/11/21 12:57 AM, Bjorn Helgaas wrote: [+cc Rafael, linux-pm] On Thu, Feb 04, 2021 at 11:06:40PM +0100, Maximilian Luz wrote: On some devices and platforms, the initial platform power state is not in sync with the power state of the PCI device. pci_enable_device_flags() updates the state

[PATCH] platform/surface: aggregator: Fix access of unaligned value

2021-02-10 Thread Maximilian Luz
The raw message frame length is unaligned and explicitly marked as little endian. It should not be accessed without the appropriatte accessor functions. Fix this. Reported-by: kernel-test-robot Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem") Signed-off-by:

Re: [PATCH 1/6] platform/surface: Set up Surface Aggregator device registry

2021-02-08 Thread Maximilian Luz
On 2/8/21 8:35 PM, Maximilian Luz wrote: The Surface System Aggregator Module (SSAM) subsystem provides various functionalities, which are separated by spreading them across multiple devices and corresponding drivers. Parts of that functionality / some of those devices, however, can (as far

Re: [PATCH] platform/surface: Add platform profile driver

2021-02-08 Thread Maximilian Luz
On 2/8/21 9:27 PM, Hans de Goede wrote: Hi, On 2/8/21 8:49 PM, Maximilian Luz wrote: Add a driver to provide platform profile support on 5th- and later generation Microsoft Surface devices with a Surface System Aggregator Module. On those devices, the platform profile can be used

Re: [PATCH 0/6] platform/surface: Add Surface Aggregator device registry

2021-02-08 Thread Maximilian Luz
On 2/8/21 8:55 PM, Hans de Goede wrote: Hi, On 2/8/21 8:35 PM, Maximilian Luz wrote: The Surface System Aggregator Module (SSAM) subsystem provides various functionalities, which are separated by spreading them across multiple devices and corresponding drivers. Parts of that functionality

[PATCH] platform/surface: Add platform profile driver

2021-02-08 Thread Maximilian Luz
fan noise and in turn sacrifices performance of the discrete GPU found on Surface Books. Its full performance can only be unlocked on the 'performance' profile. Signed-off-by: Maximilian Luz --- Note: This patch builds ontop of the platform/surface: Add Surface Aggregator device registry

[PATCH 6/6] platform/surface: aggregator_registry: Add HID subsystem devices

2021-02-08 Thread Maximilian Luz
Add HID subsystem (TC=0x15) devices. These devices need to be registered for 7th-generation Surface models. On previous generations, these devices are either provided as platform devices via ACPI (Surface Laptop 1 and 2) or implemented as standard USB device. Signed-off-by: Maximilian Luz

[PATCH 5/6] platform/surface: aggregator_registry: Add DTX device

2021-02-08 Thread Maximilian Luz
Add the detachment system (DTX) SSAM device for the Surface Book 3. This device is accessible under the base (TC=0x11) subsystem. Signed-off-by: Maximilian Luz --- drivers/platform/surface/surface_aggregator_registry.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/platform

[PATCH 4/6] platform/surface: aggregator_registry: Add platform profile device

2021-02-08 Thread Maximilian Luz
Add the SSAM platform profile device to the SSAM device registry. This device is accessible under the thermal subsystem (TC=0x03) and needs to be registered for all Surface models. Signed-off-by: Maximilian Luz --- .../surface/surface_aggregator_registry.c | 15 +++ 1 file

[PATCH 1/6] platform/surface: Set up Surface Aggregator device registry

2021-02-08 Thread Maximilian Luz
extendable, e.g. via firmware node properties. Note that this commit only provides the basis for the platform hub and registry, and does not add any content to it. The registry will be expanded in subsequent commits. Signed-off-by: Maximilian Luz --- MAINTAINERS

[PATCH 0/6] platform/surface: Add Surface Aggregator device registry

2021-02-08 Thread Maximilian Luz
to be hard-coded, so I'm open for ideas on how this could be improved. Maximilian Luz (6): platform/surface: Set up Surface Aggregator device registry platform/surface: aggregator_registry: Add base device hub platform/surface: aggregator_registry: Add battery subsystem devices platform

[PATCH 3/6] platform/surface: aggregator_registry: Add battery subsystem devices

2021-02-08 Thread Maximilian Luz
interface via the Surface ACPI Notify (SAN) driver. Signed-off-by: Maximilian Luz --- .../surface/surface_aggregator_registry.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface

[PATCH 2/6] platform/surface: aggregator_registry: Add base device hub

2021-02-08 Thread Maximilian Luz
is detached and should thus be removed and added in sync with the base. To facilitate this, we introduce a virtual base device hub, which automatically removes or adds the devices registered under it. Signed-off-by: Maximilian Luz --- .../surface/surface_aggregator_registry.c | 261

[PATCH] platform/surface: Add Surface Hot-Plug driver

2021-02-04 Thread Maximilian Luz
to the corresponding ACPI DSM calls by this driver. The DSM then takes care of issuing the appropriate bus-/device-check, causing the PCI core to properly pick up the device change. Signed-off-by: Maximilian Luz --- MAINTAINERS| 6 + drivers/platform/surface/Kconfig

[PATCH] PCI: Run platform power transition on initial D0 entry

2021-02-04 Thread Maximilian Luz
e taken. Signed-off-by: Maximilian Luz --- I'm not entirely sure if this is the best way to do this, so I'm open to alternatives. In a previous version of this, I've tried to run the platform/ACPI transition directly after the pci_read_config_word() in pci_enable_device_flags(), however, that ca

Re: drivers/platform/surface/surface3-wmi.c:60:14: warning: variable 'status' set but not used

2021-02-04 Thread Maximilian Luz
On 2/4/21 12:36 PM, Hans de Goede wrote: Hi, On 1/4/21 4:24 PM, Maximilian Luz wrote: On 1/4/21 3:52 PM, Hans de Goede wrote: Hi, On 12/29/20 4:58 AM, kernel test robot wrote: Hi Maximilian, FYI, the error/warning still remains. tree:   https://git.kernel.org/pub/scm/linux/kernel/git

[PATCH] platform/surface: aggregator: Fix braces in if condition with unlikely() macro

2021-01-26 Thread Maximilian Luz
or generated code. Reported-by: Dan Carpenter Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem") Signed-off-by: Maximilian Luz --- .../surface/aggregator/ssh_packet_layer.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git

[PATCH] platform/surface: aggregator: Fix kernel-doc references

2021-01-14 Thread Maximilian Luz
Both, ssh_rtl_rx_start() and ssh_rtl_tx_start() functions, do not exist and have been consolidated into ssh_rtl_start(). Nevertheless, kernel-doc references the former functions. Replace those references with references to ssh_rtl_start(). Signed-off-by: Maximilian Luz --- Note: This patch does

Re: [PATCH v6 16/16] platform/surface: aggregator: fix a kernel-doc markup

2021-01-14 Thread Maximilian Luz
. + * ssh_rtl_start() - Start request transmitter and receiver. * @rtl: The request transport layer. * * Return: Returns zero on success, a negative error code on failure. Thanks! Looks good to me. Reviewed-by: Maximilian Luz There seems to be another issue similar to this, specifically

[PATCH -next 1/2] platform/surface: aggregator_cdev: Fix access of uninitialized variables

2021-01-11 Thread Maximilian Luz
Fixes: 178f6ab77e61 ("platform/surface: Add Surface Aggregator user-space interface") Addresses-Coverity: ("Uninitialized pointer read") Signed-off-by: Maximilian Luz --- drivers/platform/surface/surface_aggregator_cdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 dele

[PATCH -next 2/2] platform/surface: aggregator_cdev: Add comments regarding unchecked allocation size

2021-01-11 Thread Maximilian Luz
("platform/surface: Add Surface Aggregator user-space interface") Addresses-Coverity: ("Untrusted allocation size") Signed-off-by: Maximilian Luz --- .../surface/surface_aggregator_cdev.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/driv

[PATCH -next 0/2] platform/surface: aggregator_cdev: Fixes for CI analysis

2021-01-11 Thread Maximilian Luz
Hi, here are some patches addressing two issues in the Surface Aggregator user-space interface reported by Colin Ian King via static analysis. Maximilian Luz (2): platform/surface: aggregator_cdev: Fix access of uninitialized variables platform/surface: aggregator_cdev: Add comments

Re: [PATCH][next] platform/surface: fix potential integer overflow on shift of a int

2021-01-11 Thread Maximilian Luz
dev_dbg(dev, "notify event %#04llx\n", func); Thanks, looks good to me. Reviewed-by: Maximilian Luz Regards, Max

Re: platform/surface: Add Surface Aggregator user-space interface (static analysis issues)

2021-01-11 Thread Maximilian Luz
On 1/11/21 3:11 PM, Colin Ian King wrote: On 11/01/2021 13:55, Maximilian Luz wrote: On 1/11/21 1:12 PM, Colin Ian King wrote: Hi Maximilian, Static analysis of linux-next with Coverity has found several issues with the following commit: commit 178f6ab77e617c984d6520b92e747075a12676ff Author

Re: platform/surface: Add Surface Aggregator user-space interface (static analysis issues)

2021-01-11 Thread Maximilian Luz
On 1/11/21 1:12 PM, Colin Ian King wrote: Hi Maximilian, Static analysis of linux-next with Coverity has found several issues with the following commit: commit 178f6ab77e617c984d6520b92e747075a12676ff Author: Maximilian Luz Date: Mon Dec 21 19:39:58 2020 +0100 platform/surface: Add

Re: [PATCH v3 0/9] Add support for Microsoft Surface System Aggregator Module

2021-01-06 Thread Maximilian Luz
On 1/7/21 12:40 AM, Hans de Goede wrote: Hi, On 12/21/20 7:39 PM, Maximilian Luz wrote: Hello, Here is version three of the Surface System Aggregator Module (SAM/SSAM) driver series, adding initial support for the embedded controller on 5th and later generation Microsoft Surface devices

Re: drivers/platform/surface/surface3-wmi.c:60:14: warning: variable 'status' set but not used

2021-01-04 Thread Maximilian Luz
On 1/4/21 3:52 PM, Hans de Goede wrote: Hi, On 12/29/20 4:58 AM, kernel test robot wrote: Hi Maximilian, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: dea8dcf2a9fa8cc540136a6cd885c3beece16ec3 commit:

Re: [PATCH] platform/surface: mark PM functions as __maybe_unused

2021-01-03 Thread Maximilian Luz
On 1/3/21 3:04 PM, Arnd Bergmann wrote: From: Arnd Bergmann When CONFIG_PM is disabled, the compiler produces harmless warnings: drivers/platform/surface/surface_gpe.c:184:12: error: unused function 'surface_gpe_suspend' [-Werror,-Wunused-function] static int surface_gpe_suspend(struct

[PATCH v3 7/9] docs: driver-api: Add Surface Aggregator subsystem documentation

2020-12-21 Thread Maximilian Luz
Add documentation for the Surface Aggregator subsystem and its client drivers, giving an overview of the subsystem, its use-cases, its internal structure and internal API, as well as its external API for writing client drivers. Signed-off-by: Maximilian Luz Reviewed-by: Hans de Goede

[PATCH v3 6/9] platform/surface: aggregator: Add dedicated bus and device type

2020-12-21 Thread Maximilian Luz
devices). Signed-off-by: Maximilian Luz Reviewed-by: Hans de Goede --- Changes in v1 (from RFC): - add copyright lines - change SPDX identifier to GPL-2.0+ (was GPL-2.0-or-later) - remove unnecessary READ_ONCE on multiple occasions - improve documentation of special values for SSAM_DEVICE

[PATCH v3 9/9] platform/surface: Add Surface ACPI Notify driver

2020-12-21 Thread Maximilian Luz
corresponding notifications (e.g. battery information change) from it. This interface is therefore required to provide said functionality on those devices. Signed-off-by: Maximilian Luz Reviewed-by: Hans de Goede --- Changes in v1 (from RFC): - add copyright lines - change SPDX identifier to GPL-2.0

[PATCH v3 3/9] platform/surface: aggregator: Add event item allocation caching

2020-12-21 Thread Maximilian Luz
-by: Maximilian Luz Reviewed-by: Hans de Goede --- .../platform/surface/aggregator/controller.c | 86 +-- .../platform/surface/aggregator/controller.h | 9 ++ drivers/platform/surface/aggregator/core.c| 16 +++- 3 files changed, 101 insertions(+), 10 deletions(-) diff --git

[PATCH v3 8/9] platform/surface: Add Surface Aggregator user-space interface

2020-12-21 Thread Maximilian Luz
/scripts/ssam Signed-off-by: Maximilian Luz --- Changes in v1 (from RFC): - add copyright lines - change SPDX identifier to GPL-2.0+ (was GPL-2.0-or-later) - move from debugfs to proper misc-device - move interface definitions to uapi header - remove versioning - allocate platform device

[PATCH v3 5/9] platform/surface: aggregator: Add error injection capabilities

2020-12-21 Thread Maximilian Luz
as - inject invalid data into submitted and received packets. Together with the trace points introduced in the previous commit, these facilities are intended to aid in testing, validation, and debugging of the Surface Aggregator communication layer. Signed-off-by: Maximilian Luz Reviewed-by: Hans de

[PATCH v3 2/9] platform/surface: aggregator: Add control packet allocation caching

2020-12-21 Thread Maximilian Luz
. Signed-off-by: Maximilian Luz Reviewed-by: Hans de Goede --- drivers/platform/surface/aggregator/core.c| 27 ++- .../surface/aggregator/ssh_packet_layer.c | 47 +++ .../surface/aggregator/ssh_packet_layer.h | 3 ++ 3 files changed, 67 insertions(+), 10 deletions

[PATCH v3 0/9] Add support for Microsoft Surface System Aggregator Module

2020-12-21 Thread Maximilian Luz
failed - validate flags on request initialization - improve documentation/add comments - replace 'iff' with 'if' in documentation and comments Changes regarding specific patches (and more details) can be found on the individual patch. Maximilian Luz (9): platform/surface: Add Surface Aggregator

[PATCH v3 4/9] platform/surface: aggregator: Add trace points

2020-12-21 Thread Maximilian Luz
commit. Signed-off-by: Maximilian Luz Reviewed-by: Hans de Goede --- Changes in v1 (from RFC): - add copyright line - change SPDX identifier to GPL-2.0+ (was GPL-2.0-or-later) - pack tracing structs Changes in v2: - add compiletime check on SSAM_PTR_UID_LEN - fix

Re: [PATCH] platform/surface: SURFACE_PLATFORMS should depend on ACPI

2020-12-16 Thread Maximilian Luz
have your ack or reviewed-by for this (assuming you agree with this change) ? Sure, looks good to me. Reviewed-by: Maximilian Luz Regards, Max Regards, Hans --- drivers/platform/surface/Kconfig | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers

Re: [PATCH v2 8/9] platform/surface: Add Surface Aggregator user-space interface

2020-12-15 Thread Maximilian Luz
On 12/15/20 5:35 PM, Hans de Goede wrote: Hi, On 12/3/20 10:26 PM, Maximilian Luz wrote: Add a misc-device providing user-space access to the Surface Aggregator EC, mainly intended for debugging, testing, and reverse-engineering. This interface gives user-space applications the ability to send

Re: [PATCH v2 -next] platform: surface: fix non-PM_SLEEP build warnings

2020-12-15 Thread Maximilian Luz
: Add Driver to set up lid GPEs on MS Surface device") Signed-off-by: Randy Dunlap Cc: Maximilian Luz Cc: Hans de Goede Cc: platform-driver-...@vger.kernel.org --- v2: dropped Maximilian's RVB tag since the patch changed use preferred __maybe_unused instead of ifdeffery:

Re: [PATCH -next] platform: surface: fix non-PM_SLEEP build warnings

2020-12-11 Thread Maximilian Luz
On 12/11/20 9:41 PM, Randy Dunlap wrote: On 12/11/20 12:23 PM, Maximilian Luz wrote: On 12/11/20 8:03 PM, Randy Dunlap wrote: Fix build warnings when CONFIG_PM_SLEEP is not enabled and these functions are not used: ../drivers/platform/surface/surface_gpe.c:189:12: warning: ‘surface_gpe_resume

Re: [PATCH -next] platform: surface: fix non-PM_SLEEP build warnings

2020-12-11 Thread Maximilian Luz
: Add Driver to set up lid GPEs on MS Surface device") Signed-off-by: Randy Dunlap Cc: Maximilian Luz Cc: Hans de Goede Cc: platform-driver-...@vger.kernel.org --- drivers/platform/surface/surface_gpe.c |2 ++ 1 file changed, 2 insertions(+) --- linux-next-20201210.orig/drivers/platfo

Re: [PATCH v2 1/9] platform/surface: Add Surface Aggregator subsystem

2020-12-08 Thread Maximilian Luz
On 12/8/20 3:43 PM, Hans de Goede wrote: Hi, On 12/8/20 3:37 PM, Maximilian Luz wrote: + +    obj = acpi_evaluate_dsm_typed(handle, _SSH_DSM_GUID, +  SSAM_SSH_DSM_REVISION, func, NULL, +  ACPI_TYPE_INTEGER); +    if (!obj) +    return -EIO

  1   2   3   >