Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6852802rwl; Wed, 22 Mar 2023 17:12:40 -0700 (PDT) X-Google-Smtp-Source: AK7set/cjMRAAA3QAnxzJ/btlFSD3f6aHfaxEUuZh/aAt+ltkN88ZKTkxAa7Uj3ipaVHkS/BXEJG X-Received: by 2002:a17:90b:1d11:b0:23f:7ff6:eb8 with SMTP id on17-20020a17090b1d1100b0023f7ff60eb8mr5637131pjb.31.1679530360064; Wed, 22 Mar 2023 17:12:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679530360; cv=pass; d=google.com; s=arc-20160816; b=fM5Ai+CnGcLafWKHmu6r/oRXIBnuk92yyI1JYCRNSlNVBtZeEdqF05Hk7iOil1F6tc af6mPdms++zJEXUSbmqkN7IVC4MSYKIguMaGICBS8xiXmiIoZm3y1qWAJuT4rdVRpFwM 1l55+1pfN3libfwsgmXEmK2pJnMSD150cBuVKRjF9ER4UcVh5hyKMikjq7H3RUsUYYD9 SVWx9B2ufWP6PjITcLzQXWBBZYz9jyu/barMe5MDi+7f/7uuOP2wVYrx2+WPeadhNSrm MTedbtDKK8ZgVr+hdvQ7xn4BW/riEImk1WsYbkmWRnREZKhOWLs0rymZsPJ5BIOG4LFo Pe7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=1MDls9ITIFGGKkwfzufckKk9fjZ1Lh0w+zr7TA/z5wc=; b=tk2rNJ8jcua+MgeE4ifZXJlZj2stzkIjgDgXfOn9W1tOgdHyYgjbpHWgbOMb3uoMoO yTrIq3oCw0sXus1Q4wtO+bgeVGdpRuVzYzsJW48EYE6K5X4znPgIuvIkgRYwjAOVysGR oNQ6a/3+34mo8sUhUa1PQDPdcqyu97cStFIBwo8KLCENWCgseGw7ccYiKYaNPzU8lAm7 oczVBfi2F2yCK117QOPK84HwjIXPD39nQaJVrTJ05a9VidLXu04tnscGX4NeT/sNjHob ayYI6hDj/Ee2KxmOjsnNPy9riWhtfp3RjfHmkP4GrpHdFv9qvburtArj0GILzPlVErJW yKpw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Jnymu99B; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x9-20020a170902ec8900b001a1a5d21d5csi17798775plg.110.2023.03.22.17.12.28; Wed, 22 Mar 2023 17:12:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Jnymu99B; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230494AbjCWALk (ORCPT + 99 others); Wed, 22 Mar 2023 20:11:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230493AbjCWALY (ORCPT ); Wed, 22 Mar 2023 20:11:24 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2042.outbound.protection.outlook.com [40.107.101.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2823335EDE; Wed, 22 Mar 2023 17:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dsbH/d1iUxSe3H2SMDgHI3OyPjR/suEmbkx9n6Yc6U3vr7NXpz3vymHEERgfe7hWPFFp2x6rEsAgUfxyCwjDSWzVSXK3k883rkctuE8LY4lHGJML+lzTM2PLYA225D9D4+3zV+WlJSti+ydLo2oyeNhXqX8VtSySiW6xZocOgvf3lrXbsc/DsUkyLhseyy+NILc2x/nVkT0AwJLqRZsiAK3jYcZncG0WB1PASMtNSjfP1WVcyDCV+T8YpyK7Eh5g2GgADAX9TyGvVLACaisuQR3UzZJAYIJO3bQ8JDvpY+LOEgI5hC8FjCtUYukHFcnHcdLL9z5hYYO1Z3+weAbVBA== 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=1MDls9ITIFGGKkwfzufckKk9fjZ1Lh0w+zr7TA/z5wc=; b=gclitdk/YNVPSCRObHenfOhDJyADSZMz67t9fCYLU9LgqgYgzly+vXIwGTBZjnp6C7yxma2s1vMCgrtQ9DXi0szOshdk6mQTI2X2ZhDarKQawKCdbEmSerRDgvhxZ7EtbTIZgCoihIoOuONljcxLXY/ap4Qn2GTcjPrmBJnt42wQ8tEkmxg/xx5+e3T82cZmtG79ZeXuFUPow2w0wsQA4WYtYlWKWIY1HbfG/V4I5YfkGlSFlXidjrwK0tLpagd9JP0PiGAt6qNugfqbXvIhs1EYF6ogmh42nZw0/ili366P7FsGIsGHxSnEcePl8xTyIgOxKr4DIuYK0MdOYysuYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1MDls9ITIFGGKkwfzufckKk9fjZ1Lh0w+zr7TA/z5wc=; b=Jnymu99BEijCKDHV9pa6ClhJAUb8WNPUYrvkvGuGMe2uyigHDhDqqdBnJl9AH4FM+9IubqvJOU+LzaXGCCINHvkfHFt3vF8H9ESE7uekek0VedqZLqWJ8BhoBkcAFTr89ZqZA8WcFDXqT+MOOaFZanYEt5fdnmtTYDMg2MgniRc= Received: from BL1PR13CA0241.namprd13.prod.outlook.com (2603:10b6:208:2ba::6) by MN2PR12MB4517.namprd12.prod.outlook.com (2603:10b6:208:267::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Thu, 23 Mar 2023 00:10:19 +0000 Received: from BL02EPF000100D3.namprd05.prod.outlook.com (2603:10b6:208:2ba:cafe::d8) by BL1PR13CA0241.outlook.office365.com (2603:10b6:208:2ba::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.17 via Frontend Transport; Thu, 23 Mar 2023 00:10:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF000100D3.mail.protection.outlook.com (10.167.241.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.30 via Frontend Transport; Thu, 23 Mar 2023 00:10:19 +0000 Received: from platform-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 22 Mar 2023 19:10:16 -0500 From: Brad Larson To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v12 12/15] mmc: sdhci-cadence: Support device specific init during probe Date: Wed, 22 Mar 2023 17:06:54 -0700 Message-ID: <20230323000657.28664-13-blarson@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230323000657.28664-1-blarson@amd.com> References: <20230323000657.28664-1-blarson@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000100D3:EE_|MN2PR12MB4517:EE_ X-MS-Office365-Filtering-Correlation-Id: 519749aa-39ef-412f-539a-08db2b32fcef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CrdNSGjl+Xzyf1NStkBP1cYKS5J4NHFTzF27gfPDPL3jNeJdl94cpL4bMt6Nl/xNugF/12H2HPhmjPlzGaeqS9WricERWLTdRN4lLihxFM/HY4zR+xs5vdRbu60gZq6/xK70fC5I6Mw7Jg5bDgmjYUmmhTsKI5gKg1wnJf3mlIhWD1suwGZS7EATcg0bl+FmkIQxOVJq55C8JAu2wpeiNAAvpXwU2/jO9NdLClMNMDuNvniC5HhqlhWFvm0okFIsMDbvP61k2yLDi7Tczig0iNhqQ5JEOERMt2RwHqcB2qX9boi8v/Rws3xfU8DQhKGnSdVqhtNaAYhhHng3q2YX/Z8chCCCQhFaTu4z0//GCpp9sdAlvkFiPVjQNnvofeG8XO0CZJZ1MmJCyB0YRt429MlQVX0PowoWZyFy/Qg6lNlUQd0MUsxxv4O742jBn2u66OHOHkIFeWA+KL/kk/CPMEcrfcZIf+ikOzydWlpQMAF+MVrZl/5uTSvgVf6OAy+ZF4ZP0uaV4YTzc89N+FrmvsoRebDOZP1rL1xzUmS35iKooNwvJmhMBKOtq7HotKRnaEU2H8N/HCpz/QJ5H8lvRTqnG3a+iPrxaWIRQFKLKwjz2u/rC8hC+cMjlZ8letknoKt/zzMS5C4+Bu0oNZlFX+nSaYbVBFlGM0pRvm9zNB6KBdXbCbQ+gp95tIx3zOsRwwdLgc0E0AIXPh1n4EgCGlV86qQPBA8WQtimu68lwd8= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(376002)(39860400002)(346002)(136003)(451199018)(36840700001)(40470700004)(46966006)(82740400003)(356005)(40480700001)(81166007)(40460700003)(186003)(16526019)(54906003)(336012)(2906002)(316002)(47076005)(83380400001)(36860700001)(426003)(41300700001)(82310400005)(70586007)(6916009)(4326008)(70206006)(2616005)(8676002)(26005)(1076003)(7416002)(7406005)(478600001)(6666004)(8936002)(5660300002)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2023 00:10:19.4334 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 519749aa-39ef-412f-539a-08db2b32fcef X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000100D3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4517 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move struct sdhci_pltfm_data under new struct sdhci_cdns_drv_data. Add an init() into sdhci_cdns_drv_data for platform specific device initialization in the device probe which is not used for existing devices. Signed-off-by: Brad Larson Acked-by: Adrian Hunter --- v10 changes: - New patch to provide for platform specific init() with no change to existing designs. --- drivers/mmc/host/sdhci-cadence.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c index 708d4297f241..c528a25f48b8 100644 --- a/drivers/mmc/host/sdhci-cadence.c +++ b/drivers/mmc/host/sdhci-cadence.c @@ -77,6 +77,11 @@ struct sdhci_cdns_phy_cfg { u8 addr; }; +struct sdhci_cdns_drv_data { + int (*init)(struct platform_device *pdev); + const struct sdhci_pltfm_data pltfm_data; +}; + static const struct sdhci_cdns_phy_cfg sdhci_cdns_phy_cfgs[] = { { "cdns,phy-input-delay-sd-highspeed", SDHCI_CDNS_PHY_DLY_SD_HS, }, { "cdns,phy-input-delay-legacy", SDHCI_CDNS_PHY_DLY_SD_DEFAULT, }, @@ -325,13 +330,17 @@ static const struct sdhci_ops sdhci_cdns_ops = { .set_uhs_signaling = sdhci_cdns_set_uhs_signaling, }; -static const struct sdhci_pltfm_data sdhci_cdns_uniphier_pltfm_data = { - .ops = &sdhci_cdns_ops, - .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, +static const struct sdhci_cdns_drv_data sdhci_cdns_uniphier_drv_data = { + .pltfm_data = { + .ops = &sdhci_cdns_ops, + .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, + }, }; -static const struct sdhci_pltfm_data sdhci_cdns_pltfm_data = { - .ops = &sdhci_cdns_ops, +static const struct sdhci_cdns_drv_data sdhci_cdns_drv_data = { + .pltfm_data = { + .ops = &sdhci_cdns_ops, + }, }; static void sdhci_cdns_hs400_enhanced_strobe(struct mmc_host *mmc, @@ -357,7 +366,7 @@ static void sdhci_cdns_hs400_enhanced_strobe(struct mmc_host *mmc, static int sdhci_cdns_probe(struct platform_device *pdev) { struct sdhci_host *host; - const struct sdhci_pltfm_data *data; + const struct sdhci_cdns_drv_data *data; struct sdhci_pltfm_host *pltfm_host; struct sdhci_cdns_priv *priv; struct clk *clk; @@ -376,10 +385,10 @@ static int sdhci_cdns_probe(struct platform_device *pdev) data = of_device_get_match_data(dev); if (!data) - data = &sdhci_cdns_pltfm_data; + data = &sdhci_cdns_drv_data; nr_phy_params = sdhci_cdns_phy_param_count(dev->of_node); - host = sdhci_pltfm_init(pdev, data, + host = sdhci_pltfm_init(pdev, &data->pltfm_data, struct_size(priv, phy_params, nr_phy_params)); if (IS_ERR(host)) { ret = PTR_ERR(host); @@ -397,6 +406,11 @@ static int sdhci_cdns_probe(struct platform_device *pdev) host->ioaddr += SDHCI_CDNS_SRS_BASE; host->mmc_host_ops.hs400_enhanced_strobe = sdhci_cdns_hs400_enhanced_strobe; + if (data->init) { + ret = data->init(pdev); + if (ret) + goto free; + } sdhci_enable_v4_mode(host); __sdhci_read_caps(host, &version, NULL, NULL); @@ -461,7 +475,7 @@ static const struct dev_pm_ops sdhci_cdns_pm_ops = { static const struct of_device_id sdhci_cdns_match[] = { { .compatible = "socionext,uniphier-sd4hc", - .data = &sdhci_cdns_uniphier_pltfm_data, + .data = &sdhci_cdns_uniphier_drv_data, }, { .compatible = "cdns,sd4hc" }, { /* sentinel */ } -- 2.17.1