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: 633827 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 5C117C04FDE for ; Tue, 13 Dec 2022 09:04:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235098AbiLMJE3 (ORCPT ); Tue, 13 Dec 2022 04:04:29 -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-Google-Smtp-Source: AA0mqf62S7iTVKFYlr9W6Q1O/+lbehNbU7OxE7wQMlZXuvwL6cXFsPwjnkiCTsKh2SjXmV6wenz+tg== 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 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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