bump to v3.8
[openwrt/openwrt.git] / target / linux / lantiq / patches-3.8 / 0013-PINCTRL-lantiq-add-functionality-to-falcon_pinconf_d.patch
1 From 98d06bc9e2a2f534aaaf4229aaf871e394234d20 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Wed, 30 Jan 2013 20:13:09 +0100
4 Subject: [PATCH 13/40] PINCTRL: lantiq: add functionality to
5 falcon_pinconf_dbg_show
6
7 The current code only has a stub for falcon_pinconf_dbg_show. This patch adds
8 proper functionality.
9
10 Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
11 Signed-off-by: John Crispin <blogic@openwrt.org>
12 ---
13 drivers/pinctrl/pinctrl-falcon.c | 31 +++++++++++++++++++++++++++++++
14 1 file changed, 31 insertions(+)
15
16 diff --git a/drivers/pinctrl/pinctrl-falcon.c b/drivers/pinctrl/pinctrl-falcon.c
17 index c5a9868..4a0d54a 100644
18 --- a/drivers/pinctrl/pinctrl-falcon.c
19 +++ b/drivers/pinctrl/pinctrl-falcon.c
20 @@ -315,6 +315,37 @@ static int falcon_pinconf_set(struct pinctrl_dev *pctrldev,
21 static void falcon_pinconf_dbg_show(struct pinctrl_dev *pctrldev,
22 struct seq_file *s, unsigned offset)
23 {
24 + unsigned long config;
25 + struct pin_desc *desc;
26 +
27 + struct ltq_pinmux_info *info = pinctrl_dev_get_drvdata(pctrldev);
28 + int port = PORT(offset);
29 +
30 + seq_printf(s, " (port %d) mux %d -- ", port,
31 + pad_r32(info->membase[port], LTQ_PADC_MUX(PORT_PIN(offset))));
32 +
33 + config = LTQ_PINCONF_PACK(LTQ_PINCONF_PARAM_PULL, 0);
34 + if (!falcon_pinconf_get(pctrldev, offset, &config))
35 + seq_printf(s, "pull %d ",
36 + (int)LTQ_PINCONF_UNPACK_ARG(config));
37 +
38 + config = LTQ_PINCONF_PACK(LTQ_PINCONF_PARAM_DRIVE_CURRENT, 0);
39 + if (!falcon_pinconf_get(pctrldev, offset, &config))
40 + seq_printf(s, "drive-current %d ",
41 + (int)LTQ_PINCONF_UNPACK_ARG(config));
42 +
43 + config = LTQ_PINCONF_PACK(LTQ_PINCONF_PARAM_SLEW_RATE, 0);
44 + if (!falcon_pinconf_get(pctrldev, offset, &config))
45 + seq_printf(s, "slew-rate %d ",
46 + (int)LTQ_PINCONF_UNPACK_ARG(config));
47 +
48 + desc = pin_desc_get(pctrldev, offset);
49 + if (desc) {
50 + if (desc->gpio_owner)
51 + seq_printf(s, " owner: %s", desc->gpio_owner);
52 + } else {
53 + seq_printf(s, " not registered");
54 + }
55 }
56
57 static void falcon_pinconf_group_dbg_show(struct pinctrl_dev *pctrldev,
58 --
59 1.7.10.4
60