| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Amlogic Meson GXL Internal PHY Driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2015 Amlogic, Inc. All rights reserved. |
|---|
| 5 | 6 | * Copyright (C) 2016 BayLibre, SAS. All rights reserved. |
|---|
| 6 | 7 | * 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 | | - * |
|---|
| 18 | 8 | */ |
|---|
| 19 | 9 | #include <linux/kernel.h> |
|---|
| 20 | 10 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 146 | 136 | if (ret) |
|---|
| 147 | 137 | return ret; |
|---|
| 148 | 138 | |
|---|
| 149 | | - return genphy_config_init(phydev); |
|---|
| 139 | + return 0; |
|---|
| 150 | 140 | } |
|---|
| 151 | 141 | |
|---|
| 152 | 142 | /* This function is provided to cope with the possible failures of this phy |
|---|
| .. | .. |
|---|
| 234 | 224 | |
|---|
| 235 | 225 | static struct phy_driver meson_gxl_phy[] = { |
|---|
| 236 | 226 | { |
|---|
| 237 | | - .phy_id = 0x01814400, |
|---|
| 238 | | - .phy_id_mask = 0xfffffff0, |
|---|
| 227 | + PHY_ID_MATCH_EXACT(0x01814400), |
|---|
| 239 | 228 | .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, |
|---|
| 242 | 232 | .config_init = meson_gxl_config_init, |
|---|
| 243 | | - .aneg_done = genphy_aneg_done, |
|---|
| 244 | 233 | .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, |
|---|
| 245 | 244 | .ack_interrupt = meson_gxl_ack_interrupt, |
|---|
| 246 | 245 | .config_intr = meson_gxl_config_intr, |
|---|
| 247 | 246 | .suspend = genphy_suspend, |
|---|
| .. | .. |
|---|
| 250 | 249 | }; |
|---|
| 251 | 250 | |
|---|
| 252 | 251 | 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) }, |
|---|
| 254 | 254 | { } |
|---|
| 255 | 255 | }; |
|---|
| 256 | 256 | |
|---|