On Thu, Apr 18 2019, Chaotian Jing wrote:

> On Tue, 2019-04-16 at 14:47 +1000, NeilBrown wrote:
>> The mtk-sd silicon has integrated card-detect logic that is
>> enabled, at least, on the MT7621 as used in the GNUBEE NAS.
>> 
>> If the sdhci isn't marked non-removable and doesn't have a
>> cd-gpio configured, assume the internal cd logic should be used.
>> 
>> Signed-off-by: NeilBrown <n...@brown.name>
...

>> @@ -2206,6 +2247,15 @@ static int msdc_drv_probe(struct platform_device 
>> *pdev)
>>              goto host_free;
>>      }
>>  
>> +    if (!(mmc->caps & MMC_CAP_NONREMOVABLE) &&
>> +        !mmc_can_gpio_cd(mmc)) {
>
> Should not do this assume!
> better to add "mediatek,internal-cd" in your DTS, then no impact to
> other Soc.

(Sorry for the delay).

Documentation/devicetree/bindings/mmc/mmc.txt

says:
   If no property below is supplied, host native card detect is used.

So this assumption is *exactly* what the documentation said we should
do.

How about I limit this assumption to mt7621 using a flag in the
mtk_mmc_compatible structure?

Thanks,
NeilBrown

Attachment: signature.asc
Description: PGP signature

Reply via email to