Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp720188pxu; Wed, 2 Dec 2020 01:21:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzi6YCf8c/3PxkiVMZfzbf98rHJcGI3D2KA2gjt+jvRzkpOIV257fZ3czXADfIMB8Fstli+ X-Received: by 2002:a05:6402:10ce:: with SMTP id p14mr1703667edu.12.1606900899950; Wed, 02 Dec 2020 01:21:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606900899; cv=none; d=google.com; s=arc-20160816; b=Sy7QntZhpI9pJ8GWJW1Dko3RYzW2FDIBx6+fgKqEpEyLs/q4JBcKJe3a1mgrQf7YbW SRAztaGEY5XDz1NZTCcaGcxasPldoMM02JXWe35T0rk+OE6EpbpDlB4y4iwqcXH+frNT NhgIMlULi4Eu0JUQALF3ras+bbUpaISrZU6lr6i0GoRjtukefcUK4FUklya1t0vCSvQu tjlHZUNQbtNgWEAnxq72SwqtPhU8e/plx4WntYxldi7geX57PBs67KImPbGeIDA9MjUa geCYkJN9ajz2xpdpMYgJJn6rwKO0O+yvwvsv7nTXLMrsvsL6Hqik48wIioGd9RlX/VGK /0qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=zNy/otYL40z0yuYwYUPFCuF1KIRVcjpILr1X5+aS3Fc=; b=hI+L85iGoedBA0kHLdwytS3ijk+/MvODhN7NmF4RKXB0aMoO+vyS8Myv/1AI90nzgY S5Z7XYeoZ3szO6+NaC5wLeWFGRFJYGVMRAm/1L6j2wul/hCjJIaKkcHR5Ew7+cmqWcLE /q2WxXW85L0PeybJ4lMq8DKVAwHgeeAyi9TgvR8dzQ1lQZuUgY8qNSiYSnEt+TUOApBo p8s+ukQJbHbCGBcVTuMjGKbpI1+h9568JYBY93yEU8bmVsPXMXeNHu5CcZtkUqC2a2qs 19aZ/sWZD/+zsNz5qCaWWPFVDL2YqQkkYKch0rjhksHG6roJXNiCBIi1WQAtCUNDKLhf 0Hgg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s13si532851ejv.28.2020.12.02.01.21.16; Wed, 02 Dec 2020 01:21:39 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388157AbgLBJTO (ORCPT + 99 others); Wed, 2 Dec 2020 04:19:14 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:42330 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2388132AbgLBJTM (ORCPT ); Wed, 2 Dec 2020 04:19:12 -0500 X-UUID: 4be2a8abb52d42e0ac6dff359f83e27b-20201202 X-UUID: 4be2a8abb52d42e0ac6dff359f83e27b-20201202 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2054784308; Wed, 02 Dec 2020 17:18:28 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 2 Dec 2020 17:18:19 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 2 Dec 2020 17:18:19 +0800 From: Stanley Chu To: , , , , CC: , , , , , , , , , , , , , , , , Stanley Chu Subject: [PATCH v3] scsi: ufs: Remove pre-defined initial voltage values of device powers Date: Wed, 2 Dec 2020 17:18:19 +0800 Message-ID: <20201202091819.22363-1-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org UFS specficication allows different VCC configurations for UFS devices, for example, (1). 2.70V - 3.60V (Activated by default in UFS core driver) (2). 1.70V - 1.95V (Activated if "vcc-supply-1p8" is declared in device tree) (3). 2.40V - 2.70V (Supported since UFS 3.x) With the introduction of UFS 3.x products, an issue is happening that UFS driver will use wrong "min_uV-max_uV" values to configure the voltage of VCC regulator on UFU 3.x products with the configuration (3) used. To solve this issue, we simply remove pre-defined initial VCC voltage values in UFS core driver with below reasons, 1. UFS specifications do not define how to detect the VCC configuration supported by attached device. 2. Device tree already supports standard regulator properties. Therefore VCC voltage shall be defined correctly in device tree, and shall not changed by UFS driver. What UFS driver needs to do is simply enable or disable the VCC regulator only. Similar change is applied to VCCQ and VCCQ2 as well. Note that we keep struct ufs_vreg unchanged. This allows vendors to configure proper min_uV and max_uV of any regulators to make regulator_set_voltage() works during regulator toggling flow in the future. Without specific vendor configurations, min_uV and max_uV will be NULL by default and UFS core driver will enable or disable the regulator only without adjusting its voltage. Acked-by: Avri Altman Reviewed-by: Asutosh Das Reviewed-by: Bjorn Andersson Signed-off-by: Stanley Chu --- drivers/scsi/ufs/ufshcd-pltfrm.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c index 0619cfbfbdbb..1a69949a4ea1 100644 --- a/drivers/scsi/ufs/ufshcd-pltfrm.c +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c @@ -134,25 +134,6 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name, dev_info(dev, "%s: unable to find %s\n", __func__, prop_name); vreg->max_uA = 0; } - - if (!strcmp(name, "vcc")) { - if (of_property_read_bool(np, "vcc-supply-1p8")) { - vreg->min_uV = UFS_VREG_VCC_1P8_MIN_UV; - vreg->max_uV = UFS_VREG_VCC_1P8_MAX_UV; - } else { - vreg->min_uV = UFS_VREG_VCC_MIN_UV; - vreg->max_uV = UFS_VREG_VCC_MAX_UV; - } - } else if (!strcmp(name, "vccq")) { - vreg->min_uV = UFS_VREG_VCCQ_MIN_UV; - vreg->max_uV = UFS_VREG_VCCQ_MAX_UV; - } else if (!strcmp(name, "vccq2")) { - vreg->min_uV = UFS_VREG_VCCQ2_MIN_UV; - vreg->max_uV = UFS_VREG_VCCQ2_MAX_UV; - } - - goto out; - out: if (!ret) *out_vreg = vreg; -- 2.18.0