X-Git-Url: https://git.archive.openwrt.org/?p=openwrt.git;a=blobdiff_plain;f=target%2Flinux%2Flantiq%2Fpatches-4.4%2F0012-pinctrl-lantiq-fix-up-pinmux.patch;fp=target%2Flinux%2Flantiq%2Fpatches-4.4%2F0012-pinctrl-lantiq-fix-up-pinmux.patch;h=e03fe085be822e6dbce24e3fc13d9095a88d0c4e;hp=0000000000000000000000000000000000000000;hb=4c6e7eb3af5ddd14ddb515ce725bf20ea3bfdef8;hpb=71458d886244e9eceda4c8d9510575242a19cd9a diff --git a/target/linux/lantiq/patches-4.4/0012-pinctrl-lantiq-fix-up-pinmux.patch b/target/linux/lantiq/patches-4.4/0012-pinctrl-lantiq-fix-up-pinmux.patch new file mode 100644 index 0000000000..e03fe085be --- /dev/null +++ b/target/linux/lantiq/patches-4.4/0012-pinctrl-lantiq-fix-up-pinmux.patch @@ -0,0 +1,68 @@ +From 25494c55a4007a1409f53ddbafd661636e47ea34 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Fri, 9 Aug 2013 20:38:15 +0200 +Subject: [PATCH 12/36] pinctrl/lantiq: fix up pinmux + +We found out how to set the gphy led pinmuxing. + +Signed-off-by: John Crispin +--- + drivers/pinctrl/pinctrl-xway.c | 28 ++++++++++++++++++++++++++-- + 1 file changed, 26 insertions(+), 2 deletions(-) + +--- a/drivers/pinctrl/pinctrl-xway.c ++++ b/drivers/pinctrl/pinctrl-xway.c +@@ -609,10 +609,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); + +@@ -632,6 +631,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}, +@@ -682,6 +689,18 @@ static int xway_gpio_dir_out(struct gpio + return 0; + } + ++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, +@@ -690,6 +709,7 @@ static struct gpio_chip xway_chip = { + .set = xway_gpio_set, + .request = gpiochip_generic_request, + .free = gpiochip_generic_free, ++ .to_irq = xway_gpio_to_irq, + .base = -1, + }; +