Re: [PATCH v3 6/6] mmc: sdhci-acpi: Add quirk to enable pull-up on the card-detect GPIO on Asus T100TA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Hence, I suggest to use pinconf_to_config_packed() as others do for
the run-time code.

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux