1 --- a/drivers/mmc/host/mtk-mmc/sd.c
2 +++ b/drivers/mmc/host/mtk-mmc/sd.c
3 @@ -195,7 +195,7 @@ struct msdc_hw msdc0_hw = {
7 - .flags = MSDC_SYS_SUSPEND | MSDC_WP_PIN_EN | MSDC_CD_PIN_EN | MSDC_REMOVABLE | MSDC_HIGHSPEED,
8 + .flags = MSDC_SYS_SUSPEND | MSDC_CD_PIN_EN | MSDC_REMOVABLE | MSDC_HIGHSPEED,
9 // .flags = MSDC_SYS_SUSPEND | MSDC_WP_PIN_EN | MSDC_CD_PIN_EN | MSDC_REMOVABLE,
12 @@ -2746,6 +2746,9 @@ static int msdc_drv_probe(struct platfor
15 pdev->dev.platform_data = &msdc0_hw;
17 + if (of_property_read_bool(pdev->dev.of_node, "mtk,wp-en"))
18 + msdc0_hw.flags |= MSDC_WP_PIN_EN;
20 /* Allocate MMC host for this device */
21 mmc = mmc_alloc_host(sizeof(struct msdc_host), &pdev->dev);