aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2014-06-18 05:01:42 -0400
committerDavid S. Miller <davem@davemloft.net>2014-06-21 18:50:00 -0400
commitbd8ca17f8c74fa36d1dfb1b82de416e310d1b64d (patch)
tree56700f3fda570434888b4b5141d3f8a0a530961d /drivers/net/phy
parent2b8f2a28eac1d35a432705d269f02bdaeba9be8f (diff)
net: phy: at803x: use #defines for supported PHY ids
This removes magic values from two tables and also allows us to match against specific PHY models at runtime. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/at803x.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index 6c622aedbae1..bc04fba05b86 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -35,6 +35,10 @@
35#define AT803X_DEBUG_SYSTEM_MODE_CTRL 0x05 35#define AT803X_DEBUG_SYSTEM_MODE_CTRL 0x05
36#define AT803X_DEBUG_RGMII_TX_CLK_DLY BIT(8) 36#define AT803X_DEBUG_RGMII_TX_CLK_DLY BIT(8)
37 37
38#define ATH8030_PHY_ID 0x004dd076
39#define ATH8031_PHY_ID 0x004dd074
40#define ATH8035_PHY_ID 0x004dd072
41
38MODULE_DESCRIPTION("Atheros 803x PHY driver"); 42MODULE_DESCRIPTION("Atheros 803x PHY driver");
39MODULE_AUTHOR("Matus Ujhelyi"); 43MODULE_AUTHOR("Matus Ujhelyi");
40MODULE_LICENSE("GPL"); 44MODULE_LICENSE("GPL");
@@ -192,7 +196,7 @@ static int at803x_config_intr(struct phy_device *phydev)
192static struct phy_driver at803x_driver[] = { 196static struct phy_driver at803x_driver[] = {
193{ 197{
194 /* ATHEROS 8035 */ 198 /* ATHEROS 8035 */
195 .phy_id = 0x004dd072, 199 .phy_id = ATH8035_PHY_ID,
196 .name = "Atheros 8035 ethernet", 200 .name = "Atheros 8035 ethernet",
197 .phy_id_mask = 0xffffffef, 201 .phy_id_mask = 0xffffffef,
198 .config_init = at803x_config_init, 202 .config_init = at803x_config_init,
@@ -209,7 +213,7 @@ static struct phy_driver at803x_driver[] = {
209 }, 213 },
210}, { 214}, {
211 /* ATHEROS 8030 */ 215 /* ATHEROS 8030 */
212 .phy_id = 0x004dd076, 216 .phy_id = ATH8030_PHY_ID,
213 .name = "Atheros 8030 ethernet", 217 .name = "Atheros 8030 ethernet",
214 .phy_id_mask = 0xffffffef, 218 .phy_id_mask = 0xffffffef,
215 .config_init = at803x_config_init, 219 .config_init = at803x_config_init,
@@ -226,7 +230,7 @@ static struct phy_driver at803x_driver[] = {
226 }, 230 },
227}, { 231}, {
228 /* ATHEROS 8031 */ 232 /* ATHEROS 8031 */
229 .phy_id = 0x004dd074, 233 .phy_id = ATH8031_PHY_ID,
230 .name = "Atheros 8031 ethernet", 234 .name = "Atheros 8031 ethernet",
231 .phy_id_mask = 0xffffffef, 235 .phy_id_mask = 0xffffffef,
232 .config_init = at803x_config_init, 236 .config_init = at803x_config_init,
@@ -260,9 +264,9 @@ module_init(atheros_init);
260module_exit(atheros_exit); 264module_exit(atheros_exit);
261 265
262static struct mdio_device_id __maybe_unused atheros_tbl[] = { 266static struct mdio_device_id __maybe_unused atheros_tbl[] = {
263 { 0x004dd076, 0xffffffef }, 267 { ATH8030_PHY_ID, 0xffffffef },
264 { 0x004dd074, 0xffffffef }, 268 { ATH8031_PHY_ID, 0xffffffef },
265 { 0x004dd072, 0xffffffef }, 269 { ATH8035_PHY_ID, 0xffffffef },
266 { } 270 { }
267}; 271};
268 272