From patchwork Fri Jul 10 11:12:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Chuang X-Patchwork-Id: 235228 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp347863ilg; Fri, 10 Jul 2020 04:12:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxISev2zKaqgpLtOyQXkwVYcRuf5/Otn1n/XpSdodhrKDuu3HQalIjCk76sUa05rRH+GVG+ X-Received: by 2002:a50:eb02:: with SMTP id y2mr74188930edp.281.1594379550881; Fri, 10 Jul 2020 04:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594379550; cv=none; d=google.com; s=arc-20160816; b=B98JUSEfIN71a8y4+kzQysFuv1HKngtfsf9Qnd4yaikvIHB8m0g18+m8mZYo7xPnpF Kp5x4rWxwZurMCNiM8qt7wL6CUzrq1YBOL45+gzgXZXwDFwzLcDCRMr/1TS9w0ws75UM AEMz9LBpYsCinZ+mkNa49Rf+Jzi7ai5gcZlBFGR7YupyZIX8cVoHh6UNTUsyQ+g6Oi/7 6vPyZoo/cEyV8Up+SimmryOXxokqzIoN8JMqHwXg2uJ0mzeoBJr2lLHzBs7X5ckzFTEF 3kNLAaqtmxhE9UocuuUgwvZjWlQ2j2ZC8175a2zx59U8zZJBV3O5v2xLGwT31J3qV8kY hq+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=S7yVpx9Ygx5/VQ/WoaheeloIQ6g4ecPLVpX/LrJKnQ8=; b=oZlh+snvSopUaSqf8oloSqF/+kFBBUXD3uaxJjm84sRHQmdZDT9PI0RppTQHTrdpI9 SSMTYISpZeLWuOwyW0KtnYeGrUgs2Qeryo2AIwvbjGtrPzlpLDmvJH3dajJLK0Gkuppd k6bg9Xyteec1Mb8AmT7/6J7G1tuzoPnTo/zPqr5pQJi5UFJNBUrJKY+zZ8PjJe2GsA2G wD4hvffgauwOSUQstTfCG1eocUyp0cKDcisHBlJCzE2dsxMhFofuAQTj4wuQBKj2axy0 RM1g23m6XNfsqOqbfAqGKycIN3TP0OIVywSg4Qz2D5cZlg5J4zA0UpYRKzb4yz9vLYWf tJFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Os8uLJ7q; spf=pass (google.com: domain of linux-mmc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s25si4105816edx.197.2020.07.10.04.12.30; Fri, 10 Jul 2020 04:12:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-mmc-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=@gmail.com header.s=20161025 header.b=Os8uLJ7q; spf=pass (google.com: domain of linux-mmc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-mmc-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 S1726820AbgGJLMP (ORCPT + 5 others); Fri, 10 Jul 2020 07:12:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727785AbgGJLME (ORCPT ); Fri, 10 Jul 2020 07:12:04 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1456FC08C5CE; Fri, 10 Jul 2020 04:12:04 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id a14so2416531pfi.2; Fri, 10 Jul 2020 04:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=S7yVpx9Ygx5/VQ/WoaheeloIQ6g4ecPLVpX/LrJKnQ8=; b=Os8uLJ7qBc9aLgAmNWYB9sd2IUB6Gra0WHDPMxHgQNCdWVdwc9+dOuy2xVw7UtlBue tkQNyIFczI63sen2wg6m7gkIX+yHVokdBpiCWcXaPTdpqrCgpQhBxe6IKmq37OmgrMbG zJivl/E9SLAUmosgHOAIXiVhEXQJMHFWQY1ye9fzuTEX3hvCbKB6y8Svj2DSSt/azdEL vrU9t6inD0KxX1iGGd75xS/MhzvRY+nI7+A2FB1y0T2Kh7stONaEiMMdDYWj1xsl+3ew 7CZwDegcnQrUsczZ8qQTwkka4nMkSi9nyMqqZfON0jI4Ra1XWaq644vn8RE2yV0QAs5Y Rt9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=S7yVpx9Ygx5/VQ/WoaheeloIQ6g4ecPLVpX/LrJKnQ8=; b=cX1uQ8CHJBqe96vrYSZn5y7TsXH9lWIQlT9gx4yCRRbzu23EOG0mf+WS/TVANKc85Y gh4Z9g/jQF/0tYyJiLBNSmtXNoFi74sWMhyrBtkngf8ELjNSagAmtWr5ia4Sr+mlFdQL DezDEEFxz09mHedPiEFTljcgJBzugQsELC4eK7InUD91EMHbxQyv8mu3yqpfMimdsyBR t6Amti6rjzJSERXj/xSvZTYkm0Mv5q+kusGxLSjk8YErw/bujb2bHFr7RWntF5GtSBG+ ItVjwbZGKjofa2CSmOyuQCJAaMCxhff0DLxp1UjVGotaYj+zQwuj4gDrE9QZFN46Pygf LBxQ== X-Gm-Message-State: AOAM531VYCthftH4wbADSQWUT95FrUqRzGnUWgtg46wr9vPC3B4Rjhl3 Ihl3Wy95gDIpF+RIsbZT5LE= X-Received: by 2002:a63:d250:: with SMTP id t16mr56958474pgi.51.1594379523645; Fri, 10 Jul 2020 04:12:03 -0700 (PDT) Received: from gli-arch.genesyslogic.com.tw (60-251-58-169.HINET-IP.hinet.net. [60.251.58.169]) by smtp.gmail.com with ESMTPSA id x7sm5842904pfq.197.2020.07.10.04.12.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 04:12:03 -0700 (PDT) From: Ben Chuang To: adrian.hunter@intel.com, ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, ben.chuang@genesyslogic.com.tw, takahiro.akashi@linaro.org, greg.tu@genesyslogic.com.tw, Ben Chuang Subject: [RFC PATCH V3 19/21] mmc: core: add post-mmc_attach_sd hook Date: Fri, 10 Jul 2020 19:12:47 +0800 Message-Id: <20200710111247.29937-1-benchuanggli@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: AKASHI Takahiro This "post" hook for mmc_attach_sd() will be required to enable UHS-II support, at least, on GL9755. Signed-off-by: Ben Chuang Signed-off-by: AKASHI Takahiro --- drivers/mmc/core/sd.c | 6 ++++++ include/linux/mmc/host.h | 1 + 2 files changed, 7 insertions(+) -- 2.27.0 diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index c5b071bd98b3..fd4cae4ed747 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1381,6 +1381,12 @@ int mmc_attach_sd(struct mmc_host *host) goto remove_card; mmc_claim_host(host); + + /* TODO: Is this the right place? */ + if ((host->flags & MMC_UHS2_INITIALIZED) && + host->ops->uhs2_post_attach_sd) + host->ops->uhs2_post_attach_sd(host); + return 0; remove_card: diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 56bdb153ef16..e61e0ae62cff 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -180,6 +180,7 @@ struct mmc_host_ops { int (*uhs2_set_reg)(struct mmc_host *host, enum uhs2_act act); void (*uhs2_disable_clk)(struct mmc_host *host); void (*uhs2_enable_clk)(struct mmc_host *host); + void (*uhs2_post_attach_sd)(struct mmc_host *host); }; struct mmc_cqe_ops {