Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2766603pxb; Fri, 5 Nov 2021 04:28:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwEjtDdwCZEAqtRn1gU1tCtqn6HmDK8SD7Cl2+EQKhBvaN/XaHMZTDWWYkbE/DDIOKl1xN X-Received: by 2002:aa7:d8d5:: with SMTP id k21mr43985595eds.209.1636111701701; Fri, 05 Nov 2021 04:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636111701; cv=none; d=google.com; s=arc-20160816; b=J+Pq9pV8mAybNWGma9qK5D4v3HnfyA1RJYRu674Ys8H7uvPMYmzDyZ2ncz4XR336Lo et2JWFav2JIvIOVt5+u7O/N3m2KSs/LG3KVx2m9pfIPESozoF25GjLK/KPN0SEoYBYor tUtuVPPOC9LAFzp7uSkwHhB5I1KlsmkhscvV4r6AOYbdh8aQ8Ja6FV8wKYNNU9e+t6DF cVRfHUtIV71i4yCpryDYH5RgUFBTpHudRg7/LOpvVjdIh4XK1A3WuPTR07aR5anf8GJN 7EzD5XLIDHZVkrK0w3rXiDVgRYR8Og7Z0C8e2zWmgYfvgN1bveQkaj++DM+nbcmpIsTf jASg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KHpvoFjBsD7DdrWfOIofu+L3oQA3bllZW6D/ah8Y1rg=; b=LQfVvTV/sDhyd6s1kYikBCg19Vru22uYLWOQhKUFi8dcqCw0GRnFTG4BGusMjmaauu 5/ujjvM8upqzoBMPrdh4cRofTU4bAD858A5hTcvi/UFrYQynlgvWvNyxkq+q2WUQNlDf +WJRYxnE2cR/QEbJJ+QCuC5EmABguFkI+xjGxsMD5Rg7V+i63eCu+JEsDYDXWzvE6kiK Vsvjc0N2MFmVAHvWJYyHJl0iombLI610EZlqvENmqu/iZtILM4D1Zvs9xnnyaZZZOF+E Chz0H6up8Vup0XvRKDpoLHBxlz4dHHfzSAzDgTfeox7kDoFo1GNOahK2QwEi1ynSiUMC c5qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=Ze4ACsza; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do22si15515556ejc.788.2021.11.05.04.27.39; Fri, 05 Nov 2021 04:28:21 -0700 (PDT) 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=@goldelico.com header.s=strato-dkim-0002 header.b=Ze4ACsza; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232516AbhKEJIp (ORCPT + 99 others); Fri, 5 Nov 2021 05:08:45 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.80]:25389 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbhKEJIo (ORCPT ); Fri, 5 Nov 2021 05:08:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1636103154; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=KHpvoFjBsD7DdrWfOIofu+L3oQA3bllZW6D/ah8Y1rg=; b=Ze4ACszaH1dBiXK4Bft/3iiry1KY/6RuoZMT1TRiBNPaaYhKsniPLw9Exm/sAkgHWT tO9Zn0cMfE9V8fRsj2dwqbXjTDdYtBfXeyN6jyXMZoqS0GNj+R39MzT7anxD3kNnS+fp QMEMAwwRQCFZ3YW2xxismZ4GOnuow49hVhaQ+eBR3gQOTFuMZFzTlWBU7z0HlQsk7+GA 1mUMR56TBbtu6oYLYDeeeeZE3rA6vTgPTnSL4CkgKuvPri8FSS20uPYmDNKGo3WE/evC XHMawxR1/1votO9a2dCNMdZOrDsJfxI3iF5KrUTEifrt5mfA+8/dfWnuyV8m8b4wzUv+ ImSw== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o12DNOsPj0lByOdfL1X0" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 47.34.1 DYNA|AUTH) with ESMTPSA id 902c63xA595s8uO (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 5 Nov 2021 10:05:54 +0100 (CET) From: "H. Nikolaus Schaller" To: Ulf Hansson , =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= , Avri Altman , Shawn Lin , Linus Walleij , Tony Lindgren , Bean Huo Cc: notasas@gmail.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com, "H. Nikolaus Schaller" Subject: [RFC v4 5/6] mmc: core: transplant ti,wl1251 quirks from to be retired omap_hsmmc Date: Fri, 5 Nov 2021 10:05:50 +0100 Message-Id: <3ca9a3099d86d631235b6c03ae260bc581cc8d60.1636103151.git.hns@goldelico.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; +} + /* * 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 }; -- 2.33.0