Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1142661pxb; Thu, 28 Jan 2021 08:59:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZrBYpFbXxtmz8SBwxyGFhKVMnD+kNwOCkmbHXiUkqiz372MpJUnU4PrPW4pNlnkRH/HNO X-Received: by 2002:a05:6402:54d:: with SMTP id i13mr564442edx.12.1611853163510; Thu, 28 Jan 2021 08:59:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611853163; cv=none; d=google.com; s=arc-20160816; b=i6MoPHyXl3zUW5CajYVJZwoC5XThlaWFWqGUNU6Kg/6kOg7e252MkYRSgaAVxUEALE I8J5tuw+/WRvHrBt1qNYB7wh0e2+9MI1ijgIs0A1Uv6RdD0SHajyYm9ScbfrWHfjFmTR 7HkfCZ8qb/vPOklBW1yapGYed5iDKI9WsjOTZ7UlLC0+P/1kvUbt+4mbnDZsqkxQ2X3C JmQ3xUeDXI1pM3L+KLOGS6B9XgVcaZCjYteE+iAZ3b8c1XRXX5IwwcUjAZN9yRqU0hlM 7k72NES8eUoyAEPCOWBx/67/8tgaOvznCKUxl11rXm9PLC/Rd2g1iS6C6/yvmHxOFEZ6 xsog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=n01c6T/jVGl4vRg2eap9n3EP4rMmiuK0y+qdvZ5by54=; b=kZ/LusiNGCEXug72kHGkYFCnjDELUv6SGzClaVo1pH2qvQJfGb01os2yqqamjV1iZ5 z82vSz5JHudv9h91kchpYUNYXp4WvO0XFBlaXnswnlFdHPlHGZKXH4Y6gbdUThtVzeJl 2mYpfq6AEniB/M8HZvsNXd7ci/xPqfPLSexjDexJ3BvkowVK8e0Ta1F7C6lGe+lrnl4j OdtzeHUPmTsDapmuPTC7loZ63g5MQF+59PCdIWqRerx2N/Y45ZAZ3eRBIhOGGs4oa7T9 B8Hrw9yhydDIrkHn8lQZZijF3T9b9Ej1WT+TiIRBZsmySXkiqnZGW0aXIbgQ2RowJSUu MmOA== 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 x23si3014639ejv.558.2021.01.28.08.58.59; Thu, 28 Jan 2021 08:59:23 -0800 (PST) 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 S232378AbhA1Q4U (ORCPT + 99 others); Thu, 28 Jan 2021 11:56:20 -0500 Received: from alexa-out.qualcomm.com ([129.46.98.28]:62233 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbhA1Q4M (ORCPT ); Thu, 28 Jan 2021 11:56:12 -0500 Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 28 Jan 2021 08:55:30 -0800 X-QCInternal: smtphost Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/AES256-SHA; 28 Jan 2021 08:55:28 -0800 X-QCInternal: smtphost Received: from nitirawa-linux.qualcomm.com ([10.206.25.176]) by ironmsg02-blr.qualcomm.com with ESMTP; 28 Jan 2021 22:25:01 +0530 Received: by nitirawa-linux.qualcomm.com (Postfix, from userid 2342877) id D5C3C2A73; Thu, 28 Jan 2021 22:25:01 +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 Cc: bvanassche@acm.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Nitin Rawat Subject: [PATCH V1 0/3] scsi: ufs: Add a vops to configure VCC voltage level Date: Thu, 28 Jan 2021 22:24:56 +0530 Message-Id: <1611852899-2171-1-git-send-email-nitirawa@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org UFS specification allows different VCC configurations for UFS devices, for example, (1)2.70V - 3.60V (For UFS 2.x devices) (2)2.40V - 2.70V (For UFS 3.x devices) For platforms supporting both ufs 2.x (2.7v-3.6v) and ufs 3.x (2.4v-2.7v), the voltage requirements (VCC) is 2.4v-3.6v. So to support this, we need to start the ufs device initialization with the common VCC voltage(2.7v) and after reading the device descriptor we need to switch to the correct range(vcc min and vcc max) of VCC voltage as per UFS device type since 2.7v is the marginal voltage as per specs for both type of devices. Once VCC regulator supply has been intialised to 2.7v and UFS device type is read from device descriptor, we follows below steps to change the VCC voltage values. 1. Set the device to SLEEP state. 2. Disable the Vcc Regulator. 3. Set the vcc voltage according to the device type and reenable the regulator. 4. Set the device mode back to ACTIVE. The above changes are done in vendor specific file by adding a vops which will be needed for platform supporting both ufs 2.x and ufs 3.x devices. Nitin Rawat (3): scsi: ufs: export api for use in vendor file scsi: ufs: add a vops to configure VCC voltage level scsi: ufs-qcom: configure VCC voltage level in vendor file drivers/scsi/ufs/ufs-qcom.c | 51 +++++++++++++++++++++++++++++++++++++++++++++ drivers/scsi/ufs/ufshcd.c | 14 ++++++++++--- drivers/scsi/ufs/ufshcd.h | 14 +++++++++++++ 3 files changed, 76 insertions(+), 3 deletions(-) -- 2.7.4