summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
diff options
context:
space:
mode:
authorJoachim Eastwood <manabian@gmail.com>2015-05-14 12:11:00 +0200
committerDavid S. Miller <davem@davemloft.net>2015-05-15 12:44:22 -0400
commit69bdd2d40d1e5fd9f7b92d39d129a0d057daf5fd (patch)
tree5198054bff4d29506aea8f4c72bd04e5b633c903 /drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
parentba25020e2725308562d60f3d0247218b07a49b9f (diff)
stmmac: convert dwmac-lpc18xx to a platform driver
Convert platform glue layer into a proper platform driver and add it to the build system. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
index be02b6a1475f..cb888d3ebbdc 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
@@ -9,12 +9,16 @@
*/
#include <linux/mfd/syscon.h>
+#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/phy.h>
+#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/stmmac.h>
+#include "stmmac_platform.h"
+
/* Register defines for CREG syscon */
#define LPC18XX_CREG_CREG6 0x12c
# define LPC18XX_CREG_CREG6_ETHMODE_MASK 0x7
@@ -67,8 +71,29 @@ static int lpc18xx_dwmac_init(struct platform_device *pdev, void *priv)
return 0;
}
-const struct stmmac_of_data lpc18xx_dwmac_data = {
+static const struct stmmac_of_data lpc18xx_dwmac_data = {
.has_gmac = 1,
.setup = lpc18xx_dwmac_setup,
.init = lpc18xx_dwmac_init,
};
+
+static const struct of_device_id lpc18xx_dwmac_match[] = {
+ { .compatible = "nxp,lpc1850-dwmac", .data = &lpc18xx_dwmac_data },
+ { }
+};
+MODULE_DEVICE_TABLE(of, lpc18xx_dwmac_match);
+
+static struct platform_driver lpc18xx_dwmac_driver = {
+ .probe = stmmac_pltfr_probe,
+ .remove = stmmac_pltfr_remove,
+ .driver = {
+ .name = "lpc18xx-dwmac",
+ .pm = &stmmac_pltfr_pm_ops,
+ .of_match_table = lpc18xx_dwmac_match,
+ },
+};
+module_platform_driver(lpc18xx_dwmac_driver);
+
+MODULE_AUTHOR("Joachim Eastwood <manabian@gmail.com>");
+MODULE_DESCRIPTION("DWMAC glue for LPC18xx/43xx Ethernet");
+MODULE_LICENSE("GPL v2");