1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
4 * This file is created based on MT8196 Functional Specification
10 #include <soc/regulator.h>
12 static const struct pad_func sdcard_pins
[] = {
13 PAD_FUNC_DOWN(MSDC1_CLK
, MSDC1_CLK
),
14 PAD_FUNC_UP(MSDC1_CMD
, MSDC1_CMD
),
15 PAD_FUNC_UP(MSDC1_DAT0
, MSDC1_DAT0
),
16 PAD_FUNC_UP(MSDC1_DAT1
, MSDC1_DAT1
),
17 PAD_FUNC_UP(MSDC1_DAT2
, MSDC1_DAT2
),
18 PAD_FUNC_UP(MSDC1_DAT3
, MSDC1_DAT3
),
21 void mtk_msdc_configure_sdcard(void)
25 for (i
= 0; i
< ARRAY_SIZE(sdcard_pins
); i
++) {
26 gpio_set_mode(sdcard_pins
[i
].gpio
, sdcard_pins
[i
].func
);
27 gpio_set_pull(sdcard_pins
[i
].gpio
, GPIO_PULL_ENABLE
, sdcard_pins
[i
].select
);
28 gpio_set_driving(sdcard_pins
[i
].gpio
, GPIO_DRV_6_MA
);
31 /* enable SD card power */
32 mainboard_enable_regulator(MTK_REGULATOR_VMCH
, true);
33 mainboard_enable_regulator(MTK_REGULATOR_VMC
, true);
34 mainboard_set_regulator_voltage(MTK_REGULATOR_VMCH
, 3000000);
35 mainboard_set_regulator_voltage(MTK_REGULATOR_VMC
, 3000000);