Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9b03421 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Chris Ball
Browse files

mmc: tmio: remove work-around for unmasked SDIO interrupts



SDIO IRQs got unmasked on sh-mobile while writing to the
CTL_CLK_AND_WAIT_CTL register, because that register at address 0x138
is not implemented on those SoCs and writes to it overwrite the
register at address 0x38: CTL_SDIO_IRQ_MASK. Previous patches
eliminated access to register above 0xff on sh-mobile, so that this
work-around isn't needed anymore.

Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: default avatarPaul Mundt <lethal@linux-sh.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent d80e9221
Loading
Loading
Loading
Loading
+2 −21
Original line number Original line Diff line number Diff line
@@ -208,26 +208,14 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)


static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
{
{
	struct tmio_mmc_data *pdata = host->pdata;
	struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
	struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);


	/*
	 * Testing on sh-mobile showed that SDIO IRQs are unmasked when
	 * CTL_CLK_AND_WAIT_CTL gets written, so we have to disable the
	 * device IRQ here and restore the SDIO IRQ mask before
	 * re-enabling the device IRQ.
	 */
	if (pdata->flags & TMIO_MMC_SDIO_IRQ)
		disable_irq(host->irq);
	/* implicit BUG_ON(!res) */
	/* implicit BUG_ON(!res) */
	if (resource_size(res) > 0x100) {
	if (resource_size(res) > 0x100) {
		sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000);
		sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0000);
		msleep(10);
		msleep(10);
	}
	}
	if (pdata->flags & TMIO_MMC_SDIO_IRQ) {

		tmio_mmc_enable_sdio_irq(host->mmc, host->sdio_irq_enabled);
		enable_irq(host->irq);
	}
	sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~0x0100 &
	sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~0x0100 &
		sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
		sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
	msleep(10);
	msleep(10);
@@ -235,24 +223,17 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)


static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
static void tmio_mmc_clk_start(struct tmio_mmc_host *host)
{
{
	struct tmio_mmc_data *pdata = host->pdata;
	struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);
	struct resource *res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0);


	sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 |
	sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 |
		sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
		sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
	msleep(10);
	msleep(10);
	/* see comment in tmio_mmc_clk_stop above */

	if (pdata->flags & TMIO_MMC_SDIO_IRQ)
		disable_irq(host->irq);
	/* implicit BUG_ON(!res) */
	/* implicit BUG_ON(!res) */
	if (resource_size(res) > 0x100) {
	if (resource_size(res) > 0x100) {
		sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100);
		sd_ctrl_write16(host, CTL_CLK_AND_WAIT_CTL, 0x0100);
		msleep(10);
		msleep(10);
	}
	}
	if (pdata->flags & TMIO_MMC_SDIO_IRQ) {
		tmio_mmc_enable_sdio_irq(host->mmc, host->sdio_irq_enabled);
		enable_irq(host->irq);
	}
}
}


static void tmio_mmc_reset(struct tmio_mmc_host *host)
static void tmio_mmc_reset(struct tmio_mmc_host *host)