Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2160627pxu; Sun, 6 Dec 2020 21:53:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQIYjZIqFfyTbsgKY8fqVH5R/RY8l2+2rcBhpz+DS1B8BbMoUvXjP2LkjmW1hywwPwV+Ac X-Received: by 2002:a17:906:ae41:: with SMTP id lf1mr17872529ejb.369.1607320402802; Sun, 06 Dec 2020 21:53:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607320402; cv=none; d=google.com; s=arc-20160816; b=bGiTwYDq9mjsZ7sH8z/IWsufw1b1C00jq3Xm4CKm/DkhPcbMUF8zX84PjWd9s4gcaR xK5aAAuFkpeZIMxICHooFDCoAZ9MYFzai3XnjwhqFwfoSlhKmcZRMbSQ3LM76xC1hdON Y7w+xI8YQO0GO38VKuVmsWXVDx2UW45F8/O3AgpyIKtIWW8x070W4cMUOG+Jl3Mxnklm W9YrErS4ISTahm9b3SdrYpKW7jBg6zFzW9JC5FhCvezrj2RRIOpKss0EkutmSdTfLgb8 21zKwk8AasIi9sjQmibcg/LT1kilYfT5MNkND/aNKgRaH6mJXb0I7+oeY0d/rASZl3wW RWZQ== ARC-Message-Signature: i=1; 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; bh=sxPjBWWryaVrtJKSxn00D1UOB5h8ie3epQqK9zhgnIc=; b=r5QYGArMPO/iOfPszj1hfR7HjM0xlRortW5zjAuwOsqJVxO59pmACl0sfwa5TqXko4 6118V71TZkH5nzKdmP9MVkGNPS9kNzULzW26mrhjdNlfZGp+bZDpf4q225H/owsUVWe5 mdkHKuH5Kx+hMmP13z4gauVeFtDxu0htP0jiwnke2ha3QaAO5ZRofwyvk2xW3ZxLFAHI h3JJA6qOy4eUnOFtpuFi/0TVJe1dCxgn9pokVtozm385YIXv5l9KHbD28XToqwxLBtMV FjoEDrk+xWuhTHolJx95DP8z3JIURVhbemThVF3n/awcaJXU1zhTwKY4dPeOV8UzIK+0 T+9g== 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p1si5744560ejf.418.2020.12.06.21.53.00; Sun, 06 Dec 2020 21:53:22 -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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725966AbgLGFun (ORCPT + 99 others); Mon, 7 Dec 2020 00:50:43 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:57343 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725819AbgLGFum (ORCPT ); Mon, 7 Dec 2020 00:50:42 -0500 X-UUID: 23ce1bc6ea4d42f0833bcee470ec59c0-20201207 X-UUID: 23ce1bc6ea4d42f0833bcee470ec59c0-20201207 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1241344740; Mon, 07 Dec 2020 13:49:58 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 7 Dec 2020 13:49:56 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 7 Dec 2020 13:49:55 +0800 From: Stanley Chu To: , , , , CC: , , , , , , , , , , , , , , , , Stanley Chu Subject: [PATCH v1 1/2] scsi: ufs: Allow regulators being always-on Date: Mon, 7 Dec 2020 13:49:54 +0800 Message-ID: <20201207054955.24366-2-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201207054955.24366-1-stanley.chu@mediatek.com> References: <20201207054955.24366-1-stanley.chu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce a flag "always_on" in struct ufs_vreg to allow vendors to keep the regulator always-on. Reviewed-by: Andy Teng Signed-off-by: Stanley Chu --- drivers/scsi/ufs/ufs.h | 1 + drivers/scsi/ufs/ufshcd.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h index d593edb48767..26f929afbcef 100644 --- a/drivers/scsi/ufs/ufs.h +++ b/drivers/scsi/ufs/ufs.h @@ -513,6 +513,7 @@ struct ufs_query_res { struct ufs_vreg { struct regulator *reg; const char *name; + bool always_on; bool enabled; int min_uV; int max_uV; diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 6e72c0543c7b..4879e87577e1 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7973,7 +7973,7 @@ static int ufshcd_disable_vreg(struct device *dev, struct ufs_vreg *vreg) { int ret = 0; - if (!vreg || !vreg->enabled) + if (!vreg || !vreg->enabled || vreg->always_on) goto out; ret = regulator_disable(vreg->reg); -- 2.18.0