Hi Andy, On 4/10/24 10:06 PM, Andy Shevchenko wrote: > On Wed, Apr 10, 2024 at 09:16:39PM +0200, Hans de Goede wrote: >> The card-detect GPIO for the microSD slot on Asus T100TA / T100TAM models >> stopped working under Linux after commit 6fd03f024828 ("gpiolib: acpi: >> support bias pull disable"). >> >> The GPIO in question is connected to a mechanical switch in the slot >> which shorts the pin to GND when a card is inserted. >> >> The GPIO pin correctly gets configured with a 20K pull-up by the BIOS, >> but there is a bug in the DSDT where the GpioInt for the card-detect is >> configured with a PullNone setting: >> >> GpioInt (Edge, ActiveBoth, SharedAndWake, PullNone, 0x2710, >> "\\_SB.GPO0", 0x00, ResourceConsumer, , >> ) >> { // Pin list >> 0x0026 >> } >> >> Linux now actually honors the PullNone setting and disables the 20K pull-up >> configured by the BIOS. >> >> Add a new DMI_QUIRK_SD_CD_ENABLE_PULL_UP quirk which when set calls >> mmc_gpiod_set_cd_config() to re-enable the pull-up and set this for >> the Asus T100TA models to fix this. > > ... > >> + mmc_gpiod_set_cd_config(host->mmc, >> + PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 20000)); > > > Just noticed, the PIN_CONF_PACKED() is a helper for pinconf-generic.h. It seems > unusual to use it directly, and AFAIU documentation, it's for static > initialisations, however it's not explicitly said. I saw the static vs runtime comment, but I assumed that applies to the parameters passed to PIN_CONF_PACKED() being determined at runtime (not the cases here) vs the parameters being static / const. Regards, Hans