Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp390572pxb; Wed, 3 Nov 2021 06:02:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy25pQs7lyjmp2dCPOn3GvFxkVRSVYyboEIdGFkevslAN3xXz+tx38QZNo7Iw/Az/8zt0oz X-Received: by 2002:a02:2b06:: with SMTP id h6mr32560246jaa.144.1635944573944; Wed, 03 Nov 2021 06:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635944573; cv=none; d=google.com; s=arc-20160816; b=J8zfsFqUx3+M4I4ypS9C5a6C1zYKWwbFexcg2s+IuLT+I+04EoJAFuAbFW60m+PQ1C USqHw9rSYwwijkDi1j30irfWgzzQQO7rWxNeebJ69zu0fpwofA8DKqwdJGtcraAov0rS QAulTuYZSVJFyeuhodQFBUK0NDT/ep+jwYq6wjrXVJ1DinaZrIMGrfOv++qiE+181DSn 8Dy7YzydPPGNXXwyD/R8Ciu2JVtdcG0Sb2ZYwcJcDt652ANKbwBaSa5ep8H5WzUBBrwX HTpYHGir++lHCX+t0exiluHDyWSJtn5MzOVKLXlPO9wC+XTe/yYWbWShougb9HdEf4rg 2cfg== 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=cPrsVDNh3YgbTR+Pv/a4rxJ7+ywhFHuLHgps/nYnCwU=; b=Qnew2HAH5pn1Bp+EucwhnhI9iWHxqpakV2xdvhh+d760kG4Ba18UuOX+PcrtEAymKv EWFId1MpN5GsQLzcxNI4ooviXxeMxdmczsauSM9ay1wPXj3v69pYE7QUXc3HAyzf/us6 p6Hq0erAq92SvBVO4CAD2L4zvWoiU4+6mRXb98A3C4ISO/I2dXO6KwqZs+h9dsMZa+V2 C+qdYmRo5w6a71aEcJHRR/RzmLIHEXS+HJnjpz67KyGcAtTU00c7xsWClOP5c6Ee1Qar bvsE/dAQB3lSY0dunc7QXVGMPfpbzhQerL6R8Msk/ODoThdGY/IXLlIXoCNGoVvFZdPA PfKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=lrS+e14p; 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 c19si2784284ilk.133.2021.11.03.06.02.29; Wed, 03 Nov 2021 06:02:53 -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=lrS+e14p; 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 S231804AbhKCNDi (ORCPT + 99 others); Wed, 3 Nov 2021 09:03:38 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.80]:30725 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231838AbhKCNDg (ORCPT ); Wed, 3 Nov 2021 09:03:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1635944429; 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=cPrsVDNh3YgbTR+Pv/a4rxJ7+ywhFHuLHgps/nYnCwU=; b=lrS+e14plMwdM6QOAPt6sQtEO8wkcQXMEce5CM0oWe+xS6Sg8zsBswksDNiAb5n30Q NJWekpAufL24xehCcFqK7xVm7e0Eguf29ZABwTV+xYqjX2RymmBMBqBv/PCPFPn4mmKO cL8ctRBClEdo54srpTTusrg8c3kN+gzDd/0dVjUcrPp/IrfxnDdy7UlLULCygyL6bhS7 xKC52RerH4xlTxEfDY3JyO+k5Uahshtt8gcP3gu4cQe1xA2B5fe6X5RvbNQAEJOFvUyd XD+Od1oh2KX910YdjR8A7vR5SaSTf53rLEXH5XHXqdhLgjpZNADrcCV96HVNfO6OUaXD +/bg== 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 902c63xA3D0Q0Eg (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 3 Nov 2021 14:00:26 +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 3/6] mmc: core: provide macro and table to match the device tree to apply quirks Date: Wed, 3 Nov 2021 14:00:11 +0100 Message-Id: <47e753ce9d1e17bbb2910ee24a23a85d27f860ce.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 This (initially empty) table allows to match quirks early based on .compatible of the child node of some mmc/sdio interface. A new macro SDIO_FIXUP_COMPATIBLE makes the definition readable. Signed-off-by: H. Nikolaus Schaller --- drivers/mmc/core/card.h | 15 +++++++++++++++ drivers/mmc/core/quirks.h | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/drivers/mmc/core/card.h b/drivers/mmc/core/card.h index 2f73f8567e14f..c7a61e74c02ea 100644 --- a/drivers/mmc/core/card.h +++ b/drivers/mmc/core/card.h @@ -122,6 +122,21 @@ struct mmc_fixup { _vendor, _device, \ _fixup, _data, EXT_CSD_REV_ANY) \ +#define SDIO_FIXUP_COMPATIBLE(_compatible_list, _fixup, _data) \ + { \ + .name = CID_NAME_ANY, \ + .manfid = CID_MANFID_ANY, \ + .oemid = CID_OEMID_ANY, \ + .rev_start = 0, \ + .rev_end = -1ull, \ + .cis_vendor = SDIO_ANY_ID, \ + .cis_device = SDIO_ANY_ID, \ + .vendor_fixup = (_fixup), \ + .data = (_data), \ + .ext_csd_rev = EXT_CSD_REV_ANY, \ + .of_compatible = _compatible_list,\ + } + #define cid_rev(hwrev, fwrev, year, month) \ (((u64) hwrev) << 40 | \ ((u64) fwrev) << 32 | \ diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h index a8b82b34dcfd2..619504b78bf46 100644 --- a/drivers/mmc/core/quirks.h +++ b/drivers/mmc/core/quirks.h @@ -146,6 +146,10 @@ static const struct mmc_fixup __maybe_unused sdio_fixup_methods[] = { END_FIXUP }; +static const struct mmc_fixup __maybe_unused sdio_card_init_methods[] = { + END_FIXUP +}; + static inline bool mmc_fixup_of_compatible_match(struct mmc_card *card, const char *const *compat_list) { -- 2.33.0