Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp267134pxb; Mon, 8 Nov 2021 13:18:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8oxxA6bE0RMQ4FR9UpuVSsI1gHhzk6z1I3Yf2q5Yyy3wPTTSodVapbqY+ii2p/mp20twf X-Received: by 2002:a17:906:942:: with SMTP id j2mr2843848ejd.303.1636406327462; Mon, 08 Nov 2021 13:18:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636406327; cv=none; d=google.com; s=arc-20160816; b=xA7Euv4x65V6VDPK67tgD69Xgr87PnfHW6OEERkvOJt+sRaUpMiVih7kovA5wALsai 3rPNuT7m7hrKSrHk2UcPr5NlX3+aI6RuNtCnHN6fPa1VlspzAsP3BRKxzTp7ixCfycpo vsYCr0zYC194u20Lx/ewu3fg3bqFG0wT5mz6q6beKjsoZjsPx3UwKoKjdaAAhD1yoA6A jS1J0qeQvqx/i+QAjugiwSP44aWlG8eZxfHH3URSBVcwmkKDcvT1FnnALnNLYQRtAJn8 wSIxVTWkeuc8kzLSMGDAobFQi8BQrojoWQW1CPCMkPPgFMz1txFpRpOCyWS1dk8eRDkz SKxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7cDX8QQKKuew+Ja0r9BHR27VcwBnv9KU+20lUo/z16s=; b=JHBYsFnQww7kv6X8bIGy1ZQN8OnpMw+G0kxeZKYDzzTeZgp8eqwAGQOWxNKEMSM4J1 94RpyXKrbuuVN3IG2/Xr5VQt3RYM/3SsSzrJ5kTnr6O3kI/IHnLusgsqi2N+/mxm/Ffj pzDd6xUfY7F4fT9zBhfVYjdZ5ViOeb5mWvBjmx58JsRzhhOOHNHISEIZSH5DN4A5pehz QSGMhbfAmus97as+m2QNp5Y7XEpizdLTLcmj/YyzaQ48YgSj/BbUOhvZRwKeoSRUuYlo S+a4un5i4Wy0e1XFXt9YshiCY4ocmyV5KmKILK4Zbb0ksc9QHxDGNXYV/E2xRDJqH6mw b+KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vTIb+xtH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb8si25423201edb.352.2021.11.08.13.18.20; Mon, 08 Nov 2021 13:18:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vTIb+xtH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237570AbhKHPhP (ORCPT + 99 others); Mon, 8 Nov 2021 10:37:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238365AbhKHPhO (ORCPT ); Mon, 8 Nov 2021 10:37:14 -0500 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BC45C061714 for ; Mon, 8 Nov 2021 07:34:30 -0800 (PST) Received: by mail-lj1-x233.google.com with SMTP id h11so30314858ljk.1 for ; Mon, 08 Nov 2021 07:34:30 -0800 (PST) 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=7cDX8QQKKuew+Ja0r9BHR27VcwBnv9KU+20lUo/z16s=; b=vTIb+xtH+3s+MEgysej6qyoxnPGY2brtJoQYxCc+bVniRkUxKGnhRSYHZB17wtiSJs u9nI/Ot0lCij1fZK3CD2GLJq80wHqDJd5zO1aI8+Vb6dcv1BhTE+T6VrnHvcuWe1ENz/ T6Bd3+wI+qD3VSzBJlSwZP+ZDU3RV+IYaVQeZY2WJ7TSHEVdKSZIH/hjb3NjBs4AM/Ic 8jm9NyL+YinBrCYe01bswYW5BLxQ+tWpbVNYNTNagbJk0Uhv25zjX4rhMA0T7m5EgFdQ mAXOw+Ua2Nu85Lr/+ejzJjiLx/FxkjkbhDREGW7EhXcIKF1Pq5jZO+M00TFE2TzVSl17 4nyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7cDX8QQKKuew+Ja0r9BHR27VcwBnv9KU+20lUo/z16s=; b=4ScCBxYO8jT1nTXuqKG8OrxASzFTxtuMfP0Mq3jBMWqECkwOdCg2/+E/jEa0iVeH8g noVa/H/X27z/TI7W59/uPJCwznNc45ZyKL0Xv9zDUkcCQWoXvkbOAPdOJJ8VNf1471Ht uP/b6uypZS4lrzD9gnbrNck88Lrnv+o1Yx3OnqfsmBtdYfkQZ/KHlRSAzIICFvc4Ibik oStwzIJDRiTSYKLxvaXNg3p8NIDq/lfsAGZCMTKjT1+jI8eqd9pHA0u1zasGA5nXr6Cm mFYJln76B97vNW2uiVQh7eTbtXB7Foi8+xBM8VyXkHoDBCDmWfAqcVhe1asdpYbYrUW1 Glwg== X-Gm-Message-State: AOAM533L5B6wkOrlA7Ms368VJ2n66z7YzzOHyHveQuNwE5lARWWZ+G+d oLBnIEVDBgqIhe1apdllTDfoaZt2SueljZbcG3F6vQ== X-Received: by 2002:a2e:a5c8:: with SMTP id n8mr541754ljp.367.1636385668612; Mon, 08 Nov 2021 07:34:28 -0800 (PST) MIME-Version: 1.0 References: <3ca9a3099d86d631235b6c03ae260bc581cc8d60.1636103151.git.hns@goldelico.com> In-Reply-To: <3ca9a3099d86d631235b6c03ae260bc581cc8d60.1636103151.git.hns@goldelico.com> From: Ulf Hansson Date: Mon, 8 Nov 2021 16:33:52 +0100 Message-ID: Subject: Re: [RFC v4 5/6] mmc: core: transplant ti,wl1251 quirks from to be retired omap_hsmmc To: "H. Nikolaus Schaller" Cc: =?UTF-8?B?SsOpcsO0bWUgUG91aWxsZXI=?= , Avri Altman , Shawn Lin , Linus Walleij , Tony Lindgren , Bean Huo , notasas@gmail.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 5 Nov 2021 at 10:06, H. Nikolaus Schaller wrote: > > The TiWi WL1251 WiFi chip needs special setup of the sdio > interface before it can be probed. > > So far, this is done in omap_hsmmc_init_card() in omap_hsmmc.c > which makes it useable only if connected to omap devices > which use the omap_hsmmc. The OpenPandora is the most promient > example. > > There are plans to switch to a newer sdhci-omap driver and > retire omap_hsmmc. Hence this quirk must be reworked or moved > somewhere else. Ideally to some location that is not dependent > on the specific SoC mmc host driver. > > This is achieved by the new mmc_fixup_device() option introduced > by ("mmc: allow to match the device tree to apply quirks") to match > through device tree compatible string. > > This quirk will be called early right after where host->ops->init_card() > and thus omap_hsmmc_init_card() was previously called. > > Signed-off-by: H. Nikolaus Schaller > --- > drivers/mmc/core/card.h | 19 +++++++++++++++++++ > drivers/mmc/core/quirks.h | 7 +++++++ > 2 files changed, 26 insertions(+) > > diff --git a/drivers/mmc/core/card.h b/drivers/mmc/core/card.h > index 089ede71d3150..20c8dfd6831cf 100644 > --- a/drivers/mmc/core/card.h > +++ b/drivers/mmc/core/card.h > @@ -168,6 +168,25 @@ static inline void __maybe_unused add_limit_rate_quirk(struct mmc_card *card, > card->quirk_max_rate = data; > } > > +static inline void __maybe_unused wl1251_quirk(struct mmc_card *card, > + int data) > +{ > + /* > + * We have TI wl1251 attached to this mmc. Pass this > + * information to the SDIO core because it can't be > + * probed by normal methods. > + */ > + > + dev_info(card->host->parent, "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; In the past, we discussed a bit around why card->ocr needs to be set here. The reason could very well be that the DTS file is specifying the vmmc-supply with 1.8V fixed regulator, which seems wrong to me. I would be very interested to know if we would change "regulator-min|max-microvolt" of the regulator in the DTS, into somewhere in between 2700000-3600000 (2.7-3.6V) - and see if that allows us to drop the assignment of "card->ocr = 0x80;" above. Would you mind doing some tests for this? If that works, we should add some comments about it above, I think. > +} > + > /* > * Quirk add/remove for MMC products. > */ > diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h > index 41c418527199c..e9813f1f8b23c 100644 > --- a/drivers/mmc/core/quirks.h > +++ b/drivers/mmc/core/quirks.h > @@ -146,7 +146,14 @@ static const struct mmc_fixup __maybe_unused sdio_fixup_methods[] = { > END_FIXUP > }; > > +static const char *__maybe_unused wl1251_compatible_list[] = { > + "ti,wl1251", > + NULL > +}; > + > static const struct mmc_fixup __maybe_unused sdio_card_init_methods[] = { > + SDIO_FIXUP_COMPATIBLE(wl1251_compatible_list, wl1251_quirk, 0), > + > END_FIXUP > }; > Kind regards Uffe