Skip to content

Commit f9bce00

Browse files
Bhanu Prakash MaiyaTzung-Bi Shih
authored andcommitted
platform/chrome: cros_ec_uart: Add DT enumeration support
Existing firmware uses the "PRP0001" _HID and an associated compatible string to enumerate the cros_ec_uart. Add DT enumeration support for already shipped firmware. Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@chromium.org> Co-developed-by: Mark Hasemeyer <markhas@chromium.org> Signed-off-by: Mark Hasemeyer <markhas@chromium.org> Reviewed-by: Prashant Malani <pmalani@chromium.org> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20221227123212.v13.3.Ie23c217d69ff25d7354db942613f143bbc8ef891@changeid
1 parent 04a8bdd commit f9bce00

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/platform/chrome/cros_ec_uart.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/init.h>
1212
#include <linux/kernel.h>
1313
#include <linux/module.h>
14+
#include <linux/of.h>
1415
#include <linux/platform_data/cros_ec_proto.h>
1516
#include <linux/serdev.h>
1617
#include <linux/slab.h>
@@ -326,6 +327,12 @@ static int __maybe_unused cros_ec_uart_resume(struct device *dev)
326327
static SIMPLE_DEV_PM_OPS(cros_ec_uart_pm_ops, cros_ec_uart_suspend,
327328
cros_ec_uart_resume);
328329

330+
static const struct of_device_id cros_ec_uart_of_match[] = {
331+
{ .compatible = "google,cros-ec-uart" },
332+
{}
333+
};
334+
MODULE_DEVICE_TABLE(of, cros_ec_uart_of_match);
335+
329336
#ifdef CONFIG_ACPI
330337
static const struct acpi_device_id cros_ec_uart_acpi_id[] = {
331338
{ "GOOG0019", 0 },
@@ -339,6 +346,7 @@ static struct serdev_device_driver cros_ec_uart_driver = {
339346
.driver = {
340347
.name = "cros-ec-uart",
341348
.acpi_match_table = ACPI_PTR(cros_ec_uart_acpi_id),
349+
.of_match_table = cros_ec_uart_of_match,
342350
.pm = &cros_ec_uart_pm_ops,
343351
},
344352
.probe = cros_ec_uart_probe,

0 commit comments

Comments
 (0)