git: 74a8d66c2885 - main - AM335x: Fix compatible name In the DTS import from Linux 5.14 the compatible strings has changed for the driver am335x_ecap.c && am335x_ehrpwm.c

From: Oskar Holmlund <oh_at_FreeBSD.org>
Date: Mon, 28 Nov 2022 07:15:58 UTC
The branch main has been updated by oh:

URL: https://cgit.FreeBSD.org/src/commit/?id=74a8d66c28859e725a2e0396f7a9be2714438013

commit 74a8d66c28859e725a2e0396f7a9be2714438013
Author:     Oskar Holmlund <oh@FreeBSD.org>
AuthorDate: 2022-11-28 07:13:18 +0000
Commit:     Oskar Holmlund <oh@FreeBSD.org>
CommitDate: 2022-11-28 07:13:18 +0000

    AM335x: Fix compatible name
    In the DTS import from Linux 5.14 the compatible strings has changed for
    the driver am335x_ecap.c && am335x_ehrpwm.c
    
    Approved by: manu (mentor)
    Differential revision: https://reviews.freebsd.org/D37502
---
 sys/arm/ti/am335x/am335x_ecap.c   | 9 ++++++++-
 sys/arm/ti/am335x/am335x_ehrpwm.c | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/sys/arm/ti/am335x/am335x_ecap.c b/sys/arm/ti/am335x/am335x_ecap.c
index c074f576da2d..c7f5a670b0a9 100644
--- a/sys/arm/ti/am335x/am335x_ecap.c
+++ b/sys/arm/ti/am335x/am335x_ecap.c
@@ -81,6 +81,13 @@ struct am335x_ecap_softc {
 	int			sc_mem_rid;
 };
 
+static struct ofw_compat_data compat_data[] = {
+	{"ti,am3352-ecap",	true},
+	{"ti,am33xx-ecap",	true},
+	{NULL,			false},
+};
+SIMPLEBUS_PNP_INFO(compat_data);
+
 static device_method_t am335x_ecap_methods[] = {
 	DEVMETHOD(device_probe,		am335x_ecap_probe),
 	DEVMETHOD(device_attach,	am335x_ecap_attach),
@@ -142,7 +149,7 @@ am335x_ecap_probe(device_t dev)
 	if (!ofw_bus_status_okay(dev))
 		return (ENXIO);
 
-	if (!ofw_bus_is_compatible(dev, "ti,am33xx-ecap"))
+	if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data)
 		return (ENXIO);
 
 	device_set_desc(dev, "AM335x eCAP");
diff --git a/sys/arm/ti/am335x/am335x_ehrpwm.c b/sys/arm/ti/am335x/am335x_ehrpwm.c
index 5144607ae5e5..359f54aac5f5 100644
--- a/sys/arm/ti/am335x/am335x_ehrpwm.c
+++ b/sys/arm/ti/am335x/am335x_ehrpwm.c
@@ -193,6 +193,7 @@ struct am335x_ehrpwm_softc {
 };
 
 static struct ofw_compat_data compat_data[] = {
+	{"ti,am3352-ehrpwm",    true},
 	{"ti,am33xx-ehrpwm",    true},
 	{NULL,                  false},
 };