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.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 25BA2CA9EC5 for ; Wed, 30 Oct 2019 15:51:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E84B020856 for ; Wed, 30 Oct 2019 15:51:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DKHU7UlY"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="g63vcrfv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E84B020856 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/KvvVcv4m94ptBRCxdXUJ2WH6+Rg25vGDzDAHhWBkOo=; b=DKHU7UlYPQ4Dny URMQdSZq2zyqAUvFYdcFJkECegh4ZgUz092ggOTMsDlwOIchomL9ovzGmMMi+ZbJPNC4SA7vTUiP4 A+TOPGfsx7R+le5V2JMDA24t6xtptMEjsEMZ1iQFL4dUhwZdzQ4UFp/N1hYlDMkDRJLOHVrv2d6m0 W08uJWX0uYxLsxweQ/cp03VWRGijyFf/2vrbaP2E71UoVrV/2dj/3P7H/NH8/ixh426zCnFJhrs+e 3WZ1f/K1o25ZgN+MWZ9T3a7x4yIvClHu1F2Tg2jDkRapAF5+4KjhzVTTpJ4lu/GPB4vHaqEi7lsXX 03eFWvhLJQV1TOEBEItw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPqGM-0002VM-A9; Wed, 30 Oct 2019 15:51:58 +0000 Received: from mail-vk1-xa44.google.com ([2607:f8b0:4864:20::a44]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPqGI-0002UE-So for linux-arm-kernel@lists.infradead.org; Wed, 30 Oct 2019 15:51:56 +0000 Received: by mail-vk1-xa44.google.com with SMTP id 70so596318vkz.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=MCY0FawiAj06qR1lGSsqZ8ymSsz297rhFLnkYQf+8ftOyp8c7EeEevyAM98iCMNz7g 8e/TYSmkIbxa7+P5GT7ebVva8ahwASg+/KsqxV4iJ+Mf0Rdel7dTTZUoLSjOhg1EVkO6 I1OYWHfV+ScT9BlFvUQcAOd9ZIbeo4y4baaBVyh7BLwFIsk+0U5K7EPWEQU0NOruJrHo xN+CKScj7LeEWS/nf9hv6m0IvP7/WzwPoAv99i0hGUKM6s90jHB0L0xQgz/NdyrCB50D JIuT4LujUb5Yi+ZaTPAj8xqHdkcNc608EEX4oM70VpPbUbYFMohGRUMxcp3w/uvpZwTZ zkiQ== X-Gm-Message-State: APjAAAWTFouf4VmrZHnYUMQyxUWDl17xTqXNu2M/gEK3cVWNOpjKZjJc Y/ultrPjhKi5UxUCwp/nGQCMW6LuTI0DAUO2HH71gw== 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" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191030_085154_935717_BF91E6D2 X-CRM114-Status: GOOD ( 25.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kefeng Wang , DTML , Tony Lindgren , linux-wireless , Bjorn Helgaas , Discussions about the Letux Kernel , "Rafael J. Wysocki" , Russell King , Mike Rapoport , Yangtao Li , Kalle Valo , Petr Mladek , =?UTF-8?Q?Beno=C3=AEt_Cousson?= , kernel@pyra-handheld.com, Alexios Zavras , Rob Herring , John Stultz , David Sterba , Thomas Gleixner , linux-omap , Allison Randal , Linux ARM , Greg Kroah-Hartman , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , "# 4.0+" , Sakari Ailus , netdev Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel