Skip to contentSkip to conversation

mfd: cros_ec_dev: Add gpio device and DT binding

PATCH Applied Stephen Boyd 5 participants 9 messages Feb 19, 2024 – Mar 25, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover mfd: cros_ec_dev: Add gpio device and DT binding

This is the mfd part of a larger series[1] that describes the USB topology on ARM based chromebooks. These two patches add the gpio device and DT bindings when the GPIO feature is present. The gpio driver will be sent separately.

Stephen Boyd (2):
dt-bindings: cros-ec: Add properties for GPIO controller
mfd: cros_ec_dev: Add gpio device if feature present on EC

 .../devicetree/bindings/mfd/google,cros-ec.yaml          | 7 +++++++
 drivers/mfd/cros_ec_dev.c                                | 9 +++++++++
 2 files changed, 16 insertions(+)
Cc Bartosz Golaszewski <[email protected]>
Cc Benson Leung <[email protected]>
Cc Conor Dooley <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Rob Herring <[email protected]>

[1] https://lore.kernel.org/r/[email protected]

base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d

Signature · 1 line
https://chromeos.dev
#1 lore raw

PATCH 1/2 dt-bindings: cros-ec: Add properties for GPIO controller

The ChromeOS embedded controller (EC) supports setting the state of GPIOs when the system is unlocked, and getting the state of GPIOs in all cases. The GPIOs are on the EC itself, so the EC acts similar to a GPIO expander. Add the #gpio-cells and gpio-controller properties to the cros-ec binding so that other devices described in DT can get the GPIOs on the EC.

Cc Linus Walleij <[email protected]>
Cc Bartosz Golaszewski <[email protected]>
Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Conor Dooley <[email protected]>
Cc Lee Jones <[email protected]>
Cc Benson Leung <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Pin-yen Lin <[email protected]>
---
 Documentation/devicetree/bindings/mfd/google,cros-ec.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +7 -0
index e1ca4f297c6d..aac8819bd00b 100644
@@ -93,6 +93,11 @@ properties:
   '#size-cells':
     const: 0
 
+  '#gpio-cells':
+    const: 2
+
+  gpio-controller: true
+
   typec:
     $ref: /schemas/chrome/google,cros-ec-typec.yaml#
 
@@ -275,6 +280,8 @@ examples:
             interrupts = <99 0>;
             interrupt-parent = <&gpio7>;
             spi-max-frequency = <5000000>;
+            #gpio-cells = <2>;
+            gpio-controller;
 
             proximity {
                 compatible = "google,cros-ec-mkbp-proximity";
Signature · 1 line
https://chromeos.dev
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] dt-bindings: cros-ec: Add properties for GPIO controller

Quoted 19 lines · Stephen Boyd

The ChromeOS embedded controller (EC) supports setting the state of GPIOs when the system is unlocked, and getting the state of GPIOs in all cases. The GPIOs are on the EC itself, so the EC acts similar to a GPIO expander. Add the #gpio-cells and gpio-controller properties to the cros-ec binding so that other devices described in DT can get the GPIOs on the EC.

Cc Linus Walleij <[email protected]>
Cc Bartosz Golaszewski <[email protected]>
Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Conor Dooley <[email protected]>
Cc Lee Jones <[email protected]>
Cc Benson Leung <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Pin-yen Lin <[email protected]>
Quoted 1 line

---

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 1/2] dt-bindings: cros-ec: Add properties for GPIO controller

In reply to Stephen Boyd
Quoted 50 lines · Stephen Boyd

The ChromeOS embedded controller (EC) supports setting the state of GPIOs when the system is unlocked, and getting the state of GPIOs in all cases. The GPIOs are on the EC itself, so the EC acts similar to a GPIO expander. Add the #gpio-cells and gpio-controller properties to the cros-ec binding so that other devices described in DT can get the GPIOs on the EC.

Cc Linus Walleij <[email protected]>
Cc Bartosz Golaszewski <[email protected]>
Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Conor Dooley <[email protected]>
Cc Lee Jones <[email protected]>
Cc Benson Leung <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Pin-yen Lin <[email protected]>
---
 Documentation/devicetree/bindings/mfd/google,cros-ec.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +7 -1
index e1ca4f297c6d..aac8819bd00b 100644
@@ -93,6 +93,11 @@ properties:
   '#size-cells':
     const: 0
 
+  '#gpio-cells':
+    const: 2
+
+  gpio-controller: true
+
   typec:
     $ref: /schemas/chrome/google,cros-ec-typec.yaml#
 
@@ -275,6 +280,8 @@ examples:
             interrupts = <99 0>;
             interrupt-parent = <&gpio7>;
             spi-max-frequency = <5000000>;
