Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3042309pxf; Sun, 21 Mar 2021 16:44:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7cy5HNeHsMc9cGwwVYZz3C+/O9xo4R2KRyrsr9643t2H+MgitdJ2/OhfJ0kGCcynPf14e X-Received: by 2002:a17:906:379b:: with SMTP id n27mr16864523ejc.182.1616370293106; Sun, 21 Mar 2021 16:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616370293; cv=none; d=google.com; s=arc-20160816; b=dwMNB8Mtib/WnU3n99bHpa1fSLYaEitv+9bahMLIEvTjzwlUnBwLcmSl/qAuTRsAfA 1zHTQeO1IQFqkjsJxF4t1paU9gwMV01MCQc62foF3AfLYM+FTTqcgceDgzA3bN46G1A2 Kca7ep3x2kNmqmPiLqt0tdHXFiC8Qr54qMn8njLFiEUyj/7IyyDOzU583lamgzfu/YIG W+sb9AmBAYKYKtfEkKm7ydcDvY2+GaYMTa0tTFAqUI/jwdhJT20IO2rvPVi03QIEw3ZV ZTXwUc6vRRCOPFjQsmmDD0iDCa9C85F6GHPFsubRhbjsXlY1hEervAYeAANbNsTbTGb0 E+SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=LZfmryRegfKHiXZroaw/pBUe/lXLFx+2liRRUWAmzPQ=; b=j2W9isXtqpGdR94529HI/MH9x+WTBg2lEmcpeMrVik34WBxo9IjbXahusiQ9vKwCId lCYSCYO/k0Uh5Pi2bysWFmpzel2/2asCkCxjRGr2Wwrfaft9pAPtulKhuRuRyCZxJB0Z SMcXUiZRsMMm9bi0OoLt4sQ6F55SSIY9lLGOM/DQyelJ2ic6CtmQFsstu0Pe6dYkTSVM 73/ToaqD/iKbCxlPuo46qp5KvI5iZZE/KkwE+vqjbg6nr0Tzt+5QXSzQYd2mGrP0GXHY mI6zdH6Cnjkil/ucLNFUwwL6zqhUqYcGdXANxw5X5RPDGNqBGsM6TGq9Ss0DO5ULI/lV Ju9w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hc43si10096710ejc.529.2021.03.21.16.44.31; Sun, 21 Mar 2021 16:44:53 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231644AbhCUV6u (ORCPT + 99 others); Sun, 21 Mar 2021 17:58:50 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:40323 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231570AbhCUV6X (ORCPT ); Sun, 21 Mar 2021 17:58:23 -0400 Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 21 Mar 2021 14:58:23 -0700 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/AES256-SHA; 21 Mar 2021 14:58:22 -0700 X-QCInternal: smtphost Received: from maggarwa.ap.qualcomm.com (HELO nitirawa-linux.qualcomm.com) ([10.206.25.176]) by ironmsg01-blr.qualcomm.com with ESMTP; 22 Mar 2021 03:27:47 +0530 Received: by nitirawa-linux.qualcomm.com (Postfix, from userid 2342877) id BB5752E1C; Mon, 22 Mar 2021 03:27:46 +0530 (IST) From: Nitin Rawat 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, bjorn.andersson@linaro.org, adrian.hunter@intel.com, bvanassche@acm.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Nitin Rawat Subject: [PATCH V2 2/3] scsi: ufs: add a vops to configure VCC voltage level Date: Mon, 22 Mar 2021 03:27:36 +0530 Message-Id: <1616363857-26760-3-git-send-email-nitirawa@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1616363857-26760-1-git-send-email-nitirawa@codeaurora.org> References: <1616363857-26760-1-git-send-email-nitirawa@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a vops to configure VCC voltage VCC voltage level for platform supporting both ufs2.x and ufs 3.x devices. Suggested-by: Stanley Chu Suggested-by: Asutosh Das Suggested-by: Bjorn Andersson Signed-off-by: Nitin Rawat Signed-off-by: Veerabhadrarao Badiganti --- drivers/scsi/ufs/ufshcd.c | 4 ++++ drivers/scsi/ufs/ufshcd.h | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 633ca8e..5bfe987 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7763,6 +7763,10 @@ static int ufshcd_add_lus(struct ufs_hba *hba) goto out; ufshcd_clear_ua_wluns(hba); + 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)) { diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 0db796a..8f0945d 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