stmmac: convert dwmac-sti to platform driver
authorJoachim Eastwood <manabian@gmail.com>
Thu, 14 May 2015 10:11:04 +0000 (12:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 May 2015 16:44:23 +0000 (12:44 -0400)
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>
drivers/net/ethernet/stmicro/stmmac/Kconfig
drivers/net/ethernet/stmicro/stmmac/Makefile
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h

index f103e57e3ac0c5a3092139a68ec38ea09f0f859d..f5b9f051337d066d23492e1b33c729f16ca06b97 100644 (file)
@@ -78,6 +78,18 @@ config DWMAC_SOCFPGA
          for the stmmac device driver. This driver is used for
          arria5 and cyclone5 FPGA SoCs.
 
          for the stmmac device driver. This driver is used for
          arria5 and cyclone5 FPGA SoCs.
 
+config DWMAC_STI
+       tristate "STi GMAC support"
+       default ARCH_STI
+       depends on OF
+       select MFD_SYSCON
+       ---help---
+         Support for ethernet controller on STi SOCs.
+
+         This selects STi SoC glue layer support for the stmmac
+         device driver. This driver is used on for the STi series
+         SOCs GMAC ethernet controller.
+
 endif
 
 config STMMAC_PCI
 endif
 
 config STMMAC_PCI
index 690741d6fc1061ef1100b94b0d2b331b18c40950..f8e5ddba7fd2fe1553975bab347ab8965eed8ff7 100644 (file)
@@ -10,9 +10,9 @@ obj-$(CONFIG_DWMAC_LPC18XX)   += dwmac-lpc18xx.o
 obj-$(CONFIG_DWMAC_MESON)      += dwmac-meson.o
 obj-$(CONFIG_DWMAC_ROCKCHIP)   += dwmac-rk.o
 obj-$(CONFIG_DWMAC_SOCFPGA)    += dwmac-socfpga.o
 obj-$(CONFIG_DWMAC_MESON)      += dwmac-meson.o
 obj-$(CONFIG_DWMAC_ROCKCHIP)   += dwmac-rk.o
 obj-$(CONFIG_DWMAC_SOCFPGA)    += dwmac-socfpga.o
+obj-$(CONFIG_DWMAC_STI)                += dwmac-sti.o
 obj-$(CONFIG_DWMAC_GENERIC)    += dwmac-generic.o
 stmmac-platform-objs:= stmmac_platform.o dwmac-sunxi.o \
 obj-$(CONFIG_DWMAC_GENERIC)    += dwmac-generic.o
 stmmac-platform-objs:= stmmac_platform.o dwmac-sunxi.o \
-                      dwmac-sti.o
 
 obj-$(CONFIG_STMMAC_PCI) += stmmac-pci.o
 stmmac-pci-objs:= stmmac_pci.o
 
 obj-$(CONFIG_STMMAC_PCI) += stmmac-pci.o
 stmmac-pci-objs:= stmmac_pci.o
index bb6e2dc61bec7dc8baac541e7bf390759caf017f..a2e8111c5d14302ffafb6f7fcd9db9a3db7e00e3 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/stmmac.h>
 #include <linux/phy.h>
 #include <linux/mfd/syscon.h>
 #include <linux/stmmac.h>
 #include <linux/phy.h>
 #include <linux/mfd/syscon.h>
+#include <linux/module.h>
 #include <linux/regmap.h>
 #include <linux/clk.h>
 #include <linux/of.h>
 #include <linux/regmap.h>
 #include <linux/clk.h>
 #include <linux/of.h>
@@ -351,16 +352,40 @@ static void *sti_dwmac_setup(struct platform_device *pdev)
        return dwmac;
 }
 
        return dwmac;
 }
 
