Commit f8162ac7 authored by Stanley Chu's avatar Stanley Chu Committed by Martin K. Petersen

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.

Link: https://lore.kernel.org/r/20201207054955.24366-2-stanley.chu@mediatek.comReviewed-by: default avatarAndy Teng <andy.teng@mediatek.com>
Signed-off-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 1918651f
...@@ -512,6 +512,7 @@ struct ufs_query_res { ...@@ -512,6 +512,7 @@ struct ufs_query_res {
struct ufs_vreg { struct ufs_vreg {
struct regulator *reg; struct regulator *reg;
const char *name; const char *name;
bool always_on;
bool enabled; bool enabled;
int min_uV; int min_uV;
int max_uV; int max_uV;
......
...@@ -8012,7 +8012,7 @@ static int ufshcd_disable_vreg(struct device *dev, struct ufs_vreg *vreg) ...@@ -8012,7 +8012,7 @@ static int ufshcd_disable_vreg(struct device *dev, struct ufs_vreg *vreg)
{ {
int ret = 0; int ret = 0;
if (!vreg || !vreg->enabled) if (!vreg || !vreg->enabled || vreg->always_on)
goto out; goto out;
ret = regulator_disable(vreg->reg); ret = regulator_disable(vreg->reg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment