@@ -204,12 +204,11 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
}
/* override forces default (active-low) polarity ... */
- if (override_active_level && !gpiod_is_active_low(desc))
- gpiod_toggle_active_low(desc);
-
+ if (override_active_level)
+ gpiod_set_active_low(desc);
/* ... or active-high */
- if (host->caps2 & MMC_CAP2_CD_ACTIVE_HIGH)
- gpiod_toggle_active_low(desc);
+ else if (host->caps2 & MMC_CAP2_CD_ACTIVE_HIGH)
+ gpiod_set_active_high(desc);
ctx->cd_gpio = desc;
@@ -256,7 +255,7 @@ int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
}
if (host->caps2 & MMC_CAP2_RO_ACTIVE_HIGH)
- gpiod_toggle_active_low(desc);
+ gpiod_set_active_high(desc);
ctx->ro_gpio = desc;