From ed50fbf1b8661972a183ef237b95233a87d7cde6 Mon Sep 17 00:00:00 2001 From: Nan Li Date: Thu, 14 Feb 2019 10:43:31 +0800 Subject: [PATCH] sd: add sduart not supported flag [1/1] PD#SWPL-4858 Problem: tl1 not support sduart Solution: add not supported flag in match_data Verify: verify by tl1 skt Change-Id: I651765433bb62892fad770c85a5eccd4805e7c79 Signed-off-by: Nan Li --- arch/arm/boot/dts/amlogic/tl1_pxp.dts | 1 + arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts | 1 + drivers/amlogic/mmc/amlsd.c | 4 ++-- drivers/amlogic/mmc/amlsd_of.c | 2 ++ include/linux/amlogic/sd.h | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/amlogic/tl1_pxp.dts b/arch/arm/boot/dts/amlogic/tl1_pxp.dts index c2adf2a..35e106a 100644 --- a/arch/arm/boot/dts/amlogic/tl1_pxp.dts +++ b/arch/arm/boot/dts/amlogic/tl1_pxp.dts @@ -692,6 +692,7 @@ f_min = <400000>; f_max = <200000000>; max_req_size = <0x20000>; /**128KB*/ + no_sduart = <1>; gpio_dat3 = <&gpio GPIOC_3 GPIO_ACTIVE_HIGH>; jtag_pin = <&gpio GPIOC_0 GPIO_ACTIVE_HIGH>; gpio_cd = <&gpio GPIOC_10 GPIO_ACTIVE_HIGH>; diff --git a/arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts b/arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts index 1e7be0e..cb4e7ef 100644 --- a/arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts +++ b/arch/arm/boot/dts/amlogic/tl1_t962x2_skt.dts @@ -1151,6 +1151,7 @@ f_min = <400000>; f_max = <200000000>; max_req_size = <0x20000>; /**128KB*/ + no_sduart = <1>; gpio_dat3 = <&gpio GPIOC_3 GPIO_ACTIVE_HIGH>; jtag_pin = <&gpio GPIOC_0 GPIO_ACTIVE_HIGH>; gpio_cd = <&gpio GPIOC_10 GPIO_ACTIVE_HIGH>; diff --git a/drivers/amlogic/mmc/amlsd.c b/drivers/amlogic/mmc/amlsd.c index 854c9ca..f5976de 100644 --- a/drivers/amlogic/mmc/amlsd.c +++ b/drivers/amlogic/mmc/amlsd.c @@ -850,7 +850,7 @@ int aml_sd_uart_detect(struct amlsd_platform *pdata) return 1; pdata->is_in = true; pdata->gpio_cd_sta = true; - if ((host->data->chip_type < MMC_CHIP_TL1) + if ((!pdata->no_sduart) && aml_is_sduart(pdata)) { aml_uart_switch(pdata, 1); pr_info("Uart in\n"); @@ -891,7 +891,7 @@ int aml_sd_uart_detect(struct amlsd_platform *pdata) host->is_sduart = 0; if (mmc && mmc->card) mmc_card_set_removed(mmc->card); - if (host->data->chip_type < MMC_CHIP_TL1) { + if (!pdata->no_sduart) { aml_uart_switch(pdata, 0); aml_jtag_switch_ao(pdata); } diff --git a/drivers/amlogic/mmc/amlsd_of.c b/drivers/amlogic/mmc/amlsd_of.c index fc093ed..a117ef5 100644 --- a/drivers/amlogic/mmc/amlsd_of.c +++ b/drivers/amlogic/mmc/amlsd_of.c @@ -187,6 +187,8 @@ int amlsd_get_platform_data(struct platform_device *pdev, str, pdata->gpio_power); SD_PARSE_U32_PROP_DEC(child, "calc_f", prop, pdata->calc_f); + SD_PARSE_U32_PROP_DEC(child, "no_sduart", + prop, pdata->no_sduart); SD_PARSE_U32_PROP_DEC(child, "gpio_cd_level", prop, pdata->gpio_cd_level); diff --git a/include/linux/amlogic/sd.h b/include/linux/amlogic/sd.h index ac78c36..cae0a23 100644 --- a/include/linux/amlogic/sd.h +++ b/include/linux/amlogic/sd.h @@ -297,6 +297,7 @@ struct amlsd_platform { unsigned int gpio_power; unsigned int power_level; unsigned int calc_f; + unsigned int no_sduart; unsigned int auto_clk_close; unsigned int vol_switch; -- 2.7.4