Commit da012e1e authored by Wolfram Sang's avatar Wolfram Sang Committed by Ulf Hansson
Browse files

mmc: rename mmc_can_gpio_cd() to mmc_host_can_gpio_cd()



mmc_can_* functions sometimes relate to the card and sometimes to the host.
Make it obvious by renaming this function to include 'host'.

Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250401095847.29271-11-wsa+renesas@sang-engineering.com


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent b89d05f6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -228,13 +228,13 @@ int mmc_gpiod_set_cd_config(struct mmc_host *host, unsigned long config)
}
EXPORT_SYMBOL(mmc_gpiod_set_cd_config);

bool mmc_can_gpio_cd(struct mmc_host *host)
bool mmc_host_can_gpio_cd(struct mmc_host *host)
{
	struct mmc_gpio *ctx = host->slot.handler_priv;

	return ctx->cd_gpio ? true : false;
}
EXPORT_SYMBOL(mmc_can_gpio_cd);
EXPORT_SYMBOL(mmc_host_can_gpio_cd);

/**
 * mmc_gpiod_request_ro - request a gpio descriptor for write protection
+3 −3
Original line number Diff line number Diff line
@@ -3622,7 +3622,7 @@ int dw_mci_runtime_suspend(struct device *dev)
	clk_disable_unprepare(host->ciu_clk);

	if (host->slot &&
	    (mmc_can_gpio_cd(host->slot->mmc) ||
	    (mmc_host_can_gpio_cd(host->slot->mmc) ||
	     !mmc_card_is_removable(host->slot->mmc)))
		clk_disable_unprepare(host->biu_clk);

@@ -3636,7 +3636,7 @@ int dw_mci_runtime_resume(struct device *dev)
	struct dw_mci *host = dev_get_drvdata(dev);

	if (host->slot &&
	    (mmc_can_gpio_cd(host->slot->mmc) ||
	    (mmc_host_can_gpio_cd(host->slot->mmc) ||
	     !mmc_card_is_removable(host->slot->mmc))) {
		ret = clk_prepare_enable(host->biu_clk);
		if (ret)
@@ -3690,7 +3690,7 @@ int dw_mci_runtime_resume(struct device *dev)

err:
	if (host->slot &&
	    (mmc_can_gpio_cd(host->slot->mmc) ||
	    (mmc_host_can_gpio_cd(host->slot->mmc) ||
	     !mmc_card_is_removable(host->slot->mmc)))
		clk_disable_unprepare(host->biu_clk);

+1 −1
Original line number Diff line number Diff line
@@ -3034,7 +3034,7 @@ static int msdc_drv_probe(struct platform_device *pdev)
		mmc->f_min = DIV_ROUND_UP(host->src_clk_freq, 4 * 4095);

	if (!(mmc->caps & MMC_CAP_NONREMOVABLE) &&
	    !mmc_can_gpio_cd(mmc) &&
	    !mmc_host_can_gpio_cd(mmc) &&
	    host->dev_comp->use_internal_cd) {
		/*
		 * Is removable but no GPIO declared, so
+2 −2
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ static void sdhci_set_card_detection(struct sdhci_host *host, bool enable)
	u32 present;

	if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) ||
	    !mmc_card_is_removable(host->mmc) || mmc_can_gpio_cd(host->mmc))
	    !mmc_card_is_removable(host->mmc) || mmc_host_can_gpio_cd(host->mmc))
		return;

	if (enable) {
@@ -3744,7 +3744,7 @@ static bool sdhci_cd_irq_can_wakeup(struct sdhci_host *host)
{
	return mmc_card_is_removable(host->mmc) &&
	       !(host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
	       !mmc_can_gpio_cd(host->mmc);
	       !mmc_host_can_gpio_cd(host->mmc);
}

/*
+1 −1
Original line number Diff line number Diff line
@@ -791,7 +791,7 @@ static int spmmc_get_cd(struct mmc_host *mmc)
{
	int ret = 0;

	if (mmc_can_gpio_cd(mmc))
	if (mmc_host_can_gpio_cd(mmc))
		ret = mmc_gpio_get_cd(mmc);

	if (ret < 0)
Loading