[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <26ca3e45-b89a-705a-5aa2-9c5f1a5e20db@foss.st.com>
Date: Mon, 4 Sep 2023 09:30:37 +0200
From: Yann Gautier <yann.gautier@...s.st.com>
To: Linus Walleij <linus.walleij@...aro.org>
CC: Ulf Hansson <ulf.hansson@...aro.org>,
Russell King <linux@...linux.org.uk>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Christophe Kerello <christophe.kerello@...s.st.com>,
Yang Yingliang <yangyingliang@...wei.com>,
Rob Herring <robh@...nel.org>, <linux-mmc@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] mmc: mmci: stm32: add SDIO in-band interrupt mode
On 9/2/23 18:43, Linus Walleij wrote:
> Hi Yann/Christophe,
>
> just a quick note:
>
> On Fri, Sep 1, 2023 at 2:08 PM Yann Gautier <yann.gautier@...s.st.com> wrote:
>
>> +static void sdmmc_enable_sdio_irq(struct mmci_host *host, int enable)
>> +{
>> + void __iomem *base = host->base;
>> + u32 mask = readl_relaxed(base + MMCIMASK0);
>> +
>> + if (enable)
>> + writel_relaxed(mask | MCI_ST_SDIOITMASK, base + MMCIMASK0);
>> + else
>> + writel_relaxed(mask & ~MCI_ST_SDIOITMASK, base + MMCIMASK0);
>> +}
>> +
>> +static void sdmmc_sdio_irq(struct mmci_host *host, u32 status)
>> +{
>> + if (status & MCI_ST_SDIOIT) {
>> + sdmmc_enable_sdio_irq(host, 0);
>> + sdio_signal_irq(host->mmc);
>> + }
>> +}
>
> You need to move these to mmci and rename them since Ux500 will use
> the same callbacks.
Hi Linus,
Yes, that's what I was planning to do.
>
>> static struct mmci_host_ops sdmmc_variant_ops = {
>> .validate_data = sdmmc_idma_validate_data,
> (...)
>> + .enable_sdio_irq = sdmmc_enable_sdio_irq,
>> + .sdio_irq = sdmmc_sdio_irq,
>> };
>
> What about dropping the per-variant callbacks and just inline
> this into mmci_enable_sdio_irq()/mmci_ack_sdio_irq() since
> so many variants have the same scheme? I haven't looked
> at the Qualcomm variant though, maybe it is completely
> different...
I'm not sure about this. Keeping the ops will make it easier for other
variants to bring their own code if their scheme is different.
Best regards,
Yann
>
> Yours,
> Linus Walleij
Powered by blists - more mailing lists