[][kernel][mt7988][pinctrl][separate sdcard from emmc45]

[Description]
Add sdcard pinctrl group to mediatek mt7988 SoC.

We need 11 pins for emmc 4.5 and 12 pins for emmc 5.4, but if we just
use emmc as SD card controller, we only need MSDC0_CLK, MSDC0_CMD and
MSDC0_DATA0/1/2/3 which belong the subset of emmc 4.5 pins.

This patch add a new pinctrl group 'sdcard' to use fewer pins to make
sdcard works.

[Release-log]
N/A

Change-Id: Idc3e80929111abe6d8ddf384fb4894253359dd66
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6722624
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7988a-dsa-10g-sd.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7988a-dsa-10g-sd.dts
index 2b20e0b..0cf3d6c 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7988a-dsa-10g-sd.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7988a-dsa-10g-sd.dts
@@ -127,14 +127,14 @@
 	mmc0_pins_default: mmc0-pins-default {
 		mux {
 			function = "flash";
-			groups = "emmc_45";
+			groups = "sdcard";
 		};
 	};
 
 	mmc0_pins_uhs: mmc0-pins-uhs {
 		mux {
 			function = "flash";
-			groups = "emmc_45";
+			groups = "sdcard";
 		};
 	};
 };
diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7988a-gsw-10g-spim-nand.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7988a-gsw-10g-spim-nand.dts
index 3153b89..1f300dd 100644
--- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7988a-gsw-10g-spim-nand.dts
+++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7988a-gsw-10g-spim-nand.dts
@@ -232,14 +232,14 @@
 	mmc0_pins_default: mmc0-pins-default {
 		mux {
 			function = "flash";
-			groups = "emmc_45";
+			groups = "sdcard";
 		};
 	};
 
 	mmc0_pins_uhs: mmc0-pins-uhs {
 		mux {
 			function = "flash";
-			groups = "emmc_45";
+			groups = "sdcard";
 		};
 	};
 
diff --git a/target/linux/mediatek/files-5.4/drivers/pinctrl/mediatek/pinctrl-mt7988.c b/target/linux/mediatek/files-5.4/drivers/pinctrl/mediatek/pinctrl-mt7988.c
index fcb33a0..583ba90 100644
--- a/target/linux/mediatek/files-5.4/drivers/pinctrl/mediatek/pinctrl-mt7988.c
+++ b/target/linux/mediatek/files-5.4/drivers/pinctrl/mediatek/pinctrl-mt7988.c
@@ -933,6 +933,9 @@
 };
 static int mt7988_emmc_45_funcs[] = { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 };
 
+static int mt7988_sdcard_pins[] = { 32, 33, 34, 35, 36, 37 };
+static int mt7988_sdcard_funcs[] = { 5, 5, 5, 5, 5, 5 };
+
 static int mt7988_emmc_51_pins[] = { 38, 39, 40, 41, 42, 43,
 				     44, 45, 46, 47, 48, 49 };
 static int mt7988_emmc_51_funcs[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
@@ -1157,6 +1160,8 @@
 	PINCTRL_PIN_GROUP("udi", mt7988_udi),
 	/*  @GPIO(21,28,29,30,31,32,33,34,35,36,37) emmc_45 */
 	PINCTRL_PIN_GROUP("emmc_45", mt7988_emmc_45),
+	/*  @GPIO(32,33,34,35,36,37) sdcard */
+	PINCTRL_PIN_GROUP("sdcard", mt7988_sdcard),
 	/*  @GPIO(38,39,40,41,42,43,44,45,46,47,48,49) emmc_51 */
 	PINCTRL_PIN_GROUP("emmc_51", mt7988_emmc_51),
 	/*  @GPIO(28,29) 2p5g_ext_mdio */
@@ -1321,7 +1326,7 @@
 static const char * const mt7988_spi_groups[] = {
 	"spi0", "spi0_wp_hold", "spi1", "spi2", "spi2_wp_hold",
 };
-static const char * const mt7988_flash_groups[] = { "emmc_45", "snfi",
+static const char * const mt7988_flash_groups[] = { "emmc_45", "sdcard", "snfi",
 						    "emmc_51" };
 static const char * const mt7988_uart_groups[] = {
 	"uart2",