Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp393489pxb; Wed, 3 Nov 2021 06:05:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwKkI+tKgKyPKSE+ejzYwBjmCpmq/t0DbZHJrx30GntOVSHALO+grNMbXhCQe4Hjf9e6/b X-Received: by 2002:a05:6e02:1a67:: with SMTP id w7mr23327600ilv.165.1635944712455; Wed, 03 Nov 2021 06:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635944712; cv=none; d=google.com; s=arc-20160816; b=umhgrdTp+ufy5gmiAXmKh7/ZJRwczLEXwzmXWnl7lLxq6IuQlVcOI3cAwej/q9GvVl WWXi5ABlDF6BJpHBeDVd+Zn8rwhG7dQdY1IGtmR9Xw3wyHftk8Al+iEuHdjWPxrjHN/g K5oqyxD2XzdtDW6geNyScKpqdqLVraLJh/yUXm6wY3LI4wPamQhdwJ37N6+KFcekNoVn j5GJU7dqLoTWGNT9FySapXf/UIRvoVsxwWn5mn7sI+vmHcjgvHqRiCuQq6JN/yHUCaJh VgEhsKdjHbb1e+DGhIaqfQOR0JGYv9O35pj7qZRWZqqAKVIpu9dS24vkNswvUiKZLxQF VR9A== 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=qr+QhCG/nVGggWtOXXzuIp3D/H/Ve9m2S4tWvm5QKsY=; b=nV8y+kRLI4gWdv8Vpc5lkjEmVf2Z/3fWWzKfLDO2yz7Kb3qX995/rZOEdPBuLLpdUg p7CWgFOKy723K2QkEiUHZ++cpqr6c8UcXQhdH/UIK18BwAOTmuE7WPndICfUib38HMHg j15mMfjtKENhxvlL5RZi/OVpPvZZRmzgLJmK0wi3CJzuHAFQCQaNyr6dZyY6qetbFSMX HmoepOOiuGuo84pQUfKIO8Vuk+jAs5s2tDtoKCSOKveIE8Z4+bpLrNZ2BpsByzesHWC5 NUYk1gGO+hyoWLPWq3IR9rxQOEzJaY+Yu69+DWb6RwkLfhriEaoGRYitgoxclrOAWfYW 7nIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=UNwRSPLr; 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 i12si3733873ilm.9.2021.11.03.06.04.58; Wed, 03 Nov 2021 06:05:12 -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=UNwRSPLr; 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 S231968AbhKCNDz (ORCPT + 99 others); Wed, 3 Nov 2021 09:03:55 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.84]:22573 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231983AbhKCNDo (ORCPT ); Wed, 3 Nov 2021 09:03:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1635944436; 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=qr+QhCG/nVGggWtOXXzuIp3D/H/Ve9m2S4tWvm5QKsY=; b=UNwRSPLr/hxgOo1ZE5b94kJ8TzzB06jUcqAw4Axpf5NrfHykH96F9xQ6Au7RfKsWr8 eYBNVD3xar3voidi8XvrL+3Hgl9Ptll3vXojXE9TlsIuJI88UE5vfTt8aU0AJQ+I+/mW c7uyrl0yxWPTbwEa544yqjS3gWzB/UwXEUTAea3lQR8F+LotouoIiaoL841QvadYD68C VWkn8DXB8o3YmU9RmhG2kL6B7BcUIQBWqSkeydBiq9JMEAfJO+lgglwn5xza8SYBbNpL GmktWxTsIpw/0J0MT2mHEinTVGqlpbJjaMpDngXZU6j06xs01WQx5ebE/mdxfLQj+PKK IgaQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o1OAA2UMf2MwPVbgc7na" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 47.34.1 DYNA|AUTH) with ESMTPSA id 902c63xA3D0X0Ei (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 3 Nov 2021 14:00:33 +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 v3 5/6] mmc: core: transplant ti,wl1251 quirks from to be retired omap_hsmmc Date: Wed, 3 Nov 2021 14:00:13 +0100 Message-Id: <90a75a0be2d8e05066765ede1db7a19f9f4d095a.1635944413.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 c7a61e74c02ea..f4ec33a94b0b2 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 619504b78bf46..66fcd64b5bc7a 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 *const __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