2020-12-07 05:52:50

by Stanley Chu

[permalink] [raw]
Subject: [PATCH v1 0/2] scsi: ufs: Allow regulators being always on

Hi,
This series allow vendors to keep the regulator always-on, and provide an implementation on MediaTek UFS platforms.

Stanley Chu (2):
scsi: ufs: Allow regulators being always-on
scsi: ufs-mediatek: Keep VCC always-on for specific devices

drivers/scsi/ufs/ufs-mediatek.c | 21 +++++++++++++++++++++
drivers/scsi/ufs/ufs-mediatek.h | 1 +
drivers/scsi/ufs/ufs.h | 1 +
drivers/scsi/ufs/ufshcd.c | 2 +-
4 files changed, 24 insertions(+), 1 deletion(-)

--
2.18.0


2020-12-07 05:53:23

by Stanley Chu

[permalink] [raw]
Subject: [PATCH v1 1/2] scsi: ufs: Allow regulators being always-on

Introduce a flag "always_on" in struct ufs_vreg to allow vendors
to keep the regulator always-on.

Reviewed-by: Andy Teng <[email protected]>
Signed-off-by: Stanley Chu <[email protected]>
---
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

2020-12-09 03:00:47

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH v1 0/2] scsi: ufs: Allow regulators being always on


Stanley,

> This series allow vendors to keep the regulator always-on, and provide
> an implementation on MediaTek UFS platforms.

Applied to 5.11/scsi-staging, thanks!

--
Martin K. Petersen Oracle Linux Engineering