Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3327628pxu; Sun, 29 Nov 2020 23:49:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwf0UoeKwG4wztBMJVubz7TWxF6838g//I81SYETY/NInwSiLAFBBdIRgHs3mwP7CidWMvs X-Received: by 2002:aa7:c44d:: with SMTP id n13mr20636441edr.138.1606722573188; Sun, 29 Nov 2020 23:49:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606722573; cv=none; d=google.com; s=arc-20160816; b=IgOWlFtq2bmoWisPrCOlvplIdxMDJ3ZZTS44LvcyG4Mxjn3gwD4Ugo4dfiGzvaqfVz eYxFHkgTcNycytmodh/WZsPa5QB84dmSuXQUKLqeyN1jfPe7MgT8ZNrtggeXVCWn7so7 rnS0PfQzXluF0uVNLaAtpejAqTtKov18FMDsDBDbLModg3xYwZEBVM6P3y5kJ3rQwt3n gBZAYoESklg6ujzXt6frpgqnUCBOd+sHN2M608M3XxbibjvfrtkUl4+gYuR3190K2oBR HzpCGwjFmcLwOWu7Od+cOrZWLr78Xkic1hU4ht1JwXf9X37J0roSIoKMz28N11tvwnt4 9ejg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:to:subject:ironport-sdr:ironport-sdr; bh=YbjbAAmfyxiXqu4GhP2ijx8V5sp3JG0MYxnZvWAEGKw=; b=IZbidHEj9jw/LLGW0xvJBMThgNjWcrUWwfBP6IpMBYinB/OuwnPzPC4h5CQy6pxm8O U8WI3resRGYyhWDi/i69kj2hI3pn0mYvK90Ni5vRB9gehcearBIfaTaEH4hJgrMDP5by QX5rIWcPV/uYKOKRw6E4ClxR6q/9J3gPitV5aEXhkzhQtqWxPhtr9avUmCA/6nyQGTrN Ap0jw2nCYr4JM752o3tva3SISD9PL2kg3wTnSc6OWFvnio3L22rZL7o2dxZAKCZDcCD6 lPkQTHvim+6RSG7dgwHfpzEiyLGqoQ0VVaE+YmUW2Nu8RxICn/glEz4Ceaal9Gta8bCm 7L0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si6690144edh.221.2020.11.29.23.49.09; Sun, 29 Nov 2020 23:49:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726929AbgK3Hpq (ORCPT + 99 others); Mon, 30 Nov 2020 02:45:46 -0500 Received: from mga12.intel.com ([192.55.52.136]:13438 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725965AbgK3Hpq (ORCPT ); Mon, 30 Nov 2020 02:45:46 -0500 IronPort-SDR: 0fPUOa1EkWo+xVwXLQm2kUzWS3dasgwe7g58gQJffV4hE5D2ZP8mOINi9+51bS2nDKLYfk5aVL GStoozAGvpRA== X-IronPort-AV: E=McAfee;i="6000,8403,9820"; a="151847525" X-IronPort-AV: E=Sophos;i="5.78,381,1599548400"; d="scan'208";a="151847525" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2020 23:45:00 -0800 IronPort-SDR: liIA8ZbwuNPRDI6KRgu+xm5FfHO1g6QnyEslL3jY2j5QosOCRi+0tMdlnATcgpT3QPVbg1HOfo fOti1ZambgVQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,381,1599548400"; d="scan'208";a="329485094" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.94]) ([10.237.72.94]) by orsmga003.jf.intel.com with ESMTP; 29 Nov 2020 23:44:54 -0800 Subject: Re: [RFC PATCH v3.1 13/27] mmc: sdhci-uhs2: add set_power() to support vdd2 To: AKASHI Takahiro , ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, ben.chuang@genesyslogic.com.tw, greg.tu@genesyslogic.com.tw References: <20201106022726.19831-1-takahiro.akashi@linaro.org> <20201106022726.19831-14-takahiro.akashi@linaro.org> <3b47a2d4-a281-3fac-29c4-82dd769459a1@intel.com> <20201130071550.GD48535@laputa> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Mon, 30 Nov 2020 09:44:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201130071550.GD48535@laputa> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/11/20 9:15 am, AKASHI Takahiro wrote: > On Thu, Nov 26, 2020 at 10:16:27AM +0200, Adrian Hunter wrote: >> On 6/11/20 4:27 am, AKASHI Takahiro wrote: >>> This is a UHS-II version of sdhci's set_power operation. >>> VDD2, as well as VDD, is handled here. >>> >>> Signed-off-by: Ben Chuang >>> Signed-off-by: AKASHI Takahiro >>> --- >>> drivers/mmc/host/sdhci-uhs2.c | 80 +++++++++++++++++++++++++++++++++++ >>> drivers/mmc/host/sdhci-uhs2.h | 2 + >>> drivers/mmc/host/sdhci.c | 58 +++++++++++++++---------- >>> drivers/mmc/host/sdhci.h | 2 + >>> 4 files changed, 119 insertions(+), 23 deletions(-) >>> >>> diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c >>> index e2b9743fe17d..2bf78cc4e9ed 100644 >>> --- a/drivers/mmc/host/sdhci-uhs2.c >>> +++ b/drivers/mmc/host/sdhci-uhs2.c >>> @@ -98,6 +98,86 @@ void sdhci_uhs2_reset(struct sdhci_host *host, u16 mask) >>> } >>> EXPORT_SYMBOL_GPL(sdhci_uhs2_reset); >>> >>> +void sdhci_uhs2_set_power(struct sdhci_host *host, unsigned char mode, >>> + unsigned short vdd) >> >> This function isn't used, so let's rename it sdhci_uhs2_set_power_noreg and >> drop regulator support. > > I have no strong opinion, but here Ben might want to further rework > the new sdhci_uhs2_set_power_noreg() now that it is almost the same as > GLI's gl9755_set_power()(, adding a new quirk?). > >>> +{ >>> + struct mmc_host *mmc = host->mmc; >>> + u8 pwr; >>> + >>> + /* FIXME: check if flags & MMC_UHS2_SUPPORT? */ >>> + if (!(host->mmc->caps & MMC_CAP_UHS2)) { >> >> As commented in another patch, please use a helper fn > > As said, I would defer this. > >>> + sdhci_set_power(host, mode, vdd); >>> + return; >>> + } >>> + >>> + if (mode != MMC_POWER_OFF) { >>> + pwr = sdhci_get_vdd_value(vdd); >> >> Simpler to open code this esp. as there are only 2 valid values: >> >> switch (1 << vdd) { > > Can you ignore MMC_VDD_165_195 and MMC_VDD_20_21 here? They are outside UHS-II spec, but you decide.