From patchwork Mon Mar 18 02:14:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanley Chu X-Patchwork-Id: 10856753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 693101575 for ; Mon, 18 Mar 2019 02:14:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E63A2912F for ; Mon, 18 Mar 2019 02:14:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42ADC29165; Mon, 18 Mar 2019 02:14:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8FCE2912F for ; Mon, 18 Mar 2019 02:14:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727737AbfCRCO6 (ORCPT ); Sun, 17 Mar 2019 22:14:58 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:11327 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727571AbfCRCO6 (ORCPT ); Sun, 17 Mar 2019 22:14:58 -0400 X-UUID: 0d739476ab8b495a8959947ca4b5a35c-20190318 X-UUID: 0d739476ab8b495a8959947ca4b5a35c-20190318 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 885584143; Mon, 18 Mar 2019 10:14:43 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 18 Mar 2019 10:14:42 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 18 Mar 2019 10:14:42 +0800 From: Stanley Chu To: , , , , CC: , , , , , , Stanley Chu Subject: [PATCH v3 5/5] scsi: ufs: Remove "-fixed-regulator" device tree property Date: Mon, 18 Mar 2019 10:14:40 +0800 Message-ID: <1552875280-16196-7-git-send-email-stanley.chu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1552875280-16196-1-git-send-email-stanley.chu@mediatek.com> References: <1552875280-16196-1-git-send-email-stanley.chu@mediatek.com> MIME-Version: 1.0 X-MTK: N Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP "-fixed-regulator" device tree property can be safely removed because below things are fixed or resolved, 1. "-max-microamp" becomes optional property: Undefined "-max-microamp" will not cause initialization fail if "-fixed-regulator" is not defined. 2. Current switching operation (by regulator_set_load) now has rules: Regulators will have undefined current limit if "-fixed-regulator" is not defined. But this is safe because only regulator which has configured current limit from "-max-microamp" property is allowed to change its load. Although "-fixed-regulator" is not used in any dt-bindings in tree, this patch is still safe for regulators already defined "-fixed-regulator", the reason is described as below. If a regulator defined "-fixed-regulator" before, the behavior after this patch is described as below, 1. "-max-microamp": If a regulator defined "-fixed-regulator", it is not necessary to define "-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 "-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 "-fixed-regulator" property already defined. Signed-off-by: Stanley Chu --- 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 2f244d388ca8..a667e7ba1c8b 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);