Skip to contentSkip to conversation

platform/chrome: cros_kbd_led_backlight: Fix dependencies

PATCH In review Tzung-Bi Shih 2 participants 7 messages Apr 14, 2025 – Apr 15, 2025

Subsystems (3)
lore
Share & tools
lore

Tzung-Bi Shih

author maintainer
#0 lore raw

cover platform/chrome: cros_kbd_led_backlight: Fix dependencies

The first patch removes a redundant dependency.

The second patch fixes the build errors discovered in [1].

[1]: https://lore.kernel.org/chrome-platform/[email protected]/T/#u

Tzung-Bi Shih (2):
platform/chrome: cros_kbd_led_backlight: Remove CROS_EC dependency platform/chrome: cros_kbd_led_backlight: Fix build dependencies

 drivers/platform/chrome/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH 1/2 platform/chrome: cros_kbd_led_backlight: Remove CROS_EC dependency

After applying 3a1d61dc3202 ("platform/chrome: cros_kbd_led_backlight:
Remove OF match"), cros_kbd_led_backlight no longer depends on CROS_EC directly.

Remove the redundant dependency.

Fixes 3a1d61dc3202 ("platform/chrome: cros_kbd_led_backlight: Remove OF match")
---
 drivers/platform/chrome/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/chrome/Kconfig +1 -1
index f523ae3d3be0..1614b9d3c5c2 100644
@@ -161,7 +161,7 @@ config CROS_EC_PROTO
 
 config CROS_KBD_LED_BACKLIGHT
 	tristate "Backlight LED support for Chrome OS keyboards"
-	depends on LEDS_CLASS && (ACPI || CROS_EC || MFD_CROS_EC_DEV)
+	depends on LEDS_CLASS && (ACPI || MFD_CROS_EC_DEV)
 	help
 	  This option enables support for the keyboard backlight LEDs on
 	  select Chrome OS systems.
Signature · 1 line
2.43.0
Tested-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] platform/chrome: cros_kbd_led_backlight: Remove CROS_EC dependency

Quoted 8 lines · Tzung-Bi Shih

After applying 3a1d61dc3202 ("platform/chrome: cros_kbd_led_backlight:
Remove OF match"), cros_kbd_led_backlight no longer depends on CROS_EC directly.

Remove the redundant dependency.

Fixes 3a1d61dc3202 ("platform/chrome: cros_kbd_led_backlight: Remove OF match")

Thanks.

Quoted 17 lines
---
 drivers/platform/chrome/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/chrome/Kconfig +1 -1
index f523ae3d3be0..1614b9d3c5c2 100644
@@ -161,7 +161,7 @@ config CROS_EC_PROTO
 
 config CROS_KBD_LED_BACKLIGHT
 	tristate "Backlight LED support for Chrome OS keyboards"
-	depends on LEDS_CLASS && (ACPI || CROS_EC || MFD_CROS_EC_DEV)
+	depends on LEDS_CLASS && (ACPI || MFD_CROS_EC_DEV)
 	help
 	  This option enables support for the keyboard backlight LEDs on
 	  select Chrome OS systems.
Signature · 1 line
~Randy
author maintainer
#3 lore raw

PATCH 2/2 platform/chrome: cros_kbd_led_backlight: Fix build dependencies

In reply to Tzung-Bi Shih

ccf395bde6ae ("platform/chrome: cros_ec_proto: Allow to build as module") allows CROS_EC_PROTO to be a module.

The config is possible to be:
- CONFIG_ACPI=y
- CONFIG_CROS_EC=m
- CONFIG_MFD_CROS_EC_DEV=m
- CONFIG_CROS_EC_PROTO=m
- CONFIG_CROS_KBD_LED_BACKLIGHT=y

As a result:
ld: vmlinux.o: in function `keyboard_led_set_brightness_ec_pwm':
cros_kbd_led_backlight.c:(.text+0x3554e4c): undefined reference to `cros_ec_cmd_xfer_status'
ld: vmlinux.o: in function `keyboard_led_get_brightness_ec_pwm':
cros_kbd_led_backlight.c:(.text+0x3554f41): undefined reference to `cros_ec_cmd_xfer_status'

The built-in code in CROS_KBD_LED_BACKLIGHT can't find symbols defined in the module CROS_EC_PROTO.

Let A=ACPI (bool), M=MFD_CROS_EC_DEV (tristate), and K=CROS_KBD_LED_BACKLIGHT (tristate). The possible values are:

| A | M | choice for K |
------------------------

| y | y | y/m/n        |
| y | m | m/n          |
| y | n | y/m/n        |
| n | y | y/m/n        |
| n | m | m/n          |
| n | n | n            |

Fix the dependencies in the Kconfig.

Fixes ccf395bde6ae ("platform/chrome: cros_ec_proto: Allow to build as module")
---
 drivers/platform/chrome/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/chrome/Kconfig +2 -1
index 1614b9d3c5c2..10941ac37305 100644
@@ -161,7 +161,8 @@ config CROS_EC_PROTO
 
 config CROS_KBD_LED_BACKLIGHT
 	tristate "Backlight LED support for Chrome OS keyboards"
-	depends on LEDS_CLASS && (ACPI || MFD_CROS_EC_DEV)
+	depends on LEDS_CLASS
+	depends on MFD_CROS_EC_DEV || (MFD_CROS_EC_DEV=n && ACPI)
 	help
 	  This option enables support for the keyboard backlight LEDs on
 	  select Chrome OS systems.
Signature · 1 line
2.43.0
Tested-by Acked-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] platform/chrome: cros_kbd_led_backlight: Fix build dependencies

