public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: richard clark <richard.xnu.clark@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	ulf.hansson@linaro.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] sdhci: Fix SD card detection issue
Date: Mon, 15 Apr 2024 09:23:11 +0100	[thread overview]
Message-ID: <Zhzj7+nm8q03+p4g@shell.armlinux.org.uk> (raw)
In-Reply-To: <CAJNi4rO16FDmRUCWyK=+DF5TbfryJLsX3VUN3j1mAeas7Rh84w@mail.gmail.com>

On Mon, Apr 15, 2024 at 04:17:14PM +0800, richard clark wrote:
> On Mon, Apr 15, 2024 at 3:22 PM Russell King (Oracle)
> <linux@armlinux.org.uk> wrote:
> >
> > On Mon, Apr 15, 2024 at 10:18:39AM +0300, Adrian Hunter wrote:
> > > On 15/04/24 10:06, Richard Clark wrote:
> > > > The mmc_gpio_get_cd(...) will return 0 called from sdhci_get_cd(...), which means
> > > > the card is not present. Actually, the card detection pin is active low by default
> > > > according to the SDHCI psec, thus the card detection result is not correct, more
> > >
> > > SDHCI spec covers the SDHCI lines.  GPIO is separate.
> >
> > ... and the key bit of information that should be mentioned is in the
> > case of a GPIO, the GPIO library can be told if a GPIO is active-high
> > or active-low in either firmware or via the GPIO lookup data, and this
> > should be used instead of drivers inventing their own "quirking".
> >
> Agree! But unfortunately, it seems I can't find the right place to
> handle this from either firmware or via the GPIO lookup data. Will be
> appreciated if any suggestion about that?!

If you're using DT, then, for example:

        cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;

is all it takes. If you are using firmware then GPIO lookup data isn't
what you should be using. I'm afraid I don't know the ACPI bindings for
SDHCI.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2024-04-15  8:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15  7:06 [PATCH] sdhci: Fix SD card detection issue Richard Clark
2024-04-15  7:18 ` Adrian Hunter
2024-04-15  7:22   ` Russell King (Oracle)
2024-04-15  8:17     ` richard clark
2024-04-15  8:23       ` Russell King (Oracle) [this message]
2024-04-16  2:15         ` richard clark
2024-04-15  8:11   ` richard clark
2024-04-15  9:35     ` Adrian Hunter

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=Zhzj7+nm8q03+p4g@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=adrian.hunter@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=richard.xnu.clark@gmail.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