2 * drivers/net/phy/micrel.c
4 * Driver for Micrel PHYs
6 * Author: David J. Choi
8 * Copyright (c) 2010 Micrel, Inc.
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
15 * Support : ksz9021 , vsc8201, ks8001
18 #include <linux/kernel.h>
19 #include <linux/module.h>
20 #include <linux/phy.h>
22 #define PHY_ID_KSZ9021 0x00221611
23 #define PHY_ID_VSC8201 0x000FC413
24 #define PHY_ID_KS8001 0x0022161A
27 static int kszphy_config_init(struct phy_device
*phydev
)
33 static struct phy_driver ks8001_driver
= {
34 .phy_id
= PHY_ID_KS8001
,
35 .name
= "Micrel KS8001",
36 .phy_id_mask
= 0x00fffff0,
37 .features
= PHY_BASIC_FEATURES
,
39 .config_init
= kszphy_config_init
,
40 .config_aneg
= genphy_config_aneg
,
41 .read_status
= genphy_read_status
,
42 .driver
= { .owner
= THIS_MODULE
,},
45 static struct phy_driver vsc8201_driver
= {
46 .phy_id
= PHY_ID_VSC8201
,
47 .name
= "Micrel VSC8201",
48 .phy_id_mask
= 0x00fffff0,
49 .features
= PHY_BASIC_FEATURES
,
51 .config_init
= kszphy_config_init
,
52 .config_aneg
= genphy_config_aneg
,
53 .read_status
= genphy_read_status
,
54 .driver
= { .owner
= THIS_MODULE
,},
57 static struct phy_driver ksz9021_driver
= {
58 .phy_id
= PHY_ID_KSZ9021
,
59 .phy_id_mask
= 0x000fff10,
60 .name
= "Micrel KSZ9021 Gigabit PHY",
61 .features
= PHY_GBIT_FEATURES
| SUPPORTED_Pause
,
63 .config_init
= kszphy_config_init
,
64 .config_aneg
= genphy_config_aneg
,
65 .read_status
= genphy_read_status
,
66 .driver
= { .owner
= THIS_MODULE
, },
69 static int __init
ksphy_init(void)
73 ret
= phy_driver_register(&ks8001_driver
);
76 ret
= phy_driver_register(&vsc8201_driver
);
80 ret
= phy_driver_register(&ksz9021_driver
);
86 phy_driver_unregister(&vsc8201_driver
);
88 phy_driver_unregister(&ks8001_driver
);
93 static void __exit
ksphy_exit(void)
95 phy_driver_unregister(&ks8001_driver
);
96 phy_driver_unregister(&vsc8201_driver
);
97 phy_driver_unregister(&ksz9021_driver
);
100 module_init(ksphy_init
);
101 module_exit(ksphy_exit
);
103 MODULE_DESCRIPTION("Micrel PHY driver");
104 MODULE_AUTHOR("David J. Choi");
105 MODULE_LICENSE("GPL");
107 static struct mdio_device_id micrel_tbl
[] = {
108 { PHY_ID_KSZ9021
, 0x000fff10 },
109 { PHY_ID_VSC8201
, 0x00fffff0 },
110 { PHY_ID_KS8001
, 0x00fffff0 },
114 MODULE_DEVICE_TABLE(mdio
, micrel_tbl
);