Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2161653rdb; Thu, 7 Dec 2023 23:01:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYSuALaI8o9MuPqEc5B44ahvJhouVP347/wbrnRxwIlr+0CR2+4Z2BSAk3MdVnMT2xtocJ X-Received: by 2002:a17:90b:3c11:b0:288:9282:7c1a with SMTP id pb17-20020a17090b3c1100b0028892827c1amr2249436pjb.55.1702018899940; Thu, 07 Dec 2023 23:01:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702018899; cv=none; d=google.com; s=arc-20160816; b=g6Sb5IW7QnojLTfBsRwHsy5AljXXqhbTzreBXtZy/AYwsBr99uwaQwgXwlLkzzKuPe 8Qgu6pMw+65t30sFyYZtUQQmxX3wysxJzCGKX8BzhVXzVJIwkyUgi7OBztp8zPgKEANt LmFCXsHoFj30wvdrClE/S8+7zzaeRBaLJgF4jCFjpVwc6wzFyTv5+73X1eKVM4/Gvnv4 LwLWDHLjfPclIL/o0MCdnu9WCTRd8dryll/099RHEY5N/GdeOoeLHAw/oXe5Fbi9wphL AuCPxgzO9qfoA0nnltTe6wqcB0bdAbhpWYlPLGMjjxgY975W/Pz/PAp9oYG4/eQjLAMh lcGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jL9z1/vZzZLZROJW1gRidiD4hf3DEiFp/UIXcZDRkcc=; fh=3M/8bTCRB16Lsc02X7bSCpILCqUt5UU6Z9lIcVlF+qQ=; b=hhVfj8YXq8Oz3POjgWQI5i6F42udotPrKprcjklEvb1r7g6Zu5XRCLLtPBrGe0mE2h +bRBz3OCLoYJYTpBdxwU2XiNmOsiumbtcQ5zNRlLrGQ2MFMGXhD+FK7Vd+oQ9CPtHdKf rUQI92k2OAwmgUX6Eb5QmkFx/WI6DKd0fUc/ARju1V0CO5ngxKksYWYvOI/rjducISzp 63mAAG60zzXFw4Jf7Xjgff8GY40t3MkCeXQF2kHnoNxgQP4O1kpnqVowY9Ybv8b6ihoZ xTDZFCdEvDZwTYid4Y66gaoeqfYvc6jBqw1hEw48osbbZloOJkLyYqWXR9lVurh0eFG5 l4Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rHOy/IwR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u1-20020a17090341c100b001c3a06b4fd7si1110532ple.561.2023.12.07.23.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 23:01:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="rHOy/IwR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C17308705EB4; Thu, 7 Dec 2023 23:01:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573249AbjLHHAz (ORCPT + 99 others); Fri, 8 Dec 2023 02:00:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573247AbjLHHAV (ORCPT ); Fri, 8 Dec 2023 02:00:21 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 300EF1990 for ; Thu, 7 Dec 2023 23:00:27 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1d03bcf27e9so14975215ad.0 for ; Thu, 07 Dec 2023 23:00:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702018826; x=1702623626; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jL9z1/vZzZLZROJW1gRidiD4hf3DEiFp/UIXcZDRkcc=; b=rHOy/IwRDg2AySpVozsj22bhZyCdt7kqO7MXbP6bnYQMYOHMoYzuZXLUoERX3N0mN7 IurNclhZJEo6Rx3L6ew9ak6HgTinNzyX+272zGGaaqYrd0JDwTuZDD75PTr3/bZt78kD Pd3t8zhHPefB8BXvX0SyTThkwDW1uPSmkOUkCjX/XhcOQJTjQ7owj8ThMJcS8Vx4uZPy eUiL6oXivScdDyPps+PY/mw4Yr4YKERvxSUZddPzeNxF9oE7ibC9sdO71XmE/F0Z64kM WCCI//5VF7+TzTOBFWX8FnoWSMfgolWNp5JS3DE5+09LBd2CMpuKUtpWx383EEbaNblE cDUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702018826; x=1702623626; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jL9z1/vZzZLZROJW1gRidiD4hf3DEiFp/UIXcZDRkcc=; b=Hiu3z66HkkGo4SdRwCkZ7KPF1HSQxVVwhEg0FHPL9vLquy8tA3eHbmcKbepGa4k9Lg 0WdrxO46g1Oo55NokUJ6dFeRC+UYsanuDumSTclIf9CvWNJigldj37RBxAd0SYHpihL3 sA2z49OOeJ4dr95ONhBJ39uZcAj2u6+oBw3n+tKxWZq6T1LOxyj0TaebNz8uEnCn9goV /vxC3fD3L019OL7b/neCyUrsNGtmBE1tT+G9kMtTj5Wnj0kmAk8qmr4l8wd/4j41Askx 4op0PYCP1kHsy/nSznd2/N8Kr+JKKRlLTBVB6UCbimHO/pWylg5cssmtnXwS0pPFuU1F 4YCw== X-Gm-Message-State: AOJu0Yw8jrx1mxn/bRRREm45ALrZferQ8JUzCFvdh1kYcYKL0/YRIHyP /X+6Kedj6qf08RaNm6zP8qf1 X-Received: by 2002:a17:903:247:b0:1d0:5878:d4e3 with SMTP id j7-20020a170903024700b001d05878d4e3mr4024291plh.9.1702018826702; Thu, 07 Dec 2023 23:00:26 -0800 (PST) Received: from localhost.localdomain ([117.216.123.142]) by smtp.gmail.com with ESMTPSA id n8-20020a170902e54800b001b03f208323sm934263plf.64.2023.12.07.23.00.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 23:00:26 -0800 (PST) From: Manivannan Sadhasivam To: martin.petersen@oracle.com, jejb@linux.ibm.com Cc: andersson@kernel.org, konrad.dybcio@linaro.org, linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, quic_cang@quicinc.com, ahalaney@redhat.com, quic_nitirawa@quicinc.com, Manivannan Sadhasivam Subject: [PATCH v2 14/17] scsi: ufs: qcom: Simplify ufs_qcom_{assert/deassert}_reset Date: Fri, 8 Dec 2023 12:28:59 +0530 Message-Id: <20231208065902.11006-15-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231208065902.11006-1-manivannan.sadhasivam@linaro.org> References: <20231208065902.11006-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 07 Dec 2023 23:01:24 -0800 (PST) In both the functions, UFS_PHY_SOFT_RESET contains the mask of the reset bit. So this can be passed directly as the value to be written for asserting the reset. For deasserting, 0 can be passed. This gets rid of the FIELD_PREP() inside these functions and also UFS_PHY_RESET_{ENABLE/DISABLE} definitions. Signed-off-by: Manivannan Sadhasivam --- drivers/ufs/host/ufs-qcom.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/ufs/host/ufs-qcom.h b/drivers/ufs/host/ufs-qcom.h index 53db424a0bcb..a109d3359db4 100644 --- a/drivers/ufs/host/ufs-qcom.h +++ b/drivers/ufs/host/ufs-qcom.h @@ -92,9 +92,6 @@ enum { #define TEST_BUS_SEL GENMASK(22, 19) #define UFS_REG_TEST_BUS_EN BIT(30) -#define UFS_PHY_RESET_ENABLE 1 -#define UFS_PHY_RESET_DISABLE 0 - /* bit definitions for REG_UFS_CFG2 register */ #define UAWM_HW_CGC_EN BIT(0) #define UARM_HW_CGC_EN BIT(1) @@ -157,8 +154,7 @@ ufs_qcom_get_controller_revision(struct ufs_hba *hba, static inline void ufs_qcom_assert_reset(struct ufs_hba *hba) { - ufshcd_rmwl(hba, UFS_PHY_SOFT_RESET, FIELD_PREP(UFS_PHY_SOFT_RESET, UFS_PHY_RESET_ENABLE), - REG_UFS_CFG1); + ufshcd_rmwl(hba, UFS_PHY_SOFT_RESET, UFS_PHY_SOFT_RESET, REG_UFS_CFG1); /* * Make sure assertion of ufs phy reset is written to @@ -169,8 +165,7 @@ static inline void ufs_qcom_assert_reset(struct ufs_hba *hba) static inline void ufs_qcom_deassert_reset(struct ufs_hba *hba) { - ufshcd_rmwl(hba, UFS_PHY_SOFT_RESET, FIELD_PREP(UFS_PHY_SOFT_RESET, UFS_PHY_RESET_DISABLE), - REG_UFS_CFG1); + ufshcd_rmwl(hba, UFS_PHY_SOFT_RESET, 0, REG_UFS_CFG1); /* * Make sure de-assertion of ufs phy reset is written to -- 2.25.1