All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nitin Rawat <nitirawa@codeaurora.org>
To: asutoshd@codeaurora.org, cang@codeaurora.org,
	stummala@codeaurora.org, vbadigan@codeaurora.org,
	alim.akhtar@samsung.com, avri.altman@wdc.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, stanley.chu@mediatek.com,
	beanhuo@micron.com
Cc: bvanassche@acm.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Nitin Rawat <nitirawa@codeaurora.org>,
	"Bao D . Nguyen" <nguyenb@codeaurora.org>
Subject: [PATCH V1 2/3] scsi: ufs: add a vops to configure VCC voltage level
Date: Thu, 28 Jan 2021 22:24:58 +0530	[thread overview]
Message-ID: <1611852899-2171-3-git-send-email-nitirawa@codeaurora.org> (raw)
In-Reply-To: <1611852899-2171-1-git-send-email-nitirawa@codeaurora.org>

Add a vops to configure VCC voltage VCC voltage level
for platform supporting both ufs2.x and ufs 3.x devices.

Signed-off-by: Nitin Rawat <nitirawa@codeaurora.org>
Signed-off-by: Bao D. Nguyen <nguyenb@codeaurora.org>
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
---
 drivers/scsi/ufs/ufshcd.c |  5 +++++
 drivers/scsi/ufs/ufshcd.h | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 000a03a..3b2e026 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -7772,6 +7772,11 @@ static int ufshcd_add_lus(struct ufs_hba *hba)
 	if (ret)
 		goto out;

+	if (ufshcd_vops_setup_vcc_regulators(hba))
+		dev_err(hba->dev,
+			"%s: Failed to set the VCC regulator values, continue with 2.7v\n",
+			__func__);
+
 	/* Initialize devfreq after UFS device is detected */
 	if (ufshcd_is_clkscaling_supported(hba)) {
 		memcpy(&hba->clk_scaling.saved_pwr_info.info,
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 1410c95..250cff5 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -324,6 +324,7 @@ struct ufs_pwr_mode_info {
  * @device_reset: called to issue a reset pulse on the UFS device
  * @program_key: program or evict an inline encryption key
  * @event_notify: called to notify important events
+ * @setup_vcc_regulators : update vcc regulator level
  */
 struct ufs_hba_variant_ops {
 	const char *name;
@@ -360,6 +361,7 @@ struct ufs_hba_variant_ops {
 			       const union ufs_crypto_cfg_entry *cfg, int slot);
 	void	(*event_notify)(struct ufs_hba *hba,
 				enum ufs_event_type evt, void *data);
+	int    (*setup_vcc_regulators)(struct ufs_hba *hba);
 };

 /* clock gating state  */
@@ -1269,6 +1271,14 @@ static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba,
 		hba->vops->config_scaling_param(hba, profile, data);
 }

+static inline int ufshcd_vops_setup_vcc_regulators(struct ufs_hba *hba)
+{
+	if (hba->vops && hba->vops->setup_vcc_regulators)
+		return hba->vops->setup_vcc_regulators(hba);
+
+	return 0;
+}
+
 extern struct ufs_pm_lvl_states ufs_pm_lvl_states[];

 /*
--
2.7.4


  parent reply	other threads:[~2021-01-28 16:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 16:54 [PATCH V1 0/3] scsi: ufs: Add a vops to configure VCC voltage level Nitin Rawat
2021-01-28 16:54 ` [PATCH V1 1/3] scsi: ufs: export api for use in vendor file Nitin Rawat
     [not found]   ` <DM6PR04MB657574D3D8B99F3A4997D810FCB79@DM6PR04MB6575.namprd04.prod.outlook.com>
2021-02-01  8:10     ` nitirawa
2021-01-28 16:54 ` Nitin Rawat [this message]
2021-01-28 16:54 ` [PATCH V1 3/3] scsi: ufs-qcom: configure VCC voltage level " Nitin Rawat
     [not found] ` <DM6PR04MB6575D0348161330D21A9B6C5FCB79@DM6PR04MB6575.namprd04.prod.outlook.com>
2021-02-01  8:31   ` [PATCH V1 0/3] scsi: ufs: Add a vops to configure VCC voltage level nitirawa
2021-02-08 10:30     ` nitirawa
2021-02-08 12:22       ` Avri Altman
2021-02-19 13:29         ` nitirawa

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=1611852899-2171-3-git-send-email-nitirawa@codeaurora.org \
    --to=nitirawa@codeaurora.org \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nguyenb@codeaurora.org \
    --cc=stanley.chu@mediatek.com \
    --cc=stummala@codeaurora.org \
    --cc=vbadigan@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.