From: Tzung-Bi Shih <tzungbi@kernel.org>
To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, lee@kernel.org
Cc: nfraprado@collabora.com, angelogioacchino.delregno@collabora.com,
matthias.bgg@gmail.com, linux@weissschuh.net,
devicetree@vger.kernel.org, chrome-platform@lists.linux.dev,
linux-mediatek@lists.infradead.org, bleung@chromium.org,
groeck@chromium.org, tzungbi@kernel.org
Subject: [PATCH 1/2] platform/chrome: cros_kbd_led_backlight: Remove OF match
Date: Fri, 6 Dec 2024 03:14:04 +0000 [thread overview]
Message-ID: <20241206031405.1711996-2-tzungbi@kernel.org> (raw)
In-Reply-To: <20241206031405.1711996-1-tzungbi@kernel.org>
After applying 4c03a44e2668 ("arm64: dts: mediatek: mt8195-cherry: Remove
keyboard-backlight node"), there are no users for using the OF match.
Instead, the device is added via drivers/mfd/cros_ec_dev.c by
970c3a6b7aa3 ("mfd: cros_ec: Register keyboard backlight subdevice").
Remove the OF match.
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
.../platform/chrome/cros_kbd_led_backlight.c | 62 ++++---------------
1 file changed, 11 insertions(+), 51 deletions(-)
diff --git a/drivers/platform/chrome/cros_kbd_led_backlight.c b/drivers/platform/chrome/cros_kbd_led_backlight.c
index 374de6dad4fa..fc27bd7fc4b9 100644
--- a/drivers/platform/chrome/cros_kbd_led_backlight.c
+++ b/drivers/platform/chrome/cros_kbd_led_backlight.c
@@ -121,7 +121,17 @@ static const struct keyboard_led_drvdata keyboard_led_drvdata_acpi = {
#endif /* CONFIG_ACPI */
-#if IS_ENABLED(CONFIG_CROS_EC)
+#if IS_ENABLED(CONFIG_MFD_CROS_EC_DEV)
+static int keyboard_led_init_ec_pwm_mfd(struct platform_device *pdev)
+{
+ struct cros_ec_dev *ec_dev = dev_get_drvdata(pdev->dev.parent);
+ struct cros_ec_device *cros_ec = ec_dev->ec_dev;
+ struct keyboard_led *keyboard_led = platform_get_drvdata(pdev);
+
+ keyboard_led->ec = cros_ec;
+
+ return 0;
+}
static int
keyboard_led_set_brightness_ec_pwm(struct led_classdev *cdev,
@@ -169,44 +179,6 @@ keyboard_led_get_brightness_ec_pwm(struct led_classdev *cdev)
return resp->percent;
}
-static int keyboard_led_init_ec_pwm(struct platform_device *pdev)
-{
- struct keyboard_led *keyboard_led = platform_get_drvdata(pdev);
-
- keyboard_led->ec = dev_get_drvdata(pdev->dev.parent);
- if (!keyboard_led->ec) {
- dev_err(&pdev->dev, "no parent EC device\n");
- return -EINVAL;
- }
-
- return 0;
-}
-
-static const __maybe_unused struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = {
- .init = keyboard_led_init_ec_pwm,
- .brightness_set_blocking = keyboard_led_set_brightness_ec_pwm,
- .brightness_get = keyboard_led_get_brightness_ec_pwm,
- .max_brightness = KEYBOARD_BACKLIGHT_MAX,
-};
-
-#else /* IS_ENABLED(CONFIG_CROS_EC) */
-
-static const __maybe_unused struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = {};
-
-#endif /* IS_ENABLED(CONFIG_CROS_EC) */
-
-#if IS_ENABLED(CONFIG_MFD_CROS_EC_DEV)
-static int keyboard_led_init_ec_pwm_mfd(struct platform_device *pdev)
-{
- struct cros_ec_dev *ec_dev = dev_get_drvdata(pdev->dev.parent);
- struct cros_ec_device *cros_ec = ec_dev->ec_dev;
- struct keyboard_led *keyboard_led = platform_get_drvdata(pdev);
-
- keyboard_led->ec = cros_ec;
-
- return 0;
-}
-
static const struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm_mfd = {
.init = keyboard_led_init_ec_pwm_mfd,
.brightness_set_blocking = keyboard_led_set_brightness_ec_pwm,
@@ -270,17 +242,6 @@ static const struct acpi_device_id keyboard_led_acpi_match[] = {
MODULE_DEVICE_TABLE(acpi, keyboard_led_acpi_match);
#endif
-#ifdef CONFIG_OF
-static const struct of_device_id keyboard_led_of_match[] = {
- {
- .compatible = "google,cros-kbd-led-backlight",
- .data = &keyboard_led_drvdata_ec_pwm,
- },
- {}
-};
-MODULE_DEVICE_TABLE(of, keyboard_led_of_match);
-#endif
-
static const struct platform_device_id keyboard_led_id[] = {
{ "cros-keyboard-leds", 0 },
{}
@@ -291,7 +252,6 @@ static struct platform_driver keyboard_led_driver = {
.driver = {
.name = "cros-keyboard-leds",
.acpi_match_table = ACPI_PTR(keyboard_led_acpi_match),
- .of_match_table = of_match_ptr(keyboard_led_of_match),
},
.probe = keyboard_led_probe,
.id_table = keyboard_led_id,
--
2.47.0.338.g60cca15819-goog
next prev parent reply other threads:[~2024-12-06 3:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 3:14 [PATCH 0/2] platform/chrome: Remove cros-kbd-led-backlight Tzung-Bi Shih
2024-12-06 3:14 ` Tzung-Bi Shih [this message]
2024-12-06 3:14 ` [PATCH 2/2] dt-bindings: cros-ec: Remove google,cros-kbd-led-backlight Tzung-Bi Shih
2024-12-10 23:01 ` Rob Herring (Arm)
2024-12-11 11:11 ` Lee Jones
2024-12-13 1:49 ` [PATCH 0/2] platform/chrome: Remove cros-kbd-led-backlight Tzung-Bi Shih
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241206031405.1711996-2-tzungbi@kernel.org \
--to=tzungbi@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=groeck@chromium.org \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux@weissschuh.net \
--cc=matthias.bgg@gmail.com \
--cc=nfraprado@collabora.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox