linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: "Benoît Cousson" <bcousson@baylibre.com>,
	"Tony Lindgren" <tony@atomide.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Kalle Valo" <kvalo@codeaurora.org>,
	"Mike Rapoport" <rppt@linux.ibm.com>,
	"David Sterba" <dsterba@suse.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	"Petr Mladek" <pmladek@suse.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"H. Nikolaus Schaller" <hns@goldelico.com>,
	"Kefeng Wang" <wangkefeng.wang@huawei.com>,
	"Yangtao Li" <tiny.windzz@gmail.com>,
	"Alexios Zavras" <alexios.zavras@intel.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Allison Randal" <allison@lohutok.net>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"John Stultz" <john.stultz@linaro.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>
Cc: linux-omap@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	letux-kernel@openphoenux.org, kernel@pyra-handheld.com,
	stable@vger.kernel.org
Subject: [PATCH 4/9] mmc: host: omap_hsmmc: add code for special init of wl1251 to get rid of pandora_wl1251_init_card
Date: Fri, 18 Oct 2019 22:25:25 +0200	[thread overview]
Message-ID: <347c23983a727a88c80179c7d7611d9b39e83e9d.1571430329.git.hns@goldelico.com> (raw)
In-Reply-To: <cover.1571430329.git.hns@goldelico.com>

Pandora_wl1251_init_card was used to do special pdata based
setup of the sdio mmc interface. This does no longer work with
v4.7 and later. A fix requires a device tree based mmc3 setup.

Therefore we move the special setup to omap_hsmmc.c instead
of calling some pdata supplied init_card function.

The new code checks for a DT child node compatible to wl1251
so it will not affect other MMC3 use cases.

Fixes: 81eef6ca9201 ("mmc: omap_hsmmc: Use dma_request_chan() for requesting DMA channel")

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Cc: <stable@vger.kernel.org> # 4.7.0
---
 drivers/mmc/host/omap_hsmmc.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 952fa4063ff8..03ba80bcf319 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1512,6 +1512,27 @@ static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card)
 
 	if (mmc_pdata(host)->init_card)
 		mmc_pdata(host)->init_card(card);
+	else if (card->type == MMC_TYPE_SDIO || card->type == MMC_TYPE_SD_COMBO) {
+		struct device_node *np = mmc_dev(mmc)->of_node;
+
+		np = of_get_compatible_child(np, "ti,wl1251");
+		if (np) {
+			/*
+			 * We have TI wl1251 attached to MMC3. Pass this information to
+			 * SDIO core because it can't be probed by normal methods.
+			 */
+
+			dev_info(host->dev, "found wl1251\n");
+			card->quirks |= MMC_QUIRK_NONSTD_SDIO;
+			card->cccr.wide_bus = 1;
+			card->cis.vendor = 0x104c;
+			card->cis.device = 0x9066;
+			card->cis.blksize = 512;
+			card->cis.max_dtr = 24000000;
+			card->ocr = 0x80;
+			of_node_put(np);
+		}
+	}
 }
 
 static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
-- 
2.19.1


  parent reply	other threads:[~2019-10-18 20:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 20:25 [PATCH 0/9] OpenPandora: make wl1251 connected to mmc3 sdio port of OpenPandora work again H. Nikolaus Schaller
2019-10-18 20:25 ` [PATCH 1/9] Documentation: dt: wireless: update wl1251 for sdio H. Nikolaus Schaller
2019-10-18 20:25 ` [PATCH 2/9] net: wireless: ti: wl1251 add device tree support H. Nikolaus Schaller
2019-10-18 20:25 ` [PATCH 3/9] DTS: ARM: pandora-common: define wl1251 as child node of mmc3 H. Nikolaus Schaller
2019-10-21 17:13   ` Tony Lindgren
2019-10-21 18:22     ` H. Nikolaus Schaller
2019-10-18 20:25 ` H. Nikolaus Schaller [this message]
2019-10-18 20:25 ` [PATCH 5/9] omap: pdata-quirks: remove openpandora quirks for mmc3 and wl1251 H. Nikolaus Schaller
2019-10-18 20:25 ` [PATCH 6/9] mmc: sdio: fix wl1251 vendor id H. Nikolaus Schaller
2019-10-18 20:25 ` [PATCH 7/9] mmc: core: fix wl1251 sdio quirks H. Nikolaus Schaller
2019-10-18 20:25 ` [PATCH 8/9] net: wireless: ti: wl1251 use new SDIO_VENDOR_ID_TI_WL1251 definition H. Nikolaus Schaller
2019-10-18 20:25 ` [PATCH 9/9] net: wireless: ti: remove local VENDOR_ID and DEVICE_ID definitions H. Nikolaus Schaller
2019-10-19 11:06 ` [PATCH 0/9] OpenPandora: make wl1251 connected to mmc3 sdio port of OpenPandora work again Kalle Valo
2019-10-19 11:25   ` H. Nikolaus Schaller
2019-10-19 11:34     ` Kalle Valo

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=347c23983a727a88c80179c7d7611d9b39e83e9d.1571430329.git.hns@goldelico.com \
    --to=hns@goldelico.com \
    --cc=alexios.zavras@intel.com \
    --cc=allison@lohutok.net \
    --cc=bcousson@baylibre.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dsterba@suse.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.stultz@linaro.org \
    --cc=kernel@pyra-handheld.com \
    --cc=kvalo@codeaurora.org \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=robh+dt@kernel.org \
    --cc=rppt@linux.ibm.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tiny.windzz@gmail.com \
    --cc=tony@atomide.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wangkefeng.wang@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).