diff options
Diffstat (limited to 'drivers/net/phy/micrel.c')
-rw-r--r-- | drivers/net/phy/micrel.c | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c new file mode 100644 index 000000000000..0cd80e4d71d9 --- /dev/null +++ b/drivers/net/phy/micrel.c | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * drivers/net/phy/micrel.c | ||
3 | * | ||
4 | * Driver for Micrel PHYs | ||
5 | * | ||
6 | * Author: David J. Choi | ||
7 | * | ||
8 | * Copyright (c) 2010 Micrel, Inc. | ||
9 | * | ||
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. | ||
14 | * | ||
15 | * Support : ksz9021 , vsc8201, ks8001 | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/module.h> | ||
20 | #include <linux/phy.h> | ||
21 | |||
22 | #define PHY_ID_KSZ9021 0x00221611 | ||
23 | #define PHY_ID_VSC8201 0x000FC413 | ||
24 | #define PHY_ID_KS8001 0x0022161A | ||
25 | |||
26 | |||
27 | static int kszphy_config_init(struct phy_device *phydev) | ||
28 | { | ||
29 | return 0; | ||
30 | } | ||
31 | |||
32 | |||
33 | static struct phy_driver ks8001_driver = { | ||
34 | .phy_id = PHY_ID_KS8001, | ||
35 | .phy_id_mask = 0x00fffff0, | ||
36 | .features = PHY_BASIC_FEATURES, | ||
37 | .flags = PHY_POLL, | ||
38 | .config_init = kszphy_config_init, | ||
39 | .config_aneg = genphy_config_aneg, | ||
40 | .read_status = genphy_read_status, | ||
41 | .driver = { .owner = THIS_MODULE,}, | ||
42 | }; | ||
43 | |||
44 | static struct phy_driver vsc8201_driver = { | ||
45 | .phy_id = PHY_ID_VSC8201, | ||
46 | .name = "Micrel VSC8201", | ||
47 | .phy_id_mask = 0x00fffff0, | ||
48 | .features = PHY_BASIC_FEATURES, | ||
49 | .flags = PHY_POLL, | ||
50 | .config_init = kszphy_config_init, | ||
51 | .config_aneg = genphy_config_aneg, | ||
52 | .read_status = genphy_read_status, | ||
53 | .driver = { .owner = THIS_MODULE,}, | ||
54 | }; | ||
55 | |||
56 | static struct phy_driver ksz9021_driver = { | ||
57 | .phy_id = PHY_ID_KSZ9021, | ||
58 | .phy_id_mask = 0x000fff10, | ||
59 | .name = "Micrel KSZ9021 Gigabit PHY", | ||
60 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause, | ||
61 | .flags = PHY_POLL, | ||
62 | .config_init = kszphy_config_init, | ||
63 | .config_aneg = genphy_config_aneg, | ||
64 | .read_status = genphy_read_status, | ||
65 | .driver = { .owner = THIS_MODULE, }, | ||
66 | }; | ||
67 | |||
68 | static int __init ksphy_init(void) | ||
69 | { | ||
70 | int ret; | ||
71 | |||
72 | ret = phy_driver_register(&ks8001_driver); | ||
73 | if (ret) | ||
74 | goto err1; | ||
75 | ret = phy_driver_register(&vsc8201_driver); | ||
76 | if (ret) | ||
77 | goto err2; | ||
78 | |||
79 | ret = phy_driver_register(&ksz9021_driver); | ||
80 | if (ret) | ||
81 | goto err3; | ||
82 | return 0; | ||
83 | |||
84 | err3: | ||
85 | phy_driver_unregister(&vsc8201_driver); | ||
86 | err2: | ||
87 | phy_driver_unregister(&ks8001_driver); | ||
88 | err1: | ||
89 | return ret; | ||
90 | } | ||
91 | |||
92 | static void __exit ksphy_exit(void) | ||
93 | { | ||
94 | phy_driver_unregister(&ks8001_driver); | ||
95 | phy_driver_unregister(&vsc8201_driver); | ||
96 | phy_driver_unregister(&ksz9021_driver); | ||
97 | } | ||
98 | |||
99 | module_init(ksphy_init); | ||
100 | module_exit(ksphy_exit); | ||
101 | |||
102 | MODULE_DESCRIPTION("Micrel PHY driver"); | ||
103 | MODULE_AUTHOR("David J. Choi"); | ||
104 | MODULE_LICENSE("GPL"); | ||