OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 10... | Line 10... | |||
10 | |
10 | |
|
11 | Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> |
11 | Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> |
|
12 | --- |
12 | --- |
|
13 | drivers/pinctrl/bcm63xx/Kconfig | 7 + |
13 | drivers/pinctrl/bcm63xx/Kconfig | 7 + |
|
14 | drivers/pinctrl/bcm63xx/Makefile | 1 + |
14 | drivers/pinctrl/bcm63xx/Makefile | 1 + |
|
15 | drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c | 391 ++++++++++++++++++++++++++++++ |
15 | drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c | 392 ++++++++++++++++++++++++++++++ |
|
16 | 3 files changed, 399 insertions(+) |
16 | 3 files changed, 400 insertions(+) |
|
Line 17... | Line 17... | |||
17 | create mode 100644 drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c |
17 | create mode 100644 drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c |
|
18 | |
18 | |
|
19 | --- a/drivers/pinctrl/bcm63xx/Kconfig |
19 | --- a/drivers/pinctrl/bcm63xx/Kconfig |
|
Line 35... | Line 35... | |||
35 | obj-$(CONFIG_PINCTRL_BCM63XX) += pinctrl-bcm63xx.o |
35 | obj-$(CONFIG_PINCTRL_BCM63XX) += pinctrl-bcm63xx.o |
|
36 | obj-$(CONFIG_PINCTRL_BCM6328) += pinctrl-bcm6328.o |
36 | obj-$(CONFIG_PINCTRL_BCM6328) += pinctrl-bcm6328.o |
|
37 | +obj-$(CONFIG_PINCTRL_BCM6348) += pinctrl-bcm6348.o |
37 | +obj-$(CONFIG_PINCTRL_BCM6348) += pinctrl-bcm6348.o |
|
38 | --- /dev/null |
38 | --- /dev/null |
|
39 | +++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c |
39 | +++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c |
|
40 | @@ -0,0 +1,391 @@ |
40 | @@ -0,0 +1,392 @@ |
|
41 | +/* |
41 | +/* |
|
42 | + * This file is subject to the terms and conditions of the GNU General Public |
42 | + * This file is subject to the terms and conditions of the GNU General Public |
|
43 | + * License. See the file "COPYING" in the main directory of this archive |
43 | + * License. See the file "COPYING" in the main directory of this archive |
|
44 | + * for more details. |
44 | + * for more details. |
|
45 | + * |
45 | + * |
|
Line 319... | Line 319... | |||
319 | + unsigned selector, unsigned group) |
319 | + unsigned selector, unsigned group) |
|
320 | +{ |
320 | +{ |
|
321 | + struct bcm6348_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); |
321 | + struct bcm6348_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); |
|
322 | + const struct bcm6348_pingroup *grp = &bcm6348_groups[group]; |
322 | + const struct bcm6348_pingroup *grp = &bcm6348_groups[group]; |
|
323 | + const struct bcm6348_function *f = &bcm6348_funcs[selector]; |
323 | + const struct bcm6348_function *f = &bcm6348_funcs[selector]; |
|
324 | + u32 mask, val; |
324 | + u32 group_num, mask, val; |
|
325 | + |
325 | + |
|
326 | + /* |
326 | + /* |
|
327 | + * pins n..(n+7) share the same group, so we only need to look at |
327 | + * pins n..(n+7) share the same group, so we only need to look at |
|
328 | + * the first pin. |
328 | + * the first pin. |
|
329 | + */ |
329 | + */ |
|
- | 330 | + group_num = (unsigned long)bcm6348_pins[grp->pins[0]].drv_data; |
||
330 | + mask = GROUP_MASK(grp->pins[0]); |
331 | + mask = GROUP_MASK(group_num); |
|
331 | + val = f->value << GROUP_SHIFT(grp->pins[0]); |
332 | + val = f->value << GROUP_SHIFT(group_num); |
|
332 | + |
333 | + |
|
333 | + bcm6348_rmw_mux(pctl, mask, val); |
334 | + bcm6348_rmw_mux(pctl, mask, val); |
|
334 | + |
335 | + |
|
335 | + return 0; |
336 | + return 0; |
|
336 | +} |
337 | +} |