-const struct stmmac_of_data stih4xx_dwmac_data = {
+static const struct stmmac_of_data stih4xx_dwmac_data = {
        .fix_mac_speed = stih4xx_fix_retime_src,
        .setup = sti_dwmac_setup,
        .init = stix4xx_init,
        .exit = sti_dwmac_exit,
 };
 
        .fix_mac_speed = stih4xx_fix_retime_src,
        .setup = sti_dwmac_setup,
        .init = stix4xx_init,
        .exit = sti_dwmac_exit,
 };
 
-const struct stmmac_of_data stid127_dwmac_data = {
+static const struct stmmac_of_data stid127_dwmac_data = {
        .fix_mac_speed = stid127_fix_retime_src,
        .setup = sti_dwmac_setup,
        .init = stid127_init,
        .exit = sti_dwmac_exit,
 };
        .fix_mac_speed = stid127_fix_retime_src,
        .setup = sti_dwmac_setup,
        .init = stid127_init,
        .exit = sti_dwmac_exit,
 };
+
+static const struct of_device_id sti_dwmac_match[] = {
+       { .compatible = "st,stih415-dwmac", .data = &stih4xx_dwmac_data},
+       { .compatible = "st,stih416-dwmac", .data = &stih4xx_dwmac_data},
+       { .compatible = "st,stid127-dwmac", .data = &stid127_dwmac_data},
+       { .compatible = "st,stih407-dwmac", .data = &stih4xx_dwmac_data},
+       { }
+};
+MODULE_DEVICE_TABLE(of, sti_dwmac_match);
+
+static struct platform_driver sti_dwmac_driver = {
+       .probe  = stmmac_pltfr_probe,
+       .remove = stmmac_pltfr_remove,
+       .driver = {
+               .name           = "sti-dwmac",
+               .pm             = &stmmac_pltfr_pm_ops,
+               .of_match_table = sti_dwmac_match,
+       },
+};
+module_platform_driver(sti_dwmac_driver);
+
+MODULE_AUTHOR("Srinivas Kandagatla <srinivas.kandagatla@st.com>");
+MODULE_DESCRIPTION("STMicroelectronics DWMAC Specific Glue layer");
+MODULE_LICENSE("GPL");
index 4553b50833ea0539a7f2c017f76f7ad9b6889589..21a3a2c05740ce1aa6e6eb6c7929d8328853a702 100644 (file)
 static const struct of_device_id stmmac_dt_ids[] = {
        /* SoC specific glue layers should come before generic bindings */
        { .compatible = "allwinner,sun7i-a20-gmac", .data = &sun7i_gmac_data},
 static const struct of_device_id stmmac_dt_ids[] = {
        /* SoC specific glue layers should come before generic bindings */
        { .compatible = "allwinner,sun7i-a20-gmac", .data = &sun7i_gmac_data},
-       { .compatible = "st,stih415-dwmac", .data = &stih4xx_dwmac_data},
-       { .compatible = "st,stih416-dwmac", .data = &stih4xx_dwmac_data},
-       { .compatible = "st,stid127-dwmac", .data = &stid127_dwmac_data},
-       { .compatible = "st,stih407-dwmac", .data = &stih4xx_dwmac_data},
        { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, stmmac_dt_ids);
        { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, stmmac_dt_ids);
index 3c8d7088361f93366d54bec91974ece4e85c7b92..7eb2fa8d97f33b5a03c2d73583edb681cfc3d67a 100644 (file)
@@ -24,7 +24,5 @@ int stmmac_pltfr_remove(struct platform_device *pdev);
 extern const struct dev_pm_ops stmmac_pltfr_pm_ops;
 
 extern const struct stmmac_of_data sun7i_gmac_data;
 extern const struct dev_pm_ops stmmac_pltfr_pm_ops;
 
 extern const struct stmmac_of_data sun7i_gmac_data;
-extern const struct stmmac_of_data stih4xx_dwmac_data;
-extern const struct stmmac_of_data stid127_dwmac_data;
 
 #endif /* __STMMAC_PLATFORM_H__ */
 
 #endif /* __STMMAC_PLATFORM_H__ */
This page took 0.027703 seconds and 5 git commands to generate.