MMC core:

- Allow non-sleeping read-only slot-gpio
 
 MMC host:
  - sdhci-pci-o2micro: Fix a warm reboot BIOS issue
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAmXGHa4XHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCmGGw/+Nz/YsApRWv2UigkK0iRYtowT
 XBmv5QaSN1iX9WkLG0S9BpuQVQFsPOglKbZX+p03AGD+ztYz2fwsJ807oaFlOkxy
 VzlYHAkKC0ELqwN81By1UErxyjxAsxe084JASQlO1Q4ibQ7rosXg0zwW1zxZly0F
 YFpd94a1wAZFl3Diq52iO/qidBSzCZ6JLuxKACRloNpeTVi5JSv9PMrliOCPd+cc
 99VAZyqYQ1fZ0Tge8U/gHBOb5yY3Np4K7SOMT/kta3BrvaCLvN0WgoGKXTfzdOOx
 W2sdbl4dorYClKQhpfH+wpszXfyjaSkxpEiBRojM8Z7DROMdJjyE1LzUTeBaC97N
 NJj9gfJCLvakoUPnjZwf2gpDuP/6v+2Kf44oxF6Vp8o5zqv4l3ytllvRT+ExHzcV
 fOw0pdGXndLfeg7pgRjJoPEPIkmosVm33LgoOMXmnF+Kyi8jJN3/8m2TbSUwluIk
 kEvIKpe0rlq+qo2HvuuA62yrRzN09eh+3alHVFMxPp4xyAqT4mcf2qmXBKf31Po7
 p+aFpIqE7tkhrKOBnJwN7mywI4gJ6JQi98ng9YdtykOZivZ0CdAYbD9j9j7/M1+g
 31u329nEoZnigrvChqlpczIwKBkIDKC6NvBCo826OcmsQZRnARGY2Z/zM2t+S3zY
 Uskd3ooZskQqjcRnZwM=
 =lPmp
 -----END PGP SIGNATURE-----

Merge tag 'mmc-v6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:
 "MMC core:
   - Allow non-sleeping read-only slot-gpio

  MMC host:
   - sdhci-pci-o2micro: Fix a warm reboot BIOS issue"

* tag 'mmc-v6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: slot-gpio: Allow non-sleeping GPIO ro
  mmc: sdhci-pci-o2micro: Fix a warm reboot issue that disk can't be detected by BIOS
This commit is contained in:
Linus Torvalds 2024-02-09 10:33:54 -08:00
commit eb747bcc36
2 changed files with 35 additions and 1 deletions

View File

@ -75,11 +75,15 @@ EXPORT_SYMBOL(mmc_gpio_set_cd_irq);
int mmc_gpio_get_ro(struct mmc_host *host)
{
struct mmc_gpio *ctx = host->slot.handler_priv;
int cansleep;
if (!ctx || !ctx->ro_gpio)
return -ENOSYS;
return gpiod_get_value_cansleep(ctx->ro_gpio);
cansleep = gpiod_cansleep(ctx->ro_gpio);
return cansleep ?
gpiod_get_value_cansleep(ctx->ro_gpio) :
gpiod_get_value(ctx->ro_gpio);
}
EXPORT_SYMBOL(mmc_gpio_get_ro);

View File

@ -693,6 +693,35 @@ static int sdhci_pci_o2_init_sd_express(struct mmc_host *mmc, struct mmc_ios *io
return 0;
}
static void sdhci_pci_o2_set_power(struct sdhci_host *host, unsigned char mode, unsigned short vdd)
{
struct sdhci_pci_chip *chip;
struct sdhci_pci_slot *slot = sdhci_priv(host);
u32 scratch_32 = 0;
u8 scratch_8 = 0;
chip = slot->chip;
if (mode == MMC_POWER_OFF) {
/* UnLock WP */
pci_read_config_byte(chip->pdev, O2_SD_LOCK_WP, &scratch_8);
scratch_8 &= 0x7f;
pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch_8);
/* Set PCR 0x354[16] to switch Clock Source back to OPE Clock */
pci_read_config_dword(chip->pdev, O2_SD_OUTPUT_CLK_SOURCE_SWITCH, &scratch_32);
scratch_32 &= ~(O2_SD_SEL_DLL);
pci_write_config_dword(chip->pdev, O2_SD_OUTPUT_CLK_SOURCE_SWITCH, scratch_32);
/* Lock WP */
pci_read_config_byte(chip->pdev, O2_SD_LOCK_WP, &scratch_8);
scratch_8 |= 0x80;
pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch_8);
}
sdhci_set_power(host, mode, vdd);
}
static int sdhci_pci_o2_probe_slot(struct sdhci_pci_slot *slot)
{
struct sdhci_pci_chip *chip;
@ -1051,6 +1080,7 @@ static const struct sdhci_ops sdhci_pci_o2_ops = {
.set_bus_width = sdhci_set_bus_width,
.reset = sdhci_reset,
.set_uhs_signaling = sdhci_set_uhs_signaling,
.set_power = sdhci_pci_o2_set_power,
};
const struct sdhci_pci_fixes sdhci_o2 = {