From patchwork Tue Oct 3 15:21:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 9983135 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C0708602B8 for ; Tue, 3 Oct 2017 15:31:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2D212865F for ; Tue, 3 Oct 2017 15:31:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A775A289AF; Tue, 3 Oct 2017 15:31:31 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 70F6F2865F for ; Tue, 3 Oct 2017 15:31:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752374AbdJCPar (ORCPT ); Tue, 3 Oct 2017 11:30:47 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:19555 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751953AbdJCP3N (ORCPT ); Tue, 3 Oct 2017 11:29:13 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20171003152911epoutp032d85a0613649e65b181516579baf26fd~qGQjjwG721430314303epoutp03k; Tue, 3 Oct 2017 15:29:11 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.42.70]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20171003152910epcas2p28a4fb330f59a05becbab42f65b552d31~qGQi5nvBS2425424254epcas2p24; Tue, 3 Oct 2017 15:29:10 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id F0.D4.04435.6CCA3D95; Wed, 4 Oct 2017 00:29:10 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20171003152910epcas2p3a89515a352b8291d7cdeb5a97536d2a8~qGQiozzOf2533325333epcas2p3v; Tue, 3 Oct 2017 15:29:10 +0000 (GMT) X-AuditID: b6c32a46-acbff70000001153-6f-59d3acc68de1 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id C2.0E.06856.6CCA3D95; Wed, 4 Oct 2017 00:29:10 +0900 (KST) Received: from exypnos.sisodomain.com ([107.108.73.28]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OX9009P670EU180@mmp1.samsung.com>; Wed, 04 Oct 2017 00:29:10 +0900 (KST) From: Alim Akhtar To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: vinholikatti@gmail.com, martin.petersen@oracle.com, subhashj@codeaurora.org, Bart.VanAssche@wdc.com Subject: [PATCH v2 v2 2/4] scsi: ufs-qcom: Remove uses of UFS_BIT() macro Date: Tue, 03 Oct 2017 20:51:23 +0530 Message-id: <1507044085-16905-2-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1507044085-16905-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHIsWRmVeSWpSXmKPExsWy7bCmme6xNZcjDX7ukrG49OcLo8XlXXPY LLqv72CzWH78H5PFjcU72Sx2LKxyYPO43NfL5LFz1l12j49Pb7F4fN4k59F+oJspgD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h4SlzbNZASxhUBqfi5mnsDIs4CRYRWjZGpBcW56 brFRgVFearlecWJucWleul5yfu4mRmDobDus1b+D8fGS+EOMAhyMSjy8NyZcjhRiTSwrrsw9 xCjBwawkwrtuBVCINyWxsiq1KD++qDQntfgQozQHi5I4L3/+sUghgfTEktTs1NSC1CKYLBMH p1QDo7DFjWuWP2XaWmf4OZvUtZYZVMq6LD27pe6M+aF13y7wHa/oNbn/cemKlBdb/9szVWnl b7aJNo6S3pwhw//i/2QBM93brNsvZudufCRp3MBbU8XhrZYvHVKf1lvbrxb17ZsSz0GbSieF qcrNP99WKWvVrD2SoFbXufmVdGRliOOdsLvnkq4rsRRnJBpqMRcVJwIAbB7dehkCAAA= X-CMS-MailID: 20171003152910epcas2p3a89515a352b8291d7cdeb5a97536d2a8 X-Msg-Generator: CA X-Sender-IP: 182.195.42.143 X-Local-Sender: =?UTF-8?B?7JWM66a8G1NTSVItRkRTIFNXG+yCvOyEseyghOyekBsuL1Nl?= =?UTF-8?B?bmlvciBDaGllZiBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?QUxJTSBBS0hUQVIbU1NJUi1GRFMgU1cbU2Ftc3VuZyBFbGVj?= =?UTF-8?B?dHJvbmljcxsuL1NlbmlvciBDaGllZiBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG1NXQUhRG0MxMElEMDdJRDAxMDk5Nw==?= CMS-TYPE: 102P X-CMS-RootMailID: 20171003152910epcas2p3a89515a352b8291d7cdeb5a97536d2a8 X-RootMTR: 20171003152910epcas2p3a89515a352b8291d7cdeb5a97536d2a8 References: <1507044085-16905-1-git-send-email-alim.akhtar@samsung.com> 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 Use actual bit position instead of UFS_BIT() macro. This patch also changes bit-17 to meaningful #define. This change is as per discussion here [1] [1] -> https://lkml.org/lkml/2017/8/28/786 Signed-off-by: Alim Akhtar Cc: Subhash Jadavani Reviewed-by: Bart Van Assche --- drivers/scsi/ufs/ufs-qcom.c | 4 ++-- drivers/scsi/ufs/ufs-qcom.h | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index c87d770..6a548e7 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -1458,7 +1458,7 @@ static void ufs_qcom_print_hw_debug_reg_all(struct ufs_hba *hba, print_fn(hba, reg, 44, "UFS_UFS_DBG_RD_REG_OCSC ", priv); reg = ufshcd_readl(hba, REG_UFS_CFG1); - reg |= UFS_BIT(17); + reg |= UTP_DBG_RAMS_EN; ufshcd_writel(hba, reg, REG_UFS_CFG1); reg = ufs_qcom_get_debug_reg_offset(host, UFS_UFS_DBG_RD_EDTL_RAM); @@ -1471,7 +1471,7 @@ static void ufs_qcom_print_hw_debug_reg_all(struct ufs_hba *hba, print_fn(hba, reg, 64, "UFS_UFS_DBG_RD_PRDT_RAM ", priv); /* clear bit 17 - UTP_DBG_RAMS_EN */ - ufshcd_rmwl(hba, UFS_BIT(17), 0, REG_UFS_CFG1); + ufshcd_rmwl(hba, UTP_DBG_RAMS_EN, 0, REG_UFS_CFG1); reg = ufs_qcom_get_debug_reg_offset(host, UFS_DBG_RD_REG_UAWM); print_fn(hba, reg, 4, "UFS_DBG_RD_REG_UAWM ", priv); diff --git a/drivers/scsi/ufs/ufs-qcom.h b/drivers/scsi/ufs/ufs-qcom.h index 076f528..295f4be 100644 --- a/drivers/scsi/ufs/ufs-qcom.h +++ b/drivers/scsi/ufs/ufs-qcom.h @@ -92,7 +92,8 @@ enum { #define UFS_CNTLR_3_x_x_VEN_REGS_OFFSET(x) (0x400 + x) /* bit definitions for REG_UFS_CFG1 register */ -#define QUNIPRO_SEL UFS_BIT(0) +#define QUNIPRO_SEL 0x1 +#define UTP_DBG_RAMS_EN 0x20000 #define TEST_BUS_EN BIT(18) #define TEST_BUS_SEL GENMASK(22, 19) #define UFS_REG_TEST_BUS_EN BIT(30) @@ -213,13 +214,13 @@ struct ufs_qcom_host { * Note: By default this capability will be kept enabled if host * controller supports the QUniPro mode. */ - #define UFS_QCOM_CAP_QUNIPRO UFS_BIT(0) + #define UFS_QCOM_CAP_QUNIPRO 0x1 /* * Set this capability if host controller can retain the secure * configuration even after UFS controller core power collapse. */ - #define UFS_QCOM_CAP_RETAIN_SEC_CFG_AFTER_PWR_COLLAPSE UFS_BIT(1) + #define UFS_QCOM_CAP_RETAIN_SEC_CFG_AFTER_PWR_COLLAPSE 0x2 u32 caps; struct phy *generic_phy;