forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
kernel/drivers/net/phy/meson-gxl.c
....@@ -1,20 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0+
12 /*
23 * Amlogic Meson GXL Internal PHY Driver
34 *
45 * Copyright (C) 2015 Amlogic, Inc. All rights reserved.
56 * Copyright (C) 2016 BayLibre, SAS. All rights reserved.
67 * Author: Neil Armstrong <narmstrong@baylibre.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful, but WITHOUT
14
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16
- * more details.
17
- *
188 */
199 #include <linux/kernel.h>
2010 #include <linux/module.h>
....@@ -146,7 +136,7 @@
146136 if (ret)
147137 return ret;
148138
149
- return genphy_config_init(phydev);
139
+ return 0;
150140 }
151141
152142 /* This function is provided to cope with the possible failures of this phy
....@@ -234,14 +224,23 @@
234224
235225 static struct phy_driver meson_gxl_phy[] = {
236226 {
237
- .phy_id = 0x01814400,
238
- .phy_id_mask = 0xfffffff0,
227
+ PHY_ID_MATCH_EXACT(0x01814400),
239228 .name = "Meson GXL Internal PHY",
240
- .features = PHY_BASIC_FEATURES,
241
- .flags = PHY_IS_INTERNAL | PHY_HAS_INTERRUPT,
229
+ /* PHY_BASIC_FEATURES */
230
+ .flags = PHY_IS_INTERNAL,
231
+ .soft_reset = genphy_soft_reset,
242232 .config_init = meson_gxl_config_init,
243
- .aneg_done = genphy_aneg_done,
244233 .read_status = meson_gxl_read_status,
234
+ .ack_interrupt = meson_gxl_ack_interrupt,
235
+ .config_intr = meson_gxl_config_intr,
236
+ .suspend = genphy_suspend,
237
+ .resume = genphy_resume,
238
+ }, {
239
+ PHY_ID_MATCH_EXACT(0x01803301),
240
+ .name = "Meson G12A Internal PHY",
241
+ /* PHY_BASIC_FEATURES */
242
+ .flags = PHY_IS_INTERNAL,
243
+ .soft_reset = genphy_soft_reset,
245244 .ack_interrupt = meson_gxl_ack_interrupt,
246245 .config_intr = meson_gxl_config_intr,
247246 .suspend = genphy_suspend,
....@@ -250,7 +249,8 @@
250249 };
251250
252251 static struct mdio_device_id __maybe_unused meson_gxl_tbl[] = {
253
- { 0x01814400, 0xfffffff0 },
252
+ { PHY_ID_MATCH_VENDOR(0x01814400) },
253
+ { PHY_ID_MATCH_VENDOR(0x01803301) },
254254 { }
255255 };
256256