+            #gpio-cells = <2>;
+            gpio-controller;
 
             proximity {
                 compatible = "google,cros-ec-mkbp-proximity";
--
Quoted 2 lines

https://chromeos.dev

Applied, thanks!

Bart

maintainer
#4 lore raw

Re: [PATCH 1/2] dt-bindings: cros-ec: Add properties for GPIO controller

Quoted 48 lines · Bartosz Golaszewski
Quoted 47 lines · Stephen Boyd

The ChromeOS embedded controller (EC) supports setting the state of GPIOs when the system is unlocked, and getting the state of GPIOs in all cases. The GPIOs are on the EC itself, so the EC acts similar to a GPIO expander. Add the #gpio-cells and gpio-controller properties to the cros-ec binding so that other devices described in DT can get the GPIOs on the EC.

Cc Linus Walleij <[email protected]>
Cc Bartosz Golaszewski <[email protected]>
Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Conor Dooley <[email protected]>
Cc Lee Jones <[email protected]>
Cc Benson Leung <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Pin-yen Lin <[email protected]>
---
 Documentation/devicetree/bindings/mfd/google,cros-ec.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +7 -0
index e1ca4f297c6d..aac8819bd00b 100644
@@ -93,6 +93,11 @@ properties:
   '#size-cells':
     const: 0
 
+  '#gpio-cells':
+    const: 2
+
+  gpio-controller: true
+
   typec:
     $ref: /schemas/chrome/google,cros-ec-typec.yaml#
 
@@ -275,6 +280,8 @@ examples:
             interrupts = <99 0>;
             interrupt-parent = <&gpio7>;
             spi-max-frequency = <5000000>;
+            #gpio-cells = <2>;
+            gpio-controller;
 
Quoted 7 lines
Quoted 5 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +0 -1
             proximity {
                 compatible = "google,cros-ec-mkbp-proximity";
--

https://chromeos.dev

Applied, thanks!

Why are you applying this MFD patch?

Signature · 1 line
Lee Jones [李琼斯]
#5 lore raw

PATCH 2/2 mfd: cros_ec_dev: Add gpio device if feature present on EC

In reply to Stephen Boyd

The ChromeOS embedded controller (EC) supports setting the state of GPIOs when the system is unlocked, and getting the state of GPIOs in all cases. Check for the feature support by checking for the GPIO feature and then populate a sub-device for the gpio hardware on the EC.

Cc Lee Jones <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Bartosz Golaszewski <[email protected]>
Cc Benson Leung <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Pin-yen Lin <[email protected]>
---
 drivers/mfd/cros_ec_dev.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/mfd/cros_ec_dev.c +9 -0
index 603b1cd52785..9c3f8488b416 100644
@@ -74,6 +74,10 @@ static const struct mfd_cell cros_ec_cec_cells[] = {
 	{ .name = "cros-ec-cec", },
 };
 
+static const struct mfd_cell cros_ec_gpio_cells[] = {
+	{ .name = "cros-ec-gpio", },
+};
+
 static const struct mfd_cell cros_ec_rtc_cells[] = {
 	{ .name = "cros-ec-rtc", },
 };
@@ -97,6 +101,11 @@ static const struct cros_feature_to_cells cros_subdevices[] = {
 		.mfd_cells	= cros_ec_cec_cells,
 		.num_cells	= ARRAY_SIZE(cros_ec_cec_cells),
 	},
+	{
+		.id		= EC_FEATURE_GPIO,
+		.mfd_cells	= cros_ec_gpio_cells,
+		.num_cells	= ARRAY_SIZE(cros_ec_gpio_cells),
+	},
 	{
 		.id		= EC_FEATURE_RTC,
 		.mfd_cells	= cros_ec_rtc_cells,
Signature · 1 line
https://chromeos.dev
maintainer Applied
#6 lore raw
In reply to Stephen Boyd
Quoted 10 lines · Stephen Boyd

This is the mfd part of a larger series[1] that describes the USB topology on ARM based chromebooks. These two patches add the gpio device and DT bindings when the GPIO feature is present. The gpio driver will be sent separately.

Stephen Boyd (2):
dt-bindings: cros-ec: Add properties for GPIO controller
mfd: cros_ec_dev: Add gpio device if feature present on EC

[...]

Applied, thanks!

[1/2] dt-bindings: cros-ec: Add properties for GPIO controller

      commit: 365ea466d6aa5c8618e096141d72c48fb5707ee4
[2/2] mfd: cros_ec_dev: Add gpio device if feature present on EC
      commit: 1fe6dcba7bcf0dbd53be0c7ea009524c4c44447b

--
Lee Jones [李琼斯]

#7 lore raw
In reply to Stephen Boyd
This series was applied to chrome-platform/linux.git (for-kernelci) by Lee Jones <[email protected]>:

Hello:

This series was applied to chrome-platform/linux.git (for-kernelci) by Lee Jones <[email protected]>:

Quoted 10 lines · On Mon, 19 Feb 2024 12:23:22 -0800 you wrote:

This is the mfd part of a larger series[1] that describes the USB topology on ARM based chromebooks. These two patches add the gpio device and DT bindings when the GPIO feature is present. The gpio driver will be sent separately.

Stephen Boyd (2):
dt-bindings: cros-ec: Add properties for GPIO controller
mfd: cros_ec_dev: Add gpio device if feature present on EC

[...]

Here is the summary with links:
- [1/2] dt-bindings: cros-ec: Add properties for GPIO controller

    https://git.kernel.org/chrome-platform/c/7b79740d42e7
  - [2/2] mfd: cros_ec_dev: Add gpio device if feature present on EC
    https://git.kernel.org/chrome-platform/c/8f49b623b934

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#8 lore raw
In reply to Stephen Boyd
This series was applied to chrome-platform/linux.git (for-next) by Lee Jones <[email protected]>:

Hello:

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

Quoted 10 lines · On Mon, 19 Feb 2024 12:23:22 -0800 you wrote:

This is the mfd part of a larger series[1] that describes the USB topology on ARM based chromebooks. These two patches add the gpio device and DT bindings when the GPIO feature is present. The gpio driver will be sent separately.

Stephen Boyd (2):
dt-bindings: cros-ec: Add properties for GPIO controller
mfd: cros_ec_dev: Add gpio device if feature present on EC

[...]

Here is the summary with links:
- [1/2] dt-bindings: cros-ec: Add properties for GPIO controller

    https://git.kernel.org/chrome-platform/c/7b79740d42e7
  - [2/2] mfd: cros_ec_dev: Add gpio device if feature present on EC
    https://git.kernel.org/chrome-platform/c/8f49b623b934

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html