From patchwork Tue Jan 11 17:14:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 12710118 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B8E8C4321E for ; Tue, 11 Jan 2022 17:14:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244302AbiAKROy (ORCPT ); Tue, 11 Jan 2022 12:14:54 -0500 Received: from mail-mw2nam12on2049.outbound.protection.outlook.com ([40.107.244.49]:36192 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S244420AbiAKROw (ORCPT ); Tue, 11 Jan 2022 12:14:52 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J9ty2+ahl8MpUQ125PpTHCCBf/KSx74sm0lth0HYtttVl6IanALlQ8reQlWkkYQwzU9LhzImDA2reAUAnM+u8AeMB/0ScHMVu5JqlcahER6EWH77DJd5ANZk2Eit7FgW7E0da6K/rP0fG5cYF3myv9Z75RMrgxeVfBL04A1X2eN/BLg+/W/xMzRCodbMdY6bxUFcu21uyaOQQSTfxfN2DNQo+6hi069VYj/ybiryJ1Lau7jh7V52S0XIow2cknhbC8hooBxgphpi7ggqcL91AqfunLMhp6hAJSEkh16BGSUvbpj2QdpfHd0OLSRDsjy8zY8phfYT3CZ1cZ2CVbsJmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pdhi6vLAeWe2bzUCmXW6Nfs161aFeEl02nlWgRRDz7Q=; b=MSmTtoCF5cJ0TL0bdZ1l0jcPKM49nVN3EI/TobryW0bUMP9StGWR6dcRqaSZRMBuQbcFrj9K3a0qliFwgaPS0GbgDmZvbE1G0CUU5llJkGMUrfeA9wEKGV+veQ/0l+hMipwVpUvNcbJ8hNHvah40asVNbzrZVywrqIfBZG1u7kgu+rMmCYDEw50WoSApF89ewR7MHs0FkRgmdiAEJWW8h5+Z0IkTxHJIiRRoOeEipmp8Tv99dGRbtVAu7PDQa9MXCdEgmPtQYiAZwBB80aGdroNEHz2QphMmzwvGpokeiudrP5iPT/Gd5cnYcr2GBTcj/SUrhZZPDl1eGi1QuinkXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pdhi6vLAeWe2bzUCmXW6Nfs161aFeEl02nlWgRRDz7Q=; b=F6ZBjfe7YTCF2iIk8l3fcj16fnFwIcSmrx9nIdkZQ5ZEVy4t6ijJxbQuU3tKCLvWDnK1LxO0ob20j0HTJjLD+BB4I4eP6wptPRjjip1ynIYO786vPnaK3mFz9tRkrObTNVPuOPBBBqUc5bN384i9HvttPdJ1Vu2I2ULtF9wCnkY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) by PH0PR11MB5595.namprd11.prod.outlook.com (2603:10b6:510:e5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Tue, 11 Jan 2022 17:14:48 +0000 Received: from PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::d031:da9e:71a:73e4]) by PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::d031:da9e:71a:73e4%6]) with mapi id 15.20.4867.012; Tue, 11 Jan 2022 17:14:48 +0000 From: Jerome Pouiller To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Kalle Valo Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "David S . Miller" , devicetree@vger.kernel.org, Rob Herring , linux-mmc@vger.kernel.org, =?utf-8?q?Pali?= =?utf-8?q?_Roh=C3=A1r?= , Ulf Hansson , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH v9 01/24] mmc: sdio: add SDIO IDs for Silabs WF200 chip Date: Tue, 11 Jan 2022 18:14:01 +0100 Message-Id: <20220111171424.862764-2-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220111171424.862764-1-Jerome.Pouiller@silabs.com> References: <20220111171424.862764-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN1PR12CA0099.namprd12.prod.outlook.com (2603:10b6:802:21::34) To PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6aac5540-59f0-4782-bfa2-08d9d525df45 X-MS-TrafficTypeDiagnostic: PH0PR11MB5595:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sNisIf/0BvcPVIkXEc96d/M7gPcgH1IC31R+xLcy6Tdo7cErzWnZE7hGLwxIk69LmQCAC5Vo1WrDFoAHuZ73TbFiVXqckIrStDbMlGcU5Ko0J3fF++IUG78LCWDY/Jdlj60L7nx+nrdNvQBoPZgefay2YE2RXmMGI6GTAkxN+1GyAqC3sTLlZ2tfmDQ/wcbLy+oS9AyIg1moemhAIwkXRAimDVfsH4Ilyv2A/CKPXoMTppWUXpJpOGoy4xEpZuaKjfPXad4y6ZhsFvk7/3ljCC5eElqr0uwhoHUcDx6gp3+xrl+6WXZqCUzLNC36ahrRsn8mStcca5KmNYlph4NKRGmPvK5FR520UyuqS800J/7q1lHjGysj57Pi6w2wk6NWovcqaqNKTX7yqXRjXo4H+dlMloBKcO9jE+q03cytuiI1Bh4J6CeUbBR1FFN1J/VgXYLsh03IvpqnC65PyvxIMhOYOcYySVWVrvh8iOAlYJ8JCKHnCO8IvBGGiRymDqt1MaKGvT0ZfzguR3qNxrIr/0HpQidNhD4CwpOcni1PRIXmUztHDmaGUKkB//9kPd28GlDXN8kjVImYLu0uzVXfUY8K+J8NBmb3UTOrY2Y9IhRwanLxKh4vH8PA4ykUHfjJ64LcMcdWS50HgZZVpuc7Ow== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5657.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(36756003)(66946007)(6512007)(2906002)(107886003)(8936002)(2616005)(7416002)(6666004)(38100700002)(6506007)(4326008)(66476007)(8676002)(54906003)(6916009)(316002)(66556008)(52116002)(86362001)(186003)(5660300002)(6486002)(508600001)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?KmxGKbbv0swzUoSgbbcp9Xe0BPmM?= =?utf-8?q?he0RplPY1Ge/adrn5S7kD+/4S16h6EmMv8JWoGNT/ekKJAmtlC6i/DoPetDW8yR1l?= =?utf-8?q?5GDQpJINkI50VjhytadaUhq4O6SP2qirVhAWeZ+QnHJ+uzJRiMFUsZo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8?q?aYQvbv+rULtXLWeQ52tUbr0a6EHlGsUJfro0bSr+m1IXCaC7C/h63DTN2v/UVH05x?= =?utf-8?q?BYdIlR/ktZ9F8rRo7g2QFhwm29q7oTGD2EJ89oCBPZtC/u/wyRYBeFn5idkbuB7y1?= =?utf-8?q?i13n/mT6LoOPLStW7IjWBZE7KD2RcBm+yl+pIQRa2PJg3md2AFcIBIgJUMw1so6r+?= =?utf-8?q?n6R9h0YAqQ04egeKcavAtHla4RzsPm89RKdne7w8J15PdY32NaQhENmjINj7WRIn1?= =?utf-8?q?eVHWmWA+X9fzZO5UnUO0q6RzT2ei4+QSi6EEb27LHNKqhMCVlqjWWPzhW1lSplrJD?= =?utf-8?q?1b8XFjATd/5Ms7+H7UntkaOpWFpxhrY6ZgaryVnO/gGIZ1BFej+b8SwrOy/j7WtkO?= =?utf-8?q?9mspWuo8D709ahiIAm9iCbKQkdO9dzQLPlFyaGLm4DzqEPrb3WKlxGmvGyPFGNzrP?= =?utf-8?q?4qMz2S2M9e97+9G5e6ALfGRJBvVEEJFoYITzoFiaXDBPzg4zz6H9A9fuYNxcsolpU?= =?utf-8?q?+ndx1SD6IF8GpKXlny1KIiw5nDvWO5FZ9rIpgjXqqxMMAV/TT+4OqAm2nCQp8jn1L?= =?utf-8?q?QebJz1A+tFMJWLvxTTKzHsDSl2DqiVHpRrdAt8t/ZNt2L7KySIxfvY=3D?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6aac5540-59f0-4782-bfa2-08d9d525df45 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5657.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2022 17:14:48.8375 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nzo8FkP1UqriSNYZKKoVI5spiZVQLpyVf5lh0WKWA9T8hnF1kl9nQ4xbpZ/NHnUU6pdHilcIEnNUU2WZORb0AA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5595 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Note that the values used by Silabs are uncommon. A driver cannot fully rely on the SDIO PnP. It should also check if the device is declared in the DT. So, to apply the quirks necessary for the Silabs WF200, we rely on the DT rather than on the SDIO VID/PID. Signed-off-by: Jérôme Pouiller --- drivers/mmc/core/quirks.h | 5 +++++ include/linux/mmc/sdio_ids.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h index 20f568727277..f879dc63d936 100644 --- a/drivers/mmc/core/quirks.h +++ b/drivers/mmc/core/quirks.h @@ -149,6 +149,11 @@ static const struct mmc_fixup __maybe_unused sdio_fixup_methods[] = { static const struct mmc_fixup __maybe_unused sdio_card_init_methods[] = { SDIO_FIXUP_COMPATIBLE("ti,wl1251", wl1251_quirk, 0), + SDIO_FIXUP_COMPATIBLE("silabs,wf200", add_quirk, + MMC_QUIRK_BROKEN_BYTE_MODE_512 | + MMC_QUIRK_LENIENT_FN0 | + MMC_QUIRK_BLKSZ_FOR_BYTE_MODE), + END_FIXUP }; diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index a85c9f0bd470..483692f3002a 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h @@ -25,6 +25,13 @@ * Vendors and devices. Sort key: vendor first, device next. */ +/* + * Silabs does not use a reliable vendor ID. To avoid conflicts, the driver + * won't probe the device if it is not also declared in the DT. + */ +#define SDIO_VENDOR_ID_SILABS 0x0000 +#define SDIO_DEVICE_ID_SILABS_WF200 0x1000 + #define SDIO_VENDOR_ID_STE 0x0020 #define SDIO_DEVICE_ID_STE_CW1200 0x2280