Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Kevin Hilman <khilman@baylibre.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"open list:ARM/Amlogic Meson..."
	<linux-amlogic@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/2] mmc: core: support platform interrupt as card detect interrupt
Date: Tue, 14 Feb 2023 08:45:30 +0100	[thread overview]
Message-ID: <fc9bc263-5dbb-7db3-cd23-f0351138fc47@gmail.com> (raw)
In-Reply-To: <CAPDyKFoeeof8G=AY4Z_CE4di4xUu8L9JT3UDYtPW6UVyTg1L=g@mail.gmail.com>

On 13.02.2023 23:46, Ulf Hansson wrote:
> On Mon, 30 Jan 2023 at 00:10, Heiner Kallweit <hkallweit1@gmail.com> wrote:
>>
>> On certain platforms like Amlogic Meson gpiod_to_irq() isn't supported
>> due to the design of gpio / interrupt controller. Therefore provide an
>> option to specify the cd interrupt e.g. by device tree. The host
>> controller can store the interrupt in cd_irq for use by
>> mmc_gpiod_request_cd_irq().
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>>  drivers/mmc/core/slot-gpio.c | 2 +-
>>  include/linux/mmc/host.h     | 1 +
>>  2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c
>> index dd2a4b6ab..69c22a997 100644
>> --- a/drivers/mmc/core/slot-gpio.c
>> +++ b/drivers/mmc/core/slot-gpio.c
>> @@ -99,7 +99,7 @@ void mmc_gpiod_request_cd_irq(struct mmc_host *host)
>>          * IRQ number is already used by another unit and cannot be shared.
>>          */
>>         if (!(host->caps & MMC_CAP_NEEDS_POLL))
>> -               irq = gpiod_to_irq(ctx->cd_gpio);
>> +               irq = host->cd_irq > 0 ? host->cd_irq : gpiod_to_irq(ctx->cd_gpio);
>>
>>         if (irq >= 0) {
>>                 if (!ctx->cd_gpio_isr)
>> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
>> index 8fdd3cf97..e998e919e 100644
>> --- a/include/linux/mmc/host.h
>> +++ b/include/linux/mmc/host.h
>> @@ -470,6 +470,7 @@ struct mmc_host {
>>
>>         struct delayed_work     detect;
>>         int                     detect_change;  /* card detect flag */
>> +       int                     cd_irq;         /* for use by mmc_gpiod_request_cd_irq */
> 
> Rather than putting this in the struct mmc_host, I would prefer to
> keep it more internal to the mmc core/slot code.
> 
> That said, what do you think of moving this into the struct mmc_gpio
> instead? Of course, that also means that we need to add new slot gpio
> helper that users can call to set the corresponding value for the
> cd_irq.
> 
> Would that be okay to you?
> 
Yes, that's the better approach.

>>         struct mmc_slot         slot;
>>
>>         const struct mmc_bus_ops *bus_ops;      /* current bus driver */
> 
> Kind regards
> Uffe


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2023-02-14  7:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-29 23:02 [PATCH 0/2] mmc: meson-gx: support platform interrupt as card detect interrupt Heiner Kallweit
2023-01-29 23:04 ` [PATCH 1/2] mmc: core: " Heiner Kallweit
2023-02-13 22:46   ` Ulf Hansson
2023-02-14  7:45     ` Heiner Kallweit [this message]
2023-01-29 23:10 ` [PATCH 2/2] mmc: meson-gx: " Heiner Kallweit
2023-01-30 11:06   ` Neil Armstrong
2023-01-30 19:04     ` Heiner Kallweit
2023-02-13 22:47   ` Ulf Hansson
2023-02-14  6:39     ` Heiner Kallweit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fc9bc263-5dbb-7db3-cd23-f0351138fc47@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox