diff options
author | John Crispin <blogic@openwrt.org> | 2013-04-11 07:12:37 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-04-11 07:12:37 +0000 |
commit | ce4da1634d181c883b3d7c099d034390147e918c (patch) | |
tree | 731086b78cad56e5cce1471829060d20ec7d2fbc /target/linux | |
parent | 05f61163556a77fc5fe5264dc1b0143146bc0405 (diff) | |
download | upstream-ce4da1634d181c883b3d7c099d034390147e918c.tar.gz upstream-ce4da1634d181c883b3d7c099d034390147e918c.tar.bz2 upstream-ce4da1634d181c883b3d7c099d034390147e918c.zip |
[lantiq] add missing pinmux patch
Fix lantiq pinmux which affected PCI and USB.
Known affected boards are: ARV4518 and ARV7518.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36312 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/lantiq/patches-3.8/0042-PINCTRL-lantiq-fix-pinmux.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/target/linux/lantiq/patches-3.8/0042-PINCTRL-lantiq-fix-pinmux.patch b/target/linux/lantiq/patches-3.8/0042-PINCTRL-lantiq-fix-pinmux.patch new file mode 100644 index 0000000000..d84df7e7de --- /dev/null +++ b/target/linux/lantiq/patches-3.8/0042-PINCTRL-lantiq-fix-pinmux.patch @@ -0,0 +1,67 @@ +--- a/drivers/pinctrl/pinctrl-xway.c 2013-04-10 21:51:51.739780800 +0200 ++++ b/drivers/pinctrl/pinctrl-xway.c 2013-04-10 21:56:47.990049456 +0200 +@@ -563,10 +563,9 @@ static struct pinctrl_desc xway_pctrl_de + .confops = &xway_pinconf_ops, + }; + +-static inline int xway_mux_apply(struct pinctrl_dev *pctrldev, ++static int mux_apply(struct ltq_pinmux_info *info, + int pin, int mux) + { +- struct ltq_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev); + int port = PORT(pin); + u32 alt1_reg = GPIO_ALT1(pin); + +@@ -586,6 +585,14 @@ static inline int xway_mux_apply(struct + return 0; + } + ++static inline int xway_mux_apply(struct pinctrl_dev *pctrldev, ++ int pin, int mux) ++{ ++ struct ltq_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev); ++ ++ return mux_apply(info, pin, mux); ++} ++ + static const struct ltq_cfg_param xway_cfg_params[] = { + {"lantiq,pull", LTQ_PINCONF_PARAM_PULL}, + {"lantiq,open-drain", LTQ_PINCONF_PARAM_OPEN_DRAIN}, +@@ -630,6 +637,10 @@ static int xway_gpio_dir_out(struct gpio + { + struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev); + ++ if (PORT(pin) == PORT3) ++ gpio_setbit(info->membase[0], GPIO3_OD, PORT_PIN(pin)); ++ else ++ gpio_setbit(info->membase[0], GPIO_OD(pin), PORT_PIN(pin)); + gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin)); + xway_gpio_set(chip, pin, val); + +@@ -650,6 +661,18 @@ static void xway_gpio_free(struct gpio_c + pinctrl_free_gpio(gpio); + } + ++static int xway_gpio_to_irq(struct gpio_chip *chip, unsigned offset) ++{ ++ struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev); ++ int i; ++ ++ for (i = 0; i < info->num_exin; i++) ++ if (info->exin[i] == offset) ++ return ltq_eiu_get_irq(i); ++ ++ return -1; ++} ++ + static struct gpio_chip xway_chip = { + .label = "gpio-xway", + .direction_input = xway_gpio_dir_in, +@@ -658,6 +681,7 @@ static struct gpio_chip xway_chip = { + .set = xway_gpio_set, + .request = xway_gpio_req, + .free = xway_gpio_free, ++ .to_irq = xway_gpio_to_irq, + .base = -1, + }; + |