Quoted 31 lines · Tzung-Bi Shih

ccf395bde6ae ("platform/chrome: cros_ec_proto: Allow to build as module") allows CROS_EC_PROTO to be a module.

The config is possible to be:
- CONFIG_ACPI=y
- CONFIG_CROS_EC=m
- CONFIG_MFD_CROS_EC_DEV=m
- CONFIG_CROS_EC_PROTO=m
- CONFIG_CROS_KBD_LED_BACKLIGHT=y

As a result:
ld: vmlinux.o: in function `keyboard_led_set_brightness_ec_pwm':
cros_kbd_led_backlight.c:(.text+0x3554e4c): undefined reference to `cros_ec_cmd_xfer_status'
ld: vmlinux.o: in function `keyboard_led_get_brightness_ec_pwm':
cros_kbd_led_backlight.c:(.text+0x3554f41): undefined reference to `cros_ec_cmd_xfer_status'

The built-in code in CROS_KBD_LED_BACKLIGHT can't find symbols defined in the module CROS_EC_PROTO.

Let A=ACPI (bool), M=MFD_CROS_EC_DEV (tristate), and K=CROS_KBD_LED_BACKLIGHT (tristate). The possible values are:

| A | M | choice for K |
------------------------

| y | y | y/m/n        |
| y | m | m/n          |
| y | n | y/m/n        |
| n | y | y/m/n        |
| n | m | m/n          |
| n | n | n            |
Quoted 6 lines

Fix the dependencies in the Kconfig.

Fixes ccf395bde6ae ("platform/chrome: cros_ec_proto: Allow to build as module")

Thanks.

Quoted 18 lines
---
 drivers/platform/chrome/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/chrome/Kconfig +2 -1
index 1614b9d3c5c2..10941ac37305 100644
@@ -161,7 +161,8 @@ config CROS_EC_PROTO
 
 config CROS_KBD_LED_BACKLIGHT
 	tristate "Backlight LED support for Chrome OS keyboards"
-	depends on LEDS_CLASS && (ACPI || MFD_CROS_EC_DEV)
+	depends on LEDS_CLASS
+	depends on MFD_CROS_EC_DEV || (MFD_CROS_EC_DEV=n && ACPI)
 	help
 	  This option enables support for the keyboard backlight LEDs on
 	  select Chrome OS systems.
Signature · 1 line
~Randy
author maintainer
#5 lore raw

Re: [PATCH 2/2] platform/chrome: cros_kbd_led_backlight: Fix build dependencies

Quoted 8 lines · Randy Dunlap
Quoted 4 lines · Tzung-Bi Shih
Fixes ccf395bde6ae ("platform/chrome: cros_ec_proto: Allow to build as module")

Just realized I copied wrong email address for the reporter. Will fix that when applying the patch.

Thank you for your reporting and testing.

author maintainer
#6 lore raw
In reply to Tzung-Bi Shih
Quoted 11 lines · Tzung-Bi Shih

The first patch removes a redundant dependency.

The second patch fixes the build errors discovered in [1].

[1]: https://lore.kernel.org/chrome-platform/[email protected]/T/#u

Tzung-Bi Shih (2):
platform/chrome: cros_kbd_led_backlight: Remove CROS_EC dependency platform/chrome: cros_kbd_led_backlight: Fix build dependencies

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next

[1/2] platform/chrome: cros_kbd_led_backlight: Remove CROS_EC dependency

      commit: 9aea0edcc3e92f5c40184b96d004b4af5a8d264f
[2/2] platform/chrome: cros_kbd_led_backlight: Fix build dependencies
      commit: 31d3bd592df5bf2912b8d97b0652ac3f0cd335cf

Thanks!