aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-02-15 19:45:29 +0000
committerJohn Crispin <blogic@openwrt.org>2015-02-15 19:45:29 +0000
commitc77c54e6845c201483a75dfc931f7065d3d35c84 (patch)
treeba56f28512a840dcad307d78c1c063637a014f36 /target/linux/ar71xx/files
parentbeb7f2ac7b5c617cd3e1b0060c15b1e71f8faa5c (diff)
downloadupstream-c77c54e6845c201483a75dfc931f7065d3d35c84.tar.gz
upstream-c77c54e6845c201483a75dfc931f7065d3d35c84.tar.bz2
upstream-c77c54e6845c201483a75dfc931f7065d3d35c84.zip
ar71xx: add v3.18 support
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44456 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c5
-rw-r--r--target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c6
-rw-r--r--target/linux/ar71xx/files/drivers/net/dsa/mv88e6063.c16
3 files changed, 26 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c
index 1764147386..a9bb334a20 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c
@@ -10,6 +10,7 @@
*/
#include <linux/init.h>
+#include <linux/version.h>
#include <linux/platform_device.h>
#include <asm/mach-ath79/ath79.h>
@@ -29,7 +30,11 @@ void __init ath79_register_dsa(struct device *netdev,
d->netdev = netdev;
for (i = 0; i < d->nr_chips; i++)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)
d->chip[i].mii_bus = miidev;
+#else
+ d->chip[i].host_dev = miidev;
+#endif
ar71xx_dsa_switch_device.dev.platform_data = d;
platform_device_register(&ar71xx_dsa_switch_device);
diff --git a/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c b/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c
index 5bdeb3d557..8c01efe4a0 100644
--- a/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c
+++ b/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c
@@ -8,6 +8,7 @@
* published by the Free Software Foundation.
*/
+#include <linux/version.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/gpio.h>
@@ -198,6 +199,7 @@ static int nxp_74hc153_remove(struct platform_device *pdev)
struct nxp_74hc153_platform_data *pdata = pdev->dev.platform_data;
if (nxp) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)
int err;
err = gpiochip_remove(&nxp->gpio_chip);
@@ -207,7 +209,9 @@ static int nxp_74hc153_remove(struct platform_device *pdev)
err);
return err;
}
-
+#else
+ gpiochip_remove(&nxp->gpio_chip);
+#endif
gpio_free(pdata->gpio_pin_2y);
gpio_free(pdata->gpio_pin_1y);
gpio_free(pdata->gpio_pin_s1);
diff --git a/target/linux/ar71xx/files/drivers/net/dsa/mv88e6063.c b/target/linux/ar71xx/files/drivers/net/dsa/mv88e6063.c
index b41eb5481a..224b4913c6 100644
--- a/target/linux/ar71xx/files/drivers/net/dsa/mv88e6063.c
+++ b/target/linux/ar71xx/files/drivers/net/dsa/mv88e6063.c
@@ -12,6 +12,7 @@
* (at your option) any later version.
*/
+#include <linux/version.h>
#include <linux/list.h>
#include <linux/netdevice.h>
#include <linux/phy.h>
@@ -25,7 +26,12 @@
static int reg_read(struct dsa_switch *ds, int addr, int reg)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)
return mdiobus_read(ds->master_mii_bus, addr, reg);
+#else
+ struct mii_bus *bus = dsa_host_dev_to_mii_bus(ds->master_dev);
+ return mdiobus_read(bus, addr, reg);
+#endif
}
#define REG_READ(addr, reg) \
@@ -41,7 +47,12 @@ static int reg_read(struct dsa_switch *ds, int addr, int reg)
static int reg_write(struct dsa_switch *ds, int addr, int reg, u16 val)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)
return mdiobus_write(ds->master_mii_bus, addr, reg, val);
+#else
+ struct mii_bus *bus = dsa_host_dev_to_mii_bus(ds->master_dev);
+ return mdiobus_write(bus, addr, reg, val);
+#endif
}
#define REG_WRITE(addr, reg, val) \
@@ -53,8 +64,13 @@ static int reg_write(struct dsa_switch *ds, int addr, int reg, u16 val)
return __ret; \
})
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)
static char *mv88e6063_probe(struct mii_bus *bus, int sw_addr)
+#else
+static char *mv88e6063_probe(struct device *host_dev, int sw_addr)
+#endif
{
+ struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
int ret;
ret = mdiobus_read(bus, REG_PORT(0), 0x03);