diff options
| author | Nick Hainke <vincent@systemli.org> | 2023-05-26 18:50:15 +0200 |
|---|---|---|
| committer | Nick Hainke <vincent@systemli.org> | 2024-02-10 13:06:05 +0100 |
| commit | 0dcbe4e93171dfc87f395cd148e420d8fc023ee6 (patch) | |
| tree | 21911ad4013e96e546a3160a2cfe73e5d119d759 /target/linux/ramips/patches-6.1/808-pinctrl-mtmips-support-requesting-different-function.patch | |
| parent | 2ef5714277ce32d0dc7d59e59f20591004f070c4 (diff) | |
| download | upstream-0dcbe4e93171dfc87f395cd148e420d8fc023ee6.tar.gz upstream-0dcbe4e93171dfc87f395cd148e420d8fc023ee6.tar.bz2 upstream-0dcbe4e93171dfc87f395cd148e420d8fc023ee6.zip | |
ramips: 6.1: copy config and patches
Copy config and patches from 5.15. This simplifies reviewing process.
Signed-off-by: Nick Hainke <vincent@systemli.org>
Diffstat (limited to 'target/linux/ramips/patches-6.1/808-pinctrl-mtmips-support-requesting-different-function.patch')
| -rw-r--r-- | target/linux/ramips/patches-6.1/808-pinctrl-mtmips-support-requesting-different-function.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-6.1/808-pinctrl-mtmips-support-requesting-different-function.patch b/target/linux/ramips/patches-6.1/808-pinctrl-mtmips-support-requesting-different-function.patch new file mode 100644 index 00000000000..047808f1e69 --- /dev/null +++ b/target/linux/ramips/patches-6.1/808-pinctrl-mtmips-support-requesting-different-function.patch @@ -0,0 +1,45 @@ +From: Shiji Yang <yangshiji66@outlook.com> +Date: Wed, 26 Jul 2023 01:32:55 +0800 +Subject: [PATCH] pinctrl: mtmips: support requesting different functions for + same group + +Sometimes pinctrl consumers may request different functions for the +same pin group in different situations. This patch can help to reset +the group function flag when requesting a different function. + +Signed-off-by: Shiji Yang <yangshiji66@outlook.com> +--- + drivers/pinctrl/ralink/pinctrl-ralink.c | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +--- a/drivers/pinctrl/ralink/pinctrl-ralink.c ++++ b/drivers/pinctrl/ralink/pinctrl-ralink.c +@@ -123,11 +123,24 @@ static int ralink_pmx_group_enable(struc + int i; + int shift; + +- /* dont allow double use */ ++ /* ++ * for the same pin group, if request a different function, ++ * then clear the group function flag and continue, else exit. ++ */ + if (p->groups[group].enabled) { +- dev_err(p->dev, "%s is already enabled\n", +- p->groups[group].name); +- return 0; ++ for (i = 0; i < p->groups[group].func_count; i++) { ++ if (p->groups[group].func[i].enabled == 1) { ++ if (!strcmp(p->func[func]->name, ++ p->groups[group].func[i].name)) ++ return 0; ++ p->groups[group].func[i].enabled = 0; ++ break; ++ } ++ } ++ ++ /* exit if request the "gpio" function again */ ++ if (i == p->groups[group].func_count && func == 0) ++ return 0; + } + + p->groups[group].enabled = 1; |
