MMC host:

- moxart: Fix big-endian conversion for SCR structure
  - sdhci-f-sdh30: Replace with sdhci_pltfm to fix PM support
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAmTQ1LMXHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCkbOg/9E2sGLuhf59o4F1DOzvbYc1/g
 jhTRNb5Cmtl3mFKM2XlGbPKhXggbXA9JrsuB6QpXmZky6pDbY5STvU2wd6ludGGx
 HZfmmrctBwN7VW8RSFj/S9K+rm2Enr159UXq3ghhyPjHSHWGmli/4guMKMuqzNJP
 vAfAEtBPvanHo7sYHoZinZEIIk55Z3doK67mn7mTBHpbZuxQStG8Kx5gIMjLp+ij
 2jT/VZn1zXheAwPjH73t9AI44OBIn81Hs0tbSI2YAoPWhLYvJTPnvtE4tuHD9FI1
 wVCBY8E4jpMWea7bOMdogPZ5qbBlgSJLQAmRB/9dz4iz2g6zEjNT9uens7axdYrc
 xWy6zgTeSVF0wGfMMSApwvp0uPUTy4+eHgbicR9FwOy4PwVgGBiD9pr21xpNP7Wf
 +5K3KZlx18sVCw/gEcEg7BQXRa02zJgv2K9tySywGg+GVB6y7Neksn4lFzWDF4qk
 xB8gUN2zCA0kS5ImTikXlRsTt7jCUJDFKhkKtw5XtQUTMmaD/1FA8hQVQST7fGXp
 sNZcN/ibRJrKtRbdL6mAhRg5jAV7oKDZXt/9b32t14xHmO3mlJFKxKSqPWHhR12w
 4B9st8k9Vi2vDxs9OIDWFDlsfgdNEiL2UfmzZ2P86l9NT8SUd4OKgC6vJ6PDWdzf
 TQr6LgLrzZ3xnymvpWs=
 =IjVa
 -----END PGP SIGNATURE-----

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

Pull MMC fixes from Ulf Hansson:

 - moxart: Fix big-endian conversion for SCR structure

 - sdhci-f-sdh30: Replace with sdhci_pltfm to fix PM support

* tag 'mmc-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: sdhci-f-sdh30: Replace with sdhci_pltfm
  mmc: moxart: read scr register without changing byte order
This commit is contained in:
Linus Torvalds 2023-08-07 10:08:55 -07:00
commit 016ce29713
2 changed files with 28 additions and 40 deletions

View File

@ -338,13 +338,7 @@ static void moxart_transfer_pio(struct moxart_host *host)
return;
}
for (len = 0; len < remain && len < host->fifo_width;) {
/* SCR data must be read in big endian. */
if (data->mrq->cmd->opcode == SD_APP_SEND_SCR)
*sgp = ioread32be(host->base +
REG_DATA_WINDOW);
else
*sgp = ioread32(host->base +
REG_DATA_WINDOW);
*sgp = ioread32(host->base + REG_DATA_WINDOW);
sgp++;
len += 4;
}

View File

@ -29,9 +29,16 @@ struct f_sdhost_priv {
bool enable_cmd_dat_delay;
};
static void *sdhci_f_sdhost_priv(struct sdhci_host *host)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
return sdhci_pltfm_priv(pltfm_host);
}
static void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host)
{
struct f_sdhost_priv *priv = sdhci_priv(host);
struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host);
u32 ctrl = 0;
usleep_range(2500, 3000);
@ -64,7 +71,7 @@ static unsigned int sdhci_f_sdh30_get_min_clock(struct sdhci_host *host)
static void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask)
{
struct f_sdhost_priv *priv = sdhci_priv(host);
struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host);
u32 ctl;
if (sdhci_readw(host, SDHCI_CLOCK_CONTROL) == 0)
@ -95,30 +102,32 @@ static const struct sdhci_ops sdhci_f_sdh30_ops = {
.set_uhs_signaling = sdhci_set_uhs_signaling,
};
static const struct sdhci_pltfm_data sdhci_f_sdh30_pltfm_data = {
.ops = &sdhci_f_sdh30_ops,
.quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC
| SDHCI_QUIRK_INVERTED_WRITE_PROTECT,
.quirks2 = SDHCI_QUIRK2_SUPPORT_SINGLE
| SDHCI_QUIRK2_TUNING_WORK_AROUND,
};
static int sdhci_f_sdh30_probe(struct platform_device *pdev)
{
struct sdhci_host *host;
struct device *dev = &pdev->dev;
int irq, ctrl = 0, ret = 0;
int ctrl = 0, ret = 0;
struct f_sdhost_priv *priv;
struct sdhci_pltfm_host *pltfm_host;
u32 reg = 0;
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
host = sdhci_alloc_host(dev, sizeof(struct f_sdhost_priv));
host = sdhci_pltfm_init(pdev, &sdhci_f_sdh30_pltfm_data,
sizeof(struct f_sdhost_priv));
if (IS_ERR(host))
return PTR_ERR(host);
priv = sdhci_priv(host);
pltfm_host = sdhci_priv(host);
priv = sdhci_pltfm_priv(pltfm_host);
priv->dev = dev;
host->quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC |
SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
host->quirks2 = SDHCI_QUIRK2_SUPPORT_SINGLE |
SDHCI_QUIRK2_TUNING_WORK_AROUND;
priv->enable_cmd_dat_delay = device_property_read_bool(dev,
"fujitsu,cmd-dat-delay-select");
@ -126,18 +135,6 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev)
if (ret)
goto err;
platform_set_drvdata(pdev, host);
host->hw_name = "f_sdh30";
host->ops = &sdhci_f_sdh30_ops;
host->irq = irq;
host->ioaddr = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(host->ioaddr)) {
ret = PTR_ERR(host->ioaddr);
goto err;
}
if (dev_of_node(dev)) {
sdhci_get_of_property(pdev);
@ -204,24 +201,21 @@ err_rst:
err_clk:
clk_disable_unprepare(priv->clk_iface);
err:
sdhci_free_host(host);
sdhci_pltfm_free(pdev);
return ret;
}
static int sdhci_f_sdh30_remove(struct platform_device *pdev)
{
struct sdhci_host *host = platform_get_drvdata(pdev);
struct f_sdhost_priv *priv = sdhci_priv(host);
sdhci_remove_host(host, readl(host->ioaddr + SDHCI_INT_STATUS) ==
0xffffffff);
struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host);
reset_control_assert(priv->rst);
clk_disable_unprepare(priv->clk);
clk_disable_unprepare(priv->clk_iface);
sdhci_free_host(host);
platform_set_drvdata(pdev, NULL);
sdhci_pltfm_unregister(pdev);
return 0;
}