From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA50DCA9EC5 for ; Wed, 30 Oct 2019 16:02:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A52FB20679 for ; Wed, 30 Oct 2019 16:02:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="g63vcrfv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728346AbfJ3QCN (ORCPT ); Wed, 30 Oct 2019 12:02:13 -0400 Received: from mail-vk1-f196.google.com ([209.85.221.196]:41661 "EHLO mail-vk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727893AbfJ3Pvz (ORCPT ); Wed, 30 Oct 2019 11:51:55 -0400 Received: by mail-vk1-f196.google.com with SMTP id 70so596317vkz.8 for ; Wed, 30 Oct 2019 08:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MM8FYPP/M/qSGLzrMimtzxUAQYpF/zt1wu6EL2luqtE=; b=g63vcrfvchtAY5Rd4CuFqJnAncPsp38RdAVZRNM9WTGTq5FdrGZl2oMdK24C0ouZMv Zx3My7Upbfwkqdu1ZF5cDQ1kc66k/jp8wegkgxnQ/ALeyvgSeFHS/snQ/xWL75V7Phqp 4MalfrNRHwi4CpIylLOnmzj9sdkHNkEDYEmmwx+aVxrHD+QCV51Rzzl6vHtIJ3iMO30J kFpmzeq4jWbaxsqwIjDZZneLyXJaaJdjcH+c/BSSTf8iRjl2gNc5j54vOdQqJfw/rePZ P3cKjDCcYPbQxJlN9cpB5CkBmYD/3vyML4pHLz4SnMVneG80kChlnAC6NwFHN0uFm/d2 8DyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MM8FYPP/M/qSGLzrMimtzxUAQYpF/zt1wu6EL2luqtE=; b=YCBUZGQ2o+9Y9NoGD1ZEnCds9NSwwEWCgW+4YdSvS9BqLHWuAlfENsV5Te2P0xRWUc W8fCYhyydiDkSYQBzLkZLSQvhg+N+i9Ap6KaXvfLxe+2Da0GGdLlbkKOxhDXqgzr1+De Sf7U1oJwwCSM0t/uZxS1VdxM0eHXkfHCN2bW3Te9anCGMBH5ygx9T3CmvzdOBHidHyWS CLIDlGTahJGmx+VlFW74n9qpFHcGkpvuRO2aE6StPrpN/99+kcdQ5E1FEULZZYSlDW+m upnjHeltU3HniEGHsOY/TvOOM2xz6oJhLjA7ZN2f7bFO41o4lUNoxhupezRU9P7RcwT5 MVng== X-Gm-Message-State: APjAAAXczj0Xf1zvTuo/ySFYDLAIiEBRAgUT/fZHjSseYJ0Nd35Xp6LW ODaDIkeMd1b16/363XJuE0XYbVs9YXO1hSvXYf3zJA== X-Google-Smtp-Source: APXvYqyHupdgWHa7qCIjuf/ufG4zCQRus8URSrYdV3I3LkSUfaiNNDW1LPfNwtjXqRaPr+zQbaPiggFXKTik4rvlgIk= X-Received: by 2002:a1f:2f51:: with SMTP id v78mr15055854vkv.101.1572450713564; Wed, 30 Oct 2019 08:51:53 -0700 (PDT) MIME-Version: 1.0 References: <0887d84402f796d1e7361261b88ec6057fbb0065.1571510481.git.hns@goldelico.com> In-Reply-To: <0887d84402f796d1e7361261b88ec6057fbb0065.1571510481.git.hns@goldelico.com> From: Ulf Hansson Date: Wed, 30 Oct 2019 16:51:17 +0100 Message-ID: Subject: Re: [PATCH v2 04/11] mmc: host: omap_hsmmc: add code for special init of wl1251 to get rid of pandora_wl1251_init_card To: "H. Nikolaus Schaller" Cc: =?UTF-8?Q?Beno=C3=AEt_Cousson?= , Tony Lindgren , Rob Herring , Mark Rutland , Russell King , Kalle Valo , Mike Rapoport , David Sterba , "Rafael J. Wysocki" , Petr Mladek , Sakari Ailus , Kefeng Wang , Yangtao Li , Alexios Zavras , Thomas Gleixner , Allison Randal , Greg Kroah-Hartman , John Stultz , Bjorn Helgaas , linux-omap , DTML , Linux Kernel Mailing List , Linux ARM , "linux-mmc@vger.kernel.org" , linux-wireless , netdev , Discussions about the Letux Kernel , kernel@pyra-handheld.com, "# 4.0+" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 19 Oct 2019 at 20:42, H. Nikolaus Schaller wrote: > > 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 > Cc: # 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; These things should really be figured out by the mmc core during SDIO card initialization itself, not via the host ops ->init_card() callback. That is just poor hack, which in the long run should go away. Moreover, I think we should add a subnode to the host node in the DT, to describe the embedded SDIO card, rather than parsing the subnode for the SDIO func - as that seems wrong to me. To add a subnode for the SDIO card, we already have a binding that I think we should extend. Please have a look at Documentation/devicetree/bindings/mmc/mmc-card.txt. If you want an example of how to implement this for your case, do a git grep "broken-hpi" in the driver/mmc/core/, I think it will tell you more of what I have in mind. > + of_node_put(np); > + } > + } > } > > static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable) > -- > 2.19.1 > Kind regards Uffe