From patchwork Tue Dec 13 09:00:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 32717 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:8188:b0:89:790f:f786 with SMTP id m8csp3859571dye; Tue, 13 Dec 2022 01:07:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Ubgd1DUZwirnlob8xP5OLfy0LWQbgh9QTRdZgJ/Mu8ZXZTRXBn1HKZlCgXIvyRCEv5iul X-Received: by 2002:a17:907:770e:b0:7bf:3627:df32 with SMTP id kw14-20020a170907770e00b007bf3627df32mr17768435ejc.75.1670922434519; Tue, 13 Dec 2022 01:07:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670922434; cv=none; d=google.com; s=arc-20160816; b=RUiKfqvnbI0zspV7dT4uEGCdPhcK57r6kXhCPA38r98Y1Lq7VvnILZvM+MYJp/KNOh KuFhj0K0oIwm748Oy/XHuaJgir2Kr6KqtuAOL7yQjlWOG4aeCwsIAwW4etIFbOvpmM6Y nMM1xalt7vnpCGlA4yf/GTvqG12DPgodBzlqhlav24T7DQ4R4X7VVMPJ5wBEwH6kcLVg Pwnz1PT2UVKUmEh6P+i6dekI33izr7EcvbwA8xyjY6heyCDe16LEPdDURYsLNgo3CXSh XutzKIYyeAqrvvE8raRJXZVaJQjyM5f+IN5sp7vgT7oLou4WdreAzqkAgxZ/L6IEyi0x C5qw== 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=7PSAbNdm4Wrohy+JHyHxEY4NshP0fU0POYqHyU8D18A=; b=1K0WlP61kEH8Fsl7l2VqVc/TDxHcl30qWM8SEawdFvDptAB+4/XAe6G+p3r9O6gaXY pogSw36Vqx6L4mR+ukp72bN0+m+5Y2L1TjQLt8aHegSkD9WhDyDzMAolwx0emnjwcjGX flYp3SMkWdWsWLWByX30IiyCdV4KRcen3KOQ6rDMoesA/hShqsZFn1WrV0SaysbmtSYx 03lOYjzc6VUJHyFchuULiBsEpzGwL0Vdlk81OYd0OxoHYeThNoWq2wPsiRDiBkKkrP9m dsUYjHasCDxNxw/feMThqfdMa//oQQvRcukZKRWQu/V5LpdBdLCJR4PkjBky7KQohl52 EzRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=krFazrf7; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr14-20020a170907720e00b00791910ecd0fsi7908480ejc.540.2022.12.13.01.06.50; Tue, 13 Dec 2022 01:07:14 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=krFazrf7; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235103AbiLMJEb (ORCPT + 99 others); Tue, 13 Dec 2022 04:04:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234847AbiLMJC1 (ORCPT ); Tue, 13 Dec 2022 04:02:27 -0500 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58D4910FD4; Tue, 13 Dec 2022 01:02:24 -0800 (PST) Received: by mail-pg1-x529.google.com with SMTP id 79so969854pgf.11; Tue, 13 Dec 2022 01:02:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7PSAbNdm4Wrohy+JHyHxEY4NshP0fU0POYqHyU8D18A=; b=krFazrf7dGtFk+7vHofXgXt2Z/htty3CQxH7IBofnscwhO3J9a0CDEedllYhdeq8WA zbnZxsFpF2fZA51uBmocp3g+oKn3WWnUNd1xk0ffuN4pcL6I9JBwNi3pUdMpzAraCRRH 61P+RHPhIcK+JVTG4ZYTr9d1eNEWaVPM7OxKt/UKcZFWrRj3JUhtAuhz35FoA5Ua8Od8 0gCqsEbsoLJGx3ktVqFJHkDsEaTQ80oXkF4RZ54R07K82rkh7eu8kf0P0DoVtS8lEQBM eGuvx79U0IFm5F1w/oes3TlRnQH1dy458dT0vh7m5sE+yz9qnBgw3gLCxyjh0MUSPiXy l/jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7PSAbNdm4Wrohy+JHyHxEY4NshP0fU0POYqHyU8D18A=; b=3x4Fgk5B3/EwArT8N7ce/49tLlobmMLgDaw9z/4xL2kJctS2391Vwe/JeAQ36yI/5/ 9hmNsJIrKtIzofl9VmrUWzWKnw4qBMeEfFNYAm7FFeWWREN0XRezg67Uve9/Ll1GjnHv rAo3IE8iRan/OqUEIzIt6gXEy5gQ08obuMezc7wwCxG0k35tkQeIbjaxnUV1y9lqmafu YCwdQeqU1jmrkYY60lpvH4MZJtdXJk4iiGEREA0GbsAtDAhuNIfOQ9EIivHN6znV6uKu McKASmXZd8/KqEIdpUpEVisyDj72j2Bi8NjPgd6HBmN97TbFos9uN2viW73TsVw3UOrx c8iA== X-Gm-Message-State: ANoB5pnt2QnilWRavO4tzmWbG12LhHJRBbEbLOEjGRa7Y/e8OlJOSTPs tk8kn/UymMbyL7jhEqZE1os= X-Received: by 2002:a05:6a00:26f7:b0:577:5913:5b25 with SMTP id p55-20020a056a0026f700b0057759135b25mr20871182pfw.22.1670922144172; Tue, 13 Dec 2022 01:02:24 -0800 (PST) Received: from localhost.localdomain (2001-b400-e2dc-5c03-264b-f684-a8c9-21ae.emome-ip6.hinet.net. [2001:b400:e2dc:5c03:264b:f684:a8c9:21ae]) by smtp.gmail.com with ESMTPSA id 81-20020a621954000000b0056b9ec7e2desm7141682pfz.125.2022.12.13.01.02.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Dec 2022 01:02:23 -0800 (PST) From: Victor Shih X-Google-Original-From: Victor Shih To: ulf.hansson@linaro.org, adrian.hunter@intel.com Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, benchuanggli@gmail.com, HL.Liu@genesyslogic.com.tw, Greg.tu@genesyslogic.com.tw, takahiro.akashi@linaro.org, dlunev@chromium.org, Victor Shih , Ben Chuang Subject: [PATCH V6 23/24] mmc: sdhci-pci: add UHS-II support framework Date: Tue, 13 Dec 2022 17:00:46 +0800 Message-Id: <20221213090047.3805-24-victor.shih@genesyslogic.com.tw> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221213090047.3805-1-victor.shih@genesyslogic.com.tw> References: <20221213090047.3805-1-victor.shih@genesyslogic.com.tw> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752089162308276441?= X-GMAIL-MSGID: =?utf-8?q?1752089162308276441?= From: AKASHI Takahiro This patch prepares for adding UHS-II support at a specific UHS-II capable sdhci-pci controller, GL9755 for now. Signed-off-by: Ben Chuang Signed-off-by: AKASHI Takahiro --- drivers/mmc/host/sdhci-pci-core.c | 16 +++++++++++++++- drivers/mmc/host/sdhci-pci.h | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index c359f867df0a..248f13b163b0 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -40,6 +40,7 @@ #include "sdhci.h" #include "sdhci-cqhci.h" #include "sdhci-pci.h" +#include "sdhci-uhs2.h" static void sdhci_pci_hw_reset(struct sdhci_host *host); @@ -2153,7 +2154,10 @@ static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot) if (scratch == (u32)-1) dead = 1; - sdhci_remove_host(slot->host, dead); + if (slot->chip->fixes && slot->chip->fixes->remove_host) + slot->chip->fixes->remove_host(slot, dead); + else + sdhci_remove_host(slot->host, dead); if (slot->chip->fixes && slot->chip->fixes->remove_slot) slot->chip->fixes->remove_slot(slot, dead); @@ -2161,6 +2165,16 @@ static void sdhci_pci_remove_slot(struct sdhci_pci_slot *slot) sdhci_free_host(slot->host); } +int sdhci_pci_uhs2_add_host(struct sdhci_pci_slot *slot) +{ + return sdhci_uhs2_add_host(slot->host); +} + +void sdhci_pci_uhs2_remove_host(struct sdhci_pci_slot *slot, int dead) +{ + sdhci_uhs2_remove_host(slot->host, dead); +} + static void sdhci_pci_runtime_pm_allow(struct device *dev) { pm_suspend_ignore_children(dev, 1); diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h index 3661a224fb04..7f4a981c0e63 100644 --- a/drivers/mmc/host/sdhci-pci.h +++ b/drivers/mmc/host/sdhci-pci.h @@ -140,6 +140,7 @@ struct sdhci_pci_fixes { int (*probe_slot) (struct sdhci_pci_slot *); int (*add_host) (struct sdhci_pci_slot *); void (*remove_slot) (struct sdhci_pci_slot *, int); + void (*remove_host) (struct sdhci_pci_slot *, int); #ifdef CONFIG_PM_SLEEP int (*suspend) (struct sdhci_pci_chip *); @@ -184,6 +185,8 @@ static inline void *sdhci_pci_priv(struct sdhci_pci_slot *slot) return (void *)slot->private; } +int sdhci_pci_uhs2_add_host(struct sdhci_pci_slot *slot); +void sdhci_pci_uhs2_remove_host(struct sdhci_pci_slot *slot, int dead); #ifdef CONFIG_PM_SLEEP int sdhci_pci_resume_host(struct sdhci_pci_chip *chip); #endif