From 4afdf5ad51fef9640d1848a60ff099952bd254f5 Mon Sep 17 00:00:00 2001 From: Kyle Hendry Date: Sun, 24 Nov 2024 11:29:33 -0800 Subject: [PATCH] bmips: Add gpio funcion to bcm63268 pinctl Right now there's no way to know what state CFE will leave the pinctrl registers in, so they should be explicitly set by linux on boot. This patch adds a gpio configuration for drivers that need it, i.e. gpio-leds. Signed-off-by: Kyle Hendry --- .../900-bcm63268-gpio-pinctrl.patch | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 target/linux/bmips/patches-6.6/900-bcm63268-gpio-pinctrl.patch diff --git a/target/linux/bmips/patches-6.6/900-bcm63268-gpio-pinctrl.patch b/target/linux/bmips/patches-6.6/900-bcm63268-gpio-pinctrl.patch new file mode 100644 index 00000000000..62710dbdf4a --- /dev/null +++ b/target/linux/bmips/patches-6.6/900-bcm63268-gpio-pinctrl.patch @@ -0,0 +1,99 @@ +--- a/drivers/pinctrl/bcm/pinctrl-bcm63268.c ++++ b/drivers/pinctrl/bcm/pinctrl-bcm63268.c +@@ -38,6 +38,7 @@ enum bcm63268_pinctrl_reg { + BCM63268_MODE, + BCM63268_CTRL, + BCM63268_BASEMODE, ++ BCM63268_NOREG, + }; + + struct bcm63268_function { +@@ -242,6 +243,61 @@ static struct pingroup bcm63268_groups[] + BCM_PIN_GROUP(vdsl_phy3_grp), + }; + ++static const char * const gpio_groups[] = { ++ "gpio0", ++ "gpio1", ++ "gpio2", ++ "gpio3", ++ "gpio4", ++ "gpio5", ++ "gpio6", ++ "gpio7", ++ "gpio8", ++ "gpio9", ++ "gpio10", ++ "gpio11", ++ "gpio12", ++ "gpio13", ++ "gpio14", ++ "gpio15", ++ "gpio16", ++ "gpio17", ++ "gpio18", ++ "gpio19", ++ "gpio20", ++ "gpio21", ++ "gpio22", ++ "gpio23", ++ "gpio24", ++ "gpio25", ++ "gpio26", ++ "gpio27", ++ "gpio28", ++ "gpio29", ++ "gpio30", ++ "gpio31", ++ "gpio32", ++ "gpio33", ++ "gpio34", ++ "gpio35", ++ "gpio36", ++ "gpio37", ++ "gpio38", ++ "gpio39", ++ "gpio40", ++ "gpio41", ++ "gpio42", ++ "gpio43", ++ "gpio44", ++ "gpio45", ++ "gpio46", ++ "gpio47", ++ "gpio48", ++ "gpio49", ++ "gpio50", ++ "gpio51", ++}; ++ + static const char * const led_groups[] = { + "gpio0", + "gpio1", +@@ -427,7 +483,16 @@ static const char * const vdsl_phy_overr + .mask = val, \ + } + ++#define BCM63268_NOMODE_FUN(n) \ ++ { \ ++ .name = #n, \ ++ .groups = n##_groups, \ ++ .num_groups = ARRAY_SIZE(n##_groups), \ ++ .reg = BCM63268_NOREG, \ ++ } ++ + static const struct bcm63268_function bcm63268_funcs[] = { ++ BCM63268_NOMODE_FUN(gpio), + BCM63268_LED_FUN(led), + BCM63268_MODE_FUN(serial_led_clk), + BCM63268_MODE_FUN(serial_led_data), +@@ -562,6 +627,9 @@ static int bcm63268_pinctrl_set_mux(stru + mask = f->mask; + val = f->mask; + break; ++ case BCM63268_NOREG: ++ /*Do nothing, leave regs as default*/ ++ break; + default: + WARN_ON(1); + return -EINVAL;