[PATCH 2/3] net: stmmac: add Phytium's PHYT0004 to dwmac-generic compatible devices

From: Soha Jin
Date: Sun Oct 09 2022 - 12:24:03 EST


Phytium's GMAC devices (ACPI HID: PHYT0004) can be run by DWMAC's generic
driver, add it to the match table.

Signed-off-by: Soha Jin <soha@xxxxxxxxx>
Tested-by: Yangyu Chen <cyy@xxxxxxxxxxxx>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
index 4d272605a8b7..bde827bc7b72 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
@@ -66,7 +66,7 @@ static int dwmac_generic_probe(struct platform_device *pdev)
return ret;
}

-static const struct of_device_id dwmac_generic_match[] = {
+static const struct of_device_id dwmac_generic_match_of[] = {
{ .compatible = "st,spear600-gmac"},
{ .compatible = "snps,dwmac-3.40a"},
{ .compatible = "snps,dwmac-3.50a"},
@@ -80,7 +80,13 @@ static const struct of_device_id dwmac_generic_match[] = {
{ .compatible = "snps,dwxgmac"},
{ }
};
-MODULE_DEVICE_TABLE(of, dwmac_generic_match);
+MODULE_DEVICE_TABLE(of, dwmac_generic_match_of);
+
+static const struct acpi_device_id dwmac_generic_match_acpi[] = {
+ {"PHYT0004"},
+ {}
+};
+MODULE_DEVICE_TABLE(acpi, dwmac_generic_match_acpi);

static struct platform_driver dwmac_generic_driver = {
.probe = dwmac_generic_probe,
@@ -88,7 +94,8 @@ static struct platform_driver dwmac_generic_driver = {
.driver = {
.name = STMMAC_RESOURCE_NAME,
.pm = &stmmac_pltfr_pm_ops,
- .of_match_table = of_match_ptr(dwmac_generic_match),
+ .of_match_table = dwmac_generic_match_of,
+ .acpi_match_table = dwmac_generic_match_acpi
},
};
module_platform_driver(dwmac_generic_driver);
--
2.30.2