diff options
author | Jonas Gorski <jonas.gorski@gmail.com> | 2018-12-20 00:05:15 +0100 |
---|---|---|
committer | Jonas Gorski <jonas.gorski@gmail.com> | 2018-12-30 13:22:13 +0100 |
commit | d09561f73d74c467347753a153c509faa48233a1 (patch) | |
tree | 2a8b648e3169be3eae8b84d696a04bbb5b5a7aee /target/linux/brcm63xx | |
parent | 33bff49a31692b0ab8cb32921bbce01ad7da850d (diff) | |
download | upstream-d09561f73d74c467347753a153c509faa48233a1.tar.gz upstream-d09561f73d74c467347753a153c509faa48233a1.tar.bz2 upstream-d09561f73d74c467347753a153c509faa48233a1.zip |
brcm63xx: fix bcm6348 pinmux group selection
The mask/shift computation used the pin group number instead of the pin
number, resulting in always modifying group 4 when applying muxes, so
fix it to consistently use the pin number.
Fixes: 0755c2d11706 ("brcm63xx: add pinctrl support")
Reported-by: Daniel Gonzalez Cabanelas <dgcbueu@gmail.com>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Diffstat (limited to 'target/linux/brcm63xx')
2 files changed, 12 insertions, 14 deletions
diff --git a/target/linux/brcm63xx/patches-4.14/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch b/target/linux/brcm63xx/patches-4.14/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch index 19b8075865..b48723c1b3 100644 --- a/target/linux/brcm63xx/patches-4.14/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch +++ b/target/linux/brcm63xx/patches-4.14/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch @@ -12,8 +12,8 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> --- drivers/pinctrl/bcm63xx/Kconfig | 7 + drivers/pinctrl/bcm63xx/Makefile | 1 + - drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c | 392 ++++++++++++++++++++++++++++++ - 3 files changed, 400 insertions(+) + drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c | 391 ++++++++++++++++++++++++++++++ + 3 files changed, 399 insertions(+) create mode 100644 drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c --- a/drivers/pinctrl/bcm63xx/Kconfig @@ -37,7 +37,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> +obj-$(CONFIG_PINCTRL_BCM6348) += pinctrl-bcm6348.o --- /dev/null +++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c -@@ -0,0 +1,392 @@ +@@ -0,0 +1,391 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -321,15 +321,14 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> + struct bcm6348_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); + const struct bcm6348_pingroup *grp = &bcm6348_groups[group]; + const struct bcm6348_function *f = &bcm6348_funcs[selector]; -+ u32 group_num, mask, val; ++ u32 mask, val; + + /* + * pins n..(n+7) share the same group, so we only need to look at + * the first pin. + */ -+ group_num = (unsigned long)bcm6348_pins[grp->pins[0]].drv_data; -+ mask = GROUP_MASK(group_num); -+ val = f->value << GROUP_SHIFT(group_num); ++ mask = GROUP_MASK(grp->pins[0]); ++ val = f->value << GROUP_SHIFT(grp->pins[0]); + + bcm6348_rmw_mux(pctl, mask, val); + diff --git a/target/linux/brcm63xx/patches-4.9/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch b/target/linux/brcm63xx/patches-4.9/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch index 19b8075865..b48723c1b3 100644 --- a/target/linux/brcm63xx/patches-4.9/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch +++ b/target/linux/brcm63xx/patches-4.9/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch @@ -12,8 +12,8 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> --- drivers/pinctrl/bcm63xx/Kconfig | 7 + drivers/pinctrl/bcm63xx/Makefile | 1 + - drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c | 392 ++++++++++++++++++++++++++++++ - 3 files changed, 400 insertions(+) + drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c | 391 ++++++++++++++++++++++++++++++ + 3 files changed, 399 insertions(+) create mode 100644 drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c --- a/drivers/pinctrl/bcm63xx/Kconfig @@ -37,7 +37,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> +obj-$(CONFIG_PINCTRL_BCM6348) += pinctrl-bcm6348.o --- /dev/null +++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c -@@ -0,0 +1,392 @@ +@@ -0,0 +1,391 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -321,15 +321,14 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> + struct bcm6348_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); + const struct bcm6348_pingroup *grp = &bcm6348_groups[group]; + const struct bcm6348_function *f = &bcm6348_funcs[selector]; -+ u32 group_num, mask, val; ++ u32 mask, val; + + /* + * pins n..(n+7) share the same group, so we only need to look at + * the first pin. + */ -+ group_num = (unsigned long)bcm6348_pins[grp->pins[0]].drv_data; -+ mask = GROUP_MASK(group_num); -+ val = f->value << GROUP_SHIFT(group_num); ++ mask = GROUP_MASK(grp->pins[0]); ++ val = f->value << GROUP_SHIFT(grp->pins[0]); + + bcm6348_rmw_mux(pctl, mask, val); + |