Inverting MicroSD card detect logic

Hi,

Unfortunately the logic on a new carrier board microSD card-detect input to the TX2 (GPIO_EDP2) is inverted. This means that GPIO_EDP2 is floating (and pulled up by the TX2) when an SD card is inserted and grounded when ejected. The result of this is that the TX2 will start supplying power to the microSD card slot, when the card is NOT inserted.

Is there any means to invert this logic in software or is this functionality embedded deep within the system?

Many thanks,
Josh

Hi,

There is a property “cd-inverted”, please add it in your device tree under corresponding sdmmc controller.

Many thanks Wayne, worked perfectly.

I also encountered this problem. Adding or deleting the “cd-inverted” attribute in the DTS has no effect.
When the SD card is pulled out, it shows:
[ 2843.964285] mmc2: Enabling vmmc regulator
[ 2844.246548] mmc2: host does not support reading read-only switch, assuming write-enable
[ 2844.258477] mmc2: new high speed SDHC card at address 59b4
[ 2844.260022] mmcblk2: mmc2:59b4 SD 7.51 GiB
[ 2844.262335] mmcblk2: p1
Insert the sd card to display:
[ 2894.898303] mmc2: Disabling vmmc regulator
[ 2894.898652] mmc2: card 59b4 removed

Hi qulei159,

Please help to open a new topic if it’s still an issue. Thanks