summaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/patches-3.8/0008-PINCTRL-lantiq-add-output-pinconf-parameter.patch
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-03-14 18:42:29 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-03-14 18:42:29 +0000
commit9d15912357a1e78fa578780782752d6159d53b90 (patch)
tree1305b5b94ec649d510dfbd63ccedc77446db1517 /target/linux/lantiq/patches-3.8/0008-PINCTRL-lantiq-add-output-pinconf-parameter.patch
parent6816ad29166ac86b0742c90a22a04d00b4d1a2ec (diff)
[lantiq] bump to v3.8
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36014 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/lantiq/patches-3.8/0008-PINCTRL-lantiq-add-output-pinconf-parameter.patch')
-rw-r--r--target/linux/lantiq/patches-3.8/0008-PINCTRL-lantiq-add-output-pinconf-parameter.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/target/linux/lantiq/patches-3.8/0008-PINCTRL-lantiq-add-output-pinconf-parameter.patch b/target/linux/lantiq/patches-3.8/0008-PINCTRL-lantiq-add-output-pinconf-parameter.patch
new file mode 100644
index 000000000..30e83ff54
--- /dev/null
+++ b/target/linux/lantiq/patches-3.8/0008-PINCTRL-lantiq-add-output-pinconf-parameter.patch
@@ -0,0 +1,68 @@
+From f9441b4f98b5b28f3d2cbebd0a70b227c35451d9 Mon Sep 17 00:00:00 2001
+From: John Crispin <blogic@openwrt.org>
+Date: Wed, 30 Jan 2013 18:33:39 +0100
+Subject: [PATCH 08/40] PINCTRL: lantiq: add output pinconf parameter
+
+While converting the boards inside OpenWrt to OF I noticed that the we are
+missing a pinconf parameter to set a pin to output.
+
+Signed-off-by: John Crispin <blogic@openwrt.org>
+---
+ drivers/pinctrl/pinctrl-lantiq.h | 1 +
+ drivers/pinctrl/pinctrl-xway.c | 14 ++++++++++++++
+ 2 files changed, 15 insertions(+)
+
+diff --git a/drivers/pinctrl/pinctrl-lantiq.h b/drivers/pinctrl/pinctrl-lantiq.h
+index 4419d32..6d07f02 100644
+--- a/drivers/pinctrl/pinctrl-lantiq.h
++++ b/drivers/pinctrl/pinctrl-lantiq.h
+@@ -34,6 +34,7 @@ enum ltq_pinconf_param {
+ LTQ_PINCONF_PARAM_OPEN_DRAIN,
+ LTQ_PINCONF_PARAM_DRIVE_CURRENT,
+ LTQ_PINCONF_PARAM_SLEW_RATE,
++ LTQ_PINCONF_PARAM_OUTPUT,
+ };
+
+ struct ltq_cfg_param {
+diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c
+index aa4c8b8..b23b895 100644
+--- a/drivers/pinctrl/pinctrl-xway.c
++++ b/drivers/pinctrl/pinctrl-xway.c
+@@ -466,6 +466,11 @@ static int xway_pinconf_get(struct pinctrl_dev *pctldev,
+ *config = LTQ_PINCONF_PACK(param, 1);
+ break;
+
++ case LTQ_PINCONF_PARAM_OUTPUT:
++ reg = GPIO_DIR(pin);
++ *config = LTQ_PINCONF_PACK(param,
++ gpio_getbit(info->membase[0], reg, PORT_PIN(pin)));
++ break;
+ default:
+ dev_err(pctldev->dev, "Invalid config param %04x\n", param);
+ return -ENOTSUPP;
+@@ -515,6 +520,14 @@ static int xway_pinconf_set(struct pinctrl_dev *pctldev,
+ dev_err(pctldev->dev, "Invalid pull value %d\n", arg);
+ break;
+
++ case LTQ_PINCONF_PARAM_OUTPUT:
++ reg = GPIO_DIR(pin);
++ if (arg == 0)
++ gpio_clearbit(info->membase[0], reg, PORT_PIN(pin));
++ else
++ gpio_setbit(info->membase[0], reg, PORT_PIN(pin));
++ break;
++
+ default:
+ dev_err(pctldev->dev, "Invalid config param %04x\n", param);
+ return -ENOTSUPP;
+@@ -573,6 +586,7 @@ static inline int xway_mux_apply(struct pinctrl_dev *pctrldev,
+ static const struct ltq_cfg_param xway_cfg_params[] = {
+ {"lantiq,pull", LTQ_PINCONF_PARAM_PULL},
+ {"lantiq,open-drain", LTQ_PINCONF_PARAM_OPEN_DRAIN},
++ {"lantiq,output", LTQ_PINCONF_PARAM_OUTPUT},
+ };
+
+ static struct ltq_pinmux_info xway_info = {
+--
+1.7.10.4
+