linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Stanley Chu <stanley.chu@mediatek.com>
To: <linux-scsi@vger.kernel.org>, <martin.petersen@oracle.com>,
	<avri.altman@wdc.com>, <alim.akhtar@samsung.com>,
	<pedrom.sousa@synopsys.com>
Cc: marc.w.gonzalez@free.fr, chun-hung.wu@mediatek.com,
	kuohong.wang@mediatek.com, evgreen@chromium.org,
	subhashj@codeaurora.org, linux-mediatek@lists.infradead.org,
	peter.wang@mediatek.com, vivek.gautam@codeaurora.org,
	matthias.bgg@gmail.com, sayalil@codeaurora.org,
	Stanley Chu <stanley.chu@mediatek.com>,
	linux-arm-kernel@lists.infradead.org, beanhuo@micron.com
Subject: [PATCH v4 5/5] scsi: ufs: Remove "<name>-fixed-regulator" device tree property
Date: Thu, 28 Mar 2019 17:16:27 +0800	[thread overview]
Message-ID: <1553764587-26357-6-git-send-email-stanley.chu@mediatek.com> (raw)
In-Reply-To: <1553764587-26357-1-git-send-email-stanley.chu@mediatek.com>

"<name>-fixed-regulator" device tree property can be
safely removed because below things are fixed or resolved,

1. "<name>-max-microamp" becomes optional property: Undefined
   "<name>-max-microamp" will not cause initialization fail if
   "<name>-fixed-regulator" is not defined.

2. Current switching operation (by regulator_set_load) now has rules:
   Regulators will have undefined current limit if
   "<name>-fixed-regulator" is not defined. But this is safe because
   only regulator which has configured current limit from
   "<name>-max-microamp" property is allowed to change its load.

Although "<name>-fixed-regulator" is not used in any dt-bindings
in tree, this patch is still safe for regulators already defined
"<name>-fixed-regulator". To be more clear, if a regulator defined
"<name>-fixed-regulator" before, the behavior difference after
this patch is,

1. "<name>-max-microamp":
   If a regulator defined "<name>-fixed-regulator", it is not necessary
   to define "<name>-max-microamp" property in device tree and it is
   expected to have an undefined current limit, i.e., "max_uA" field
   is zero in struct ufs_vreg. This is exactly the same as patched.

2. "vcc-supply-1p8" or volatge range settings:
   * For vcc, vccq or vccq2, these three regulators shall not define
     "<name>-fixed-regulator" because defining it will lead to
     undefined voltage range and thus voltage switching will be
     unexpected.
   * For other regulators with undefined voltage range, voltage range
     will be still undefined after patched.

Therefore this patch is safe for all existed regulators with
"<name>-fixed-regulator" property already defined.

Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Acked-by: Alim Akhtar <alim.akhtar@samsung.com>
---
 drivers/scsi/ufs/ufshcd-pltfrm.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
index 2420e6962219..7b404df965b2 100644
--- a/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -151,11 +151,6 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name,
 
 	vreg->name = kstrdup(name, GFP_KERNEL);
 
-	/* if fixed regulator no need further initialization */
-	snprintf(prop_name, MAX_PROP_SIZE, "%s-fixed-regulator", name);
-	if (of_property_read_bool(np, prop_name))
-		goto out;
-
 	snprintf(prop_name, MAX_PROP_SIZE, "%s-max-microamp", name);
 	if (of_property_read_u32(np, prop_name, &vreg->max_uA)) {
 		dev_info(dev, "%s: unable to find %s\n", __func__, prop_name);
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-03-28  9:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28  9:16 [PATCH v4 0/5] scsi: ufs: Fix regulator operations and remove "<name>-fixed-regulator" device tree property Stanley Chu
2019-03-28  9:16 ` [PATCH v4 1/5] scsi: ufs: Remove unused min_uA field in struct ufs_vreg Stanley Chu
2019-03-28  9:16 ` [PATCH v4 2/5] scsi: ufs: Avoid configuring regulator with undefined voltage range Stanley Chu
2019-03-28  9:16 ` [PATCH v4 3/5] scsi: ufs: Fix regulator load and icc-level configuration Stanley Chu
2019-03-28  9:16 ` [PATCH v4 4/5] scsi: ufs: Change "<name>-max-microamp" to non-mandatory property Stanley Chu
2019-03-28  9:16 ` Stanley Chu [this message]
2019-03-29 14:21 ` [PATCH v4 0/5] scsi: ufs: Fix regulator operations and remove "<name>-fixed-regulator" device tree property Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1553764587-26357-6-git-send-email-stanley.chu@mediatek.com \
    --to=stanley.chu@mediatek.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=chun-hung.wu@mediatek.com \
    --cc=evgreen@chromium.org \
    --cc=kuohong.wang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=marc.w.gonzalez@free.fr \
    --cc=martin.petersen@oracle.com \
    --cc=matthias.bgg@gmail.com \
    --cc=pedrom.sousa@synopsys.com \
    --cc=peter.wang@mediatek.com \
    --cc=sayalil@codeaurora.org \
    --cc=subhashj@codeaurora.org \
    --cc=vivek.gautam@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).