2 * Driver for Moschip MCS814x internal PHY
4 * Copyright (c) 2012 Florian Fainelli <florian@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
12 #include <linux/kernel.h>
13 #include <linux/string.h>
14 #include <linux/errno.h>
15 #include <linux/unistd.h>
16 #include <linux/interrupt.h>
17 #include <linux/init.h>
18 #include <linux/delay.h>
19 #include <linux/netdevice.h>
20 #include <linux/etherdevice.h>
21 #include <linux/skbuff.h>
22 #include <linux/spinlock.h>
24 #include <linux/module.h>
25 #include <linux/mii.h>
26 #include <linux/ethtool.h>
27 #include <linux/phy.h>
29 MODULE_DESCRIPTION("Moschip MCS814x PHY driver");
30 MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
31 MODULE_LICENSE("GPL");
33 /* Nothing special about this PHY but its OUI (O) */
34 static struct phy_driver mcs8140_driver
= {
36 .name
= "Moschip MCS8140",
38 .features
= PHY_BASIC_FEATURES
,
39 .config_aneg
= &genphy_config_aneg
,
40 .read_status
= &genphy_read_status
,
41 .suspend
= genphy_suspend
,
42 .resume
= genphy_resume
,
43 .driver
= { .owner
= THIS_MODULE
,},
46 static int __init
mcs814x_phy_init(void)
48 return phy_driver_register(&mcs8140_driver
);
51 static void __exit
mcs814x_phy_exit(void)
53 phy_driver_unregister(&mcs8140_driver
);
56 module_init(mcs814x_phy_init
);
57 module_exit(mcs814x_phy_exit
);
59 static struct mdio_device_id __maybe_unused mcs814x_phy_tbl
[] = {
64 MODULE_DEVICE_TABLE(mdio
, mcs814x_phy_tbl
);