2022-04-29 17:56:30

by Fabio Baltieri

[permalink] [raw]
Subject: [PATCH v6 0/4] Add channel type support to pwm-cros-ec

Hi,

The ChromiumOS EC PWM host command protocol supports specifying the
requested PWM by type rather than channel. [1]

This series adds support for specifying PWM by type rather than channel
number in the pwm-cros-ec driver, which abstracts the node definitions
from the actual hardware configuration from the kernel perspective,
aligns the API with the one used by the bootloader, and allows removing
some dtsi overrides.

Tested on a sc7180-trogdor board, build tested on x86.

Changes from v5:
(https://patchwork.kernel.org/project/chrome-platform/list/?series=633811)
- reworded the binding patch commit subject
- added one more review tag

Changes from v4:
(https://patchwork.kernel.org/project/chrome-platform/list/?series=632212)
- fixed wrong indentation in the devietree file on patch 3
- added review and ack tags from the previous run

Changes from v3:
(https://patchwork.kernel.org/project/chrome-platform/list/?series=631131)
- actually reworded patch 2 commit description
- reworked patch 2 to use of_device_is_compatible() instead of compatible .data

Changes from v2:
(https://patchwork.kernel.org/project/chrome-platform/list/?series=627837)
- reworded patch 2 commit description
- reworked the driver and dt documentation to use a new compatible rather than
boolean property
- dropped the comment about build test only, tested on actual hardware
(trogdor), build test on x86 (with CONFIG_OF=n).

Changes from v1:
(https://patchwork.kernel.org/project/chrome-platform/list/?series=625182)
- fixed the dt include file license
- fixed the property name (s/_/-/)
- rebased on current linus tree (few dts files changed from a soc tree
pull, so patch 4 needs a recent base to apply correctly)

[1] https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/common/pwm.c;l=24
[2] https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/depthcharge/src/drivers/ec/cros/ec.c;l=1271-1273

Fabio Baltieri (4):
dt-bindings: add mfd/cros_ec definitions
pwm: pwm-cros-ec: add channel type support
dt-bindings: google,cros-ec-pwm: add the new -type compatible
arm64: dts: address cros-ec-pwm channels by type

.../bindings/pwm/google,cros-ec-pwm.yaml | 9 +-
.../mt8183-kukui-jacuzzi-fennel-sku1.dts | 4 +-
.../dts/mediatek/mt8183-kukui-jacuzzi.dtsi | 4 +-
.../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 +
.../boot/dts/qcom/sc7180-trogdor-coachz.dtsi | 4 -
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 9 +-
.../qcom/sc7280-herobrine-herobrine-r0.dts | 7 +-
.../arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 7 +-
.../arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi | 4 +-
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 7 +-
.../boot/dts/rockchip/rk3399-gru-bob.dts | 4 -
.../dts/rockchip/rk3399-gru-chromebook.dtsi | 5 +-
.../boot/dts/rockchip/rk3399-gru-kevin.dts | 4 -
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 1 +
drivers/pwm/pwm-cros-ec.c | 82 +++++++++++++++----
include/dt-bindings/mfd/cros_ec.h | 18 ++++
16 files changed, 121 insertions(+), 49 deletions(-)
create mode 100644 include/dt-bindings/mfd/cros_ec.h

--
2.36.0.rc2.479.g8af0fa9b8e-goog


2022-04-29 23:01:28

by Fabio Baltieri

[permalink] [raw]
Subject: [PATCH v6 1/4] dt-bindings: add mfd/cros_ec definitions

Add a dt-bindings include file for cros_ec devicetree definition, define
a pair of special purpose PWM channels in it.

Signed-off-by: Fabio Baltieri <[email protected]>
Acked-by: Rob Herring <[email protected]>
---
include/dt-bindings/mfd/cros_ec.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
create mode 100644 include/dt-bindings/mfd/cros_ec.h

diff --git a/include/dt-bindings/mfd/cros_ec.h b/include/dt-bindings/mfd/cros_ec.h
new file mode 100644
index 000000000000..3b29cd049578
--- /dev/null
+++ b/include/dt-bindings/mfd/cros_ec.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * DTS binding definitions used for the Chromium OS Embedded Controller.
+ *
+ * Copyright (c) 2022 The Chromium OS Authors. All rights reserved.
+ */
+
+#ifndef _DT_BINDINGS_MFD_CROS_EC_H
+#define _DT_BINDINGS_MFD_CROS_EC_H
+
+/* Typed channel for keyboard backlight. */
+#define CROS_EC_PWM_DT_KB_LIGHT 0
+/* Typed channel for display backlight. */
+#define CROS_EC_PWM_DT_DISPLAY_LIGHT 1
+/* Number of typed channels. */
+#define CROS_EC_PWM_DT_COUNT 2
+
+#endif
--
2.36.0.rc2.479.g8af0fa9b8e-goog

Subject: Re: [PATCH v6 0/4] Add channel type support to pwm-cros-ec

Hello:

This series was applied to chrome-platform/linux.git (for-next)
by Thierry Reding <[email protected]>:

On Thu, 28 Apr 2022 10:04:17 +0000 you wrote:
> Hi,
>
> The ChromiumOS EC PWM host command protocol supports specifying the
> requested PWM by type rather than channel. [1]
>
> This series adds support for specifying PWM by type rather than channel
> number in the pwm-cros-ec driver, which abstracts the node definitions
> from the actual hardware configuration from the kernel perspective,
> aligns the API with the one used by the bootloader, and allows removing
> some dtsi overrides.
>
> [...]

Here is the summary with links:
- [v6,1/4] dt-bindings: add mfd/cros_ec definitions
https://git.kernel.org/chrome-platform/c/84d0940454a3
- [v6,2/4] pwm: pwm-cros-ec: add channel type support
https://git.kernel.org/chrome-platform/c/3d593b6e80ad
- [v6,3/4] dt-bindings: google,cros-ec-pwm: add the new -type compatible
https://git.kernel.org/chrome-platform/c/a48d66d87274
- [v6,4/4] arm64: dts: address cros-ec-pwm channels by type
(no matching commit)

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html