From patchwork Mon Jun 17 13:49:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700795 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2DABDC27C79 for ; Mon, 17 Jun 2024 13:50:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uOw9ZuYF7yVVJfGh3LeTM6VDPH42QqBSzznALZp99zM=; b=M1SKiIM1m4hDoYQfPrcoVD3ILy MTcovt6bDjjcvj4YYvBA0+c8bgk9p55YXMM8jhwdmfN3EgviJAD32WdVa4tR8SK0pr5B5rqCArAHK Slh/A1nubrRBOr/DocFMvm24RUU+LAI94DzOObcl0LB3hG+40AZNj92mRPsfnZdZ7H+4D11mB/ZU7 19RtXAdtX5gZ/7s0KIzbkWqZODk7mPhoop8jiqzlTccY65pl86rU8UD5q+d8yGAsoENycuBO6idtV m3iQ1XmUBBLzzwBzEzGFKSt3j2i9C6KMeV27gly63zWU/TJnHOPzM9ikiHvzWrOHwrevU/zTARy3x ulDQ7VQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCk3-0000000AwiV-0fR9; Mon, 17 Jun 2024 13:49:51 +0000 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCk0-0000000Awgo-0cjX for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:49:50 +0000 Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3d22378c59eso2595165b6e.1 for ; Mon, 17 Jun 2024 06:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632187; x=1719236987; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=uOw9ZuYF7yVVJfGh3LeTM6VDPH42QqBSzznALZp99zM=; b=yoWAMTktXbKE90Y6crZFtx49v0F0zvrKPsuqAE1IdRf0m8AvbUIXb86As4RrldrplA DccmIpgH1K4W6QWWggnWN2z/mCjOGokZqunGa6xqkb3U/K6yjr2H2/2/T+QVRsP0VZ02 9q3mlxAVNI4vifG1PPGGEqulVO+B5ztIe4a75iJjMPbvQBHdmVVTWBnGpgwF+baoifCf pXFUVcbVYQmndnTJD5LISRwD9SuzgNSla9nd+EqJrCJCogAEbHC5cQ/59e7kdXm07KYM U/WHKamSEwDZsTbnzh9088vpzh2EW7wDFxEKvLDvz2d7MiNYwjM1vGaey44zm0mVcPx+ SWDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632187; x=1719236987; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uOw9ZuYF7yVVJfGh3LeTM6VDPH42QqBSzznALZp99zM=; b=LVVMMLM2W5u9hqbrUBwyj7+jFbrUtjDGlETdMzsX3Oi11UenxGE8kXt/gx9ajOA0ZY I17BuJVwiYg23l0g8dapIXV0FmIpYWc0wUsusUvrshJ1/uiz3T1jzl7zasdsMK3OTRTU xg6XZ7aTqvkyKG8nVDqXxXYe+gYxQOAlpr6HqBs33PEFRn8Neax+ztztvfcpbOwAleC5 vWPnOlkrSb8TaJ+S6cSehADkyUKyw1MXVT1IqcovGKR75DkIKtu6eNKhWQ/JEVFkaPQ+ s+mWKbQejcsNNWxPoBNHfsOwb+1PB0atErMOqfkpVbs339t0wk8UdHlWh8N7ioz9iuLI iYEg== X-Forwarded-Encrypted: i=1; AJvYcCU75M5mJzlk8W/Udtv65acmCoPs91paR+PUehB1oiO0Z1Y/we2LKc1AE4W3i4BQ4fbA8/kBN1xzsmNwzcp1ihF6E07ajCLDOLW7Mplutx4qaAhxPyk= X-Gm-Message-State: AOJu0YzuE5V3mEkMZW+GLTL1ghbM9Tm53rLCn/YJSZgUJl339e1lvDgv HOXoDH7aVTWAag9m1u185pv52e8rNbGebwTBWQPzosQ2xy1AieRqHAaZ8Znnjqo= X-Google-Smtp-Source: AGHT+IFJGSJ8d0p4WXCzz2NyljOfF1k3KjSXOWFFs3OCSrxLmfdmtEDsU18y1hD0hfEhjyu+NXEwMw== X-Received: by 2002:a05:6870:8188:b0:255:1bb8:85ec with SMTP id 586e51a60fabf-2584288e46bmr10661973fac.12.1718632186790; Mon, 17 Jun 2024 06:49:46 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:46 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:41 -0400 Subject: [PATCH v3 01/41] iio: accel: fxls8962af-core: Make use of regmap_set_bits(), regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-1-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_064948_228250_53915A23 X-CRM114-Status: GOOD ( 10.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/accel/fxls8962af-core.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c index 4fbc01bda62e..d25e31613413 100644 --- a/drivers/iio/accel/fxls8962af-core.c +++ b/drivers/iio/accel/fxls8962af-core.c @@ -228,8 +228,8 @@ static int fxls8962af_power_off(struct fxls8962af_data *data) static int fxls8962af_standby(struct fxls8962af_data *data) { - return regmap_update_bits(data->regmap, FXLS8962AF_SENS_CONFIG1, - FXLS8962AF_SENS_CONFIG1_ACTIVE, 0); + return regmap_clear_bits(data->regmap, FXLS8962AF_SENS_CONFIG1, + FXLS8962AF_SENS_CONFIG1_ACTIVE); } static int fxls8962af_active(struct fxls8962af_data *data) @@ -785,9 +785,8 @@ static int fxls8962af_reset(struct fxls8962af_data *data) unsigned int reg; int ret; - ret = regmap_update_bits(data->regmap, FXLS8962AF_SENS_CONFIG1, - FXLS8962AF_SENS_CONFIG1_RST, - FXLS8962AF_SENS_CONFIG1_RST); + ret = regmap_set_bits(data->regmap, FXLS8962AF_SENS_CONFIG1, + FXLS8962AF_SENS_CONFIG1_RST); if (ret) return ret; @@ -830,9 +829,8 @@ static int fxls8962af_buffer_postenable(struct iio_dev *indio_dev) fxls8962af_standby(data); /* Enable buffer interrupt */ - ret = regmap_update_bits(data->regmap, FXLS8962AF_INT_EN, - FXLS8962AF_INT_EN_BUF_EN, - FXLS8962AF_INT_EN_BUF_EN); + ret = regmap_set_bits(data->regmap, FXLS8962AF_INT_EN, + FXLS8962AF_INT_EN_BUF_EN); if (ret) return ret; @@ -851,8 +849,8 @@ static int fxls8962af_buffer_predisable(struct iio_dev *indio_dev) fxls8962af_standby(data); /* Disable buffer interrupt */ - ret = regmap_update_bits(data->regmap, FXLS8962AF_INT_EN, - FXLS8962AF_INT_EN_BUF_EN, 0); + ret = regmap_clear_bits(data->regmap, FXLS8962AF_INT_EN, + FXLS8962AF_INT_EN_BUF_EN); if (ret) return ret; From patchwork Mon Jun 17 13:49:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700797 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 89246C27C79 for ; Mon, 17 Jun 2024 13:50:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8Zs4CGtswXRcL4r5zLR2D5+LAoG+l8N82wbiM+7ownU=; b=FSj/osHxnXVCSm+VRR3kekpca2 CR/4rnUbhk1MKnmTFnqvp2LAd9GMnqpFrMccTFxKOsv5OPpcJD1/YeqJ7k6OxleHTugZTt049fvpl qv3psJNkG4RK0//A2++97kQt1L1LiKvEwFLk4HMIHN+fjqLhM2rkb6/2VNJwtoQsfQvMW2dU2l7W/ j1pau3gVXuyOPDGLHx29HeH3ACm3syCjRvI8fzPts3EzeNyDba0gMjZW1V2Ub+B0iZkIIxPQHUx2r wZaiBvu4LIGEz2Wlw1IL7M1m9tMxZRh57cDyfM6Uf7uGZTDSXwhTdsyxk8b7/jZFauvKGKHG9vt5n QpPpWkUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkH-0000000Awsp-20K8; Mon, 17 Jun 2024 13:50:05 +0000 Received: from mail-ua1-x92c.google.com ([2607:f8b0:4864:20::92c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCk3-0000000Awhx-4BZI for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:49:53 +0000 Received: by mail-ua1-x92c.google.com with SMTP id a1e0cc1a2514c-80d6534e302so1379891241.0 for ; Mon, 17 Jun 2024 06:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632189; x=1719236989; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8Zs4CGtswXRcL4r5zLR2D5+LAoG+l8N82wbiM+7ownU=; b=qY0q55DHIUhO0iGnnmUPAmyPbfIpDj4DS+8DQ2Jbut6PZGk1gtIIMWVLfZ3IcMS2DT QjSbCEHiEFdLoNQiMbB3uDeShDPidD/7/yAJ9QlWwGKA/Gn8iCarX1Qf1+XThsZjwLbD 1emZA3G9UmvTzne+PmhjcdgV4mhpN7yAq016mu2YoePRMd7fSdGh3aLTfdHefFp91J0S KZQgrH5Bf+mSbVt2UGKKtSKGZWiHJdghncDUdGTo6MRQXFioENdZJBcSkiJjTHEK7BfN TbqWlSfHMaexCnrKz/dghX2z5FbgmhAmhgVxb+lDr9HdP/F7V4M5Z2s7GcPhsVDnSlk7 cDpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632189; x=1719236989; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8Zs4CGtswXRcL4r5zLR2D5+LAoG+l8N82wbiM+7ownU=; b=FFwf1rFKFulsnClZTX4n/v8q5H4vrsmUtOWlsEpB3ECti7pr702nfcEPEtNX/nvqSG 1RCrmkCcJPCWQ7fuyBDItwVj/bONJ+lknyRRKit/udi+qaGFSnKigAF34YN4GBVZxWWS 8rnrW00Ll+kpR54YYndFbEIamgjFLLPxsI1Wqeonr9TbfCTmNGc2e70E/gvk+BfbXGST Zmciz0eJPwYKZzJIxVZ3ibmSJkuCBg4y46HX9+zLLmKMK69NaHGiC9iVmWufMQoEdE0T L6+X7cwo/kL7w4neGq17FStQILIXOCVtm43Cu75FlkOjVrc1e92yzFGrylcL7aKmxjCX sbLg== X-Forwarded-Encrypted: i=1; AJvYcCX4d3t0TZxk5lGKV9J2w8sFQSmrwWpZRfgfkGsz9Aq89kkorkeC6ah1Kg1ccczTsk9FnVwQ14d2UiNicxUv4CzS3v2SoT3ejUOo7PQa9fHeIEQ92Eg= X-Gm-Message-State: AOJu0YxTSawVDvMCUgGMGOxi1viyqvFPbdl7tTnobCNr302W4JSql5eQ XRBr7XPNLFvl5X2DKloat2ZyFg3pVcTpiUJhBT1wSYHXIyRtI5ZLj1IeEmCW5K0= X-Google-Smtp-Source: AGHT+IEFmgHtaGyOVxmPD/zpG+S8mAUnggR0FqGzztaCLAyq4bVNR5GtCNAnJm1CQv7c1xou1ffjIg== X-Received: by 2002:a67:b902:0:b0:48d:7702:99e2 with SMTP id ada2fe7eead31-48dae3e00c7mr8793212137.31.1718632188950; Mon, 17 Jun 2024 06:49:48 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:48 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:42 -0400 Subject: [PATCH v3 02/41] iio: accel: kxsd9: Make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-2-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_064952_242003_3317AF96 X-CRM114-Status: GOOD ( 10.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Reviewed-by: Linus Walleij --- drivers/iio/accel/kxsd9.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/accel/kxsd9.c b/drivers/iio/accel/kxsd9.c index ba99649fe195..03ce032e06ff 100644 --- a/drivers/iio/accel/kxsd9.c +++ b/drivers/iio/accel/kxsd9.c @@ -370,10 +370,8 @@ static int kxsd9_power_down(struct kxsd9_state *st) * make sure we conserve power even if there are others users on the * regulators. */ - ret = regmap_update_bits(st->map, - KXSD9_REG_CTRL_B, - KXSD9_CTRL_B_ENABLE, - 0); + ret = regmap_clear_bits(st->map, KXSD9_REG_CTRL_B, + KXSD9_CTRL_B_ENABLE); if (ret) return ret; From patchwork Mon Jun 17 13:49:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700798 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2C63C2BB9A for ; Mon, 17 Jun 2024 13:50:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+qpLBIScyQiW6pZURHAKIC6sw71J1lEFsgxMlm6mPzw=; b=FL5aJL4mzFagIog5IYJnIRoanB TeLPTWHwj6tCsY6F/BDbrTRNOnqMtTW0gfYXNVapHA/+tkNT8vebhiLZE+CATH42ECqr6j6/AqvAJ lL0ASAL1xJWyR8j2VtW8vkk+VtKjyEKUVbjcpzR2aVaXSXzAbc2wurXnOBhfskfwV+GRn5atyJkyc 6VlGhofPkOcyYiySZrADWdn4ZtegRzhO9J2iTqiclqsR7dQAUgmJH7gGN+Y7H9FQ2U40cNuHKnok5 8kFoa3pAcO2EHNK3IfXKK3WYnW+35k+2bH0WmLHdOCmVWJUcUPmuVE8lSfrXm2cozgMyKg7BVwbzM cjWrAhYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkJ-0000000AwvH-3ajE; Mon, 17 Jun 2024 13:50:07 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCk4-0000000Awig-2yvR for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:49:55 +0000 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-797f2d8b408so310891085a.1 for ; Mon, 17 Jun 2024 06:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632191; x=1719236991; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=+qpLBIScyQiW6pZURHAKIC6sw71J1lEFsgxMlm6mPzw=; b=yVZgKwHk530v03/MT+KAndO/eQMEd08pC5cQXCX1gXrQdI8PrhRaA8CJmT0QrULoIY /QJnMt8QTl/zAXo1AG8bz9/qFuWSfI9ZbQBO+B7YFkfB39RRuNW2XcGZ9ty1vF4uostS IzKsXs6fWDpS2FlxP1XrwNgwEYIyZxBKK2VIohcy042O547bQx2ADKCPoajWcUgBTV7a x4kaktg9leW6n/vd/5PsLEWiQST1Nh3Z809Vm0VaxFWbkVNxIJ/5wucESK2WkHZFLS5q WzOWJYYsxrQ5RlbxvX+D27pu+ZGptKeraHtAAJFW7d/qK/1X/ijRBtP9c38eLFlpZUrF UOfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632191; x=1719236991; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+qpLBIScyQiW6pZURHAKIC6sw71J1lEFsgxMlm6mPzw=; b=CVDsuSA7oR8rfnzgtbMGalZ8QWC6VgXNlwgF7QfanF0/wpV1qulXJPAOvKYFXMCw/O N0DGzeX8FPrWpp09cmNabc4HOZOMVTNGZYTek8O9aKU4nEF6Rjp6AAye/7bXUuHzrlOg bNZTYZh6rsnueo6vkblDIYNQbBfW4nVy7h1foZuhqmuuwNSviIL7zs8U2LvSB0O9KAJY XmqmRo8WShySvFdMxWoNlo619myQHFC2NULJ3soOzy4TrJxY7kJDh6Si0Wd5QRcl96no Y4M1TlavNaYINUcsQCsEXU/n66DiclNCdUL2NfnKZVwdZZU63vY2R1cVUUJOf8a1y1Fo 0cQw== X-Forwarded-Encrypted: i=1; AJvYcCVmvFK7F6O1nh+PcTzYPTkNef6S4XM4eKIs23c5PyWsYhIrBr6TDa37BG+HO6W3wPIZ+LGKgHykmXh4ZyzOClG03+7WyM78n7OV+ysK9Qp5s3z5lF0= X-Gm-Message-State: AOJu0Yxu877JOvc4KnbQKkz/li3FNWYsqyLweoh7lwZwuy46SXe4T+zR b/gQ8pKwt6hPj4BstixryEclKFVxBD+o6tlH7Bi7UWtr7wtBGY2qxG6DysgoeXc= X-Google-Smtp-Source: AGHT+IECnYQvKUI7WwTgcSFed1zXdKR1H19TPysNu9rY9UY+uM67szMwUskr66DbaCdyM94wmFAuyQ== X-Received: by 2002:a05:620a:372a:b0:797:b2a9:90a7 with SMTP id af79cd13be357-798d26b9321mr1211989385a.69.1718632191103; Mon, 17 Jun 2024 06:49:51 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:50 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:43 -0400 Subject: [PATCH v3 03/41] iio: accel: msa311: make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-3-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_064952_808066_435BA5A3 X-CRM114-Status: GOOD ( 10.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/accel/msa311.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/accel/msa311.c b/drivers/iio/accel/msa311.c index b8ddbfd98f11..4cdbf5424a53 100644 --- a/drivers/iio/accel/msa311.c +++ b/drivers/iio/accel/msa311.c @@ -1034,10 +1034,10 @@ static int msa311_chip_init(struct msa311_priv *msa311) "failed to unmap map0/map1 interrupts\n"); /* Disable all axes by default */ - err = regmap_update_bits(msa311->regs, MSA311_ODR_REG, - MSA311_GENMASK(F_X_AXIS_DIS) | - MSA311_GENMASK(F_Y_AXIS_DIS) | - MSA311_GENMASK(F_Z_AXIS_DIS), 0); + err = regmap_clear_bits(msa311->regs, MSA311_ODR_REG, + MSA311_GENMASK(F_X_AXIS_DIS) | + MSA311_GENMASK(F_Y_AXIS_DIS) | + MSA311_GENMASK(F_Z_AXIS_DIS)); if (err) return dev_err_probe(dev, err, "can't enable all axes\n"); From patchwork Mon Jun 17 13:49:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700799 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7AC40C27C79 for ; Mon, 17 Jun 2024 13:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EcLjABCmPDgHOzLEYjNK5DROGA4JTxd15k6kwWpFoxg=; b=ryELbFisoem0GWOwd4lUEYfRLw WWz49CS8BrESqZroA+G57oC6CiDvXSA/jIQmopRBW2rpv5IhqW3ei/A/by7NvBx264OO5vsUMWxGh 7ek4Yxeof+3hW3ve03lrpqVjFzAt6RllRVCFA3vHTZgDORKYXU9CR+cPEx6oZLKvgqwD33DSVm+yC 0woTHowy0wgvOv9ZsOTVuTqNMhunB40Si4G33yzbNeGJH35cA7cYL6YkPJg2jlJwK/+gCz85Qq6FO SOW0EnOpwG9qWTcEg4nmZUURBOQ1ufHD3JmjmvaGaWdw85Oyuemzb0nnz8Fe5IQOdCZAU53NsedKe 158nUw4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkQ-0000000Ax1S-1wA0; Mon, 17 Jun 2024 13:50:14 +0000 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCk6-0000000AwkW-3Rkb for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:49:56 +0000 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-2508320e62dso2268437fac.3 for ; Mon, 17 Jun 2024 06:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632193; x=1719236993; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EcLjABCmPDgHOzLEYjNK5DROGA4JTxd15k6kwWpFoxg=; b=J/7agfne7tU6CRXIFGIpvWDHjGHCgF4Scqa7m+d/e6OFW1YAV1cXG8DXkV2xOSNTmG RjhDklAHEfMa1DxAsW9QDousc+CLRy5OurBgSSAgCrEHpJj0Zot4Hh2qVauDt0bykcLa MEqKdjW/Pcxfq+hxIMyUiScO2pqHamkwh3oWXCNOUieBTYOQucZnzaVseLb7/1vwfgJ2 ZLDQvYsnPP5+Cy5HC/cwyMltoKZmxnpSvpdPavzGKvdeNsMJjDaEnX5b4UiH0krPrdHF zQh9q0AuzGJju1Fy3WnezqBwcAcCN4noXXyCYv6ptvXU3iIx/ikW0+MyA/PYaw+wC+7j q0ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632193; x=1719236993; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EcLjABCmPDgHOzLEYjNK5DROGA4JTxd15k6kwWpFoxg=; b=mWWNRn8ONDox+sWurBSkNfKreie76GLp2FOf/ehMNU8I9Lt1hE+rEefuXKoh0rJw5V rbNEE+V//5sdf3DrRAQckIVBUDz46lMR2014h4vmzBDCmoAiERJMXEiGQ9YQDom+cqjp jyPnJatny7BytzIn3SNldG+0TfACzhR1TgODgstAjMzsjW6T8Jf4QBBVIaM3WA0olxkE +HkQ2nTGpZYdqty0mg6WIWaHl895zzZQKToNVKE5GRy34webRkSfJjkpv2JZVcOdF3Mg 3NQ7Rjc+cGV4PxTj36rIQaX9J86QF3rrzvatGj8I41487FzHYK/3Gt1rqM4VVxOAxLL+ I13A== X-Forwarded-Encrypted: i=1; AJvYcCVZKzymLhXo8u/ePoS4jFviHM8WmdaeRBmjZUQwZUxdju2RkbV19rjsq7Kl/3VzF1NIhBU1w54IAe1ki9o3EU4PdDCduUFLAwo1flzRnUXQdIClSzg= X-Gm-Message-State: AOJu0Yw9Mrmqq6aKM/y8YZ4KL+PvQz/BDIj8GGPAozp/TizresXM9N+4 J+YKXs1FTkFilxSGtjaY1OjRxFmY1YC3cvmHm2pLvtxZjeKCmnsk0jEq2beo8Lw= X-Google-Smtp-Source: AGHT+IGzXK8LLO+jQf8g3iL5MCifYqjIipjPlFcW7eDQk67H8aKJxfmuoG4FYBXo33Z8PvtltK6jug== X-Received: by 2002:a05:6870:4728:b0:24f:d9de:3bed with SMTP id 586e51a60fabf-25842b793famr10756815fac.41.1718632193273; Mon, 17 Jun 2024 06:49:53 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:53 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:44 -0400 Subject: [PATCH v3 04/41] iio: adc: ad4130: make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-4-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_064955_108049_449AEF21 X-CRM114-Status: GOOD ( 11.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Reviewed-by: Nuno Sa --- drivers/iio/adc/ad4130.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ad4130.c b/drivers/iio/adc/ad4130.c index aaf1fb0ac447..e134d6497827 100644 --- a/drivers/iio/adc/ad4130.c +++ b/drivers/iio/adc/ad4130.c @@ -1883,8 +1883,8 @@ static int ad4130_setup(struct iio_dev *indio_dev) if (ret) return ret; - ret = regmap_update_bits(st->regmap, AD4130_FIFO_CONTROL_REG, - AD4130_FIFO_CONTROL_HEADER_MASK, 0); + ret = regmap_clear_bits(st->regmap, AD4130_FIFO_CONTROL_REG, + AD4130_FIFO_CONTROL_HEADER_MASK); if (ret) return ret; From patchwork Mon Jun 17 13:49:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700800 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64242C2BA15 for ; Mon, 17 Jun 2024 13:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6sTXUSoBs+YlsgH71N9X/wOixyDVYk1BR8pUCCabPaI=; b=t598BzXRDXy+sy0ixmd/Bf+hus uDEjbt90REV2jGDqsk1fjpxEsnzVDFkHpTpppJGie+YKmmezJpxJmcD5cBQfdkEJnqgGBv4diJARj 9Wf8T14thYQr+Bxid+heP30H7a64LnSGNV9mE6xNs1AXljT20FN04sClJuowgKP0eZzCsHRwv4zQK WFqPJY86OANoAbTKpTVMNAIfJjjxPdiGxioJMIa5Yb59bVVI/NLJmQ/rFokE9r9nTRqCogR5/jaiv 8dvinVu9gjbPWPi46olVUg0KpMHNx2oKBmps5V94QjGUhmntzJ5Ve4npxiSWNMqVRYnEB27tO7iUq FK87vVbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkX-0000000Ax94-328H; Mon, 17 Jun 2024 13:50:21 +0000 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCk8-0000000Awll-3sGN for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:49:58 +0000 Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-795fb13b256so419679785a.0 for ; Mon, 17 Jun 2024 06:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632195; x=1719236995; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=6sTXUSoBs+YlsgH71N9X/wOixyDVYk1BR8pUCCabPaI=; b=DENyv7BI6gz0r+lI7wOQfQ5PznjHP19nJOH6y7Ni7xtXbpuHKOXI+Omdl0U3G78avv eJ8hUfzBPT7BqpFH8objYMTcVu0fEZB+rGU2ktzjNHqlciApm5qiSTjV/YwQEvfSzshK 5HjrewBAZzH+1FabTpPgUrlRPMp6EOA0EOKhFQNHCH5M0/19mvnVyoWwlvHrkp3AcKCk uul0Muhrh2NYqxFqd6VrUGDpkeAU2/Dtgsxr2toqhJ+cNN6j8NIf+oLV0k0IffRRdqHb M0TVHredsAhyqol4U61P1sSyak9enuFg6RaXOfZOf2EamOv9GiiNnMur2spbqWZZOn6j rAAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632195; x=1719236995; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6sTXUSoBs+YlsgH71N9X/wOixyDVYk1BR8pUCCabPaI=; b=vDqw3wzfFTbXQxs8+sPqxqmxflNuBUF4Hzxi1RxbemLAAIvYJAGHxnvSX77y7sAD8g VlHcynrQUYo2SlbghIu2YUnSa4FBydgbFiXMGpmNqEPFvimAvQBp9ewxaRF/3SaeC2NS kuAL/YSfcWcdKRSnmvaH7XyoMOzSSi5bQWijC5vvI9vg+ik1wBHdyc9px5wXPgKRW/ow 5mSH2WejiiEpG8Xg6eYLcN15SOTY67a6cKR/8FqMNZQdRIbUu7FRd7R4pdT8veVmEeDH JLaD3KsPcELEekAECEmyodd+rToWJTUAUOSZm5vyI62fQ2JlE4+zybMc8ZYoCG0dttsw AUqg== X-Forwarded-Encrypted: i=1; AJvYcCVcESM/eOTR+D0DKS6SbXOEaKzUTLH81z+CaB1adgcYE8SnQgwzdCY73aVKVuypluLLNp975cAs4k2GMzGby4wpV421YWS+RJSOTnX1U15FWDPO8eg= X-Gm-Message-State: AOJu0YwALtiVW/IVsYzoRiQa/VmY2c6we6xEtpzpreeSuhBIQ52z1GUG daXy4OUCVhQ05CPNX9OzukdEAP/kL0Dv2YABV5+SPV6nyysGs0iYehQwYAsYG3M= X-Google-Smtp-Source: AGHT+IGjHbBOrTl20NthbniN5xVzM8rCge08JoanAoI0amw+zX4G0dqtT7iYT1wcjjqa5iiFtvInEw== X-Received: by 2002:a05:620a:44c4:b0:795:5b00:edcb with SMTP id af79cd13be357-798d0243396mr1793084785a.21.1718632195400; Mon, 17 Jun 2024 06:49:55 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:55 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:45 -0400 Subject: [PATCH v3 05/41] iio: adc: axp20x_adc: make use of regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-5-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_064957_022682_0DB023E7 X-CRM114-Status: GOOD ( 10.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/axp20x_adc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/axp20x_adc.c b/drivers/iio/adc/axp20x_adc.c index d6c51b0f48e3..00c1a01cac63 100644 --- a/drivers/iio/adc/axp20x_adc.c +++ b/drivers/iio/adc/axp20x_adc.c @@ -712,9 +712,8 @@ static int axp20x_probe(struct platform_device *pdev) regmap_write(info->regmap, AXP20X_ADC_EN1, info->data->adc_en1_mask); if (info->data->adc_en2_mask) - regmap_update_bits(info->regmap, AXP20X_ADC_EN2, - info->data->adc_en2_mask, - info->data->adc_en2_mask); + regmap_set_bits(info->regmap, AXP20X_ADC_EN2, + info->data->adc_en2_mask); /* Configure ADCs rate */ info->data->adc_rate(info, 100); From patchwork Mon Jun 17 13:49:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700802 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8BFA8C27C79 for ; Mon, 17 Jun 2024 13:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=g6UQvfPsoXnGJXINmWjQmEBO62NliLdepCpDJh/A7YM=; b=RTnEUg5Yplh0nyCKZkj3cnK110 xjBOBiYsv8/1ltPrCUuNQ1t5cMnZphtVLsvArj6TUmu7NhJWFrwo+O12jiusGyZmJLp+c4OE1BG9J jE1dX7VJrqK98w4WhOsDYWzn70P3CbvtFzwVNkYe2heOAfMPoSqV0dmBisfQYVG9TiOLZAmvVGZv3 sxI31iTFRjGK9kb5EWYBLpIDwPznF55JV2B2QBn2DFM4A79hRuv8DgeBPmfd1pqLxleYYb2oAD+Aq 4Ck0xytoN+lJCnR5W7yReZulpGdwNE/iZ1+dz6i0MGpoZnUEJALNp+nxGz6el7d9ydmFzNkHSDCRc w9JIQGKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClN-0000000Axuy-0WjQ; Mon, 17 Jun 2024 13:51:13 +0000 Received: from mail-vs1-xe2a.google.com ([2607:f8b0:4864:20::e2a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkB-0000000Awmr-1HFu for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:02 +0000 Received: by mail-vs1-xe2a.google.com with SMTP id ada2fe7eead31-48ed52b59acso531345137.1 for ; Mon, 17 Jun 2024 06:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632197; x=1719236997; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=g6UQvfPsoXnGJXINmWjQmEBO62NliLdepCpDJh/A7YM=; b=pGLnMn5E1BgmvnMnMs5clVKrJX9klikxlOFiGsSQ63/oXjQ8m3P1PjV3WqQLyXilKt SZ3jZFEhso8D2AQ3UU20U9vDgcT858k7hJBzCginSWIvI7Q4q5T74PkaW0qEo/k3b8gy +HhA/+tjnQVV+kMQe2ucsJ4NkE7N/DYQK9eIXywv3tjeqFAlWB529SqlIAXChYABu7ji kBkVbIuoHV0TFABIIF05i2HCYfbwmiyb74ihBVXV7ZUewAE6I096WXxPHGv4x7VcUTYt r1tlQSScC4so0CJfyGpLVsSdwVmxdj9uTYIdmTVQkI2RJg1eW2DBuKuFMovsSQdFJbyP 2Yig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632197; x=1719236997; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g6UQvfPsoXnGJXINmWjQmEBO62NliLdepCpDJh/A7YM=; b=bkIAds/v3GVk2IHmkBF64SKL6qVXLu4Wq6OEgtQcVHOu94/WvA3PyNSjpE3Ivl48x2 n0TJ0qZCkdESnI+wSBNsVo0i3Mv/hs5wzfpnJJncRKIMjdCMg0RqU7tBhYjm8Oqz9FMu 92ilh2COe3rJvFSkC7thJ78dAp4HFRi7w+vYuVRODAvYXSf0QULy5dBdpYHfHltQJb6V ch6gT+h/W+yaSc7HTAdub8h/TLncZHP4KCirf/Ywe7rGJj3ib/sUgDCHSNebeCDXkI7e et7l7wYRed77DFTHtnP8BG0m6FUYCDbSh8k5854JhYExOJEda6zRRCOk8R0s7HJJpDtC sNaQ== X-Forwarded-Encrypted: i=1; AJvYcCVEAt/JcyMhqTfQJ2JLiWUDEwnHwOvxvthPy/bI7G3GCnHn0VcpJqYOPntLJh7V48cEINrIVIr+tawaUOQ7S4ANHACebShBVy8aT5wecZPb8xVE21w= X-Gm-Message-State: AOJu0Yzg07yaST41fBxHf+5gcvj5134EtFUOlTK6gu0dNe7YO78YcAxC uepMlxqJPu56IJ9JJjo4kJYXDepvr+4BDsc9oab5uFOKxG8/a07MEssmFnEraOc= X-Google-Smtp-Source: AGHT+IHh1rKlzT8+664YalrD1JcHiwA7k7yzEL0kYz4H+P2//V4FMw+RVSrpyNsoJMn06TFOuuRyhA== X-Received: by 2002:a67:f452:0:b0:48d:a159:dd80 with SMTP id ada2fe7eead31-48dae329fbdmr9819998137.12.1718632197524; Mon, 17 Jun 2024 06:49:57 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:57 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:46 -0400 Subject: [PATCH v3 06/41] iio: adc: axp288_adc: make use of regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-6-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_064959_432106_A09BE07D X-CRM114-Status: GOOD ( 12.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/axp288_adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/axp288_adc.c b/drivers/iio/adc/axp288_adc.c index 49fff1cabd0d..f135cf2362df 100644 --- a/drivers/iio/adc/axp288_adc.c +++ b/drivers/iio/adc/axp288_adc.c @@ -247,8 +247,8 @@ static int axp288_adc_initialize(struct axp288_adc_info *info) return ret; /* Turn on the ADC for all channels except TS, leave TS as is */ - return regmap_update_bits(info->regmap, AXP20X_ADC_EN1, - AXP288_ADC_EN_MASK, AXP288_ADC_EN_MASK); + return regmap_set_bits(info->regmap, AXP20X_ADC_EN1, + AXP288_ADC_EN_MASK); } static const struct iio_info axp288_adc_iio_info = { From patchwork Mon Jun 17 13:49:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5CB63C27C79 for ; Mon, 17 Jun 2024 13:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YrcJbk8xCEXw8t4EaXrcTeVF+NCC1LSKzcpZFP4BG5g=; b=auL00WYUe8kz8FBdUE7cgDsRq3 YRGqSfyQnCSVM8LmqvlfCni/LeqZjM979YPToPNe8rbCsxJ7eYAgw1U8MB6Fq7DDEaeHHwSjbLFow aoKxb9IdKOteZiyNYLgNjFsGb9YTy9PvtUdvaN4sUu7ffJstqcr3ww1hkXnmNbefOaT0wr+RAl7F8 QaimGJrKWGLI0SnHi4F0k0eWgKqpOGNr/zUmHrO/U/qK/hIfAejPt7L1ueDSnxrZ7gfY1ifAFZgRj QYTswTUItup6a8iLno1JUApptWiX/UUl/Co88eB1UpmiT6S8IjqIHDfjgXmW+CcR2RehyCUwNptZE Pczz77kg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkj-0000000AxJu-2qwp; Mon, 17 Jun 2024 13:50:33 +0000 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkD-0000000Awp0-1OMp for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:03 +0000 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-796df041d73so313346485a.3 for ; Mon, 17 Jun 2024 06:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632200; x=1719237000; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YrcJbk8xCEXw8t4EaXrcTeVF+NCC1LSKzcpZFP4BG5g=; b=HkCvVIaYP7nUKus49paYihGHIeTIQa7TNKahfpiRaT1xU6ZUytRm2qRua9sATqHPSO LoNEQzNTbWNzyOkm/UChHHYxuRb/nT/7cC/ZNl4Trp0V/ndRareOqrYUzv63b+uhzHPV 9Q6pc/lkbzC3cWlSGQeS8QDsEAZ0lgTVqcZaST50gWf72weCOweMWJbq+xUan+Liolzt PSeKJDGR7bSI7DHo7L9i3Lf3mIM4mFNiLJEmWBaSKEFqKlfVrCD7lnQhXLsuxRuS9Ct8 omoA9hLuJPPrLlFOtHH+FLifQnoflnK/kzyiTWLWQloyoHx8xhaSlq6FQJbOiqmLHDnP 8wnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632200; x=1719237000; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YrcJbk8xCEXw8t4EaXrcTeVF+NCC1LSKzcpZFP4BG5g=; b=csC0DRvRg9OaHvMf+C9QGejLABp7NrEM1qnitm3pEbTNlK9imcp/iP/ukIWDB/K2X7 M02eLf/eln62yxX2e6jeVc49gY4aYyMaiETBP7bTbuh4n+n+jZZDG68VYiPLqtQ1H9SI rPLLlIjwMtsa2VT4fFWfaf8Zox7T+C1RHiVktonJS0HNCxc1ocAA7i0txi1KdHbiX+Hb 7svIi2q1+rbIjjKorZ8eu9tVVAwp9OxoVW2BznIRz5k1d7qZBZJMlDpY45LZ4uQHimx3 JNvrpZFkgIQfzMpHo0pbCjqhhw3wqHCiFsteTfReu9nTfxcXNvPUstXsV4HkJiAF0IlF evag== X-Forwarded-Encrypted: i=1; AJvYcCW4JRKJaR8S0dO+gsAgVruEH74JwD5knGlPE+3xoQR0huY2M+yNlI1uyFPjpn3IJ0Y81jd0J7zEGkhIAh9NPmRY9WM3plAivkyAZF3HRsu/Fef8aTQ= X-Gm-Message-State: AOJu0YzJp3e+oDzMGisuY1u6vKNpmFd+9l6x0L2rXQuleBN2jTwmtd1v 7F/oMXdC1OJtXh3aFAfXNxbll1njPrsoafSh4V8xrXpcVlFZxnuOe6RUjCiV1xo= X-Google-Smtp-Source: AGHT+IE5uBXfLurzd0jxJqKEavsP5xlBerQNz/5zZPhVz/sS8JYp4QTVcbxX+BgweFysUZBWMYLagg== X-Received: by 2002:a05:620a:1a81:b0:795:4e35:ea9d with SMTP id af79cd13be357-798d2692fc4mr1312471985a.60.1718632199656; Mon, 17 Jun 2024 06:49:59 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:59 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:47 -0400 Subject: [PATCH v3 07/41] iio: adc: bcm_iproc_adc: make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-7-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065001_527629_72179CC3 X-CRM114-Status: GOOD ( 11.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/bcm_iproc_adc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c index 5bc514bd5ebc..6bc149c51414 100644 --- a/drivers/iio/adc/bcm_iproc_adc.c +++ b/drivers/iio/adc/bcm_iproc_adc.c @@ -357,8 +357,8 @@ static int iproc_adc_enable(struct iio_dev *indio_dev) int ret; /* Set i_amux = 3b'000, select channel 0 */ - ret = regmap_update_bits(adc_priv->regmap, IPROC_ANALOG_CONTROL, - IPROC_ADC_CHANNEL_SEL_MASK, 0); + ret = regmap_clear_bits(adc_priv->regmap, IPROC_ANALOG_CONTROL, + IPROC_ADC_CHANNEL_SEL_MASK); if (ret) { dev_err(&indio_dev->dev, "failed to write IPROC_ANALOG_CONTROL %d\n", ret); @@ -543,8 +543,8 @@ static int iproc_adc_probe(struct platform_device *pdev) if (adc_priv->irqno < 0) return adc_priv->irqno; - ret = regmap_update_bits(adc_priv->regmap, IPROC_REGCTL2, - IPROC_ADC_AUXIN_SCAN_ENA, 0); + ret = regmap_clear_bits(adc_priv->regmap, IPROC_REGCTL2, + IPROC_ADC_AUXIN_SCAN_ENA); if (ret) { dev_err(&pdev->dev, "failed to write IPROC_REGCTL2 %d\n", ret); return ret; From patchwork Mon Jun 17 13:49:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700803 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 74F56C2BA18 for ; Mon, 17 Jun 2024 13:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/J+uii6o7EZaRWTf6fwT0Zq6b6sr2oRr59Sqisc7RFA=; b=LSGeL8eFOsKigZbKi3VMsy/niF /eTy0udDStJuQ6nXCMbHmILQg17I/7MwbWAKpn4CuFNCuO0fUksXvKj+hWliDvYIp0z90x1TSF7+R Lme28nEYlk9i6ncVZfNLfYCQl3mU9p/4HEWL0GbrQAHDD/mavt5HwhL8c8DCGr6u6si1O3qR8XjaM m6cGcSNdskCdq8XdQA8BmKBKOfyy+Ro7bTDz98uaOpKkxMPSh9+7Gz9QjktoJEy18sOBM1lZNhO3W ANtXcNd1IsJiWpoSeWTcpBmGBb/28ssZXmJ3y2iU208/D5LWCEnbLLYaB5zYAktZmJn+y1Llahq9n xI+0SgTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClP-0000000AxxV-2Zav; Mon, 17 Jun 2024 13:51:15 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkF-0000000AwqP-1nx3 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:07 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-797dcb558ebso286406885a.2 for ; Mon, 17 Jun 2024 06:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632202; x=1719237002; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/J+uii6o7EZaRWTf6fwT0Zq6b6sr2oRr59Sqisc7RFA=; b=Z62+76zECgvxOVOgdKztbbH4WxdEmspunuLD1LflxLMHormlzfBi2VaNqaZNP5ZrRy vqovFwd1Kli9dsIsazA6OQ6SQSIRi3O3YQ2h1O40xA/39nL71SmmNUjsZXxgILsbntSC +JhRdHbdOztYBtcDL0yj+RTzogOx72K805xQc7vD68tpeIp//qP85YDF0qJeCtKHHdQc Extf5UOpcjcZKR73GGfSKq4wEcj82M9zrCaoZup1NPy4LkXyTCx6HqdRTT57AEde6eTu 13RQtG7Al25k1n306Lc84faF0723vgcvzyli1NzNw2nPwAfVvv7OsHRth9jOcJGpZMFS e8ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632202; x=1719237002; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/J+uii6o7EZaRWTf6fwT0Zq6b6sr2oRr59Sqisc7RFA=; b=m1fYIDU6xyYOwwl6rYp3w1h+OY0JSoxe3mhhofzaHoY+sYl7Zs2vasQZ69J6kGBGeW e4k7846JcnIDc57Y6QDa+EUCTmxtT3NnFTu1Y4D2HmB38XsJsmvggthhx3hQQfQUXFCi Nlo0fE1ft2d/k+k1uSPeCYzqq4xlsdnVArxSx2fDcXWJJ3TuVlTq1MsawismCvLhLKAG Z2shBl4wadx8c7QevQVbzfM7SksIzedZBeK3/gKoE5UB8qX5Z57R2my1abTmlKO1PLcE W0cnXncsf+ruvBoyeh1KB5Ed+j3+x1B7PR88OH+YQ71uTucTw9nUBHO+GSro7wQQ4a8q slsA== X-Forwarded-Encrypted: i=1; AJvYcCV8kB4+tbXpfITLRF2lOCIo0km5qj65vjRPOBTOCTtcEC1ltxSk0Wm+Od8btb5lv0Z3b0mm5EQQEHXjdt5E5qB1Pbrb4tdSyb70ScrujVziWYuGR2Y= X-Gm-Message-State: AOJu0YwfHFjKq2A9jU4l/7O1g6sgCqoDh2rdPDlSemtrcqxr/9kebecq cjrakm2yO03Erq96arGsAb7GXJsQDNRpxUaMdcRe11EhXHjPGJYJCo2xQbRN0Sw= X-Google-Smtp-Source: AGHT+IHQO7lDiG1TVDzbCtPAbJI8uHKSdU2/yIiDIlagRddBfJsOkXoStyLOw9TY/mBvF1osZeRq9Q== X-Received: by 2002:a05:620a:2955:b0:792:c34d:482 with SMTP id af79cd13be357-798d2413b26mr1228938285a.25.1718632201881; Mon, 17 Jun 2024 06:50:01 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.49.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:01 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:48 -0400 Subject: [PATCH v3 08/41] iio: adc: berlin2-adc: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-8-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065003_669800_962CFED0 X-CRM114-Status: GOOD ( 12.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/berlin2-adc.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/iio/adc/berlin2-adc.c b/drivers/iio/adc/berlin2-adc.c index a4e7c7eff5ac..4cdddc6e36e9 100644 --- a/drivers/iio/adc/berlin2-adc.c +++ b/drivers/iio/adc/berlin2-adc.c @@ -129,8 +129,8 @@ static int berlin2_adc_read(struct iio_dev *indio_dev, int channel) msecs_to_jiffies(1000)); /* Disable the interrupts */ - regmap_update_bits(priv->regmap, BERLIN2_SM_ADC_STATUS, - BERLIN2_SM_ADC_STATUS_INT_EN(channel), 0); + regmap_clear_bits(priv->regmap, BERLIN2_SM_ADC_STATUS, + BERLIN2_SM_ADC_STATUS_INT_EN(channel)); if (ret == 0) ret = -ETIMEDOUT; @@ -139,8 +139,8 @@ static int berlin2_adc_read(struct iio_dev *indio_dev, int channel) return ret; } - regmap_update_bits(priv->regmap, BERLIN2_SM_CTRL, - BERLIN2_SM_CTRL_ADC_START, 0); + regmap_clear_bits(priv->regmap, BERLIN2_SM_CTRL, + BERLIN2_SM_CTRL_ADC_START); data = priv->data; priv->data_available = false; @@ -180,8 +180,8 @@ static int berlin2_adc_tsen_read(struct iio_dev *indio_dev) msecs_to_jiffies(1000)); /* Disable interrupts */ - regmap_update_bits(priv->regmap, BERLIN2_SM_TSEN_STATUS, - BERLIN2_SM_TSEN_STATUS_INT_EN, 0); + regmap_clear_bits(priv->regmap, BERLIN2_SM_TSEN_STATUS, + BERLIN2_SM_TSEN_STATUS_INT_EN); if (ret == 0) ret = -ETIMEDOUT; @@ -190,8 +190,8 @@ static int berlin2_adc_tsen_read(struct iio_dev *indio_dev) return ret; } - regmap_update_bits(priv->regmap, BERLIN2_SM_TSEN_CTRL, - BERLIN2_SM_TSEN_CTRL_START, 0); + regmap_clear_bits(priv->regmap, BERLIN2_SM_TSEN_CTRL, + BERLIN2_SM_TSEN_CTRL_START); data = priv->data; priv->data_available = false; @@ -284,8 +284,7 @@ static const struct iio_info berlin2_adc_info = { static void berlin2_adc_powerdown(void *regmap) { - regmap_update_bits(regmap, BERLIN2_SM_CTRL, - BERLIN2_SM_CTRL_ADC_POWER, 0); + regmap_clear_bits(regmap, BERLIN2_SM_CTRL, BERLIN2_SM_CTRL_ADC_POWER); } @@ -339,9 +338,8 @@ static int berlin2_adc_probe(struct platform_device *pdev) indio_dev->num_channels = ARRAY_SIZE(berlin2_adc_channels); /* Power up the ADC */ - regmap_update_bits(priv->regmap, BERLIN2_SM_CTRL, - BERLIN2_SM_CTRL_ADC_POWER, - BERLIN2_SM_CTRL_ADC_POWER); + regmap_set_bits(priv->regmap, BERLIN2_SM_CTRL, + BERLIN2_SM_CTRL_ADC_POWER); ret = devm_add_action_or_reset(&pdev->dev, berlin2_adc_powerdown, priv->regmap); From patchwork Mon Jun 17 13:49:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700888 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2A2FAC2BA18 for ; Mon, 17 Jun 2024 15:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ClhrI/fyo1cx6bZjSpXIGRy7tTTxclMqWX7+F4JU4yY=; b=DL1iF8pJPBu5DVYfF4rJ9WDMqH ekSQ1GjA7eNF8BL5nNVtz0gpjCpIYZeXE4uZJ+hBvfEPcRGzKC0HrgO5BkSOBiph93TYLNECx3swn 3emIAGqjLSTXGNqlGa6C8exUSdXtJiyEKN4l2Ql1IikATcK9MaiPf8Ox3nbJLcPnOMZi8rwSJdVoK Hsi4JO6JScheIYNJaEy+6Biqbp/2dmZbqCQxbzUXz0S0KubeaxAKQL0dUNnBSGvg+poB+qcTOUkLs aJ+E1NpEpFndbVxECWXFn7zMlkO3XyP9Hp5jadUxiQYbRNerJOIS5anwQmlUbgUwRw1xKeY9eRswE WchYIrow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDr7-0000000BKJo-25Px; Mon, 17 Jun 2024 15:01:13 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkH-0000000AwsO-2qFH for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:09 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-795ca45c54cso246567085a.0 for ; Mon, 17 Jun 2024 06:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632204; x=1719237004; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ClhrI/fyo1cx6bZjSpXIGRy7tTTxclMqWX7+F4JU4yY=; b=yNeJfl6BraxpB5EAgtCMRVeBOqrTwS7IVIG2jjV86QYKRd3cLc1asf8KDYH1EGcjy+ 8DHCj61IQ9BUAWHb7sFunVxzf907cTu2hlM+echpzyOi46bAEmCo4Pj1cwFnhDLhI3/8 Nfenmv/6HSUfAS0PvOgrXsSPdMcLPXl7v7WunkpbnJiYcpVmCtpr9/c2pVeeAquFk46i xIvuSqXiMz9kA9xtgqYXSRa2jkqxhxNEUqlDxeyAdN8drb9y/jXB6Hurq6Pw5dNWXn1w EMqTJyWNiBOejJ0ow8wrbZX8Yv/ZPT9wwqFTtNv1sEbGBjtHTWGq2vGzkeRA6nz27Xar 0mtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632204; x=1719237004; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ClhrI/fyo1cx6bZjSpXIGRy7tTTxclMqWX7+F4JU4yY=; b=ZQlEJxQ+OeeAg0KzDOPWRSCH1bDIcDCNg2c6zrQmoX9bTkcBHWX+n6ALPRUvvdquzc XDO3hTb7NJlqkd8GH+gw1a1L5Jxbf99r7ej2YWwUAh09u0cgHM68wq3LcDxLHBH6zXL1 nKShU0wGK7Vcxpwce/2frTnjgtsRj5kT7kzUmYmYZ3gWrusjtRfTXAPF8WiLqEmWNXRN 4R4KzaJCh90FPoEbT87YuOSPUeeeazv8RzzKdd5X4FLPTdWZEpHFw8V/qY+omwlDKzYv u/2tpWWriW3JCQIjPY1DVcsQMeR39v4I5zsbMfn0GvnLcpMYC6Q/YbVw/un6V8yV3udz +kfQ== X-Forwarded-Encrypted: i=1; AJvYcCXQD4a7W+mSCePTupwoyQzunDvBt0AkXnHfsuXfammdB+3tQfAiUCfs0OdvpW+RQ8Ds69H/QSWO+JU5u4qnCyKTpr0UuMIZlv7FSVOwHJFvfUpMajg= X-Gm-Message-State: AOJu0YzoLLdKPR1iTkdPcxJHuYGCr+6xmOdWmmVTBoBfroQ2092tbXQA X/SOZLUPRhdSpcOg4ahiH4aqjtwC4NZZ7Iz9gCISA4My0EfL8XdkGsna1Y7GIg0= X-Google-Smtp-Source: AGHT+IGEJP+y4ORB/qQsSLGS1aQN67uw6XFJYR5D2HpTVdZajfNzX+EcKLbp10S7XC6/Qne2Ev/fMQ== X-Received: by 2002:a05:620a:4721:b0:795:55a1:9dd3 with SMTP id af79cd13be357-798d23c4382mr1195766785a.16.1718632204033; Mon, 17 Jun 2024 06:50:04 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:03 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:49 -0400 Subject: [PATCH v3 09/41] iio: adc: cpcap-adc: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-9-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065006_452706_06841131 X-CRM114-Status: GOOD ( 11.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/cpcap-adc.c | 46 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/drivers/iio/adc/cpcap-adc.c b/drivers/iio/adc/cpcap-adc.c index b6c4ef70484e..c218acf6c9c6 100644 --- a/drivers/iio/adc/cpcap-adc.c +++ b/drivers/iio/adc/cpcap-adc.c @@ -385,9 +385,8 @@ static irqreturn_t cpcap_adc_irq_thread(int irq, void *data) struct cpcap_adc *ddata = iio_priv(indio_dev); int error; - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ADTRIG_DIS, - CPCAP_BIT_ADTRIG_DIS); + error = regmap_set_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ADTRIG_DIS); if (error) return IRQ_NONE; @@ -424,23 +423,19 @@ static void cpcap_adc_setup_calibrate(struct cpcap_adc *ddata, if (error) return; - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ATOX_PS_FACTOR | - CPCAP_BIT_ADC_PS_FACTOR1 | - CPCAP_BIT_ADC_PS_FACTOR0, - 0); + error = regmap_clear_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ATOX_PS_FACTOR | + CPCAP_BIT_ADC_PS_FACTOR1 | + CPCAP_BIT_ADC_PS_FACTOR0); if (error) return; - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ADTRIG_DIS, - CPCAP_BIT_ADTRIG_DIS); + error = regmap_set_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ADTRIG_DIS); if (error) return; - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ASC, - CPCAP_BIT_ASC); + error = regmap_set_bits(ddata->reg, CPCAP_REG_ADCC2, CPCAP_BIT_ASC); if (error) return; @@ -455,8 +450,8 @@ static void cpcap_adc_setup_calibrate(struct cpcap_adc *ddata, dev_err(ddata->dev, "Timeout waiting for calibration to complete\n"); - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC1, - CPCAP_BIT_CAL_MODE, 0); + error = regmap_clear_bits(ddata->reg, CPCAP_REG_ADCC1, + CPCAP_BIT_CAL_MODE); if (error) return; } @@ -602,26 +597,23 @@ static void cpcap_adc_setup_bank(struct cpcap_adc *ddata, return; if (req->timing == CPCAP_ADC_TIMING_IMM) { - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ADTRIG_DIS, - CPCAP_BIT_ADTRIG_DIS); + error = regmap_set_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ADTRIG_DIS); if (error) return; - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ASC, - CPCAP_BIT_ASC); + error = regmap_set_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ASC); if (error) return; } else { - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ADTRIG_ONESHOT, - CPCAP_BIT_ADTRIG_ONESHOT); + error = regmap_set_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ADTRIG_ONESHOT); if (error) return; - error = regmap_update_bits(ddata->reg, CPCAP_REG_ADCC2, - CPCAP_BIT_ADTRIG_DIS, 0); + error = regmap_clear_bits(ddata->reg, CPCAP_REG_ADCC2, + CPCAP_BIT_ADTRIG_DIS); if (error) return; } From patchwork Mon Jun 17 13:49:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700808 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF637C2BA18 for ; Mon, 17 Jun 2024 13:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QUJvHuZZxgwBDIkIwz1c6/5nEPPRUcnNJo5C6L4NEfc=; b=2VBh5jqZ26pPF45dGfapv5Oz7m /MjuphqspQUgpGNRdNNrS+EkDN5z1g4GkbwOY8wya0PjFB6IPwah2OU569v9qevtWxmsRWbtxAfvO msgp9f4OlywV7rq8WOeyklkUOx7U6NHVpZkgW5Qk0gclui88TUnVTaFiO9/afD4tnBO8yPXkVs0d6 ihnf+ezqmfVpdclnA/IX3huebH0xNhSfxtjWrI/ZxZ/v+J1TTn9GAvs96A4TN0Psd/w4yEThArRjS PvXvdP+G6eMDQNNJjGfliI5zB0py0xUBFv3x+c5884rbr0zu+pRdXnV2J+ulgU+xFy7u5hBe4aa0s APM6wW9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCme-0000000Ayj6-42WE; Mon, 17 Jun 2024 13:52:32 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkJ-0000000Awui-3Ees for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:13 +0000 Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-797f1287aa3so342724185a.2 for ; Mon, 17 Jun 2024 06:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632206; x=1719237006; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=QUJvHuZZxgwBDIkIwz1c6/5nEPPRUcnNJo5C6L4NEfc=; b=XWNna51lU41pDVbKmjaafsvSd9elL4Pi0RVMcBXnziO4Qjikz119sp05vdPKFXruKS ceCS5v/s/gBzgVEb6zYTbXMzLfrh1DNCqeRfs4dVSx2bFGDTXCjmcwOpbP5jEGE1BRFP tr4GavNLQhDApCQi+CK7qSaMzV2Gf6C/Ng0B7sQVIdj94iA9O1/AaCH7yj1R8drbPBBQ /fm7hf9rvizewD5VpzbxRJVioHqhjdgJ1IjvqTa0yV47d1JILxXAtG40jMUJL4GdNqf3 C7ZP0MwCXB9EA51jRoiNTAsIz5lVnRcQk6wNpu8zxeT0FJtwq33jv6WpeyXuBfiC0+xR dxHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632206; x=1719237006; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QUJvHuZZxgwBDIkIwz1c6/5nEPPRUcnNJo5C6L4NEfc=; b=TSfgyc8+7EFmEfbZEwXLFJ2jtimRLg9IkNCJqE9STldhRKWLcPswN1tsX4Fj3TYNr8 /f5oybqNELOF35bXDGPLF2n5eoCFSlLP5javHjAZXKuUcJNDqixK3z9Uch9Da7vwi24X +DdKPX0BSiMevfilcwfRMxsooASs3h4TLb+Pyf9JHxQq4AoX+1uTW4xvpBhkv4fC4H/T KAnQlVBshngh1IkPRIwGU2eBLeco8v4Bggcxh60Y8qoSyEPjiH/gCnfWhfwH5cKs8dAp zoZaONN1mSJLwOQRndCyCSFke3PCAN7HhuvnWrcjLfoVK2dREUIJVw9uaQ8IqVK1yw9Q T5VQ== X-Forwarded-Encrypted: i=1; AJvYcCUcR43UvZJ6bSpeiLBV+pAm7JAJGGwzIctAGf595UniGQU6hyIl2YViFjnzZUj7/WBS5Zv8App7tCVpSOUvFnf9izL248AsOg3L4YuoHBNnQ5sySNg= X-Gm-Message-State: AOJu0YzCs0ZPoQP8JVEJXpSI4HUXtulWGlhkTxNUYT4tGQ+R3hUo+Au9 bMdHcN7g6IpELjuMWLe5eGPCvMr4tGCQxQL8D/TPStsvvSu0bvfcAOtvd6Xjb6Q= X-Google-Smtp-Source: AGHT+IEuE3X+Ttrgd1pciF1gOmiGqm6CNudwXH5GABygzdDAc5BXX3iLlJx1my8INZ4E7qgPOczVYA== X-Received: by 2002:a05:620a:444f:b0:795:5815:2f9f with SMTP id af79cd13be357-798d241d00fmr1205475685a.25.1718632206164; Mon, 17 Jun 2024 06:50:06 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:05 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:50 -0400 Subject: [PATCH v3 10/41] iio: adc: fsl-imx25-gcq: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-10-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065008_267249_E31E6105 X-CRM114-Status: GOOD ( 12.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/fsl-imx25-gcq.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c index b680690631db..b3f037510e35 100644 --- a/drivers/iio/adc/fsl-imx25-gcq.c +++ b/drivers/iio/adc/fsl-imx25-gcq.c @@ -87,13 +87,13 @@ static irqreturn_t mx25_gcq_irq(int irq, void *data) regmap_read(priv->regs, MX25_ADCQ_SR, &stats); if (stats & MX25_ADCQ_SR_EOQ) { - regmap_update_bits(priv->regs, MX25_ADCQ_MR, - MX25_ADCQ_MR_EOQ_IRQ, MX25_ADCQ_MR_EOQ_IRQ); + regmap_set_bits(priv->regs, MX25_ADCQ_MR, + MX25_ADCQ_MR_EOQ_IRQ); complete(&priv->completed); } /* Disable conversion queue run */ - regmap_update_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FQS, 0); + regmap_clear_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FQS); /* Acknowledge all possible irqs */ regmap_write(priv->regs, MX25_ADCQ_SR, MX25_ADCQ_SR_FRR | @@ -115,11 +115,10 @@ static int mx25_gcq_get_raw_value(struct device *dev, regmap_write(priv->regs, MX25_ADCQ_ITEM_7_0, MX25_ADCQ_ITEM(0, chan->channel)); - regmap_update_bits(priv->regs, MX25_ADCQ_MR, MX25_ADCQ_MR_EOQ_IRQ, 0); + regmap_clear_bits(priv->regs, MX25_ADCQ_MR, MX25_ADCQ_MR_EOQ_IRQ); /* Trigger queue for one run */ - regmap_update_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FQS, - MX25_ADCQ_CR_FQS); + regmap_set_bits(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_FQS); time_left = wait_for_completion_interruptible_timeout( &priv->completed, MX25_GCQ_TIMEOUT); @@ -272,9 +271,8 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev, MX25_ADCQ_CFG_REFN_MASK, refp | refn); } - regmap_update_bits(priv->regs, MX25_ADCQ_CR, - MX25_ADCQ_CR_FRST | MX25_ADCQ_CR_QRST, - MX25_ADCQ_CR_FRST | MX25_ADCQ_CR_QRST); + regmap_set_bits(priv->regs, MX25_ADCQ_CR, + MX25_ADCQ_CR_FRST | MX25_ADCQ_CR_QRST); regmap_write(priv->regs, MX25_ADCQ_CR, MX25_ADCQ_CR_PDMSK | MX25_ADCQ_CR_QSM_FQS); From patchwork Mon Jun 17 13:49:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700804 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A24AFC27C79 for ; Mon, 17 Jun 2024 13:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SS/VahdjQ8SKQC25MQPNc7rg+KDijJeHwUtRITveNmM=; b=Zj+/jH8IXnnUeNvR/AOb2amOPv 4HUOqE8tHZ+As6Wz9UcdQFXr9/VZ0GTk49aj9x4LBRyvagozkGttpUEwr+ghQrYNT6r7TSSYJYWjr vz7lA8mY8B0fexE+wnwO+7KVJVN7rMY3ThI43BH2XfuPN3kLUNd4Khdd0pVyoS3ufIq1aTMz9JChC s8rFWNktArxI4B8LX9WOkMsbtC/09zzjOO6D2kqEdv1Hqgx05IB7IrmUnI/mbaeN1ji8rLty27L7X 6+0m6wERu20bJjztvDW769wXS++yDZHOia/VOB0TddFA7leTUnrV9tuA1gK7AxvyVXqXoWQshA9KK wnW160Mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCll-0000000AyDj-1lDb; Mon, 17 Jun 2024 13:51:37 +0000 Received: from mail-ua1-x92b.google.com ([2607:f8b0:4864:20::92b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkM-0000000AwxE-0oWd for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:16 +0000 Received: by mail-ua1-x92b.google.com with SMTP id a1e0cc1a2514c-80b755c6c06so1494250241.2 for ; Mon, 17 Jun 2024 06:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632208; x=1719237008; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SS/VahdjQ8SKQC25MQPNc7rg+KDijJeHwUtRITveNmM=; b=HAM1LXFSMXBLSiuZPkGSN81N5iHrZsZ+0yFmpZm9XhB0vSMpc1ZakIUS6PZL2o/xmA nc3N1FvVfP2ktFeMgiPw39qtnuqTau3PSW8FwnbMKnldlKrqYwybxupUVObgzA6sXHTS CrEuI+KNBMrlNhUTaNaXveG586QK1K03bd68Uyo+d9cl9S32l5b7/mE8pc6oT8Bym4DB j3pAlvKmVyMkQBynjxcG/dnbUMa3ifFPV2U/smAYQl/4XPLRvRcklkL6UHJ8le/fwIJ0 cxyvoCwEC5ur+UDJBVhC/t4ij+wm5cjofWTJWTGjxRUaNPrlK0nWO6w+27/AZEk2IFFo oAXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632208; x=1719237008; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SS/VahdjQ8SKQC25MQPNc7rg+KDijJeHwUtRITveNmM=; b=Pmd16mO4AmO+z3763th0SiRmd2uU1ILf+9sl6f7XDoGCMfIbtye87t+r1KwE5KDDnV yZwA3k1R0KpoGDL7lG4ylhzoWOzUQTdMPYaVqzzPj/Ov/0+OlyWOXTJkXchQqSMHMUEn 8vByE3Hp3vVDDkUNBUmyFkaQV3mjUz6XUUFcCcXwqUIOhbL7UwQFzCUAV2+8cC1j5854 mhjH0U2UJu/QztdtbLWDq8FFPo9m1CWBjuMvs+pJApeGwDQ+1hB+SyHewpdYqTH8mOu+ r/EHydW/Z33a80toBL8i/tyIxVuyVk4fC8+NBcBupdGpcyBaTzm052soe3ulsjoRfrqL TFsg== X-Forwarded-Encrypted: i=1; AJvYcCWRoFwTEOhW2UeIcufIloeryVlVReG87iO4D0t2/LU6N8NvHkNrmkPHsapdPTEEFV+yN40u5bXYOCPWkbkAXzJF/yREXXWg12PujJlZShQCYF2dcbI= X-Gm-Message-State: AOJu0YxfBep8759x7+IKFr8W3gMI9XynrJC5UZAdp6ynxAeY7n3oScgl eGhPrYc9dh8P0a5zJ/Wpzt4OsEGRtSNzMkaW2rAa2RZheiRpqTXinlb9CihmN+U= X-Google-Smtp-Source: AGHT+IExs5o6BBy2GiVBbRbl5RTcmAHYS/6pj70WZUFQ8c7/pJkIjoippgtnc/biSc9YFfMmt2B/ig== X-Received: by 2002:a67:f783:0:b0:48d:9b03:3ff4 with SMTP id ada2fe7eead31-48dae3e1559mr9042383137.28.1718632208483; Mon, 17 Jun 2024 06:50:08 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:08 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:51 -0400 Subject: [PATCH v3 11/41] iio: adc: ina2xx-adc: make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-11-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065010_883193_58C317AA X-CRM114-Status: GOOD ( 10.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/ina2xx-adc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c index 9e52207352fb..727e390bd979 100644 --- a/drivers/iio/adc/ina2xx-adc.c +++ b/drivers/iio/adc/ina2xx-adc.c @@ -1046,8 +1046,7 @@ static void ina2xx_remove(struct i2c_client *client) iio_device_unregister(indio_dev); /* Powerdown */ - ret = regmap_update_bits(chip->regmap, INA2XX_CONFIG, - INA2XX_MODE_MASK, 0); + ret = regmap_clear_bits(chip->regmap, INA2XX_CONFIG, INA2XX_MODE_MASK); if (ret) dev_warn(&client->dev, "Failed to power down device (%pe)\n", ERR_PTR(ret)); From patchwork Mon Jun 17 13:49:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700809 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50C3DC41513 for ; Mon, 17 Jun 2024 13:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DyBlb3Ba1k/jlth0MsPpVigCEg60zHZmfggBIvSR+YQ=; b=RvFc8rblyzj/ZErFznXzclPxuJ VZlSsDN0HLZtFckup3OAKPyVpwRK+2wBWmV708qWmvMRevNXtm5dbOHqALhS+j99zl1mjMXFWBWV4 34NHihfLfMQH4Ows+G2nmsGwj3b2SYnCcQu5OGkIQRtg6WueBMeH1Jc07HKFZROP1W1fSnbl9+AeR 3bQASPbKGmNVz4L5/Ktq+cQro/cJcNmXvjZP7ke/sqRNl+a0SIyka+TmWJhYLscLjC9rH+KcdUFPk dWuEnjI8yKpQKDuCqRzaO+dl2z3IhkmJBwNogmo31fzFrw6QSdhIWoay1K4sSzHlL0YZX3a0vjAb/ ElcXNWdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCmg-0000000Ayk8-29TP; Mon, 17 Jun 2024 13:52:34 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkN-0000000Awyj-3mZL for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:17 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-7955841fddaso361885985a.1 for ; Mon, 17 Jun 2024 06:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632210; x=1719237010; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DyBlb3Ba1k/jlth0MsPpVigCEg60zHZmfggBIvSR+YQ=; b=SIB/YZ5EL9WTjFOX0NhJG1I8ywfsqImD9AwpVfHikf3PXxGQBNnCjxEdI1oyLXs5iy nTiceQriXx2wCw1UCw8BBTjXtKqcRPbNBTE3Pw2FXwJHsDxWP/bEZavE/YIVCGICnFGO m26qua77bB9MUZb3AUELEsVxEDWpTbDFkaM/vjiuh73JXBLIrH3laepYcxPu21kbjEY+ 65Num2UO9DFmQQJwgchmJWXsSVFNgBdzuYsM35B1C2dkBMP+y5VvOtPbPKiEa+my5Wdv YyQq68y+ooDICwtDTG++v1Dok5kqNyVoBqBEmRPl6jhCvPjogZCEHu0sIdXRGeA3mvdt FhXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632210; x=1719237010; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DyBlb3Ba1k/jlth0MsPpVigCEg60zHZmfggBIvSR+YQ=; b=qxttuZ68bJ+mq6yyTMI+DMvEitv+ECcSpV0jDx6m9T0LQpDQz2Lx0msXMHxpR/7AKD NFukLOhUwAZu8D2GarqEPK1n7tboko6QjUJ1LOsNOsr0NDnhO5tpazhmZ8BI3Lek+w33 xXEfYaFo6OpYL/uvRvpuMy3UTCEjiTpJijlBk8pmW7cZYY53Kebap20jxUPLHxWD8sPe 11ekWOPKbO/gSRfU/qVYTf17ZwetZqdU2AWvi66C67LkCXkQRtf7MkljMNcghUMxlvTK jfyI52aau+SE9bBw1qDJc6Argdih3rEOQaAjAxPxwA11mT2fMvrm6swJH/HxRLlDAyz+ dCnw== X-Forwarded-Encrypted: i=1; AJvYcCVqSPUVusRk7JYbPN5R9xoRsBCcYgGWNliIHFQ7uJUlm32crWs5h0/pO4pjahiB5n4gSeBm4qPoXlO7ZTpPS44/QrRy04YcpflK4yYFrpTxT4d+XX0= X-Gm-Message-State: AOJu0Yxj5Nz5SdLVoXzlKHlYcRwXHNRa9DwE5mtl8TBo83JVuLhR5p9z yVfaS6KIjsv4GGmODWzfuPRChPM7WOws8jrlON2g24gwxBCLpfmyd0B+pqC5Mn8= X-Google-Smtp-Source: AGHT+IHWmg+UOH3erM5jeRd6l80OV3UNPvKSawdtaAa099apOKn54lBrRboJnTNNmboBsmxvynve5Q== X-Received: by 2002:a05:620a:408a:b0:799:b171:b1fe with SMTP id af79cd13be357-799b171b5f4mr1409403885a.14.1718632210646; Mon, 17 Jun 2024 06:50:10 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:10 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:52 -0400 Subject: [PATCH v3 12/41] iio: adc: intel_mrfld_adc: make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-12-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065012_430063_502DA8B3 X-CRM114-Status: GOOD ( 10.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/intel_mrfld_adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/intel_mrfld_adc.c b/drivers/iio/adc/intel_mrfld_adc.c index c7f40ae6e608..0590a126f321 100644 --- a/drivers/iio/adc/intel_mrfld_adc.c +++ b/drivers/iio/adc/intel_mrfld_adc.c @@ -81,8 +81,8 @@ static int mrfld_adc_single_conv(struct iio_dev *indio_dev, reinit_completion(&adc->completion); - regmap_update_bits(regmap, BCOVE_MADCIRQ, BCOVE_ADCIRQ_ALL, 0); - regmap_update_bits(regmap, BCOVE_MIRQLVL1, BCOVE_LVL1_ADC, 0); + regmap_clear_bits(regmap, BCOVE_MADCIRQ, BCOVE_ADCIRQ_ALL); + regmap_clear_bits(regmap, BCOVE_MIRQLVL1, BCOVE_LVL1_ADC); ret = regmap_read_poll_timeout(regmap, BCOVE_GPADCREQ, req, !(req & BCOVE_GPADCREQ_BUSY), From patchwork Mon Jun 17 13:49:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700805 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 377A7C27C79 for ; Mon, 17 Jun 2024 13:51:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KXJIaHqTfmpNhZnTE583n/Ec2b/3cyzD9UXAylu36IA=; b=usgjUlKFFph+ATcjF1JEUOfjvg G8ovsUuj+LFLJQ17KcUjdl5P0Mun7CbeO4WH0gTMkIym715yyJykEDH+XlOgKqh69Ac5xdxHA99P0 yQ5RDUvF5efwA0suju9BodXUl7cBSY48BDWIS1jlUMf5v0CCLc0uG4sWEIHketcySRre7co3CVFwu e89hern9+X542zDBqXDg+COY7BaisWOVKtYPFr+tqZtE/pJHBlcApjg6/+vyFuY7RkXzx7shV0Quf U9GA8G2lt/st5UCZUXb7RTrLYKn+3Mf33sc4dAAB7rJag3UX3MdtoTX62wRMYWhU8KUqO3Dh8B7PJ lQ1C/Fmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCln-0000000AyF2-27RJ; Mon, 17 Jun 2024 13:51:39 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkP-0000000Ax0w-3xlE for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:25 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7961fb2d1cfso368627985a.0 for ; Mon, 17 Jun 2024 06:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632213; x=1719237013; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=KXJIaHqTfmpNhZnTE583n/Ec2b/3cyzD9UXAylu36IA=; b=or/5JjqSFdvZs+dvbpX5HM0txOhDCBcO74rTh06Ck4A35k3u9hp/ezebKJOM02xUzh gxVwWu3a2qNDtohJAWBEH8Buy/rlPKAbDW5FecBvFn7Z7DlG+Vx8eKrz9oqz1tf3XabP 4iqfVp8mIvDQ81aAJJ0itLQgrXf2fZ7ZlKDJOtbfPevIBBzD3s8vVyRuEHyXQMSr6fcT tVIIGX+Z1d0P7ZxnVwapZSdYPysPV1uXl9G/hlMViKu42Vz2gMUB0+3vTM85o/oLudSy vo3I7u+AQ2B348x6bpMA3EO8jbUQPMcTrWGnx3XyVjyAXmE8MQ/qmuX1emqHbbI+6OH6 SKdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632213; x=1719237013; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KXJIaHqTfmpNhZnTE583n/Ec2b/3cyzD9UXAylu36IA=; b=XheIAjIAjfnV9VNyfidgkXWyAPUvgZVBeXnlN6ndLF0AhT6DoLd3UCf3GsemLIdkTE oYLOIvkjjufPL5Onp+NnMM+TvWEwv7LzohP3CJqvyZV3DoEW9MNJWUWI4+lalc/WEMrP ZBawY3A2xKeb21uIErnGqEwz5bedAs5BqwjZFdGnlJNl/Yn/SEe+POZMAYCyHL47c4vC jY4vS4Jb+tNduEL/DTMm4FHn3dc2kDI7tgMHGSxEoB2PyMKwv2VaLyMrQuon+w/wiZvH IvG+h+zP9NRezr/HnjMUC3szkGPYeqjwHwiF5s0w77Hn6RHUjYwPQ49rDIVY5C1NCiYT 0rgQ== X-Forwarded-Encrypted: i=1; AJvYcCUKbkFfsIn5Jyja+BujiW0p2uJvQxB0haWQICXwo8xf83pfcgPO0YochFkD8PkAMbA5+9JbeTM+tMaOWYMtx6el+ELlF7VHdcplm5xiy20hgHqyQ0o= X-Gm-Message-State: AOJu0YyN0K26AQeZBebSuZ/1wMNBClrDYoZz6Ws7E0vzzjRcV8nwJmz8 ssxzphvW8BcHQdFvxYxL0O2e9t8qLHkxZgOf/vWeJi9BZ8+xvDHPnJPthymP0+Q= X-Google-Smtp-Source: AGHT+IFE4+GjUcRvfBj86U5p9RlM1W0UrqMbwwjDZojT1mdFRj7PyY3udpb+reAC5jxDfHM60DBB3g== X-Received: by 2002:a05:620a:28c7:b0:797:8564:920a with SMTP id af79cd13be357-798d2413c45mr1111201285a.29.1718632212779; Mon, 17 Jun 2024 06:50:12 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:12 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:53 -0400 Subject: [PATCH v3 13/41] iio: adc: meson_saradc: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-13-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065014_703302_19CAACE9 X-CRM114-Status: GOOD ( 14.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Reviewed-by: George Stark --- drivers/iio/adc/meson_saradc.c | 101 ++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 57 deletions(-) diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c index 13b473d8c6c7..e16b0e28974e 100644 --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers/iio/adc/meson_saradc.c @@ -546,35 +546,31 @@ static void meson_sar_adc_start_sample_engine(struct iio_dev *indio_dev) reinit_completion(&priv->done); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_FIFO_IRQ_EN, - MESON_SAR_ADC_REG0_FIFO_IRQ_EN); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_FIFO_IRQ_EN); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_SAMPLE_ENGINE_ENABLE, - MESON_SAR_ADC_REG0_SAMPLE_ENGINE_ENABLE); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_SAMPLE_ENGINE_ENABLE); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_SAMPLING_START, - MESON_SAR_ADC_REG0_SAMPLING_START); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_SAMPLING_START); } static void meson_sar_adc_stop_sample_engine(struct iio_dev *indio_dev) { struct meson_sar_adc_priv *priv = iio_priv(indio_dev); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_FIFO_IRQ_EN, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_FIFO_IRQ_EN); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_SAMPLING_STOP, - MESON_SAR_ADC_REG0_SAMPLING_STOP); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_SAMPLING_STOP); /* wait until all modules are stopped */ meson_sar_adc_wait_busy_clear(indio_dev); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_SAMPLE_ENGINE_ENABLE, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_SAMPLE_ENGINE_ENABLE); } static int meson_sar_adc_lock(struct iio_dev *indio_dev) @@ -586,9 +582,8 @@ static int meson_sar_adc_lock(struct iio_dev *indio_dev) if (priv->param->has_bl30_integration) { /* prevent BL30 from using the SAR ADC while we are using it */ - regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELAY, - MESON_SAR_ADC_DELAY_KERNEL_BUSY, - MESON_SAR_ADC_DELAY_KERNEL_BUSY); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_DELAY, + MESON_SAR_ADC_DELAY_KERNEL_BUSY); udelay(1); @@ -614,8 +609,8 @@ static void meson_sar_adc_unlock(struct iio_dev *indio_dev) if (priv->param->has_bl30_integration) /* allow BL30 to use the SAR ADC again */ - regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELAY, - MESON_SAR_ADC_DELAY_KERNEL_BUSY, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_DELAY, + MESON_SAR_ADC_DELAY_KERNEL_BUSY); mutex_unlock(&priv->lock); } @@ -869,17 +864,16 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev) * disable this bit as seems to be only relevant for Meson6 (based * on the vendor driver), which we don't support at the moment. */ - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, - MESON_SAR_ADC_REG0_ADC_TEMP_SEN_SEL, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_REG0, + MESON_SAR_ADC_REG0_ADC_TEMP_SEN_SEL); /* disable all channels by default */ regmap_write(priv->regmap, MESON_SAR_ADC_CHAN_LIST, 0x0); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, - MESON_SAR_ADC_REG3_CTRL_SAMPLING_CLOCK_PHASE, 0); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, - MESON_SAR_ADC_REG3_CNTL_USE_SC_DLY, - MESON_SAR_ADC_REG3_CNTL_USE_SC_DLY); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_REG3, + MESON_SAR_ADC_REG3_CTRL_SAMPLING_CLOCK_PHASE); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_REG3, + MESON_SAR_ADC_REG3_CNTL_USE_SC_DLY); /* delay between two samples = (10+1) * 1uS */ regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELAY, @@ -914,21 +908,17 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev) MESON_SAR_ADC_CHAN_10_SW_CHAN1_MUX_SEL_MASK, regval); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN0_XP_DRIVE_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN0_XP_DRIVE_SW); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, + MESON_SAR_ADC_CHAN_10_SW_CHAN0_XP_DRIVE_SW); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN0_YP_DRIVE_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN0_YP_DRIVE_SW); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, + MESON_SAR_ADC_CHAN_10_SW_CHAN0_YP_DRIVE_SW); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN1_XP_DRIVE_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN1_XP_DRIVE_SW); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, + MESON_SAR_ADC_CHAN_10_SW_CHAN1_XP_DRIVE_SW); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN1_YP_DRIVE_SW, - MESON_SAR_ADC_CHAN_10_SW_CHAN1_YP_DRIVE_SW); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_CHAN_10_SW, + MESON_SAR_ADC_CHAN_10_SW_CHAN1_YP_DRIVE_SW); /* * set up the input channel muxes in MESON_SAR_ADC_AUX_SW @@ -944,12 +934,10 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev) regmap_write(priv->regmap, MESON_SAR_ADC_AUX_SW, regval); if (priv->temperature_sensor_calibrated) { - regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, - MESON_SAR_ADC_DELTA_10_TS_REVE1, - MESON_SAR_ADC_DELTA_10_TS_REVE1); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, - MESON_SAR_ADC_DELTA_10_TS_REVE0, - MESON_SAR_ADC_DELTA_10_TS_REVE0); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, + MESON_SAR_ADC_DELTA_10_TS_REVE1); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, + MESON_SAR_ADC_DELTA_10_TS_REVE0); /* * set bits [3:0] of the TSC (temperature sensor coefficient) @@ -976,10 +964,10 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev) regval); } } else { - regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, - MESON_SAR_ADC_DELTA_10_TS_REVE1, 0); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, - MESON_SAR_ADC_DELTA_10_TS_REVE0, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, + MESON_SAR_ADC_DELTA_10_TS_REVE1); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_DELTA_10, + MESON_SAR_ADC_DELTA_10_TS_REVE0); } regval = FIELD_PREP(MESON_SAR_ADC_REG3_CTRL_CONT_RING_COUNTER_EN, @@ -1062,9 +1050,8 @@ static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev) meson_sar_adc_set_bandgap(indio_dev, true); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, - MESON_SAR_ADC_REG3_ADC_EN, - MESON_SAR_ADC_REG3_ADC_EN); + regmap_set_bits(priv->regmap, MESON_SAR_ADC_REG3, + MESON_SAR_ADC_REG3_ADC_EN); udelay(5); @@ -1079,8 +1066,8 @@ static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev) return 0; err_adc_clk: - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, - MESON_SAR_ADC_REG3_ADC_EN, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_REG3, + MESON_SAR_ADC_REG3_ADC_EN); meson_sar_adc_set_bandgap(indio_dev, false); regulator_disable(priv->vref); err_vref: @@ -1104,8 +1091,8 @@ static void meson_sar_adc_hw_disable(struct iio_dev *indio_dev) clk_disable_unprepare(priv->adc_clk); - regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, - MESON_SAR_ADC_REG3_ADC_EN, 0); + regmap_clear_bits(priv->regmap, MESON_SAR_ADC_REG3, + MESON_SAR_ADC_REG3_ADC_EN); meson_sar_adc_set_bandgap(indio_dev, false); From patchwork Mon Jun 17 13:49:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700810 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 39213C27C79 for ; Mon, 17 Jun 2024 13:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GyaMuqBhP7o7wmqZwNnsnkbTtRp5AugJ4lcsefsATFM=; b=bhj2D89mRNsDug8/FBFmJfB9EF IQByikOfT+ncYYf6zSZbVtOM/DPCGp0QGV2Y4eLrIJ0Nmjp0fDaUn5miKGotUSTz1IqJrqeBMxwRx tKDQe5y1GaW//QeGLXHnaudZChyRxYaKknPWd0myJxfrlY4ntAv91SC5Wux2/TSNfgLiF66yF9zys kIovCsaBxgWiwiE0muM8hUvD7zoFTtf7x+LRjweFuqKGU8g6Cvuhrhb8lr7Lt2QuOjgUr3xV5a6DH dn8hacwUhzG0vwqu/8sTpRAo377KPTx0yi3Mwsle5MHHsG6/8wfNe77z7u6Y1VNKhCSHMbHcjNMUn h1bKktEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCmj-0000000AynF-2rm9; Mon, 17 Jun 2024 13:52:37 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkS-0000000Ax3O-1aAY for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:30 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-795569eedcaso228709685a.3 for ; Mon, 17 Jun 2024 06:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632215; x=1719237015; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=GyaMuqBhP7o7wmqZwNnsnkbTtRp5AugJ4lcsefsATFM=; b=H9bETH7NPyBdAtafP6V5xbQ/koL+OI/skxFH5OjIBCunDt4oe9dJeKYldJQcmkInKg bD+gqpjaJwsyuFBNyOq3vNmc2xhyZqK9XZfxiqzDto78mttz73ui02HEwBSsdpg4bPsA UzY1Zo223SuNzuQJ3T6u1Sd8DiXptvmzSsPvhLTPdPw4/p8BAd6cGqbutGRqshDDwdAG 1KZa0HlsA0AwOSdDIxhiRjfbsDddZieLf1FP/xXFkzZoew+NblU3BSW5BhZcOrBvdid4 EaRQf0YAFih7EHaK8bt6ovDorQkwnrg4BQcdSWbBZC2OrXx0OR3Js6DqQmIZssrhD/xw z/uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632215; x=1719237015; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GyaMuqBhP7o7wmqZwNnsnkbTtRp5AugJ4lcsefsATFM=; b=wZcBWTVfmv7lJoPI8BSmxszK8tW7RCpmhhhVxNlFj3p8iWKbQQF7351JH5gsRHUfzL 9T/qHCIYCkTczGiMrCAG0C7KOqNMU9i/FAcgB91qvexIqA7FztJw5aFmLpQu3vpILGT9 1qh+HCRink2L108TbKR7k0f/osnDUdk4/U1cizjtV6fw5MWxxFQKG4PSQclX6og6mN4a 2KmczewrFh2n69sE9tDlL83eXItdZgHDyratfc7Jl+URGiJdLfwaXVKjQN7H1SV9evDW ie79ST0CDkhfQNuxiSgisfvg40ji0AaGkqIcGQ3ik2s0kJRPdxxXR96RQhIDutJC5j5o nThA== X-Forwarded-Encrypted: i=1; AJvYcCUPAx1X7xNIyxJjhHbQluoAi0e8tTvDKICosHz/Cdo35C5gRf2eeC8AAVQwJRhguOB43bIq58jX/buGmvPmGNAlViIo9nJBwNiN0umVgtXflfAGLv4= X-Gm-Message-State: AOJu0YybqnB/1VkeZtBsOdJ7tB1dyWMxDULWPyWeEMffG1AWxaQ8OWsY iO/z8yZMmy2B5/FoWkx27pSTZLO52iqIs6fxebablS9yoiArJD/IbNqb3OdpgBw= X-Google-Smtp-Source: AGHT+IG9rvLxXHys5yM3fiDf+G14AWJNmGoLIu5wSpeGGOXNzHBF3wjPuE24N3ncETdlUUNQNA6oSA== X-Received: by 2002:a05:620a:45aa:b0:795:4e64:dbbe with SMTP id af79cd13be357-798d1f824a7mr1191474185a.0.1718632214915; Mon, 17 Jun 2024 06:50:14 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:14 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:54 -0400 Subject: [PATCH v3 14/41] iio: adc: mp2629_adc: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-14-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065016_677067_1B71EAD3 X-CRM114-Status: GOOD ( 12.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/mp2629_adc.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/iio/adc/mp2629_adc.c b/drivers/iio/adc/mp2629_adc.c index 7c66c2cd5be2..5f672765d4a2 100644 --- a/drivers/iio/adc/mp2629_adc.c +++ b/drivers/iio/adc/mp2629_adc.c @@ -131,9 +131,8 @@ static int mp2629_adc_probe(struct platform_device *pdev) info->dev = dev; platform_set_drvdata(pdev, indio_dev); - ret = regmap_update_bits(info->regmap, MP2629_REG_ADC_CTRL, - MP2629_ADC_START | MP2629_ADC_CONTINUOUS, - MP2629_ADC_START | MP2629_ADC_CONTINUOUS); + ret = regmap_set_bits(info->regmap, MP2629_REG_ADC_CTRL, + MP2629_ADC_START | MP2629_ADC_CONTINUOUS); if (ret) { dev_err(dev, "adc enable fail: %d\n", ret); return ret; @@ -163,10 +162,9 @@ static int mp2629_adc_probe(struct platform_device *pdev) iio_map_array_unregister(indio_dev); fail_disable: - regmap_update_bits(info->regmap, MP2629_REG_ADC_CTRL, - MP2629_ADC_CONTINUOUS, 0); - regmap_update_bits(info->regmap, MP2629_REG_ADC_CTRL, - MP2629_ADC_START, 0); + regmap_clear_bits(info->regmap, MP2629_REG_ADC_CTRL, + MP2629_ADC_CONTINUOUS); + regmap_clear_bits(info->regmap, MP2629_REG_ADC_CTRL, MP2629_ADC_START); return ret; } @@ -180,10 +178,9 @@ static void mp2629_adc_remove(struct platform_device *pdev) iio_map_array_unregister(indio_dev); - regmap_update_bits(info->regmap, MP2629_REG_ADC_CTRL, - MP2629_ADC_CONTINUOUS, 0); - regmap_update_bits(info->regmap, MP2629_REG_ADC_CTRL, - MP2629_ADC_START, 0); + regmap_clear_bits(info->regmap, MP2629_REG_ADC_CTRL, + MP2629_ADC_CONTINUOUS); + regmap_clear_bits(info->regmap, MP2629_REG_ADC_CTRL, MP2629_ADC_START); } static const struct of_device_id mp2629_adc_of_match[] = { From patchwork Mon Jun 17 13:49:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 01287C2BA18 for ; Mon, 17 Jun 2024 15:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FJ898fDCKj42D5/vtQAto1s5SAQxhzxV4OLmCarOpnQ=; b=VmxhyL/A7fNGfkDcH0WGVtTTET x6xmsZZ8/1GjjtHfcndM+OgtuqoEor5sDCWtHxwSkOpBd45aqO2FN9EoMww2IpFYE9y4Ahb0TNymx MCtpbpxtNwJlKUpZw+uBcNYWLXfaHwAKNI+HCA+k07Fc/JJSsgwDVYr4rysHLIkZl4OzW4V4ANFsT SxUDUD7nsLnA13TGyHa3qGi6r9v/UZme0qDNQAJYuT4i/ztXCFkXB50AOxMO5wue1wQHhWxzTjhh2 vxRqlXwM5l9zDn+lxjzY4P0lCpl4dGIChmhuqZAsIPE3WXo0NEsXrzw0K140G3N+M3F78hysbNZfV qKZ3NJmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrD-0000000BKNa-0rmD; Mon, 17 Jun 2024 15:01:19 +0000 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkU-0000000Ax5p-0hE3 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:38 +0000 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7953f1dcb01so389048085a.3 for ; Mon, 17 Jun 2024 06:50:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632217; x=1719237017; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FJ898fDCKj42D5/vtQAto1s5SAQxhzxV4OLmCarOpnQ=; b=j6cCNDY8oru7YYO0M2rpNXdb80xaSJFKwL+zv8yrRfSogy52hSKrlphTr/xAONgbdD k4jBeBM1noy/lk4hLLx9yhDAdcUR2tOojFgaTueamJ9FatIRqyF1uDUc64RX4jFzT40k XIn1duUvT7p14Yielq2q6yduxqH5qM4draXHFPG+I3copzmCA9wet+jftylwDCL6CV7b H90zNJyHSqAbudlnQUlpjsVVE8GLGUZPj6gPhVa9KDfZS9ovijnIZDpTsD12PaaSo+Df YD74gG5lWI6gkuWq8gGrT7z6eyYgouPtsaKk61DFfQHbTLDnc3qDr39IwaQEPg/7S6VS J+YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632217; x=1719237017; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FJ898fDCKj42D5/vtQAto1s5SAQxhzxV4OLmCarOpnQ=; b=gR2OsfVPgLVvk+3AborbJlgs4Qe+Sn8IKiEWN5MWlaE6eRFDAO0SlMMPrVyuHNo9Xg kdMgyPjKumW0dudn1JS0utXmpRthRlrfT0CwzFIVtphCGVxf3fEBdjesXlUnibd70k+F aXvEqfbB3xQdSsZLwDb9LX/FQMgPpl8TI1GZi6EQRgKz0NgM/0OpXroEZUeye2rHnG5R qHtcYiziWE30fnzZzAiUbV4fO0PhtBvFLg2fr4vI1sQYyeNAIkd9ECuLynycmHbWZR/h eweJ5aarR6/Ukbp789KEMFb/623Y3H4v6cLojah2RzR3M2Jg+8OoQO3PYFvJnsINh9Lp lIgA== X-Forwarded-Encrypted: i=1; AJvYcCWiOQ+Rk4KzE0txVUYaXh1RYQxpwCg2o1WMK13byhhcpE6u+zzY9rfM70u8grbajPKHJGoM6QOaNTLbhi+8lHseYRdpdZp5bGt0wN1d1KEBn6uh/3A= X-Gm-Message-State: AOJu0YwCkfWqU86H9FkWc/BX/YZRy/MVjaLZzy1C0VPHzyXL35RZKzW4 kSnyKhjeItfIKksD2Ds5sSN7ZGpc4bpjKVM9XyWw/jssRLb13YhqC2Ovmq2MX74= X-Google-Smtp-Source: AGHT+IG7O2bJi0GCfnphwmiN8zuYwAKTZAA7K/LgtdsfOhK/hCe8sAhzrzmLoDYS8PhLsNItnynlLA== X-Received: by 2002:a05:620a:404a:b0:795:2307:97ec with SMTP id af79cd13be357-798d2588f12mr1074628285a.56.1718632217032; Mon, 17 Jun 2024 06:50:17 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:16 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:55 -0400 Subject: [PATCH v3 15/41] iio: adc: qcom-spmi-rradc: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-15-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065018_797230_B861EB02 X-CRM114-Status: GOOD ( 12.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/qcom-spmi-rradc.c | 50 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/drivers/iio/adc/qcom-spmi-rradc.c b/drivers/iio/adc/qcom-spmi-rradc.c index 56a713766954..1402df68dd52 100644 --- a/drivers/iio/adc/qcom-spmi-rradc.c +++ b/drivers/iio/adc/qcom-spmi-rradc.c @@ -358,15 +358,15 @@ static int rradc_enable_continuous_mode(struct rradc_chip *chip) int ret; /* Clear channel log */ - ret = regmap_update_bits(chip->regmap, chip->base + RR_ADC_LOG, - RR_ADC_LOG_CLR_CTRL, RR_ADC_LOG_CLR_CTRL); + ret = regmap_set_bits(chip->regmap, chip->base + RR_ADC_LOG, + RR_ADC_LOG_CLR_CTRL); if (ret < 0) { dev_err(chip->dev, "log ctrl update to clear failed:%d\n", ret); return ret; } - ret = regmap_update_bits(chip->regmap, chip->base + RR_ADC_LOG, - RR_ADC_LOG_CLR_CTRL, 0); + ret = regmap_clear_bits(chip->regmap, chip->base + RR_ADC_LOG, + RR_ADC_LOG_CLR_CTRL); if (ret < 0) { dev_err(chip->dev, "log ctrl update to not clear failed:%d\n", ret); @@ -374,9 +374,8 @@ static int rradc_enable_continuous_mode(struct rradc_chip *chip) } /* Switch to continuous mode */ - ret = regmap_update_bits(chip->regmap, chip->base + RR_ADC_CTL, - RR_ADC_CTL_CONTINUOUS_SEL, - RR_ADC_CTL_CONTINUOUS_SEL); + ret = regmap_set_bits(chip->regmap, chip->base + RR_ADC_CTL, + RR_ADC_CTL_CONTINUOUS_SEL); if (ret < 0) dev_err(chip->dev, "Update to continuous mode failed:%d\n", ret); @@ -389,8 +388,8 @@ static int rradc_disable_continuous_mode(struct rradc_chip *chip) int ret; /* Switch to non continuous mode */ - ret = regmap_update_bits(chip->regmap, chip->base + RR_ADC_CTL, - RR_ADC_CTL_CONTINUOUS_SEL, 0); + ret = regmap_clear_bits(chip->regmap, chip->base + RR_ADC_CTL, + RR_ADC_CTL_CONTINUOUS_SEL); if (ret < 0) dev_err(chip->dev, "Update to non-continuous mode failed:%d\n", ret); @@ -434,8 +433,8 @@ static int rradc_read_status_in_cont_mode(struct rradc_chip *chip, return -EINVAL; } - ret = regmap_update_bits(chip->regmap, chip->base + chan->trigger_addr, - chan->trigger_mask, chan->trigger_mask); + ret = regmap_set_bits(chip->regmap, chip->base + chan->trigger_addr, + chan->trigger_mask); if (ret < 0) { dev_err(chip->dev, "Failed to apply trigger for channel '%s' ret=%d\n", @@ -469,8 +468,8 @@ static int rradc_read_status_in_cont_mode(struct rradc_chip *chip, rradc_disable_continuous_mode(chip); disable_trigger: - regmap_update_bits(chip->regmap, chip->base + chan->trigger_addr, - chan->trigger_mask, 0); + regmap_clear_bits(chip->regmap, chip->base + chan->trigger_addr, + chan->trigger_mask); return ret; } @@ -481,17 +480,16 @@ static int rradc_prepare_batt_id_conversion(struct rradc_chip *chip, { int ret; - ret = regmap_update_bits(chip->regmap, chip->base + RR_ADC_BATT_ID_CTRL, - RR_ADC_BATT_ID_CTRL_CHANNEL_CONV, - RR_ADC_BATT_ID_CTRL_CHANNEL_CONV); + ret = regmap_set_bits(chip->regmap, chip->base + RR_ADC_BATT_ID_CTRL, + RR_ADC_BATT_ID_CTRL_CHANNEL_CONV); if (ret < 0) { dev_err(chip->dev, "Enabling BATT ID channel failed:%d\n", ret); return ret; } - ret = regmap_update_bits(chip->regmap, - chip->base + RR_ADC_BATT_ID_TRIGGER, - RR_ADC_TRIGGER_CTL, RR_ADC_TRIGGER_CTL); + ret = regmap_set_bits(chip->regmap, + chip->base + RR_ADC_BATT_ID_TRIGGER, + RR_ADC_TRIGGER_CTL); if (ret < 0) { dev_err(chip->dev, "BATT_ID trigger set failed:%d\n", ret); goto out_disable_batt_id; @@ -500,12 +498,12 @@ static int rradc_prepare_batt_id_conversion(struct rradc_chip *chip, ret = rradc_read_status_in_cont_mode(chip, chan_address); /* Reset registers back to default values */ - regmap_update_bits(chip->regmap, chip->base + RR_ADC_BATT_ID_TRIGGER, - RR_ADC_TRIGGER_CTL, 0); + regmap_clear_bits(chip->regmap, chip->base + RR_ADC_BATT_ID_TRIGGER, + RR_ADC_TRIGGER_CTL); out_disable_batt_id: - regmap_update_bits(chip->regmap, chip->base + RR_ADC_BATT_ID_CTRL, - RR_ADC_BATT_ID_CTRL_CHANNEL_CONV, 0); + regmap_clear_bits(chip->regmap, chip->base + RR_ADC_BATT_ID_CTRL, + RR_ADC_BATT_ID_CTRL_CHANNEL_CONV); return ret; } @@ -965,9 +963,9 @@ static int rradc_probe(struct platform_device *pdev) if (batt_id_delay >= 0) { batt_id_delay = FIELD_PREP(BATT_ID_SETTLE_MASK, batt_id_delay); - ret = regmap_update_bits(chip->regmap, - chip->base + RR_ADC_BATT_ID_CFG, - batt_id_delay, batt_id_delay); + ret = regmap_set_bits(chip->regmap, + chip->base + RR_ADC_BATT_ID_CFG, + batt_id_delay); if (ret < 0) { dev_err(chip->dev, "BATT_ID settling time config failed:%d\n", From patchwork Mon Jun 17 13:49:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700811 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03851C27C79 for ; Mon, 17 Jun 2024 13:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KVb/0PilAc52B9kaVfDX+4rlv8WRgZtRLdvIf/r6J1Y=; b=Nphn/XjBz37kOpH8+XAcFfReGm ohRQMFC1jSZYbwTGl1tHSNXXjdD0cw9yr8lRpuvH0aZU4mddzIPBijurPosgwTknnE7+tQavzP7w4 AhoUsb5acoqtElAckNcWoSb9cAV7teUFlcdF17u4oa87dPIcvnU4LkuYjk8NUjnDJfx8JDgzY5rEf iKY8g38ZAlcpDL/JdROHDs8kyRrJNzb2PzWeqYnybQ4Uwk69wmzWeSTwT6aeKQNGcGbx3yVBlOuWd SYJ/9ey++hj+TC0ly5z5HHc8fQ0E19sMzfygClfioudDwqRY6bHIry0/P8XPdbmehPBFWISqa7WTK otDVnvyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCmp-0000000Ays7-3lTX; Mon, 17 Jun 2024 13:52:43 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkW-0000000Ax7o-12mv for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:36 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-797b24b8944so418383385a.0 for ; Mon, 17 Jun 2024 06:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632219; x=1719237019; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=KVb/0PilAc52B9kaVfDX+4rlv8WRgZtRLdvIf/r6J1Y=; b=Q+NpJy2Fflq/Y8d09hPhyHpmVZtJR2r66y0SFYH07i/+M3103MZ+t4zroqsNDRuZQl keyrgz65ISh9GgCCBnpDxcPRAS8fkhwh1TJaTcExY79cNZqcRYzY3tLhWo7fy+3Q8mby xbpFV8zTIHrZ70m/1P587BaI003cSi3VK1OITZ5tjOb11DZSPAS+fWLc3/Dn4I67cUzN ppPFC4WLqgJd0H28EPGjeHV4f71T8w+AEU2A5UvWFd0TgIxB3l+WFx+h6XpfABottL2j qfxmfr9exqHdbu1CZPGcJQrOJGeEss4AtVsvbexmHQms0E6aPbfR09oFUByCEzuCvpZY 4Ikw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632219; x=1719237019; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KVb/0PilAc52B9kaVfDX+4rlv8WRgZtRLdvIf/r6J1Y=; b=LAbnn9rQVcJcMSugSTWDmhM/cie69v4Z14dJ/TawCDiGU70Yr+enSlzdOF6bJlrb4Y w7lo90l+Ec5mYiNT+fqeC6qkMBYwRRG/Mpw3bTqk3yKJA8eGtTtnJPy8//Yu6XXbjSne LKb8qaJ14BV8eO/r3RBci3HRATNgK7XAfgIMcZ4E48hbFllP38bzPOsTxZTGnIXQS0JH i+dQqoXGR8d0XlAnDwbMpN2JBxq1hVGC4LQogwoLrds+cdn3Ux0Lt5OmevBhSKe1164e v6ruLZxDld4ZL6Bi8Kt3wF7MGUT34coXvDXdGE8FfHWpLltb+Y5tJ9+i5hGNy8cnl+Pz E5IA== X-Forwarded-Encrypted: i=1; AJvYcCXjQpUKldv68Vzubh+b7no61a117AVydbHq3sEj7kGzjoJKFOkoepSH8NEoiZj8RI5GR5D27Laop1ZRxtjOdn3OZf/FjGMKoPi2J6jlpZnFHAHzn1o= X-Gm-Message-State: AOJu0YxABzJHNY+SZuSujHwDmUiqjMlS1rxAgc8G4rNNC0aDsEJ2I4ag xUnnFBtMZafqRt0infYHyIwC/nWDsv7JZzDEQ9mXYsbv7IkbraQIrJOmzqWhUuI= X-Google-Smtp-Source: AGHT+IEhAnjjomgk19gOfh4FY6+tmL+ftVg/dpR5n10Qt2NpVGAkWAorRIXV5RllBFaajmvErpGqLg== X-Received: by 2002:a05:620a:370d:b0:796:842c:77f1 with SMTP id af79cd13be357-798d243aaa6mr1278103785a.36.1718632219186; Mon, 17 Jun 2024 06:50:19 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:18 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:56 -0400 Subject: [PATCH v3 16/41] iio: adc: rn5t618-adc: make use of regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-16-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065021_161861_34F0303E X-CRM114-Status: GOOD ( 10.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/rn5t618-adc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/rn5t618-adc.c b/drivers/iio/adc/rn5t618-adc.c index 6bf32907f01d..ce5f3011fe00 100644 --- a/drivers/iio/adc/rn5t618-adc.c +++ b/drivers/iio/adc/rn5t618-adc.c @@ -137,9 +137,8 @@ static int rn5t618_adc_read(struct iio_dev *iio_dev, init_completion(&adc->conv_completion); /* single conversion */ - ret = regmap_update_bits(adc->rn5t618->regmap, RN5T618_ADCCNT3, - RN5T618_ADCCNT3_GODONE, - RN5T618_ADCCNT3_GODONE); + ret = regmap_set_bits(adc->rn5t618->regmap, RN5T618_ADCCNT3, + RN5T618_ADCCNT3_GODONE); if (ret < 0) return ret; From patchwork Mon Jun 17 13:49:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700890 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1887C27C79 for ; Mon, 17 Jun 2024 15:01:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pghOqqoUrgqxulm8czqYmTg2ejQ+jCMFTS9OcdLe8gI=; b=WL+L8v6LEYbDS82gSojvmswl6D wES/EMf2KanagBiIn/4fJLhu59qUFtYT2Bef57dPWcSOem19i5bDiYwQ2ubXe/9yRB9rh8n9E1gJC pdiiR0X4Fzndvf+4YGH9HXDybkS8nWgl7OLLoob+0H1GDfnvrZPVqclT4AAonkJzJZAnSl+CpOcoV bZmj2SdmHen3Duw4k6W87gQI4vL4rAw7IFm8G7dV8SpOjqvpKXiEKoVaMmWf4Q9cJlAow6WZX2UxS OmPfcfcL8AZJE3V3wM9LFTgoqGrAAJbvppJ9xevIxVPqwik2MkFkxHYTUfD05TrkPW8vKSKAu0/2a k9bg8qug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDr8-0000000BKKa-43kx; Mon, 17 Jun 2024 15:01:15 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkg-0000000AxH8-3i5j for linux-arm-kernel@bombadil.infradead.org; Mon, 17 Jun 2024 13:50:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=pghOqqoUrgqxulm8czqYmTg2ejQ+jCMFTS9OcdLe8gI=; b=n4uC6iydJCUd9RlrF8UcYhrKYa UAL0WoQ55SrwD9fT70n6+nBL8Pt7nJCRzHoESHDGOCr4ipL3pqRloXYhNlcBcCwD8cKfnKJ9P/kZs JpxkRfTI1Yx+AiqZzi5t+gRegQzCOcrVl11R8IVrgvraydAhvOK8o6ziBrh0JwU6kIxwzF4bsRhXI KCgg7OmvPn2yngrtBVgzRWdzAZNWhTBQijlU5SRDmoeTPe1aeA8Zx2XC3ntsXGK0imqAsUXwm4enk I5Vf72MejUAunMGA4ilj3PFnDIiDu5jSZdpIDTntsDhpPMc4CAP5ZcSx4jvHIx9B4MHlgk8apbDuI uCQpWRcg==; Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkc-00000006R9U-0XZV for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:29 +0000 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3d21c4eec2dso2297865b6e.1 for ; Mon, 17 Jun 2024 06:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632221; x=1719237021; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pghOqqoUrgqxulm8czqYmTg2ejQ+jCMFTS9OcdLe8gI=; b=hDBqs6qsW0yBSifAoTUnfep8qL5VZS3BkpxpEJuu4KBgISgirRgpiKHu6r26H2uJIU nJql0pcrlBhcdBP3CO5DOmK64Rjg4S9d42wGDvjP5QT3zYOyjaUiMszLKAaMQCjN1/zC YLCXopmis3Qkl+5QSXYdArC8l2VKtjP59ScNsaTnH17TjpbX5tqcA5bMllEf7Qvjdpqp XOklv3M1QobwPGOhXD/rAnVSFb85zp+rekVRm2lPTLm3VGqosodaDHt9M4r5PdB2tQDY yGvxzBmTSChJNZNqHugwdQlpZBuXtEXmBppu9DoQCtmGW0ULnvOPM90zP1AJEqF5jVEr RcEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632221; x=1719237021; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pghOqqoUrgqxulm8czqYmTg2ejQ+jCMFTS9OcdLe8gI=; b=rTCX+RDkofWkT//v14BwEyunotEjaWXhq4mf/KESAEpCXgosYCs6GeA/pflK45HSr6 8ThjbdImgcF2uovnIeBSoVAQfcO9XvlqSFXvwjfe7Z+j2NOF+96rzugvZF/CIlPvZVhU pXZlR2+mLrCyxRDNFMo6C4q06/5W4pYDH8HphBiHX2FBVLFytJ8kU/e/0venE4QFGez/ qzBG5lAxNTZDJEL56z/NIvpkcG0VirjSA+0dLM2FFfCeeD/BdpzLE1Z6r5NnbeDl/Y6k TNDZIxZMke5XNAW4kf+vVqqc0iZd20bSzYsIvn1daqOvUoPdfCh9KakJgVTedt9tHhqA tdXA== X-Forwarded-Encrypted: i=1; AJvYcCWmuz2n2esp6kYYaPR+T7Ef8fhPDzjjUyn2Hu80bNaMaoOgXYOkluGDSo7bgBJuxkJyejAxXz4AiQKvbpL+pi++wGzTUZFLzDOvyg7eBkBsqE985Ws= X-Gm-Message-State: AOJu0YzN0DrBn6Ht8SO+Wz3lMPghY81QZpcgjIBjBv+oSe3l+vYZ0rVg cGG1Z7xx4D0Mcg9ClMaxcLxDoT6PCbg5IeS/q8IZMKNoiAQaVdkBzl26s7B6fWU= X-Google-Smtp-Source: AGHT+IHPRFjhQJMl5A95ZWgXFtrQQKsMmXYW6RVDp9V1gMjS9xuHYY98wxPGrZXsyYueeiP6Xe3wcg== X-Received: by 2002:a05:6871:5c9:b0:254:94a4:35d2 with SMTP id 586e51a60fabf-25842b7af81mr10339918fac.45.1718632221358; Mon, 17 Jun 2024 06:50:21 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:21 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:57 -0400 Subject: [PATCH v3 17/41] iio: adc: sc27xx_adc: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-17-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_145026_541656_EFAA9928 X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Reviewed-by: Baolin Wang Signed-off-by: Trevor Gamblin --- drivers/iio/adc/sc27xx_adc.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/drivers/iio/adc/sc27xx_adc.c b/drivers/iio/adc/sc27xx_adc.c index b4a2e057d80f..2535c2c3e60b 100644 --- a/drivers/iio/adc/sc27xx_adc.c +++ b/drivers/iio/adc/sc27xx_adc.c @@ -508,13 +508,13 @@ static int sc27xx_adc_read(struct sc27xx_adc_data *data, int channel, } } - ret = regmap_update_bits(data->regmap, data->base + SC27XX_ADC_CTL, - SC27XX_ADC_EN, SC27XX_ADC_EN); + ret = regmap_set_bits(data->regmap, data->base + SC27XX_ADC_CTL, + SC27XX_ADC_EN); if (ret) goto regulator_restore; - ret = regmap_update_bits(data->regmap, data->base + SC27XX_ADC_INT_CLR, - SC27XX_ADC_IRQ_CLR, SC27XX_ADC_IRQ_CLR); + ret = regmap_set_bits(data->regmap, data->base + SC27XX_ADC_INT_CLR, + SC27XX_ADC_IRQ_CLR); if (ret) goto disable_adc; @@ -537,8 +537,8 @@ static int sc27xx_adc_read(struct sc27xx_adc_data *data, int channel, if (ret) goto disable_adc; - ret = regmap_update_bits(data->regmap, data->base + SC27XX_ADC_CTL, - SC27XX_ADC_CHN_RUN, SC27XX_ADC_CHN_RUN); + ret = regmap_set_bits(data->regmap, data->base + SC27XX_ADC_CTL, + SC27XX_ADC_CHN_RUN); if (ret) goto disable_adc; @@ -559,8 +559,8 @@ static int sc27xx_adc_read(struct sc27xx_adc_data *data, int channel, value &= SC27XX_ADC_DATA_MASK; disable_adc: - regmap_update_bits(data->regmap, data->base + SC27XX_ADC_CTL, - SC27XX_ADC_EN, 0); + regmap_clear_bits(data->regmap, data->base + SC27XX_ADC_CTL, + SC27XX_ADC_EN); regulator_restore: if ((data->var_data->set_volref) && (channel == 30 || channel == 31)) { ret_volref = regulator_set_voltage(data->volref, @@ -765,15 +765,14 @@ static int sc27xx_adc_enable(struct sc27xx_adc_data *data) { int ret; - ret = regmap_update_bits(data->regmap, data->var_data->module_en, - SC27XX_MODULE_ADC_EN, SC27XX_MODULE_ADC_EN); + ret = regmap_set_bits(data->regmap, data->var_data->module_en, + SC27XX_MODULE_ADC_EN); if (ret) return ret; /* Enable ADC work clock and controller clock */ - ret = regmap_update_bits(data->regmap, data->var_data->clk_en, - SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN, - SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN); + ret = regmap_set_bits(data->regmap, data->var_data->clk_en, + SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN); if (ret) goto disable_adc; @@ -789,11 +788,11 @@ static int sc27xx_adc_enable(struct sc27xx_adc_data *data) return 0; disable_clk: - regmap_update_bits(data->regmap, data->var_data->clk_en, - SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN, 0); + regmap_clear_bits(data->regmap, data->var_data->clk_en, + SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN); disable_adc: - regmap_update_bits(data->regmap, data->var_data->module_en, - SC27XX_MODULE_ADC_EN, 0); + regmap_clear_bits(data->regmap, data->var_data->module_en, + SC27XX_MODULE_ADC_EN); return ret; } @@ -803,11 +802,11 @@ static void sc27xx_adc_disable(void *_data) struct sc27xx_adc_data *data = _data; /* Disable ADC work clock and controller clock */ - regmap_update_bits(data->regmap, data->var_data->clk_en, - SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN, 0); + regmap_clear_bits(data->regmap, data->var_data->clk_en, + SC27XX_CLK_ADC_EN | SC27XX_CLK_ADC_CLK_EN); - regmap_update_bits(data->regmap, data->var_data->module_en, - SC27XX_MODULE_ADC_EN, 0); + regmap_clear_bits(data->regmap, data->var_data->module_en, + SC27XX_MODULE_ADC_EN); } static const struct sc27xx_adc_variant_data sc2731_data = { From patchwork Mon Jun 17 13:49:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700892 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F3CEC27C79 for ; Mon, 17 Jun 2024 15:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=l19FGmHt7cx9Y1e6lJcD6lg62Kq+f+HHsekNkW7FIwQ=; b=Y1v0FvsBNpO1Z0qvnmdIHdI8kb LfL/W6VQ7jMZgSW4C79A1ucs9LkNAYUdVfu21XKdfvByhG/IjLU7kdIa1vR/b9X43JAC651FxCh8N 88b0128G7cwtSMjC3NX1u9fQaFPUIalqzvgcnDxWVFgs2KdPRHJU+J92jGZSHdaUyoG2rDi063l7O ow1RiqVEPro1cycgajIz9yYspA8jl+bYJ3A0lBZTK2EZ0tQ6eNIm1FQ92VfY8JvvobWcESRFO9AVB oyBcl+/mcdJej2ILLvvhUSi/uCPHP84vOMj3I0jtMn0Z9bbUhRodJSvlZoSKEh9Rt/sncs33FBPis 5ckKHcZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrE-0000000BKP3-3Z4j; Mon, 17 Jun 2024 15:01:20 +0000 Received: from mail-qk1-f175.google.com ([209.85.222.175]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkb-0000000AxBs-2EDi for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:39 +0000 Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-7979198531fso327514785a.0 for ; Mon, 17 Jun 2024 06:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632223; x=1719237023; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=l19FGmHt7cx9Y1e6lJcD6lg62Kq+f+HHsekNkW7FIwQ=; b=GKl7d3zi7qtXnC+IIcuKX13J16jbw++94w33mMj4w1/LJlQFqne0/FXvVUnMHs1zXi U6emrRJ6P/t3y/8rTtH/NOfCYkrc9oPM4+dSQX6igMsgSGQ6MAZJacxEfRbiKs7aXsui /1+K00sgVOH6pR+JgpQW/GknZa9QoPwAjlw1OsVOpBpIxP37EOr1RTsEI11nJv9PP11n 6FgG42A+EmM41j1fBQTnqu59/VcrOAWk2LnaNViOHU3ZsTz2ePiT5S9iRzKviBMmEfAM 8hdGY6UoW/GfP9zqbXeb8JCNYt0CRU7j+fmRKB5MCba8YcU3rA/K4CbQd08Hl/Rbs3MH n2ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632223; x=1719237023; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l19FGmHt7cx9Y1e6lJcD6lg62Kq+f+HHsekNkW7FIwQ=; b=ppwaFR1e0PqDICBTLK43vKd8XApZWzIdMiqIqY8A+JckPl9TDyVMGTr7vNuHqDmN12 YJQvrgGQ83tENs4CfRM8HBYf3/Byd/3/5lKYJjmb3UyjPjsMNZAYj3bE3OC/pF4OQnTm XwwarV+PY7GhP8DhA/9+EMIOo26Bzd2jV9ewkHPO07M9WHV/Lmyy8cBq06/eJmcjODKk Drh6YzspJuVk7fkE6YVsPgQWf3jdyHxoiYBw2HWMrWcEoQm+DUb57+GF58emz28S2n6m 2pPaPzk5nWnH54ecBVjOrgeepk0UIMzuYS2y26ONmWICIEui0gbxWABCWTkehuElHZ4Z Ac2g== X-Forwarded-Encrypted: i=1; AJvYcCUtZpZeM2NnSPZ43ppZZducZkOCdv/LfELY2nGojtGschFWcfmmtiDrwJQGacWx0+UapTaxxU96snwEGtqM5VxvgEU4PAeKfwuWgF5JjsJY0MXVpgs= X-Gm-Message-State: AOJu0YzvrF0Dac8WdsF6CbXnFNKLsEVueiwLk4wvHH85x9Pcn5hE7qY6 mnDzvrUkKr9g+9Eh2WsLF/72Z75efHIe6MUE65znC+lBdVKqOwobIfgKVyWnmYI= X-Google-Smtp-Source: AGHT+IEh7KDprGK33BeeaVNTDiPQqvpWOrx7hEFjzf44w52REiEzqTJNM1IGPx8qlAanIRK9VBBUsQ== X-Received: by 2002:a05:620a:4101:b0:795:dca5:e9b7 with SMTP id af79cd13be357-798d26b4948mr1182835585a.69.1718632223483; Mon, 17 Jun 2024 06:50:23 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:23 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:58 -0400 Subject: [PATCH v3 18/41] iio: adc: stm32-dfsdm-adc: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-18-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065026_591863_E86FFE45 X-CRM114-Status: GOOD ( 12.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/adc/stm32-dfsdm-adc.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c index 9a47d2c87f05..fabd654245f5 100644 --- a/drivers/iio/adc/stm32-dfsdm-adc.c +++ b/drivers/iio/adc/stm32-dfsdm-adc.c @@ -759,8 +759,7 @@ static int stm32_dfsdm_start_conv(struct iio_dev *indio_dev, return 0; filter_unconfigure: - regmap_update_bits(regmap, DFSDM_CR1(adc->fl_id), - DFSDM_CR1_CFG_MASK, 0); + regmap_clear_bits(regmap, DFSDM_CR1(adc->fl_id), DFSDM_CR1_CFG_MASK); stop_channels: stm32_dfsdm_stop_channel(indio_dev); @@ -774,8 +773,7 @@ static void stm32_dfsdm_stop_conv(struct iio_dev *indio_dev) stm32_dfsdm_stop_filter(adc->dfsdm, adc->fl_id); - regmap_update_bits(regmap, DFSDM_CR1(adc->fl_id), - DFSDM_CR1_CFG_MASK, 0); + regmap_clear_bits(regmap, DFSDM_CR1(adc->fl_id), DFSDM_CR1_CFG_MASK); stm32_dfsdm_stop_channel(indio_dev); } @@ -951,16 +949,14 @@ static int stm32_dfsdm_adc_dma_start(struct iio_dev *indio_dev) if (adc->nconv == 1 && !indio_dev->trig) { /* Enable regular DMA transfer*/ - ret = regmap_update_bits(adc->dfsdm->regmap, - DFSDM_CR1(adc->fl_id), - DFSDM_CR1_RDMAEN_MASK, - DFSDM_CR1_RDMAEN_MASK); + ret = regmap_set_bits(adc->dfsdm->regmap, + DFSDM_CR1(adc->fl_id), + DFSDM_CR1_RDMAEN_MASK); } else { /* Enable injected DMA transfer*/ - ret = regmap_update_bits(adc->dfsdm->regmap, - DFSDM_CR1(adc->fl_id), - DFSDM_CR1_JDMAEN_MASK, - DFSDM_CR1_JDMAEN_MASK); + ret = regmap_set_bits(adc->dfsdm->regmap, + DFSDM_CR1(adc->fl_id), + DFSDM_CR1_JDMAEN_MASK); } if (ret < 0) @@ -981,8 +977,8 @@ static void stm32_dfsdm_adc_dma_stop(struct iio_dev *indio_dev) if (!adc->dma_chan) return; - regmap_update_bits(adc->dfsdm->regmap, DFSDM_CR1(adc->fl_id), - DFSDM_CR1_RDMAEN_MASK | DFSDM_CR1_JDMAEN_MASK, 0); + regmap_clear_bits(adc->dfsdm->regmap, DFSDM_CR1(adc->fl_id), + DFSDM_CR1_RDMAEN_MASK | DFSDM_CR1_JDMAEN_MASK); dmaengine_terminate_all(adc->dma_chan); } @@ -1305,9 +1301,8 @@ static irqreturn_t stm32_dfsdm_irq(int irq, void *arg) if (status & DFSDM_ISR_ROVRF_MASK) { if (int_en & DFSDM_CR2_ROVRIE_MASK) dev_warn(&indio_dev->dev, "Overrun detected\n"); - regmap_update_bits(regmap, DFSDM_ICR(adc->fl_id), - DFSDM_ICR_CLRROVRF_MASK, - DFSDM_ICR_CLRROVRF_MASK); + regmap_set_bits(regmap, DFSDM_ICR(adc->fl_id), + DFSDM_ICR_CLRROVRF_MASK); } return IRQ_HANDLED; From patchwork Mon Jun 17 13:49:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700812 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A084C2BA15 for ; Mon, 17 Jun 2024 13:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TsjL1PDi95mMX5sXzypBRu5MAqP+mGu/27hW1rxKMDQ=; b=j4GFnfx7TIYUhRim0yXl3DG/Zo CDjDD91Ji7WEq/xib8xmiX7BsLSTzI7xI0C+Xl7MHnVy2CORJldeuP+17CIQQUFM5MJYDwAplzqH/ dxXYny4nSz3R1ycbW0oIZcpo6KpSN4eoyVC5evt36QVo8cwDDx8uVhZYtyjhlJe2U76UBXmx7aJFW l+GeSlv2RVHgoqoFuOrQNFqoOfbUaujl4uJn458ms5bUTB0wqFAG09SUXD+PCBnqu7Q/xdr0TrVOC u0B933P6XW13VlaWh8rjZiELWcL6Sp+dg9MchYXwaKfOD7WSklM71YygtCs84jE22+dkt9JCyCmFa BEZWR5wA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCmn-0000000Aypz-3GkH; Mon, 17 Jun 2024 13:52:41 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkh-0000000AxHy-3zko for linux-arm-kernel@bombadil.infradead.org; Mon, 17 Jun 2024 13:50:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=TsjL1PDi95mMX5sXzypBRu5MAqP+mGu/27hW1rxKMDQ=; b=piOsJVPOG3G5053TzFgDdNL2Op +K2Is5jiIaJcXJMeRkt8q/GjKcVlzAyisEVjZsRfrQ48I8Q9SoJgLJtCBr0h43G0l+t0vzn7SfMnn WW60iAuNTqaF9U2zWA25zIRWJqC20xY/G7Pzh2YuaYQFb2wQgPLS2Ojn8bxAtRdJ1X0oaz+pX8v79 RUDLgfM5Qq8RY0TTaFF4sUWJ7eK8mDXssqqGFMSnQFcMVuiqXsd0F9Olnbrpb4DFR0bUMykJMHMtB fY0WNtnIzNHydCr3MQZUCdqCTPZYTr2iEqm0nwXbWP3FbbPLac+knYNlfi01wPfYQ6TrCTPm0PDAC 8BLYv4Ng==; Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCke-00000006R9l-1X41 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:30 +0000 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-250ca14422aso2411822fac.0 for ; Mon, 17 Jun 2024 06:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632225; x=1719237025; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TsjL1PDi95mMX5sXzypBRu5MAqP+mGu/27hW1rxKMDQ=; b=NHLDejAHv3kGcPt+hjxgX4CKd4XX35w2tdGirCE706xde1TODvqIQIzYkuFnv/zkMO XvFvEtv3QcYZPzCywGVtItATfgxn80dQYb3hXvVC1y4VLEhb0F6FeS7xbTx15llpXJnp l5sd7ZTQ63qU1kpk8RldTcQGvUH1SHatIl/gtC29ouRz5q6mVsH453QYAGMJnCZnJex1 3H7psrJx9Z+lVMAGt9XmLoNqNuZbN2/J69hX8yCbGx0TY7KT+eseYSJm5Ga/yX3oWFq9 p0SUm33c7c5HkuPOjPpMQhN2x3/8T5oTO2n5f0PaK1U1aNd0uzfAiwHljvnS/CrkqRDh wzrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632225; x=1719237025; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TsjL1PDi95mMX5sXzypBRu5MAqP+mGu/27hW1rxKMDQ=; b=mAY8LSTA0UqPjwWVHuohKrdfpCQYdQ23tFR8MbIcDl39GzocVa0WfRQr4RkFy3/jRf W56bPSotWTOYeDfYirmNWx73HU7xVuTyoXl3cTldtQdqtVBcBpkLOkru8NSg/63Naru2 4mm9jJjVKWb4emh9JVe89ELdmsllajpCLjys0weQJzU8nBF1MRjPUNrDQk8C+Y+Kx6HF fafymwc3lz0aEYTknJW7JGdA8jE0fKLNifWFVpp3jy3PDL2YvMQhC87LKP9Z3avBdECB j3/SGcWbG9Eh1KgBvsdYk9dxkPlf1yzBaX9ozTKt4oesN3PpRO2Js3XVl+issGDyJ1FQ x7+Q== X-Forwarded-Encrypted: i=1; AJvYcCUaSA6Job6sPYkiBX5st75B237vHiPdEmnt8UZfSmEc48uii53RnN/IFz5yMy5pLf4QfbWLgSoBzKmZ7WCsiZP+8UWIr6/UsxnwO+6sufdHjbpsyRU= X-Gm-Message-State: AOJu0Yxb22Nc2BhPJTz7BLwNXKbjb3Xk4QdYv7UA1lfJ2yhsJRN2oFZj aNCyFwKcEKfvAi9aGIEroAZG6TK5XfoJx7WliAE4TZwlwAWagSUGf7evnV4Axyk= X-Google-Smtp-Source: AGHT+IFvblxIubOLu7csKqd2DaYsYhFE9mHOS6tHSYRNjsfIzum/J8kKl7oiGVOQ0fHTuqtXTzPk8w== X-Received: by 2002:a05:6870:d383:b0:254:ac99:1152 with SMTP id 586e51a60fabf-25842baade0mr8855321fac.58.1718632225631; Mon, 17 Jun 2024 06:50:25 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:25 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:49:59 -0400 Subject: [PATCH v3 19/41] iio: dac: ltc2688: make use of regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-19-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_145028_662384_C2C9C484 X-CRM114-Status: GOOD ( 11.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Reviewed-by: Nuno Sa --- drivers/iio/dac/ltc2688.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/dac/ltc2688.c b/drivers/iio/dac/ltc2688.c index c4b1ba30f935..af50d2a95898 100644 --- a/drivers/iio/dac/ltc2688.c +++ b/drivers/iio/dac/ltc2688.c @@ -860,9 +860,8 @@ static int ltc2688_setup(struct ltc2688_state *st, struct regulator *vref) /* bring device out of reset */ gpiod_set_value_cansleep(gpio, 0); } else { - ret = regmap_update_bits(st->regmap, LTC2688_CMD_CONFIG, - LTC2688_CONFIG_RST, - LTC2688_CONFIG_RST); + ret = regmap_set_bits(st->regmap, LTC2688_CMD_CONFIG, + LTC2688_CONFIG_RST); if (ret) return ret; } From patchwork Mon Jun 17 13:50:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700807 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48F5AC27C79 for ; Mon, 17 Jun 2024 13:52:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/XakTIALlxEv0HYj2MxlbOtZFxZOxjUYZWhXJH4zlh0=; b=TiT5y+HbzN747jSRySdRniRpjB N00jwNn8ZcHCIXKcytJDA7sOhXPipmnWCZ1orekrI30Lsf/w96Q1ikdp8kN6jQB50/6EY3awsuY2x bRRjxbGopLsCDGu8iMmALD6Y+CrUVb7WHOJ4D2ZCH+0mUyxGCLXOWrlRzYfnbCVMiHFTtrUACdxS9 f8qUnS6rq/DNzEqTmmCTeKbYFEwZamcwN1sUum2JbbPOHfwOlBFOtfnU57AOlcOizUhg4U3QEl+KR J5i0Jb9D6PWjsn8GZSyFnbkW3IP2flmoJnHzmaPnQYVkd9LGiDZ6bwyZc9GfC5zxENYNGlfOk4lNC xqJtcf8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCmb-0000000Ayh4-37s4; Mon, 17 Jun 2024 13:52:29 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCke-0000000AxFo-400s for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:41 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-7979198531fso327524285a.0 for ; Mon, 17 Jun 2024 06:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632228; x=1719237028; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/XakTIALlxEv0HYj2MxlbOtZFxZOxjUYZWhXJH4zlh0=; b=Y4kbC2qzRBRLdhdJRHO7JuMrWj2eL27tKZfHfvBlxnaTKV+i7BQfnBszyAgu3ZBsaJ tLpTGCz7yzxXCl+nT2MYfFM7agRM4fvdn+cKwGU6FCgrU6xEHylj7us2IBIy0L8WYqvo //YIE5B8aOm8UJmASb6FlvwqR5vuJX9Y/kDG4yXLLTfHPldY+gSpe/ojMjWNipIdlwKB kTrsBArDKrGbqtK3va48rPcwgX/8mc8fkgMFhwWvEc9JmKIKneK7nezplPlRsjjkfhDK /uiV9N8IWrj7FvZoCluKEjxU8+PhrwnTFCBGTKqbL1aUREqOeAn738MmNler6n4bZcsK VkAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632228; x=1719237028; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/XakTIALlxEv0HYj2MxlbOtZFxZOxjUYZWhXJH4zlh0=; b=PJvH+3N1qTLsEqErW0d4bMqFJk36z+SwImsOjp0hnqI7r3SZorOs0AyyfsSOg6PRSm GM3mxmn2w1Xl1EINObyg6uJHp60q+xdtE7KGwp0RESEOZb+mE8Q1A79IjE5G4iZdsWB5 cUIdcNMakPGbcCXHZUAQdRqLHDcM1GBgnGyHN3xcQA5p24wIa6cUiFPaqAgOPEQnXKPe n4yY/iZlqIJqQMyAXsFiyNMBzqxK1PtFuBD7zNHW69mndDaf+JTmaK+YFelv8MpXJYdO eccu6j/ipMQpzFiOQdx4pALUPGblXta8hDCrmN4/UUfCHe0TRdX0fz2TaFulW2IHsxOo S2gQ== X-Forwarded-Encrypted: i=1; AJvYcCXdjxbmimFwTIbWki8UjEikKCECOoDWIEv/iKxxFe3zUUqBalbewXEPxhSCcLZlmYOCk7sE/DKHhcQbl5gvC3eAgWP7FCpLr5hf1utMV1KL9X+lr0Y= X-Gm-Message-State: AOJu0YxxeU4GfOTSb41MHgqfMvUyyI84lg5kDLhUI7MWupViaaCovEzH tHurGJ2UOq4lEkfyWTOVfmtuGtz5My4eiue1WkrzxY9wETTD18OlEP9Kh2RJsmI= X-Google-Smtp-Source: AGHT+IG8ABD9tEwAKr1/xa6bdVCx92iQnTrVgELPE/Lymo3q9zF8m5xvFoyu+g0K7+PoHeaETQDP6g== X-Received: by 2002:a05:620a:29d1:b0:795:967d:b1f4 with SMTP id af79cd13be357-798d26b5261mr1162014985a.70.1718632227786; Mon, 17 Jun 2024 06:50:27 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:27 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:00 -0400 Subject: [PATCH v3 20/41] iio: dac: stm32-dac-core: make use of regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-20-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065029_297665_52A024E9 X-CRM114-Status: GOOD ( 11.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/dac/stm32-dac-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/dac/stm32-dac-core.c b/drivers/iio/dac/stm32-dac-core.c index e150ac729154..2d567073996b 100644 --- a/drivers/iio/dac/stm32-dac-core.c +++ b/drivers/iio/dac/stm32-dac-core.c @@ -200,9 +200,8 @@ static int stm32_dac_core_resume(struct device *dev) if (priv->common.hfsel) { /* restore hfsel (maybe lost under low power state) */ - ret = regmap_update_bits(priv->common.regmap, STM32_DAC_CR, - STM32H7_DAC_CR_HFSEL, - STM32H7_DAC_CR_HFSEL); + ret = regmap_set_bits(priv->common.regmap, STM32_DAC_CR, + STM32H7_DAC_CR_HFSEL); if (ret) return ret; } From patchwork Mon Jun 17 13:50:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700806 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0306C2BA15 for ; Mon, 17 Jun 2024 13:52:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DerxFnnoYXb7MP4GOUVN2xlgxjAao77OyLSOrDCydO0=; b=C3Kk+S5vIHe3dyKe2d9vhNMceR Yc+OUlsjFzqRAIRcCxNnC6DjamdjoeNJXreezys7sbVdXW+vwRNJoniTXRk97qof41/RzyKoLBkkg IXOvHT/YgWhH/gcpmJ9JNgdE6m6cyJMLis0ZVsCehnjMS9VFZVLlMIkQ7jF2ykcLUGxOaAwr+PbJs /FMqyyUv3wDuAp2JXnF28Oh89XmSt47HjMB+QJa8z3ETfI9qK57KiqIO42wEvHoben8tSbtPKoKd+ spxvftQkEp2ZKBTWCSnXnQsFEvhigRpHV82TiXu6cny2QswXeRhYIltCDWtEiN+CBVYz7mjK+GW2z Z9qwMMjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCmd-0000000Ayi0-0BF1; Mon, 17 Jun 2024 13:52:31 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkh-0000000AxHl-0nmJ for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:41 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-7953f1dcb01so389062785a.3 for ; Mon, 17 Jun 2024 06:50:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632230; x=1719237030; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DerxFnnoYXb7MP4GOUVN2xlgxjAao77OyLSOrDCydO0=; b=WQGmHoQ0VS2USINi7Db71fhi0FwycK1OXvADlvH7nTeTN4iyVVjc7/0lt9SRfx+5LT foNYHsuEDzO6fH/K3Auxbr0qUrFCfjWGJMmqhV6oNtsAF/SQBlSH+KJ2oCTzNetHFz2X Lqu622pNUhcjGnJf2lbRiQ/2rMsLoMgw84N1n5438eozidEnRanfdDRp0DQ9GlcERMcN JBProYA0f6IBMl7QhgCTfX83hdsF1M6Tr5gb7psdlkmU9N1Znl48MtwLgNZUcCKoXwhu 3nyLErGLifk2vxudySutCeiJA0hQf8qiEsVKT7ghXJspSZi9ZqypJFqC2ZkLxRVkEi6p 9INg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632230; x=1719237030; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DerxFnnoYXb7MP4GOUVN2xlgxjAao77OyLSOrDCydO0=; b=CC4Yxu21WnqM6cVSysY4C4RYY5n3JBDRcEwkHod96diIZ5CIzUXV4ZOP/gZtkhS3GW kdDoiUsBwli+QRsK8V4XTbxpFW4TOvWJlF/kCDmWi7h3T4gUqwry5YRX+3J58a2nFjHa ieywlBZajkN06dgSORfe9QkMruPZNqNdUiMeMGgjF8H0cYyKkPO9sroBMs7hUb5Tolgy CZ5MGO6JXgE+UkqH3glv1whplhL0GFfZAy3sZQtigqj6m6ODg6VRPZ0/Y5MjyPMkod4L OFrnPFf8cwVnwYeQAPuhN8E1BofD0KHy3PP+vel1fxTozDEdV3OA3Z30sNRGAon+a+kU 7Rjg== X-Forwarded-Encrypted: i=1; AJvYcCV3xN/+RbFYAwOgOYYrgqC+TYVkRPKmOF8FY38lAp7yMych6QMEuC/ktG9bWcsOBRy7JwRMoYOoCENp6PesCinur3ahNGm98mCXA5B6JQv7GEzrdag= X-Gm-Message-State: AOJu0YyAjdQ5TxKi7Qy3SLoKvOFcUUg82S5f60fyHm1lixU1sE4mP9bW nxbZPEnYIJjpGW5cO8NibPKBSVF7SWDcujCO9qSfICES84k3fc5hU1UMVmUZUTw= X-Google-Smtp-Source: AGHT+IHxtzkdFJwlDchh8tO2N+M/GUfc/zgUMeSNzO08CBN63HSCP+uPJVwg8RWxzdMRcwiKU/TPZA== X-Received: by 2002:a05:620a:2443:b0:795:4e2c:eabf with SMTP id af79cd13be357-798d240dcf1mr1259752585a.26.1718632229931; Mon, 17 Jun 2024 06:50:29 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:29 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:01 -0400 Subject: [PATCH v3 21/41] iio: gyro: bmg160_core: make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-21-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065032_199294_8A5A05B7 X-CRM114-Status: GOOD ( 11.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/gyro/bmg160_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c index 0e2eb0e98235..10728d5ccae3 100644 --- a/drivers/iio/gyro/bmg160_core.c +++ b/drivers/iio/gyro/bmg160_core.c @@ -285,8 +285,8 @@ static int bmg160_chip_init(struct bmg160_data *data) data->slope_thres = val; /* Set default interrupt mode */ - ret = regmap_update_bits(data->regmap, BMG160_REG_INT_EN_1, - BMG160_INT1_BIT_OD, 0); + ret = regmap_clear_bits(data->regmap, BMG160_REG_INT_EN_1, + BMG160_INT1_BIT_OD); if (ret < 0) { dev_err(dev, "Error updating bits in reg_int_en_1\n"); return ret; From patchwork Mon Jun 17 13:50:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2F79C2BA15 for ; Mon, 17 Jun 2024 13:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bPhEFIEI65Agzd+gTNE/8pf9Wc0auEQHD6gWw+Mp2Us=; b=sQf3gcmI1sVS+e1IxAZ5M8eH80 GHOqfYCtDpfxasf0wqNZcGGveSLX2JMdvKySAOrn4qmeLxGxiqPuqjGBUQcZJ4rDyyyiRu7tf99Yr meo2LtKcCntVNLJFWLV3n7TJ3wWtuohB2P9QENCqeEKq17HW8a9PoIJtFZU5MSaaFuohslCQMiLJF BKCPTyyQXsIRXubMdAOmYJJgUOX6xA4L+S3CII0Dq9xcK08NuLlhRhrKgY0GNXhsBUL+qJEoEJw/U e3W3VNrXTkgBaWsc7WerSCc5MDuxyCEWWqCgKe2WGio8WcwDBkbuF77pFxnoVHyWKghBbjgxblgHO BKtGdA7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCmw-0000000Ayxf-0A2O; Mon, 17 Jun 2024 13:52:50 +0000 Received: from mail-oa1-f53.google.com ([209.85.160.53]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkk-0000000AxJx-0jl5 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:44 +0000 Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-254fa9fe36eso2187432fac.2 for ; Mon, 17 Jun 2024 06:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632232; x=1719237032; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bPhEFIEI65Agzd+gTNE/8pf9Wc0auEQHD6gWw+Mp2Us=; b=u7CHoGByXn6lSSUB4gpW7X7Riim8LpwTMtmcxHiKek//xHPxLMyXOEDSf7DiJsPOKO jbnR58wHsyVx6ERD1PCUp6bFP9Td0qaNJsYDfkrs8VQn9/LPz3rQkhWI9kp8WZv6brEI 38zhYjJjQ1lOEcyerR2AF12yvu4mZEt+IqB2xMUpv+KP9arfde2Js0+cvMnYs2naJERT V6n92wQOlYpUqKzC0e/Pdch42SBshqNt/wI6jO/OIL5HVp6s58qRD+/uWXIt06NfBVVZ QzS4XvaGqsbT5wfp9i+uTclJQSx8TrePDH1cYjqlwaeJvwxSkVcqBShu3gZYp4P7ws0L aOJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632232; x=1719237032; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bPhEFIEI65Agzd+gTNE/8pf9Wc0auEQHD6gWw+Mp2Us=; b=G7Fz5XEfcqxWUSLzEwlDT10F9lTwUvlkz1mFQENz0JOXeGje8w7FkVr0P72QKKTGMo pQBxj3j2QW+2Fb4Rg+i2s9U+KVJ68arlb6rwnMvH8xR5MdxgAuam7zmkANJ9qMamYMEt zMbhz10DO6cIPkvH8VcaBWCHiZnSAGHNykTEguxP9s7Y4wO1d7T1yy2PLxQLx1qnJZDU 5VBmzDhDn/NrwUigSVPdDwKwXSHKFqEaLpMRL+HU7i1fZ43WQF1nNqMIk0djFNh4o89e ENxeMsCbSMhWOY6uEPdHbJYwm066EiYkQF8vFXnSDkE+nQBvDPdzqqnIW/fSb5OZpuWh Cqmg== X-Forwarded-Encrypted: i=1; AJvYcCX1+4876dIzDrztfDIVdUOrUYIL3Hll5Snh0R4NLZrNID7BzNmbnmh+6UeJ7JYiycTeUDZ2j2HwPEAHEvOJnSc2UQDBvFktwptqQXkj0+s/3ichlJI= X-Gm-Message-State: AOJu0Yz40J3n9cA0RhfekZSg2ayD5EoS9AiSV5lRzxdyojvTKM9HMJuH kmPT7exQG7mF7kts8JByrFmPh0ZjUWJAaGSnDy2XoALOTUqNdYSOMZw8vMdrzkk= X-Google-Smtp-Source: AGHT+IESOlQlf6WzweXkTkf8MrnVQGCcG3xC67OqCrm+RTbQElgJSgw2YCA/KexywnTT/s9UGGqyWA== X-Received: by 2002:a05:6870:c1d4:b0:24f:dd11:4486 with SMTP id 586e51a60fabf-25842ba209bmr11672904fac.36.1718632232087; Mon, 17 Jun 2024 06:50:32 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:31 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:02 -0400 Subject: [PATCH v3 22/41] iio: gyro: mpu3050-core: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-22-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065034_824568_FE946D5C X-CRM114-Status: GOOD ( 11.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/gyro/mpu3050-core.c | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c index a791ba3a693a..ff1c81553045 100644 --- a/drivers/iio/gyro/mpu3050-core.c +++ b/drivers/iio/gyro/mpu3050-core.c @@ -197,8 +197,8 @@ static int mpu3050_start_sampling(struct mpu3050 *mpu3050) int i; /* Reset */ - ret = regmap_update_bits(mpu3050->map, MPU3050_PWR_MGM, - MPU3050_PWR_MGM_RESET, MPU3050_PWR_MGM_RESET); + ret = regmap_set_bits(mpu3050->map, MPU3050_PWR_MGM, + MPU3050_PWR_MGM_RESET); if (ret) return ret; @@ -513,12 +513,8 @@ static irqreturn_t mpu3050_trigger_handler(int irq, void *p) "FIFO overflow! Emptying and resetting FIFO\n"); fifo_overflow = true; /* Reset and enable the FIFO */ - ret = regmap_update_bits(mpu3050->map, - MPU3050_USR_CTRL, - MPU3050_USR_CTRL_FIFO_EN | - MPU3050_USR_CTRL_FIFO_RST, - MPU3050_USR_CTRL_FIFO_EN | - MPU3050_USR_CTRL_FIFO_RST); + ret = regmap_set_bits(mpu3050->map, MPU3050_USR_CTRL, + MPU3050_USR_CTRL_FIFO_EN | MPU3050_USR_CTRL_FIFO_RST); if (ret) { dev_info(mpu3050->dev, "error resetting FIFO\n"); goto out_trigger_unlock; @@ -799,10 +795,8 @@ static int mpu3050_hw_init(struct mpu3050 *mpu3050) u64 otp; /* Reset */ - ret = regmap_update_bits(mpu3050->map, - MPU3050_PWR_MGM, - MPU3050_PWR_MGM_RESET, - MPU3050_PWR_MGM_RESET); + ret = regmap_set_bits(mpu3050->map, MPU3050_PWR_MGM, + MPU3050_PWR_MGM_RESET); if (ret) return ret; @@ -872,8 +866,8 @@ static int mpu3050_power_up(struct mpu3050 *mpu3050) msleep(200); /* Take device out of sleep mode */ - ret = regmap_update_bits(mpu3050->map, MPU3050_PWR_MGM, - MPU3050_PWR_MGM_SLEEP, 0); + ret = regmap_clear_bits(mpu3050->map, MPU3050_PWR_MGM, + MPU3050_PWR_MGM_SLEEP); if (ret) { regulator_bulk_disable(ARRAY_SIZE(mpu3050->regs), mpu3050->regs); dev_err(mpu3050->dev, "error setting power mode\n"); @@ -895,8 +889,8 @@ static int mpu3050_power_down(struct mpu3050 *mpu3050) * then we would be wasting power unless we go to sleep mode * first. */ - ret = regmap_update_bits(mpu3050->map, MPU3050_PWR_MGM, - MPU3050_PWR_MGM_SLEEP, MPU3050_PWR_MGM_SLEEP); + ret = regmap_set_bits(mpu3050->map, MPU3050_PWR_MGM, + MPU3050_PWR_MGM_SLEEP); if (ret) dev_err(mpu3050->dev, "error putting to sleep\n"); @@ -997,11 +991,8 @@ static int mpu3050_drdy_trigger_set_state(struct iio_trigger *trig, return ret; /* Reset and enable the FIFO */ - ret = regmap_update_bits(mpu3050->map, MPU3050_USR_CTRL, - MPU3050_USR_CTRL_FIFO_EN | - MPU3050_USR_CTRL_FIFO_RST, - MPU3050_USR_CTRL_FIFO_EN | - MPU3050_USR_CTRL_FIFO_RST); + ret = regmap_set_bits(mpu3050->map, MPU3050_USR_CTRL, + MPU3050_USR_CTRL_FIFO_EN | MPU3050_USR_CTRL_FIFO_RST); if (ret) return ret; From patchwork Mon Jun 17 13:50:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700814 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF033C27C79 for ; Mon, 17 Jun 2024 13:53:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fGWBtK2gGzg6dOcIkV68NwvgEBcr/hA30WsTyKyEtwo=; b=hpZL39QOKgOafjfV0xy71tnsdK O1SW/DffNIdqBsLYvAzZgBDe4XtESP+6y+2V3ZHQSIAedFp2JOBqhPzHK7noh+u5fKtVTyjw5uGS/ 3LhrJ7JSqw8NCwjoLe/vGWgl88lNPd9QeD9u2k8rDcVX6ZKKAH1AKYEch0i49GFQOeYlW54WAk9dR OVbOeUnoTlLL7NCyHuN3/T+j3Hijp0aQGqiCiDCBy9K4vbyr/AkZ+1aZQKP8eC02q0PHh8hUhBO+S f/HMZrp6Ang3bLOfwuEp3+35hyhVd/P6xbeAK42cGyg7ZnULT8S2b3cinsUS2CEdsNcpmPkUPqjVo 23xVFibQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCn2-0000000Az2i-1jg7; Mon, 17 Jun 2024 13:52:56 +0000 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkn-0000000AxMv-26J1 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:44 +0000 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3d24a231342so1952105b6e.1 for ; Mon, 17 Jun 2024 06:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632236; x=1719237036; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fGWBtK2gGzg6dOcIkV68NwvgEBcr/hA30WsTyKyEtwo=; b=agdx/ZVnEa91hR8XzFNY+x3QAA+PPy8FUm9bUqm8SAqrbQQWT3DXrwoaDyc2r1TuUk I8+ZT2KAljjJsYtUPBA5MJBHfLzyMCQTlqDdtibKfAzc3F7U64fvb5/OHeFeb5XWJfrk POZf75oRfD+j+C4po3YED2LZSjYzDna6EV94XfZrplSUTnyT/Y8ybwjPKNRTR/I/qOSC wIPiuL6abanTTP0SUVZwdyNVJjK7QTzbSuuxD6Wnis7XTPyiJMwoXyFDd5/qCEwi3KW3 YJwdaWMIxUmOSdWHcy0rUQgSJwZ5ian3ucvBzziyUps6B3oC1EUlaAYh+w/6cYMO7paP h1tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632236; x=1719237036; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fGWBtK2gGzg6dOcIkV68NwvgEBcr/hA30WsTyKyEtwo=; b=Tc9I4U/4aS4638rALNsSkox//QtOJOKT0vnbRSlf7pC9mBbJ+FTbxNf5h0dZh9929J p9Ee6fNO8ChkJgmg0ymJh+p0ucjgvNQ3iFzbHlnkhrtZsU2XmM2/1eUWRIp3xYNbYSBI pT4oBXOVhEs5n0700aKwLvDj9gouhgzVkuO7YohbW5OEyoXGbDgBVjLGUG4HWHrf3fIn soeo3e5BiAGFhR7EF7Q3FzBtVhi5O48PhV1WpWcq92FUDxeR8h/K3AfzUF4kZ/y8yHD6 Zx+5JZR7+fA0g+3ScYrACUujnfcrdRXCc5GukQ/+kO3Zyazo0aD0y3AZvHnLOPWxA0KO 5W8A== X-Forwarded-Encrypted: i=1; AJvYcCVFhqewyG0TXUwkfM/1uLZ35GmjmLWSftyWInql/EJYs+Na6A8bX+rjPX/SA7gIQ4/YBhySBnS7SfRoF0UX5QPVRHGE30An0lTa5447vp3oPhqEeP0= X-Gm-Message-State: AOJu0YxYpc+XFqY0AQx6y99mfvFRNFPbt16ZI1rxSSoONiJa13DrHnAp UwLsaqGsHa8AKRwVnnQYd2bDIdOIccbuf5ThZjAISfhVAhckvJDwH0/l47tbFmw= X-Google-Smtp-Source: AGHT+IENHYKm3NgqHa1MPYUPJeZqzEGABKtYhMj6CIPi8s9CW+uIlwWgMeUoLMPd9TX2TqZf6pVe1w== X-Received: by 2002:a05:6808:e83:b0:3d2:27d3:2928 with SMTP id 5614622812f47-3d24e8f5deamr10493207b6e.28.1718632234195; Mon, 17 Jun 2024 06:50:34 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:33 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:03 -0400 Subject: [PATCH v3 23/41] iio: health: afe4403: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-23-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065038_029160_D6D4D0F0 X-CRM114-Status: GOOD ( 10.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/health/afe4403.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c index 1dbe48dae74e..52326dc521ac 100644 --- a/drivers/iio/health/afe4403.c +++ b/drivers/iio/health/afe4403.c @@ -422,9 +422,8 @@ static int afe4403_suspend(struct device *dev) struct afe4403_data *afe = iio_priv(indio_dev); int ret; - ret = regmap_update_bits(afe->regmap, AFE440X_CONTROL2, - AFE440X_CONTROL2_PDN_AFE, - AFE440X_CONTROL2_PDN_AFE); + ret = regmap_set_bits(afe->regmap, AFE440X_CONTROL2, + AFE440X_CONTROL2_PDN_AFE); if (ret) return ret; @@ -449,8 +448,8 @@ static int afe4403_resume(struct device *dev) return ret; } - ret = regmap_update_bits(afe->regmap, AFE440X_CONTROL2, - AFE440X_CONTROL2_PDN_AFE, 0); + ret = regmap_clear_bits(afe->regmap, AFE440X_CONTROL2, + AFE440X_CONTROL2_PDN_AFE); if (ret) return ret; From patchwork Mon Jun 17 13:50:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 848DAC2BA15 for ; Mon, 17 Jun 2024 13:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yqMe4af98NHJiZdRmZKfGjAtSzwLMs3Usdpoxv76E0s=; b=oIAGgdiifz869kUy1bWHq9SBiI TuDFW7TtER+b77ErIqYK7m2QgkH3NHp/X2sTSLDJ5tWDMukX8xQIbI1acmJzpoeYZ16u4e6S0cRZJ 1onbG3Ztr+4Q/R5dau4dPd6IMGNPxWCkV1rWGVj3NWlY371KHDi9f5fruzGoUArPcA9vlnTLiMznV RupxSAq1S3wHD9GBUfwXQxi+pyEWsbAoAppJjb2YyrkDdluuZsZp83qPKkM/nJWx4K/lTwhct0Sc4 me0D0nQ8/79X6nLzq8bqi2+Al7QEBJXxkXzpHSMFe/JGXfgDJIyLs4DUV/GbVVHyd+3jY6nYrecf4 Rx+ueGug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCnN-0000000AzKN-0pKr; Mon, 17 Jun 2024 13:53:17 +0000 Received: from mail-vs1-xe2d.google.com ([2607:f8b0:4864:20::e2d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCko-0000000AxNV-3I4y for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:48 +0000 Received: by mail-vs1-xe2d.google.com with SMTP id ada2fe7eead31-48c2d01994eso1388212137.3 for ; Mon, 17 Jun 2024 06:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632236; x=1719237036; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yqMe4af98NHJiZdRmZKfGjAtSzwLMs3Usdpoxv76E0s=; b=dENKeH5mDMxJgCOAaIQYIUHZngon76uKfFjoMnRycl1dU8WKPBlj3LqHl32j5pMgt7 Jyn8HQMK8qJ3VWZtFSJWpjNKn0CznBti6HcbUJNdFeI1HCJgzWtb+NRd7aY5JQXCwta5 MGKBJWGWgGXUcamusJllF4uEUlk5eqJoMAghKf7UQWRzM4UXpFAgbVB4lOlU7+V+HuPy MuDNkAxq0e6jVEDPM9Dke0SdsDA7+pguqLed9kEpPrTi3yR3Iv1ecH0sdXVrLf+Kxxbr INnMb4mZwXwJG3NU2rYu1FwUWQv5Yjx1Mie1MytyFHv0jSxOxD8bi7IZuXMzFBw0mwg9 vljg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632236; x=1719237036; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yqMe4af98NHJiZdRmZKfGjAtSzwLMs3Usdpoxv76E0s=; b=GIL5C3pKtnNK05W3D0ieZtr8NM1Kkfo1pYVBZZ7rh04CFJU2Wi4uM35GCjB1i466u5 rHj633ziiVY+A2mkjirftT+DdPXlbJxbrm4oTSphwtM/GzWTl5lGJ2RdygvkLM4k69cF jqU6gM9QT7d31cYgOXh3a1KafJrOKwLRLAO3PvkAf/Q0KxIvRYJ+/0ltjPmRwfVojQvu KNZuOFLH1MPIFtwRbEpVqgpNODlyWvdg7ePHJlqWXywRT3ykDOPtH6gxgXGBYABFpHzC TfSyzdVT4hy80g3O36fMSsUnXYbJ+xGQl5dCWgLrQlqq/7OTHRn5SryIU4+zXLd38ysw CYAg== X-Forwarded-Encrypted: i=1; AJvYcCWpwdFrVSe8WPShnn/A3InXB+1fy7pRjM1KDFdry6daB2eu2pBJLRu1g1u7kLMcurdWuFd48VTfZ++NZTlCTy8uIRmWBppCiPdrxV2pzsBWoa5/rbw= X-Gm-Message-State: AOJu0YzRFaSqvR+PbWtU/A7+yUi40U/9TjdV+zJxHUXCT9227q1XIolp YAu1T1r0E37Rya1tYvDda6Pqe1ahtjONlsHKN2gWnm8VvdJDkhKGDmyIfvGyiAg= X-Google-Smtp-Source: AGHT+IFihHa6bMcNzaeLIOOLDw8PfmzIsl9aK4RVvUYriLx2jOAq5E+Axp1aames8cM1+wIsIKtc2A== X-Received: by 2002:a05:6102:3b96:b0:48c:19d7:eb83 with SMTP id ada2fe7eead31-48dae3f30ebmr8867679137.34.1718632236471; Mon, 17 Jun 2024 06:50:36 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:36 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:04 -0400 Subject: [PATCH v3 24/41] iio: health: afe4404: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-24-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065039_304658_82DB0512 X-CRM114-Status: GOOD ( 10.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/health/afe4404.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/iio/health/afe4404.c b/drivers/iio/health/afe4404.c index 7768b07ef7a6..51f4be39d20b 100644 --- a/drivers/iio/health/afe4404.c +++ b/drivers/iio/health/afe4404.c @@ -430,9 +430,8 @@ static int afe4404_suspend(struct device *dev) struct afe4404_data *afe = iio_priv(indio_dev); int ret; - ret = regmap_update_bits(afe->regmap, AFE440X_CONTROL2, - AFE440X_CONTROL2_PDN_AFE, - AFE440X_CONTROL2_PDN_AFE); + ret = regmap_set_bits(afe->regmap, AFE440X_CONTROL2, + AFE440X_CONTROL2_PDN_AFE); if (ret) return ret; @@ -457,8 +456,8 @@ static int afe4404_resume(struct device *dev) return ret; } - ret = regmap_update_bits(afe->regmap, AFE440X_CONTROL2, - AFE440X_CONTROL2_PDN_AFE, 0); + ret = regmap_clear_bits(afe->regmap, AFE440X_CONTROL2, + AFE440X_CONTROL2_PDN_AFE); if (ret) return ret; From patchwork Mon Jun 17 13:50:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700815 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE83AC27C79 for ; Mon, 17 Jun 2024 13:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7n1vQrJKdah20S8ZMrVRWoElzUuvEAd8XeagF8Tz1M4=; b=FoZEcWVLhK0GADWacQuWYnpWD3 Hhvmoo5EXnHOE5/k0fB0MHB+DytNbLG60fMUVcsOQ1DSpPKBlpbjX/0xvs9XTCndK2fsjwA/EmsZO FKcOYJlIc0/YWpDXEI3d1YP8DeXZNGqv7YphCtIkFTI0zYv28joDdsO9FXsfgrAiTYXp/x1xM7yz6 VDawbvfWLIbk8O9oR7ETDmvbNUtj17jrNJkAV6MsdIi2hHIPp2rsUifpHfbzJ/vTlmClejKm0kOrG yWm1VUeaQ1GXxidi08mSu2rK+n0s53tyj1k6q/pQKJwvRPRcsisIljoMC5h5XhJol2+yopAurddmq HLChc9Mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCnA-0000000Az9n-13Ow; Mon, 17 Jun 2024 13:53:04 +0000 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkp-0000000AxPN-421E for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:47 +0000 Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-7960454db4fso263129685a.2 for ; Mon, 17 Jun 2024 06:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632238; x=1719237038; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7n1vQrJKdah20S8ZMrVRWoElzUuvEAd8XeagF8Tz1M4=; b=HuYwajOAyk/559EmR/1/W2S88i14JG8kW8dyNbnb8zSSQj00EpMtJ7gjkCez2o7Zk5 8Wxd4vbM7vbp4LAXgPF3EaY2URqMqb4sOH/9kXHdf3T8MW0avLcSr9Z+yNJ2iSn9D22K v+i0wM/plmXuhS9AhxqCeeDRIC0XWy/KPPiMPbSGBQ/tQZwUtMVhC9Ef+tCsaJNdOs4x ZrwR6OJZdmGgoAgG3Qg85/thGTPDZ2yWAiVZ8VlmCc81hncKkmiGNMnuf29CFNZOSF+C GVMbLY7/8GWHBnEMMnk7noJha80tjmNKlu31DlKbr/Aca2aZy+AUqWxNJQJ+PbEhbuXC Po0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632238; x=1719237038; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7n1vQrJKdah20S8ZMrVRWoElzUuvEAd8XeagF8Tz1M4=; b=wZjC232rk5H+wRiYV9CUSWZy95yyjJIWTXNdRndoPEkBaFSCjnuPl0HP95ERACRcZT Lx+V6xpO51fDds9fuio30koWcoOfvF/41syawn4qvXZbu8MUooHHtkjaj/hvWylZG+vf bC70/Lbh7frUknG+9K0dmbYkiwjwqPFE0UA1q2CTnFdEkAwKn78ND2IRg2ZlVEgOb/uO /CCkkt/3Gba5Ez5LUFhGVNWBTw62WiJ48rUPRNraXICHAc5onQBY86Mfh5yspLo3A3tP Q7XSlWQ80q0oO7EmTgg+wFaUF7XcQB2XZIrwrcFl+LVWALJuLKVcyePPV8Uw5MnylYyZ V25w== X-Forwarded-Encrypted: i=1; AJvYcCU6p+IdRXlA6w/FS9xPJfTLWsB98VCzM/c72d0wrJA/6JXhCInAXcPUUlCZZs5CubGK68goNH8yqQpaYwzhFiCsAqxYqjSkRBt4fIintoeFKGhvgis= X-Gm-Message-State: AOJu0YxmtaHjNcggI48YPkHchpo3eDd462W0JxcrO5pv1YEOVnovi51r LLIXDn7nKBei0XoBfbuQ+r1trb/GOaQ6aRdGKqdtnAyGRv2JV5mExhegWKU1H4o= X-Google-Smtp-Source: AGHT+IFPBsXk8OC1fXhOsjN5sQEyfL0NaDJoRNSti0BCnQHlNJa0XX2KPq4TD0tgoqruv2mBvc8G+w== X-Received: by 2002:a05:620a:2947:b0:795:60b0:3f5 with SMTP id af79cd13be357-798d2430e27mr984123785a.34.1718632238585; Mon, 17 Jun 2024 06:50:38 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:38 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:05 -0400 Subject: [PATCH v3 25/41] iio: health: max30100: make use of regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-25-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065040_327390_2574B001 X-CRM114-Status: GOOD ( 10.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/health/max30100.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/health/max30100.c b/drivers/iio/health/max30100.c index 6236b4d96137..c1867c2ef8e2 100644 --- a/drivers/iio/health/max30100.c +++ b/drivers/iio/health/max30100.c @@ -363,9 +363,8 @@ static int max30100_get_temp(struct max30100_data *data, int *val) int ret; /* start acquisition */ - ret = regmap_update_bits(data->regmap, MAX30100_REG_MODE_CONFIG, - MAX30100_REG_MODE_CONFIG_TEMP_EN, - MAX30100_REG_MODE_CONFIG_TEMP_EN); + ret = regmap_set_bits(data->regmap, MAX30100_REG_MODE_CONFIG, + MAX30100_REG_MODE_CONFIG_TEMP_EN); if (ret) return ret; From patchwork Mon Jun 17 13:50:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700816 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D9D69C27C79 for ; Mon, 17 Jun 2024 13:53:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=s9IxtXAJpg0zoHi2O9sRGBPOMzr1DfcZ9EisZFYQElQ=; b=CVa2ROPgWFp9KAltdNsjjj+bQF rnhccmXLWQ9gW8Vnvy9rD3RUSBg2mbXKIMka5YVy33oRAtPYuP+YhE46X6RP9b1EnXBf7NBf/Fz0R LfUdG9fO4+D3u9POxX+eKV2FCc1ISi6ZlR/YHMzUpzy9+xWSNvjNSdqoudjRVGGnCqX/ugyNfMMPf xGowbgkKX0T26FvcC6LA6Aww8g/Gh+I/19cg7Ya2tNNSWwG6TUEdU+6qwce+t5TZPJbJrJ6DRQEKf X6xE1/D6iB8FhikXF880l+ULa+mdnwM3X4VRekwWJxCdqA4Rlnp/Yy6hAKITdN0XolLL47Q1mhC4T xQPUqTFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCnE-0000000AzDD-3YU5; Mon, 17 Jun 2024 13:53:08 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkw-0000000AxWt-4C12 for linux-arm-kernel@bombadil.infradead.org; Mon, 17 Jun 2024 13:50:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=s9IxtXAJpg0zoHi2O9sRGBPOMzr1DfcZ9EisZFYQElQ=; b=oFbsXoGwUMt+azV83qbE1P1Gwa rcQpZm+Scr/nuIZNZ0nPT+UnTG+5yWL+1vnistVleboYWKK++Mhd3UGWX7+Ch1OwYthYl7+df+Bmv D5FhiwTs4I5H+42vnN1RL8no6NwiHXyqDZTqTfVux6apsVsJT362KnXQFYgBAljrdm48HV0VD5LgH T5IkZYuHgQjaR91YB3KZycy/IdFO3nbAM0XjePQpVLeJI8YrIWwT6LfKc3y56F0dcgctwDigwqj86 bH+aW3Q8jPOxU128wJon3F7a0tu9JD2cXOeaimlj0HYLhqXogQdgAAflNmCQkgfUC0wMcG2CsR8mP 8VHYRYmw==; Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCks-00000006RCF-2z02 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:45 +0000 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-7955f3d4516so481905885a.1 for ; Mon, 17 Jun 2024 06:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632241; x=1719237041; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=s9IxtXAJpg0zoHi2O9sRGBPOMzr1DfcZ9EisZFYQElQ=; b=kStuCXCqRJ1ZA9qQ1TjxEUqnfJTLXF9J2N0zMc6M5BtPTeUmeYgh/mBt7Az74QMQx7 pFsa+2YF1WwvxfrXhPnsKzkgCv6Kp0hY/UYTEm8aPhioAS4ZhOryxfXOERIluzdeKwtE Virid5TMEaWny+79yjInDzuMEzC1KaY2WqTL2fGcSx8F09DKVrOkBO5kueTSjHOSecro fU18bJARcx1XpVmXmQsHnkeKDpWR9hTyFOgw2k7L0U5HLgTMMRfKwcSML2Tv6o9w3i/5 pcN1B5dnI6BuogxlQzNDBRoNAwP6dymYBJtslJdGA2VWUqs1bKM8OFViqRom82JAB7qw BycQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632241; x=1719237041; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s9IxtXAJpg0zoHi2O9sRGBPOMzr1DfcZ9EisZFYQElQ=; b=IX8Xwuv5Jf6xosaGlwu+98vNVJlpYyni2oscLQbzJsZJL9k6P74OknVjSMv0mev3fP I0Sk5YK2gBBgh6TVeF6EA8Ib5+8xVd9rdUeF4E/D1pmCElQcCrT1ME3769EcnyhuX5A/ XbE1RBsz8cnfk3M3VR3TApSlSIDejd4VzRV61c3NBErpzF4oUTBLXEoBmIf1KqPiWI83 3DO0Nt5t6aBhNR3nqMva4y9uOVgwyGYGDtFCsIs55Mi59DjsvK2THR8v5I1rcyT9PDCI lN2lGmdzAYm7lVbAxPIUxxs06S8Im9+kDAIfXPKin9bslk5XvX4MuMAs1rEbvuZA13Dh Qm1Q== X-Forwarded-Encrypted: i=1; AJvYcCVml9hbm/F6H4jY2NuNPNZyir7QoQUlTS9ONQBuzgbZTHl65DiEr15FZZ2joeVJi+Q+gmGG/3T4sDSYC35Q9An3Q4GGpvwBpvuYCYvMIzuxnNhWInM= X-Gm-Message-State: AOJu0YzOd3oy9UfPflx3XZa+KbUXWtLWAWWxXoQpaagNa5inNRSdcE27 3UXfjzZYc2yykK/fIOSfMWVwIcvNolqVw3LPZoEMgqx+ZJcKICOGEpvJiJUlbYI= X-Google-Smtp-Source: AGHT+IEvNWEsHTIz+Kh5SLMDJk99l/NCyLAOM78IKPUk0tI5a9ZCslYv7WlkhqmAtTcQfPh0VS34pA== X-Received: by 2002:a05:620a:2981:b0:795:5469:1b32 with SMTP id af79cd13be357-798d0242f64mr1752044785a.18.1718632240726; Mon, 17 Jun 2024 06:50:40 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:40 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:06 -0400 Subject: [PATCH v3 26/41] iio: health: max30102: make use of regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-26-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_145043_767975_20A7F3FD X-CRM114-Status: GOOD ( 10.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/health/max30102.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/health/max30102.c b/drivers/iio/health/max30102.c index 6616729af5b7..07a343e35a81 100644 --- a/drivers/iio/health/max30102.c +++ b/drivers/iio/health/max30102.c @@ -448,9 +448,8 @@ static int max30102_get_temp(struct max30102_data *data, int *val, bool en) } /* start acquisition */ - ret = regmap_update_bits(data->regmap, MAX30102_REG_TEMP_CONFIG, - MAX30102_REG_TEMP_CONFIG_TEMP_EN, - MAX30102_REG_TEMP_CONFIG_TEMP_EN); + ret = regmap_set_bits(data->regmap, MAX30102_REG_TEMP_CONFIG, + MAX30102_REG_TEMP_CONFIG_TEMP_EN); if (ret) goto out; From patchwork Mon Jun 17 13:50:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700818 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D717EC2BA15 for ; Mon, 17 Jun 2024 13:53:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S/wwf4Pyf9v8s/HS7lCuvhL4I665hNiJrFxeq5WtNz8=; b=4feN0WMIxltCfPpHaOdGDj1Ffv HM9zFpX1rJdfkJ54F1oIYATNzdnv2JJ2y9OTKoLTldu9RGO9QVRwt9/No/lg3k/xInZdkv0q7AGXg vQ3E3C49AE1NSe6xqOasFCsQm4cqdAxfXbl6nyJF5NxSnUFuXI1lQ/FOEgHJF+rSMsNj8KJsf81Hc L9QhXV83LcmbPyDdEGcpJ+RI6FK4aXXdz3A3f57Uf1jlnF8A155y+BAd5PmK1DNxiGkGP5L0M4VSI 20VIxZVoRYd+/AfLG7P5vYrARw7kKEdRVSE5XvUvG4mVzp6jO+Su1iiz2spRsbHn35nvg1Q/i0uOp HGkyf+BA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCnU-0000000AzQO-25LI; Mon, 17 Jun 2024 13:53:24 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCku-0000000AxU8-2twW for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:51 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-797fb0b4832so218432885a.0 for ; Mon, 17 Jun 2024 06:50:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632243; x=1719237043; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=S/wwf4Pyf9v8s/HS7lCuvhL4I665hNiJrFxeq5WtNz8=; b=AG4OMr5f7mguBjZ04tSh9FwUkTw3wElg4fyZrAxwWZJ/BqYPPNDo8oWGlBdLtlAlRM J533p6PHot+Hlrcyj9pvSx4iEvaGcpPWYI76yufYgweC9kQdcGaW36CQrSYNBe1FCE2d lq959V12YnYhBO25fpCmdBWbQCPbFTGCwRJmfNuJ/gx5k+IW2w+51k1GCgEknMIWIMfU bMR3jH7mN2R77VyMxIFusaSlsNj76qMcZ9Jopvb/aBNEAZjWf2FO6yEq4eYzqWAioNp8 ydS1HTnn4/CW2nRs+Bt22NyAkvCcPDnaGj0IWTM2/0nPADK3eIfHf13cF4a3xtX41S29 Pojg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632243; x=1719237043; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S/wwf4Pyf9v8s/HS7lCuvhL4I665hNiJrFxeq5WtNz8=; b=pIw2OUcEWGgpvc42+w8O0MSpS+L8wVPPsMlyeBC8dqd+B0n0RSP76gj8XsuwKVNQ5q LWny+eDRYV1YeTeSXo3HR0rZUKL3l4SeDmtI9j3/kzvJPX1KZEiwMCIbLm6tCpgfrQoU nbGUdtQcxCQkfWXailRk6QuhcCQQqiYBxvQ8N1CDvDSskzRSx78IViXZHauJpOEDLle9 +LudsZ+aBRs7cS4eBJmKja4VXVXYcz9t7vhXGkFw+7/nAhQqBLzIe4Tk8U/bVdPFTC4t Uaviz1PUh3Gx1dYwGN+TcPNzxymaN5Izm+GwJZatbPWLhWDS5qY0q4/pWMPV1z3j8ji2 yZ4Q== X-Forwarded-Encrypted: i=1; AJvYcCUwZsArU0Iy9bahjz2/DZ4bMI1k/35PvpIeoQSIymCHCI756DB+C8aSdAklnmozyC0aOHuch9UtbbSqE0ez7KETep3zBQXYRsY3pAchcV7k8Sc0m+o= X-Gm-Message-State: AOJu0YzVRdloYoxY6NqKBu1Yoc18rHMIpxq5rWt4SWknB+GpWfQP+7rf C6yoTgUTAM5R1Z83Z6O/I+P7ys6Q8hJPUxi5vVcaHJbyzyisnTtrteSUg7tMLkk= X-Google-Smtp-Source: AGHT+IFGOx2s8Nnos2uW+1yz9gXjI96q1FUrsSHsvdHqjpAdDpOLj6w2PTD0THhqXhocLH6W1aVi0w== X-Received: by 2002:a05:620a:46a1:b0:79a:2613:9b40 with SMTP id af79cd13be357-79a26139e04mr977624785a.50.1718632242836; Mon, 17 Jun 2024 06:50:42 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:42 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:07 -0400 Subject: [PATCH v3 27/41] iio: imu: inv_icm42600: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-27-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065045_168064_F647E582 X-CRM114-Status: GOOD ( 12.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Acked-by: Jean-Baptiste Maneyrol --- drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c | 14 ++++++-------- drivers/iio/imu/inv_icm42600/inv_icm42600_core.c | 9 ++++----- drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 4 ++-- drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 4 ++-- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c index 63b85ec88c13..509fe6a3ae97 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c @@ -262,9 +262,8 @@ int inv_icm42600_buffer_update_watermark(struct inv_icm42600_state *st) /* restore watermark interrupt */ if (restore) { - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INT_SOURCE0, - INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN, - INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN); + ret = regmap_set_bits(st->map, INV_ICM42600_REG_INT_SOURCE0, + INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN); if (ret) return ret; } @@ -306,9 +305,8 @@ static int inv_icm42600_buffer_postenable(struct iio_dev *indio_dev) } /* set FIFO threshold interrupt */ - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INT_SOURCE0, - INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN, - INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN); + ret = regmap_set_bits(st->map, INV_ICM42600_REG_INT_SOURCE0, + INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN); if (ret) goto out_unlock; @@ -363,8 +361,8 @@ static int inv_icm42600_buffer_predisable(struct iio_dev *indio_dev) goto out_unlock; /* disable FIFO threshold interrupt */ - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INT_SOURCE0, - INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN, 0); + ret = regmap_clear_bits(st->map, INV_ICM42600_REG_INT_SOURCE0, + INV_ICM42600_INT_SOURCE0_FIFO_THS_INT1_EN); if (ret) goto out_unlock; diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c index 96116a68ab29..bb302f5540cf 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c @@ -435,9 +435,8 @@ static int inv_icm42600_setup(struct inv_icm42600_state *st, return ret; /* sensor data in big-endian (default) */ - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG0, - INV_ICM42600_INTF_CONFIG0_SENSOR_DATA_ENDIAN, - INV_ICM42600_INTF_CONFIG0_SENSOR_DATA_ENDIAN); + ret = regmap_set_bits(st->map, INV_ICM42600_REG_INTF_CONFIG0, + INV_ICM42600_INTF_CONFIG0_SENSOR_DATA_ENDIAN); if (ret) return ret; @@ -532,8 +531,8 @@ static int inv_icm42600_irq_init(struct inv_icm42600_state *st, int irq, return ret; /* Deassert async reset for proper INT pin operation (cf datasheet) */ - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INT_CONFIG1, - INV_ICM42600_INT_CONFIG1_ASYNC_RESET, 0); + ret = regmap_clear_bits(st->map, INV_ICM42600_REG_INT_CONFIG1, + INV_ICM42600_INT_CONFIG1_ASYNC_RESET); if (ret) return ret; diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c index 8d33504d770f..ebb31b385881 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c @@ -28,8 +28,8 @@ static int inv_icm42600_i2c_bus_setup(struct inv_icm42600_state *st) INV_ICM42600_INTF_CONFIG6_MASK, INV_ICM42600_INTF_CONFIG6_I3C_EN); - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4, - INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY, 0); + ret = regmap_clear_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4, + INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY); if (ret) return ret; diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c index cc2bf1799a46..eae5ff7a3cc1 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c @@ -27,8 +27,8 @@ static int inv_icm42600_spi_bus_setup(struct inv_icm42600_state *st) if (ret) return ret; - ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4, - INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY, 0); + ret = regmap_clear_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4, + INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY); if (ret) return ret; From patchwork Mon Jun 17 13:50:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6D4FC2BA18 for ; Mon, 17 Jun 2024 13:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=no5e4JgYnxUL9VEAR0MyhLfYZ2Dji3NZkE6FFtqTn2Y=; b=r5qWSPr3zDIYtK202f2VcOb29h ijkblLtlgepYTzpliRZ5i5IRkvGfFRZ+rBqO0tc6aFxg42IykPgqknRGNsixZaRtZ5fZxZxsjhxKI OHXv9XmufdPoJGZmBcVcrIjEqH6icujqMmGmJ+D0TDFAx0SNY3fOAAWvZLRiI81nwW1BJbS4xJh+w IpoMp4SLXeNZMZHTBhML28smH1+gILVpu2T5oUPDyhZ3gOf2u/F9faxbgdvSpqHUztMyl1Het8352 LsjeBJYgxzAfew7FAhg6kCCdZFReAdDZ+nD8tXZRqBfywwj+N3Q/aCWnltM6KaapOoce4ga7ukRwv p2xjsvKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCna-0000000AzVP-0ojo; Mon, 17 Jun 2024 13:53:30 +0000 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkw-0000000AxWU-3e1p for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:53 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-25957dfd971so477044fac.0 for ; Mon, 17 Jun 2024 06:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632245; x=1719237045; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=no5e4JgYnxUL9VEAR0MyhLfYZ2Dji3NZkE6FFtqTn2Y=; b=zz496VrjVwl92+1Ot4/1+YZWIy2OF5HEGiCxXfHX9bH7EmDHh30qB8kIoOwWfq1fRa jLi3Qp5gcaDp3GIbEAvk4U8Br0P/S0pyGLxYVW9mgkB2zze/XSjK3p4Qcx0r8Qb1gdnJ VPa0j5nEhak801O69pqBb304CqHRV3K7SpIpLfyfvuGA7/fRtW2CCfTTttX919DfMYh5 kKh94HNfb2mWhCNaJqxEWUNoly/ZB+MBJgkhO971FT0nHtLmZFOVj+vx2Vn8211TDJtv AxH0qa3o6VvLnR2GgGJGMPAAdFDVCmpyTbp/y8Go/FiO1WoUpoPg37HzItt9iul6UFQt 4hcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632245; x=1719237045; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=no5e4JgYnxUL9VEAR0MyhLfYZ2Dji3NZkE6FFtqTn2Y=; b=p6gJQh1y49pNcY7vNX8zYO8f9/08poLhxONOZaDBBo9uxYDQK3pztA4kcXrZOTub3S KJN//phaXQ5nlyLRO0xx80uTAuRrPxBx8zh7q7HLfRK9c0DnSChi+4Ld2es3XsXOp7Jo /WnJeOrH+qXouKp2tOeANBd6giLu1ivIB9R8XJysAHUtiMvMJTn3DrAfoI3Zak32wqnq UYFF0Eqt/gPsMNHD/+BXCA40i/izR3Gw2+OLeWzeaL8As40ASULP6xRNmwOd3lNxrBMV +SDJJtyMtuJ6bhlDhl6jQ6RH5UiCOHQwHjGYA4VQJAhUzJFeAd/LrVRcYvsBIiPN3y0R NzgQ== X-Forwarded-Encrypted: i=1; AJvYcCWTVdZ68sqy6IQCjp6F8BTeQw0sxAV6+Ndj9SsbV2j7QRRVIIjxvk0WH7X0PrIgvyJhOac50DjnbE7TIbxqsEXWrrWzHlW3Tuxm4fnkMB6D7wdfpbU= X-Gm-Message-State: AOJu0YxIxDoiCI0Qb2FH8yRbWA5ZXG3NJeVz0K0wuZpsD5BLcVZMczKw 7GedzoXdJYn5EVExPZY0XC0HtzidXsTHp73hu++GGB9TzeZw90jcFjaESTwsasQ= X-Google-Smtp-Source: AGHT+IGU9b+YnJX5hCRw1ClyleRAxjZc2rSg4p660bR5sIf4JFOEx4FbnA14YINHS71KeMJAZo8MSg== X-Received: by 2002:a05:6870:472c:b0:24f:c95b:ab6 with SMTP id 586e51a60fabf-2584288ca57mr11986485fac.8.1718632244964; Mon, 17 Jun 2024 06:50:44 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:44 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:08 -0400 Subject: [PATCH v3 28/41] iio: light: adux1020: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-28-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065047_558121_0CF3661A X-CRM114-Status: GOOD ( 11.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/light/adux1020.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/iio/light/adux1020.c b/drivers/iio/light/adux1020.c index aa4a6c78f0aa..34230e699d27 100644 --- a/drivers/iio/light/adux1020.c +++ b/drivers/iio/light/adux1020.c @@ -539,9 +539,8 @@ static int adux1020_write_event_config(struct iio_dev *indio_dev, * Trigger proximity interrupt when the intensity is above * or below threshold */ - ret = regmap_update_bits(data->regmap, ADUX1020_REG_PROX_TYPE, - ADUX1020_PROX_TYPE, - ADUX1020_PROX_TYPE); + ret = regmap_set_bits(data->regmap, ADUX1020_REG_PROX_TYPE, + ADUX1020_PROX_TYPE); if (ret < 0) goto fail; @@ -748,8 +747,8 @@ static int adux1020_chip_init(struct adux1020_data *data) dev_dbg(&client->dev, "Detected ADUX1020 with chip id: 0x%04x\n", val); - ret = regmap_update_bits(data->regmap, ADUX1020_REG_SW_RESET, - ADUX1020_SW_RESET, ADUX1020_SW_RESET); + ret = regmap_set_bits(data->regmap, ADUX1020_REG_SW_RESET, + ADUX1020_SW_RESET); if (ret < 0) return ret; @@ -764,8 +763,8 @@ static int adux1020_chip_init(struct adux1020_data *data) return ret; /* Use LED_IREF for proximity mode */ - ret = regmap_update_bits(data->regmap, ADUX1020_REG_LED_CURRENT, - ADUX1020_LED_PIREF_EN, 0); + ret = regmap_clear_bits(data->regmap, ADUX1020_REG_LED_CURRENT, + ADUX1020_LED_PIREF_EN); if (ret < 0) return ret; From patchwork Mon Jun 17 13:50:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700821 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 947DAC27C79 for ; Mon, 17 Jun 2024 13:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DclUw90neJHmAEodckLVU1MrMAClwpCF1mlaeSjcN+U=; b=iFIGJXntVDhQcBHJk7tlAWaJMP 6svGtiV3rH/aUk1aI3BuB33IPwbQQEvOZhJZNsEHFUyJgCTf8iczMQ4UAnW9oDJeewGBerwRRx87t OrBLuS3SGBH6gJ7EOmHpgAJTXpWMk8pVj5kGzO0KMAyeIzlo6KIOC3+DJUyRTxQqjp3qi3sd9Lz+1 qCpNPKq34JYcZ2VkbqBNFL5km6pSZX8w6T75i8OdnBxbTdu4FrE3qQhzTqbC0nJWAv2jKqTt6WyS2 FU6fxg/yE422vSYbQMZ4HVFDzinTqSYPHuxq53lFFBif/YJAEHI2H/CBqDLdfvQmTC21ttII+hjBM UFtpWQCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCnu-0000000AznV-0E9g; Mon, 17 Jun 2024 13:53:50 +0000 Received: from mail-vs1-xe35.google.com ([2607:f8b0:4864:20::e35]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCky-0000000AxYN-47Lo for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:56 +0000 Received: by mail-vs1-xe35.google.com with SMTP id ada2fe7eead31-48c4c5c0614so1354183137.1 for ; Mon, 17 Jun 2024 06:50:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632247; x=1719237047; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DclUw90neJHmAEodckLVU1MrMAClwpCF1mlaeSjcN+U=; b=OjFPQkhl6K6SsrQ/CRGORZQTvU5S3AyOvJB0gdCQdYyPzeqmwZw06SzaOAqXDBZaJs 1yd21oXwFqMtGXskAtLgAKvF0LlDZR5awNL8KgXELcQgMr3S6X1dpA6iQTnnxANfqgjc QjG4oiIOh7bx8u7kud0dAw12YIjYLlZ5VOvGXHdF4AkoxDhrAuKzZ5SQ8x1oWCIoS/rU 48UW/Tyg7DmMqU+EBF9Av/awzKiE1AmKI9h8gRW9aAra4VbYQbsSb8dro55pGpY7bliE 4Mtd83eGsyi4kPGpz6XT010kXiSoZLTKs4l1gXDtopnBEjKfhHP3KbZMjypQVjOD62ZP RzqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632247; x=1719237047; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DclUw90neJHmAEodckLVU1MrMAClwpCF1mlaeSjcN+U=; b=EL1HLaozO87VwdiLjx93jbu4vb8aJH7k1VKfyT9KkVHkoY8XzOxgFaumrpJmnbvDm8 ZcQ2U88aRrHSltjAsmLSzLiQUYvbjxFZ4Hki5t+mFWK5K1+/lWHgZlpPS0uu7KGS1lux DmRd4H50S4X4PV06Jxpdt4VEc4qv2Q2rI8JpZEkrXfC4D5zlGkjNP10vs8yOFP8kDhAQ s9CZ7JN4GBPKGWHRlyFR2C/bRZxyVZ21UmOghwawX9/5v/b2C/mdZaw0zeZ9NGWKhc4+ RRYUioOBg3ZKs9dHmjzVHf0t6kmmnD1CXUIMcrT6J1NXK3BRDe7Lo/rMcz8aRVhceato 9JRQ== X-Forwarded-Encrypted: i=1; AJvYcCWdOkeh/gHFJ7kk+s+JQ5s11HtbHM9HEZ+ZHngoN9UXxnJN1a5pMhWqlwTCw26NWc+sOqcc+qBU0ny+Ph9LnFU8BI+kNZJO+/QRZE36BropfFvOggc= X-Gm-Message-State: AOJu0Yw8+/qBn31OsYh4lXhpgQ5kbO8xW13Wgu2D5wb1Rn3ODMa0HvgL 1mS/8AnI3dbAKbG4Lkp1kt5mK62E/DogDyGbhHCnw70mLGyzuT7dSK2rfWT+o/o= X-Google-Smtp-Source: AGHT+IEubRIeXP7Kagp49NVByjjGeveFz51rlB4BKjhqfHfpKBEa7G7VixyRzOvMhLylvoLMhbPrtQ== X-Received: by 2002:a67:ec98:0:b0:48d:c0ab:ac20 with SMTP id ada2fe7eead31-48dc0abad12mr7057846137.7.1718632247057; Mon, 17 Jun 2024 06:50:47 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:46 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:09 -0400 Subject: [PATCH v3 29/41] iio: light: iqs621-als: make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-29-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065049_248749_F738FD1F X-CRM114-Status: GOOD ( 10.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/light/iqs621-als.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/iqs621-als.c b/drivers/iio/light/iqs621-als.c index 004ea890a4b2..6de33feada3a 100644 --- a/drivers/iio/light/iqs621-als.c +++ b/drivers/iio/light/iqs621-als.c @@ -86,8 +86,8 @@ static int iqs621_als_init(struct iqs621_als_private *iqs621_als) if (iqs621_als->prox_en) event_mask |= iqs62x->dev_desc->ir_mask; - return regmap_update_bits(iqs62x->regmap, IQS620_GLBL_EVENT_MASK, - event_mask, 0); + return regmap_clear_bits(iqs62x->regmap, IQS620_GLBL_EVENT_MASK, + event_mask); } static int iqs621_als_notifier(struct notifier_block *notifier, From patchwork Mon Jun 17 13:50:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700820 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B64D2C27C79 for ; Mon, 17 Jun 2024 13:53:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qNtak+2SP0bqKcAwBmLBKZAak83BgIl2xc15imfy8nI=; b=3IxfZBFg0HWZ4tqfLHxBJSG3dh YVH08E4doseujai/O7mBdKoLR5wF+0KCFEdOXF7V23fScOzbrSAErueyFAjTfm5TNIRw2NSWa1ibC Hk8KcPXNgOWOzfx7qagiTnmTS1Y/d3IboEmPLXlEuDLO7esChNickuKQvSFSJn4eEoGXww5/31G7b mL9hlHogwx2IusAnnJNKcTEhL+CShkzRXlhJlhCkeoPQVUeJdxhENIZMWiDCmsDfmvZQqyXrzH7EJ P+qx9WriA9I6fblF9+8Q7uQ9tcS+I5Ye177c3bHwtbtwmVSClCgTFR6QfVu6ZjQl7Rm7m4Hevskl2 /CyIw+iQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCnj-0000000Azcy-01my; Mon, 17 Jun 2024 13:53:39 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCl0-0000000AxaT-19wY for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:56 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-797a7f9b552so306650785a.0 for ; Mon, 17 Jun 2024 06:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632249; x=1719237049; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qNtak+2SP0bqKcAwBmLBKZAak83BgIl2xc15imfy8nI=; b=dJYdIXQcwaia4PmJUecGojjh+N5rp8na86jWvF1PV3RbDV7TuJNvmYUSHfsXJdK24k kdluZ0VlU+pFIN7BSwYnuCIYHHvqTGg9DGV05H6vUImPB55Vcv8AeGsaFRW/D0423qwq vs9NLxSzy02EHN9LLe71nkm3D4b5JylyPz8K+pTh3UHiuwUpxRNmjuvx5O1NAl75e9hb PJlrIzPnuUNqFL2YFB16lXfmEZZWqm6pui+qRGlyo2ykyQf9pgaiCOjpntNkb34fhHaZ +qV6pMoBCLZxKO2pSwNhmvPthdQymtCAXEebr7JyLlXXtByB7ur+5KyVjfdYOW+9gaQU UhiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632249; x=1719237049; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qNtak+2SP0bqKcAwBmLBKZAak83BgIl2xc15imfy8nI=; b=LywnD5V5yScWCuuFWnslK6fxQE7u6vrLGVZ7jQ2eYDBadx0cRXXjSS7d2KKoCF1/NM 40JIpHKcZV3GR/6b3wmgJk6f3SMuiKGIOJqO4bNoyWyWeVCJvPb+/ZXGohUsZU1Q2eMm 8+/NGAnY5gyZ31hwIStwi4PL3jO414fqDfx6GxhCfNvRhmXVY9hi+wWOdMyXfQaDTfJu qIt1BOQD75ZjRofsMg7eQWz7UB93vmFCIQCjcJU11UNoaWn0siZeH7Zmp8l8obV1z8a2 CIeZ2GGdPNcCJyF/L2dM04CDH/VoTTBH5W5W2GwFQ4Run3F/ed/l1p1aAMZ8kKZKpK7F 621Q== X-Forwarded-Encrypted: i=1; AJvYcCVJFkQZqlY4f9+t0BeDORR5La32nGmbrsbtTKKhQqoD33RUpPYXpjZ2ZDHs9i/Payc+XLPx7rOiwm45Dz8G57Ud5PeTx1Vjk4S16HFZqkKrTFJz0Co= X-Gm-Message-State: AOJu0YwD4TGffXk6KuwjRt4qxa0pbesfOv8yYJFq3wAje0+JXtZKbJmj tvjKnvT/RMPhlN04v6Uujawyv97ZQ8DJS5C3GTdTLWLANRKRjTBHlp2qAM8EKCI= X-Google-Smtp-Source: AGHT+IEff9Dln+tnuVCEmbJAGpzplXAkkgqJD6yK1MHCx8a+d/cYhrzz8V7ALZ8zTjCZj6a+ffKadQ== X-Received: by 2002:a05:620a:4088:b0:797:d55a:5166 with SMTP id af79cd13be357-798d258dd41mr1141019385a.58.1718632249174; Mon, 17 Jun 2024 06:50:49 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:48 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:10 -0400 Subject: [PATCH v3 30/41] iio: light: isl29018: make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-30-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065050_530032_55891C69 X-CRM114-Status: GOOD ( 11.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/light/isl29018.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c index 43484c18b101..8dfc750e68c0 100644 --- a/drivers/iio/light/isl29018.c +++ b/drivers/iio/light/isl29018.c @@ -550,9 +550,9 @@ static int isl29018_chip_init(struct isl29018_chip *chip) return -ENODEV; /* Clear brownout bit */ - status = regmap_update_bits(chip->regmap, - ISL29035_REG_DEVICE_ID, - ISL29035_BOUT_MASK, 0); + status = regmap_clear_bits(chip->regmap, + ISL29035_REG_DEVICE_ID, + ISL29035_BOUT_MASK); if (status < 0) return status; } From patchwork Mon Jun 17 13:50:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59EAFC2BD05 for ; Mon, 17 Jun 2024 15:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=b+ymucZ3m6lrJGr3WTAeCvzidHKg4xOe2grvPyQxJhA=; b=APdOtMV/Ih9DSCFZiJn3P4ztSH xadVdFgmj+3+ajshvpVmoRhmJJb85R2q8D9DMIkYnuatNl8+mX01xqALmRPWgKLvV5A/AU9SDrVmj XzsqWe/k5MO5xK0nH/1sm3A8DNJlcBgiuDO8z2dEj+o0V1r3ZEa7jgiv8+X8qaKDFu6g+qvTN6to3 ecS6KLGh5rm+rgpp2dWb5c3J5pc+5gZEYq9A85DE2dbUl39gT2qxRma/IrKnoXL3gEO+IzEr9fq5R WOaTySFn1JXUeY7YdKjMOO5ZJGB4Y0Zd3ObDQbFEXioEbzDHO59ODNmO21sBQnHF8aE97jv+EYQtZ MUhgznTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrI-0000000BKRv-0OzT; Mon, 17 Jun 2024 15:01:24 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCl2-0000000Axbv-1SVA for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:50:57 +0000 Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-797e2834c4eso366754685a.0 for ; Mon, 17 Jun 2024 06:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632251; x=1719237051; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=b+ymucZ3m6lrJGr3WTAeCvzidHKg4xOe2grvPyQxJhA=; b=cg3m+UNm5cj53SiOCopffSu2NrqsqVryVEFNFdIQ2hXMJcsvJQo++7XitZxgt5zlxB Wr9+hcNO9yCxxGweqiXArTiyE8iKuLVHMFhyQUQ4eVBTPzDQ2Ho82FKUT4BggamkdXEw SpyRd4mgH7lxwIEo6fqCqgBEc+P+IIeVwG8lgqcUk0bczTDx7Ra6SDCldl0jiynsXtek De3pF4e1+MDj51KBNO5K9FlMQ/ExP+Rd+d+05S8QLDX2iCjrsKyz0EBpYjSllaqh/xYQ pQfzgniJvZzr5DkJltiGPokl+X5YzWub84S2lZpxIlWa3DYeFSEnzHTz/VQ0YE70fEdN wL7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632251; x=1719237051; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b+ymucZ3m6lrJGr3WTAeCvzidHKg4xOe2grvPyQxJhA=; b=NFTk2xZ5BLjSZS/OBTokrbKuzZ5oPGi9OseO+3Lnp5pb9M8zpCfvDKWV51ECHPxj3A 8mJcE/v33AfoskwRQXtGMYmMKZZiI0aGseJcdo8WOAAgN9AL3aPx+II5ZddITUdeeG2o KChnI1q/j/VGsisX1HkXvbzBgobBwoOA9JRxB+llomzycbkhweui0Js/jVcpMOV+OR0e rc6AVuvWTFJ8LjQGod4G5Mo/vsKMZDqw5f9UPKQ0w/7exCNM7gegp2aGFjiNzleGSJdP +WefH2xJo8r3J2Nr4WdgPoHv7UyBv/LLP1WuLi85iIYUYu/5O6hS7A1ae2u92d3zM+iE i8Zw== X-Forwarded-Encrypted: i=1; AJvYcCVQlxebJj/utJVMBODs/R8qqsOCQA0kPYh36xKzk5g/yJzh4VJ4Wzbcl+BxezmDElwh3VvQ2F7uZYR5GCDX65VP+eVlw/SfmQfs6GI4nPW/i/TMq1A= X-Gm-Message-State: AOJu0YwWWoU95qqeuGBCAMJlely/jDADjajmjZnxM7g8oMFL6VA3N8Fp 79o4XSv1NYB/0XlblPSjT9MpTFb6gbjUF/HrkjtTf/ASid0G+DzNqdjcJKZlk+s= X-Google-Smtp-Source: AGHT+IFhD2JefGeiJgsg6Ae7QRIe/BDndSP0Z/WiCRPC91zIn6+wpqBzLsiQzn3/JIP4kN+hagVe4g== X-Received: by 2002:a05:620a:4056:b0:795:56a1:6c0a with SMTP id af79cd13be357-798d03b78c4mr1852443685a.30.1718632251285; Mon, 17 Jun 2024 06:50:51 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:51 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:11 -0400 Subject: [PATCH v3 31/41] iio: light: st_uvis25_core: make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-31-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065052_596921_EB26158B X-CRM114-Status: GOOD ( 11.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/light/st_uvis25_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/st_uvis25_core.c b/drivers/iio/light/st_uvis25_core.c index d4e17079b2f4..fba3997574bb 100644 --- a/drivers/iio/light/st_uvis25_core.c +++ b/drivers/iio/light/st_uvis25_core.c @@ -330,8 +330,8 @@ static int st_uvis25_suspend(struct device *dev) struct iio_dev *iio_dev = dev_get_drvdata(dev); struct st_uvis25_hw *hw = iio_priv(iio_dev); - return regmap_update_bits(hw->regmap, ST_UVIS25_REG_CTRL1_ADDR, - ST_UVIS25_REG_ODR_MASK, 0); + return regmap_clear_bits(hw->regmap, ST_UVIS25_REG_CTRL1_ADDR, + ST_UVIS25_REG_ODR_MASK); } static int st_uvis25_resume(struct device *dev) From patchwork Mon Jun 17 13:50:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700832 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38F94C2BA18 for ; Mon, 17 Jun 2024 13:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8+9CxU2CvbNCydIwkwVi62wLJsPjXvn/mOpa7x+p1k8=; b=cufZE70yg/MppaZgA1Jdt7dsMm ahCRWh0+BeC1cBPVtRSQw4BY+DJ/rb1+WQcHgse04cJHvBIZN3htHFlafz8Bb1wA1Ef5pHCtpTeAa bLYczr5EekSSF+orxZf7FnasM+rCOq62xNGsimPabXDO4GDquz/7oGFLxVAEIbZcoZQu9e0RbJeqK Vd4NHNKGw2FlIv/WdMJco0IHoai2K/j8SzEQfH0ahxG9Ktp25faWw63uKXkLXy+aGvPlsnHUid53e p8HsouvzgO4HdvmJvCivx7DK+Qt10LtoCsrhGwrwqAb8MXWTj87fDlIYJobUVKwNDPml48jMruEDO CYAZ8OVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCoB-0000000B00o-1iVs; Mon, 17 Jun 2024 13:54:07 +0000 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCl4-0000000Axdt-2AHY for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:51:00 +0000 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-795482e114cso363679885a.1 for ; Mon, 17 Jun 2024 06:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632253; x=1719237053; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8+9CxU2CvbNCydIwkwVi62wLJsPjXvn/mOpa7x+p1k8=; b=KNJGPmcirQ9u8fLSA34zRzrQ1AAM7xqKU5mhNoHH6lBkVcP9ln+PM+l/x6UQeXemLi QtgafwDjlNXEipBRKmpWDAL/vvNqA+WuCTdWgWkjY7z1diIM/fNDRsXuOJPu6WzvZXol IA7/8WQnDsM/yP8Qr9kbqeeQ4KyBVUgzN5FTWB5XiKdirKyJoQeqNtxvURM57zePo9iT IBYnE4ozbFUvXIX989x28Pv05bZFmaMQ4o41PFrsTij5KlyQl3/Q7x1kbnNyz2hmLWSO b726iP75dY1xaZojH2kVPuaWcgp3r1hFTxZB+3GUB3sZU1wDZ+YjakvXDX6DkOoBS+QD bgzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632253; x=1719237053; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8+9CxU2CvbNCydIwkwVi62wLJsPjXvn/mOpa7x+p1k8=; b=kpkF6xjxDxIqe6IkrhYSGNqWDSxaVe8/yTMZ1kvsPnSUIMTcIvqYNlB+AScKmlkqwI b31v/SvZGAcnkr2NtkKeiXBSdEyOOdbCofTk25xwdBRUcB50AQxNasG8aqDpk09HCqSn PLvsM0vsBiX7sYUaXp35Hrswo/brjnQqN7wgcKk/AMeA+5Hqq6HXjFYijMIp6TNRyBEF n57NeVs5pKcEvETocYKOM+dm9Dg+ZjwC+BAaJSYUGbu5KTPuGSxGKMesvNemUuIl45JR BnN96aiAb/b2PGp+TxFcFsFB6jIOi09t5zOFvl5sjDXHYqQbmx622ZUL2Hl0EpSF5jW9 y9YQ== X-Forwarded-Encrypted: i=1; AJvYcCUJ9ZlZOD4+vbxqx+3540l5N0Gb7HhN4cNVoBF5Vnly28kZDBOHyi7CwoN/OtdCZnu7d3irdvusci1kE5+BWONHPfCl8ARRAJimDaZ0htUnyBUqxjA= X-Gm-Message-State: AOJu0Yzhcht3iDrfq0sSc5Rvc3zoyU1UsVrAywrFbHUoQuacJOlZGV8P qqNMzTvCQThUWhTA/fJv7s4SUh7YoJ4gmgtjyWxhXStxYnWNZXQJGqrG/7PpIeo= X-Google-Smtp-Source: AGHT+IF0QBpD3doG6Fp1c+vnf+YJQ81FC5gB6//3DNzmC1F9GzI4GVFvf6U3tYk3LEdICO36nL3YKg== X-Received: by 2002:a05:620a:2a0a:b0:795:5c3e:eb45 with SMTP id af79cd13be357-798d2531f98mr1137480985a.34.1718632253384; Mon, 17 Jun 2024 06:50:53 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:53 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:12 -0400 Subject: [PATCH v3 32/41] iio: light: veml6030: make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-32-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065054_843463_04E12C0A X-CRM114-Status: GOOD ( 11.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/light/veml6030.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c index 043f233d9bdb..f7ccbce45f38 100644 --- a/drivers/iio/light/veml6030.c +++ b/drivers/iio/light/veml6030.c @@ -144,8 +144,8 @@ static const struct attribute_group veml6030_event_attr_group = { static int veml6030_als_pwr_on(struct veml6030_data *data) { - return regmap_update_bits(data->regmap, VEML6030_REG_ALS_CONF, - VEML6030_ALS_SD, 0); + return regmap_clear_bits(data->regmap, VEML6030_REG_ALS_CONF, + VEML6030_ALS_SD); } static int veml6030_als_shut_down(struct veml6030_data *data) From patchwork Mon Jun 17 13:50:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700833 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 033DEC27C79 for ; Mon, 17 Jun 2024 13:54:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ia4Z2qLqqNhVaFO8MtaqZtGEmhpmvSbj7T0WFgyfsq8=; b=JH3BUlHcf8CfLlvA/qJQLT3Xu/ +1hWbaDp4iub+2OZ8c4EYj2yV7jeMv9Ge8oIhw/yYaLjzIBoVZVngRJi2QEY8FZg6Akjav7yRXAeJ 4NUsJwr9WcTWUxmNGCnK8Gv+utc0IHXdjpEiHtJJTGHiBElX+GRJ+jLkw/H+dwtB2pv56Xfmiiycf 6xRt8t+sAKW19WWRpboAlkw+FOboWyIicHf7AAJQML0aLpTXdupEL6K8zcGqXruNLCMUnmYAkjNNp 9XS+kmxqJTptYmPsj5kZIvybCteu6BgtjnGjLm52ciNpZPo/DWqS43BrBuklh/+crhcV0Nz+H7grZ lwHKu3bw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCoI-0000000B07V-2xDw; Mon, 17 Jun 2024 13:54:14 +0000 Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCl6-0000000Axg7-3iHB for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:51:00 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-796df041d73so313416185a.3 for ; Mon, 17 Jun 2024 06:50:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632255; x=1719237055; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Ia4Z2qLqqNhVaFO8MtaqZtGEmhpmvSbj7T0WFgyfsq8=; b=wngAor7BnaQyPzSHvwXGdPIc3JMqy6/6TBk82G5G6YB2XH9Foat4jH9whiEudDB9YB o+wpcDb0VIv2i4kihQmgwGMZh3ysAKHHgeUVtuO+4nXqYPVvxJt7TO9lt9m1xzRXz3QF PXdpMkEC53SVMXaCqAx0mouWYaAWBlDx98HKEQVaEzEZ/PpXNn5BRCoT9CoJZ8NZ3BOW //xjcGfaM78pA545PRfaCdtg5ASRBdwiNVAxsj5EcCMRdWyg95VIj9aOIouhAAHfV+Zz b3P+G1bazUlp51aVW1kXQLXscjbhmcwX+b85HXehDumI62dS60I59HZMGs19KkiQf8yh H/NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632255; x=1719237055; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ia4Z2qLqqNhVaFO8MtaqZtGEmhpmvSbj7T0WFgyfsq8=; b=Vj2bcSW8nKB3C9DV2XmTNIHEMBbCdVasab65/zZEwXfCFyNrqwYEDyrF+2H9ekqaVX It6OaewNT+CAP857yDm0TGz0wxHsQjZiyskgp9JO6foUqqKTktSqcBIJqBX3QlMKGdlk PcS0wdgyRjMb3Nfst/Soe77VZxKK89B2OMYiTB7iiv7kHdIuCnEwYTKbQrKkCkVuGkGk TxM4lRWELPhJS4KPViZ2hUAdWjUbGvNI6B/qmSYUAt3VNFAjqaBv/lIYSLyyVgEY8Xsn I5Mw2a+89j3BB28LuZRJbaVmgLAyd7kS8R93LTIODQ5UQWkmbuqFlMqIw9qmxW9/gLsS 6rTA== X-Forwarded-Encrypted: i=1; AJvYcCWSKNhQcqU3rgkzAOQ2kl8KAE/lfMOOw0mVa1UZ2rNv7XLxDUe0lLcKmj4Zq/axSjovgu/wDmKBihvBjSksUPMhBN44evfsU/VfBuys5A6gBExRMtE= X-Gm-Message-State: AOJu0YygUhi/i4yi5QVudhI6rwoNu5K2CRsLlyW1JhY52nE+kLUfiqa3 ov5co2Dt023orQHfWcHyaJ7rdSRkqUyJqYzHSD8LckSBf4DVXVbyulGc9mQD+bc= X-Google-Smtp-Source: AGHT+IEp5RQjN3OqXqNMmTgCMp6Y0MDh6HV8RUCzW71+lzqdiGZxksmwSY5WI1Xptssn8y0vJEqwfQ== X-Received: by 2002:a05:620a:1921:b0:797:74ba:8ab with SMTP id af79cd13be357-798d26b4a64mr1132760985a.73.1718632255523; Mon, 17 Jun 2024 06:50:55 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:55 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:13 -0400 Subject: [PATCH v3 33/41] iio: magnetometer: ak8974: make use of regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-33-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065057_575394_F5D60AEF X-CRM114-Status: GOOD ( 10.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Reviewed-by: Linus Walleij --- drivers/iio/magnetometer/ak8974.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index c74d11943ec7..70172b918e16 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c @@ -327,10 +327,7 @@ static int ak8974_trigmeas(struct ak8974 *ak8974) } /* Force a measurement */ - return regmap_update_bits(ak8974->map, - AK8974_CTRL3, - AK8974_CTRL3_FORCE, - AK8974_CTRL3_FORCE); + return regmap_set_bits(ak8974->map, AK8974_CTRL3, AK8974_CTRL3_FORCE); } static int ak8974_await_drdy(struct ak8974 *ak8974) @@ -438,10 +435,8 @@ static int ak8974_selftest(struct ak8974 *ak8974) } /* Trigger self-test */ - ret = regmap_update_bits(ak8974->map, - AK8974_CTRL3, - AK8974_CTRL3_SELFTEST, - AK8974_CTRL3_SELFTEST); + ret = regmap_set_bits(ak8974->map, AK8974_CTRL3, + AK8974_CTRL3_SELFTEST); if (ret) { dev_err(dev, "could not write CTRL3\n"); return ret; From patchwork Mon Jun 17 13:50:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 029ACC2BA15 for ; Mon, 17 Jun 2024 15:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Bd9TIH+WbKUd6xwGH770DEQhZI10Wa7zRAAyumCALaY=; b=34RwSG/Q/37mdWqSnPaRTC3j9L VyCtd5kjYf3G3RjsbEZ2ZZTuxgqkc/2srZ5mY/v2WBAsNl95OFM4i8W4nKPo5XQiwkP+B5Vg2aDMy Qs7XaPOKlJCyq1xlSXUFp5F5JY70WnF44YBWO10DZMe/4p4c2io8FWIFkbX5ujp2w++YWxLSaXkC8 yGnPpPMRzcxEqjPJ3ZsSPU9dR71tGvA7nTt7N/MawGjuyjObQszx1YKW8Pow/tXfcW24z2EB858ld GB4qFM8IKZG+jNZC16F+dU2pWHfLk2wisSuBM1hPiAtXKbniqmOf1/Onjt9AEmMwEFhz/AjPGqre6 l24iJ1LQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrK-0000000BKTs-23fu; Mon, 17 Jun 2024 15:01:26 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCl9-0000000Axi6-1295 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:51:04 +0000 Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-797a7f9b52eso343354285a.2 for ; Mon, 17 Jun 2024 06:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632258; x=1719237058; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Bd9TIH+WbKUd6xwGH770DEQhZI10Wa7zRAAyumCALaY=; b=MWz7Dyl+VRGMT3tw8aEE19MSPG7Dt7nlCbHV61JNrfNYNw8IiwKuhyCo+/UBbvh7VR lxUvV6WjF3rTSDEnRj6ltNiAdCejOQGvXmLlj6SATGGirdK6RDhDnxqFGgD1OoyqU1sm gJ9GeWYNQeHmBYqbZe+OGpSldR2a7gLbTBptyQfE6Irf20i3e2YcSwvlD5LL1ZPcZtOM EFxZccu1puuFG8kSrcRmFTJXttrm94t+f25+oRKyHTYeaY/IjDHNfPxRY5YKrb7tmDRH TxzyeDIW0NaTGfGhNMpZjVA8mFfLyb0MRkHsNZ8xcdA3fWZHwSl2s8ZJi882fgC9/k+I wcDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632258; x=1719237058; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bd9TIH+WbKUd6xwGH770DEQhZI10Wa7zRAAyumCALaY=; b=FLs61569VSxStkqQzQiUZcb3KkPk15rZ3+unrnRJM+DH4nujhKsywss7WqcUWan0A1 Vq33MeWcVMGt01/t7IByu6pRnDSG5cAwFGKV0SEMwc/UFtMHgfz3KLJPH5S2FgawkiHS cKo1HMg7uj0cLanHOOtfRCk0RRkSLNBiEgOMtu2r97DfjCxL7b6qaRNFhGJu53UD3ywW aTsmpX0FW2m24udPdhtfahJv7ra09DrtFkUvOfyx30pATvXlz8m/LFOJ41/5fozjAYoo WUDvhNmfGrlYkSXKdWJFFHaxqj1DsK7DqJdoQQI+EiBBWmgXhsx5ZPFVzSx/GXIgOX5N gBkg== X-Forwarded-Encrypted: i=1; AJvYcCXc2lgTocLzn2EYyPZbabYz1QsEaBHZHNlZznPiYTk8gLfAQR4BJmb4fWsw9GEzBtGBANnnXCTuijMQ+WDFK1OnWln4x6A9m7cbnB0vRHU1/gNUGUg= X-Gm-Message-State: AOJu0Yx4exG7DDNSfgPyUUnfqZH2dGK4LW00ISc5solKjA3kSVeYjkQK GaYKcfQEqLATrO26amdv9UOO5vpwbepkxolpQcATDxWuLV0XwmPzm794mMDzU0I= X-Google-Smtp-Source: AGHT+IHIgplKyy0pftg/5a2SG9pITo7fxr5SdNNjpCXiI/wTi4jbCSV+DPabl4pWpKgzNJgkUownfQ== X-Received: by 2002:a05:620a:2684:b0:797:8ee3:9f01 with SMTP id af79cd13be357-798d2437ce1mr1017310785a.34.1718632257705; Mon, 17 Jun 2024 06:50:57 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:57 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:14 -0400 Subject: [PATCH v3 34/41] iio: magnetometer: mmc35240: make use of regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-34-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065059_524405_614A7942 X-CRM114-Status: GOOD ( 11.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/magnetometer/mmc35240.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/iio/magnetometer/mmc35240.c b/drivers/iio/magnetometer/mmc35240.c index 6b9f4b056191..ec35e9543a96 100644 --- a/drivers/iio/magnetometer/mmc35240.c +++ b/drivers/iio/magnetometer/mmc35240.c @@ -186,9 +186,8 @@ static int mmc35240_hw_set(struct mmc35240_data *data, bool set) * Recharge the capacitor at VCAP pin, requested to be issued * before a SET/RESET command. */ - ret = regmap_update_bits(data->regmap, MMC35240_REG_CTRL0, - MMC35240_CTRL0_REFILL_BIT, - MMC35240_CTRL0_REFILL_BIT); + ret = regmap_set_bits(data->regmap, MMC35240_REG_CTRL0, + MMC35240_CTRL0_REFILL_BIT); if (ret < 0) return ret; usleep_range(MMC35240_WAIT_CHARGE_PUMP, MMC35240_WAIT_CHARGE_PUMP + 1); @@ -198,8 +197,7 @@ static int mmc35240_hw_set(struct mmc35240_data *data, bool set) else coil_bit = MMC35240_CTRL0_RESET_BIT; - return regmap_update_bits(data->regmap, MMC35240_REG_CTRL0, - coil_bit, coil_bit); + return regmap_set_bits(data->regmap, MMC35240_REG_CTRL0, coil_bit); } From patchwork Mon Jun 17 13:50:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700834 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE19BC27C79 for ; Mon, 17 Jun 2024 13:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cCh+HIY0adNQEnDSauX7K8bw5POFZegMypjkhgGy1wk=; b=Ho/cSjnuKk9IAV+Cf7JjPpMN0+ m5E28AlcecLyP/u2vkGj5XzzcHgm9grT7mzJOKzlw5JR0gKtJkQNDzOv7cl7FiUiFoZyZBuWHtv2y h88JURt20/mTCewDBwvNC7CZrqIwdPV7nT4e8zYla+C6NcrAogmXCEEkKGVt2yiN/4JkGqe1fjcYe yI3jjuH95i8yyVObhNDPney1fuNFlq/YIqlmkxfsNlvuhDW087q9UuwQr76j0i8klPO58OEeW9OTw PxyZ6mNmqMGGGrncoq6YPBpEQidxUW5Vc/FtVrOqGAmq96wZQRW0gqRyT1W1yzrvVnFPkPe1tDfBj eOT8ZjVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCoT-0000000B0FD-2jRV; Mon, 17 Jun 2024 13:54:25 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClB-0000000Axjr-1ObO for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:51:06 +0000 Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-7955e1bf5f8so275176285a.0 for ; Mon, 17 Jun 2024 06:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632260; x=1719237060; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=cCh+HIY0adNQEnDSauX7K8bw5POFZegMypjkhgGy1wk=; b=UucAIcqaQDHcTui/8kfQO9B7fUrlHFBR6fw9wBwxsvmfjjtUm4ei3HLdMMPia6HMGR 6KbWvjUgFBf7SYh8AeFM632r3+d8YGnRChecDwUkVE6i8c6WF42xsq1EJwJfDFGi7c0N JC6Z5BAAhgTvKa5v41Z681Ga8ddwunIVMq0BDw2YElGSEorEgFHunXlSBRVCNNnvBLky rTlu8cRbj5yf0MoCu3DhmSCe17WP3YSLdtXP8vsH2hRnLYZKbRy48N6yn7JOW7UiTGUn C+0DkEv/+UQHBqPAyxvKO0pKK9XYWLi4oUHYUQe0/VXSdXYWNWozLPEs3E5w6j5hjN2/ XQMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632260; x=1719237060; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cCh+HIY0adNQEnDSauX7K8bw5POFZegMypjkhgGy1wk=; b=awBKmV21LjCmXEFNgIdyaeFw2SJfcUkGEeKiyZcRpVMJIuHluR+VR328tTYK+3kiyS PQxHjcMXoEWDl9sw6Wn+/cTmECmo3GGNYPvnU2PtvCFIvbxeXj0oSDLT98kltgiqE/v1 mg4ynhk7Ja5uH9i8MneZfGdu0JxDA5fWldSXlYd/TstJHN92L1jDfytrunOA9PBzeiCc 7BimUClniKJZu2Tj5T/hka063+4OCIG6oOS75FHrTjlddF5JgGYPxV3rfgRvxSBQb4Ov YiSsfU8vTXDgxL+ZJYhm3vRs6kGIBNUrOE6UzDv3BDkb0Eg24sY4qyWndgneJv7kchkh fKHQ== X-Forwarded-Encrypted: i=1; AJvYcCXOyT2tVECMzXpQIX/ZgoMIjVvOcmkJkT8ycHB2eD3jqzyzwZa9cbNOo9u1nqyCVJTGUVbWw62YWCJnmt7yq+FSl81nl6OYhXpleuvJAugXj9b9lJI= X-Gm-Message-State: AOJu0YzeB21Ci41Xcfyf3gGT+Odj/yhe9YCBFjZQo+2MIdfmHVl1oSUS x5LYaKUse1vYItNCabdy6sTNZSlNZdeT1GJ9xnIszDO218l1ppWhtSXZ3wvtVIY= X-Google-Smtp-Source: AGHT+IENId7QjpgihvaST50kcENjvnWyxdiSnte4lhDV+Skn20e41tG2cguOi5hNHA7+JrD8WB9kUA== X-Received: by 2002:a05:620a:1a29:b0:795:50fa:c0be with SMTP id af79cd13be357-798d243ab42mr1258423585a.39.1718632259895; Mon, 17 Jun 2024 06:50:59 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:50:59 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:15 -0400 Subject: [PATCH v3 35/41] iio: pressure: bmp280-core: make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-35-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065101_758830_1B22E4B4 X-CRM114-Status: GOOD ( 11.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin Tested-By: Vasileios Amoiridis Reviewed-by: Linus Walleij --- drivers/iio/pressure/bmp280-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index 09f53d987c7d..ef7f546839e4 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c @@ -1566,8 +1566,8 @@ static int bmp580_nvmem_write(void *priv, unsigned int offset, void *val, goto exit; /* Disable programming mode bit */ - ret = regmap_update_bits(data->regmap, BMP580_REG_NVM_ADDR, - BMP580_NVM_PROG_EN, 0); + ret = regmap_clear_bits(data->regmap, BMP580_REG_NVM_ADDR, + BMP580_NVM_PROG_EN); if (ret) { dev_err(data->dev, "error resetting nvm write\n"); goto exit; From patchwork Mon Jun 17 13:50:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700835 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4EECBC2BA15 for ; Mon, 17 Jun 2024 13:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1Tk27b9u+l0CzDHHIWu0wOizrcdk6I7Pf7l1UE2LHs0=; b=AhPsQ1ybhyjKqYAYabURBXmZiX EK4cGpTqTnT2nfxZ3LvoHlkN7WCocdazXTJGDDlzVIKdYKnPLHDU6ZfFZ5x8zHWq430Jj1j5jYgtT Fa9srY6P7H7A4C846NzNeN3Hl/KHMVZv7xctXZenOJU4Tw51mdiAjYU4FTQJoAGSmQDnZkXsd+v8S /s0TNMMQvubWcSLZGuGTPRph4/RnMwYuTLiwAkJRdGR6B21CZnP/zeINOAf5AK5/W6WVE27SamVlS N1iLqrZ3yWtcec+MqeBziL9G1mEenSYMgmHVfGuATlFON9s0eSKGYA9XqXZwnEGK1mNmywLCl3tmi qayiSKBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCob-0000000B0MS-1hfP; Mon, 17 Jun 2024 13:54:33 +0000 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClC-0000000AxlT-3yoN for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:51:07 +0000 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-24c9f628e71so2279958fac.1 for ; Mon, 17 Jun 2024 06:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632262; x=1719237062; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1Tk27b9u+l0CzDHHIWu0wOizrcdk6I7Pf7l1UE2LHs0=; b=ZRW2ww0NDW4aYlhCaME/E9vKjcSlkZcGcaiSyVic59a87F3AETdPZsaiz6zph5vGTH nM34dS38371T4224w6ByUCPjAhz1iL7EmF5oXXc5EfXro7/4v54ijTrMmZygPJbfgJSL LB098r6L1aYUYGFx8lg/hKyt4u+Xcb+Tc/zjFZLMK9R0s1TiN+EYb6izxo4EGEV3BX/u q7dMrn2sjsHHuL4Ng/BgqzXjBNRRuTDtjrNRZF7A3njS/G+BRc467LQsV7Vh2NVPCpH9 eBfw9Artxq57vFpZFHpjnJLmEcYYrzOWYx4HqJhFUEe5TLizMFinT8JQM56DtAYpGJXg /7Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632262; x=1719237062; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Tk27b9u+l0CzDHHIWu0wOizrcdk6I7Pf7l1UE2LHs0=; b=MXuodeK7td2ereTiv4hl/az0ikPVsYjzLXL3KTnAOaA/coPgKTtwqJHtxxPu1K43CE pdd0MpJJLk6u7xxqnzAKsVvTWzlTC1UbzAeohhy+ub0sZBPBjJhNuahhoPUJ+HPpMLIU ssCN0crnAhylsfWJz9a2jm660pmC1gG8QPHdh7M+IGmyexv4tqvAwSYU77ET0nEcMN8D svN1Ds9y+d6iEcDzO4ye9cNeN7coLJ5MmGPiZ1tYixBiOaOB1UjT8WkCC2ghmM/9/BF0 ADXv6RoNkqGO2vph9HkErZNWk7DmCI7ZWD0w1jzv0MhegrGGq1iy6OYX/ygiJU3N6ddM FnFg== X-Forwarded-Encrypted: i=1; AJvYcCU5JEprX65Na9ELwiLNcz//9EnKU7SxvQ7tAm1/1vjxUbws/l6z8dpHCn+7PWrA/TnJNm2H5c5e751lnfjIpzK6xpDS+RBx6F9B1G3H5a4cMRgBP2o= X-Gm-Message-State: AOJu0Ywnwx6bsgZHaxNOhLq512YCVeiddHlH3p7+vOk3MFLsyU8GEkhV G6bE2R12oJzpLsljbGB1zmREX4+JMVg+nsGY1iRR7fzskLnPBHmX9tCtQyeZvSg= X-Google-Smtp-Source: AGHT+IFPuCaLYR0OC2CKxxs6bVWzV0l0Y4GqKpcVsLYm2jLp2HnQirR7TaXtLxRY2U4vfGwAEVGQmA== X-Received: by 2002:a05:6870:89a4:b0:254:7471:56b7 with SMTP id 586e51a60fabf-25842853b1bmr11345694fac.11.1718632262042; Mon, 17 Jun 2024 06:51:02 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:01 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:16 -0400 Subject: [PATCH v3 36/41] iio: proximity: sx9324: make use of regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-36-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065103_207064_283728AD X-CRM114-Status: GOOD ( 11.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/proximity/sx9324.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/proximity/sx9324.c b/drivers/iio/proximity/sx9324.c index aa0d14a49d5e..629f83c37d59 100644 --- a/drivers/iio/proximity/sx9324.c +++ b/drivers/iio/proximity/sx9324.c @@ -835,9 +835,8 @@ static int sx9324_init_compensation(struct iio_dev *indio_dev) int ret; /* run the compensation phase on all channels */ - ret = regmap_update_bits(data->regmap, SX9324_REG_STAT2, - SX9324_REG_STAT2_COMPSTAT_MASK, - SX9324_REG_STAT2_COMPSTAT_MASK); + ret = regmap_set_bits(data->regmap, SX9324_REG_STAT2, + SX9324_REG_STAT2_COMPSTAT_MASK); if (ret) return ret; From patchwork Mon Jun 17 13:50:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700894 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 267D6C2BA15 for ; Mon, 17 Jun 2024 15:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MWd9RIrs8wL0I/TcIsG/QAgGB9T5+fxOkhv6E/dAdZI=; b=CyWU6j5g0KESA1hktA+2x413B9 SHPe11q4xWvBfhLU4mFjjGdbWsxzU/+GR8CGhOLDrIJx+ldW4nk4urdN17z4EVv2vqBfEmBEfPQSr iRXCl9X7IiLe1yb8StIi+DuGdeRiKzEoCYq3BZQiYfUkPOOl/ZRkZ6Ao/Z3DKK48WXjMQetz7nQnu tPkjOu1o2yW6EEAClLo4rerMFQhVgVxnxtNQTP2qXOgGAUht+VqM8Os97DbRRM1aTD1LP9AmpZ9zT Gh89WP5DkLSbEL1/bmfNW1e3+k3j2aufNyOZnAEuWcLhggGtE2DamSJm7Wps05vk0gCKKRXshf2jo NryEndJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrP-0000000BKYF-31xi; Mon, 17 Jun 2024 15:01:31 +0000 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClF-0000000Axna-0T1h for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:51:11 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-24c9f630e51so2184994fac.1 for ; Mon, 17 Jun 2024 06:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632264; x=1719237064; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=MWd9RIrs8wL0I/TcIsG/QAgGB9T5+fxOkhv6E/dAdZI=; b=zR8DSh2FKFTPPZt6rehf2AgFByGKGrBv1pG8uJEZTBSdfHGnObpry5sW0/mI2jB2q8 2W3ecplnTLFYf6LCrkJxArno6PIMUe23SjbibSIKNnHbbGaTkmIiHEGn08lImu9DSyk8 t/BC4IMNbYuurJ9/vRWffGo3adj+GpNAPh8uJPef5GAFqwu82E38/Is6fhcRuS43M784 KZ6BSRODVssg3tsFj6bsR7/u4kiYviCr7FDk/UfUuvYRuD16ysHh/S6TVfdJPsn496vy 9faAMv67zmYGjxMkmtwf49uvLPhxLDgD/ZyxlJzv0rqBLhxwNB00bn0rzQtUs8YgQWvP ryAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632264; x=1719237064; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MWd9RIrs8wL0I/TcIsG/QAgGB9T5+fxOkhv6E/dAdZI=; b=MPJ8Aq5q01PHCKtwkul63e2BseVEPqeLnmJ1Ab1PmCAgIqsQ2jHtI/RT93vj+KROJX zfQmfaIbRwzPgudbaLVv/xdVTm8l+fIIxkA4v4QvyxegX+ahsC3SCOFu3hNVIv8J/Fav 73vFMEz2T/0wUOwBgpx4fs0+/zvc3XfhlYYOy0vpdyNw4Y9OLT5x0XBbNsxOXPsFsSxz XZ78km2IND15cY8YBl/p4m53e0iE5u1AUjql0349hBwVHRJYyclHgv9CvKXN8Cu9rvly 57AlwXSfUnW3j5AijuuR8+c44VdzAw6G2f7NIy552FS37ddBh0A+qtq/urmS6XPhhzL9 969A== X-Forwarded-Encrypted: i=1; AJvYcCVADrgc2q0l9uGGK25MOo2flZLp/FdZLS+p7rRU60Ds+C7OGOv10Fx8g58144Ao42z/xnYyKMe5AtuiZ7AeQ9Q/mSnnE/vFo+Sda+2bCPD5I8tdyT0= X-Gm-Message-State: AOJu0Yynw7acnVIEWyDW5t0NJe01qShSqsyDKlI7mfe0/9r+3OA2bubf /n2ho/gZc8W9CoeO52FW2MlyDVWgCe+oakfH+v5it0zp6HL8rbC902lIAhK5M78= X-Google-Smtp-Source: AGHT+IH8uTWV+X4VQg+Hvv7+Ss0V04PvnK1VdmrqhUaV/+VFOL4UdwUlA2xHiJMwUxJKiw4xuPCudA== X-Received: by 2002:a05:6870:15d5:b0:254:8bb9:d0bf with SMTP id 586e51a60fabf-2584298505cmr11157462fac.32.1718632264185; Mon, 17 Jun 2024 06:51:04 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:03 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:17 -0400 Subject: [PATCH v3 37/41] iio: proximity: sx9360: make use of regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-37-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065105_467734_F6C28C96 X-CRM114-Status: GOOD ( 11.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/proximity/sx9360.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/proximity/sx9360.c b/drivers/iio/proximity/sx9360.c index 75a1c29f14eb..2b90bf45a201 100644 --- a/drivers/iio/proximity/sx9360.c +++ b/drivers/iio/proximity/sx9360.c @@ -672,9 +672,8 @@ static int sx9360_init_compensation(struct iio_dev *indio_dev) int ret; /* run the compensation phase on all channels */ - ret = regmap_update_bits(data->regmap, SX9360_REG_STAT, - SX9360_REG_STAT_COMPSTAT_MASK, - SX9360_REG_STAT_COMPSTAT_MASK); + ret = regmap_set_bits(data->regmap, SX9360_REG_STAT, + SX9360_REG_STAT_COMPSTAT_MASK); if (ret) return ret; From patchwork Mon Jun 17 13:50:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 20BCDC2BA15 for ; Mon, 17 Jun 2024 15:01:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=79Hx9GfOVVYusy8xA5eoh/JX07K+FfT35u2XbTC3DMc=; b=wBE5+8ne25EBeUj6mt7laZxw07 5/+FgBUXgbOJqCWdCTt1/zx5DvRWEyostamiUesBD44W8vUB1gUh0IQlvQJpVraVqdcb9lwT4cAqz c9pxKeKJgf0g0NEA5Fo6UJJrXkbZUq1fR+OUaU1JBgsFDOztYMdLVj3Z3v+t7NNM25w/nD6CoRG6L NTcjQsE0FIRn9RThQkPrMrbZ84+aFNSB0qQwK1qzQp5fI8JdLtLTa6Bc1dGhj8q0R+wOI6DkvboUD BwxZIAu2WJ2kctuc9siWlXrpsLIuQJEfssDO0lB3thela/L/RDDswLUgkBPnWfTJUzrcidkEqB989 0SkTlb1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrU-0000000BKc6-096b; Mon, 17 Jun 2024 15:01:36 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClH-0000000Axpq-2WR8 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:51:16 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-795ca45c54cso246635885a.0 for ; Mon, 17 Jun 2024 06:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632266; x=1719237066; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=79Hx9GfOVVYusy8xA5eoh/JX07K+FfT35u2XbTC3DMc=; b=XKFv00xUrOTUp57bC52zkN2VFw594bGqRYlm5MvQFRfeTpSgohnH59+eLZARE6fra6 Lyfd5PboDfmQOn9E4z/VxOAJXtbOU6sOpzDZqEtUCqi3DQZXEVLav1wfg7rT7xMlr6fP c4+dr2Ww2Ga5sOjii3axayR7UqPU9zrpGoM0G4ZJMwTNZxz4n85tnNEpqxv4fzJ6rX91 RcNv02uDl3ABHKK/JbXU8QFRYjC8bLOCrfnw9zgHyWRh2sVjgsDKfjiM7JN14QfPxNvA XLmOL3JieuI/prILYClbM0OkITGTDyI7yVfRA7FhQ8SOQHDG5mKzUfq1ytxeXCf7JO4m 9WRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632266; x=1719237066; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=79Hx9GfOVVYusy8xA5eoh/JX07K+FfT35u2XbTC3DMc=; b=I/Lp14gydvA3LZOBbyfQ3+JH8R82iN71WMHGNuvaJwtvafhtPDQST9Wm9XUGBCUp3s 9Z9ERRzhOIVBNapjd4tXnG33jOyzgGoU9kMNQy+NjypQvIKX3BGJHDQom1pArXdZjFbz /sefdDCkoRwHnHip1RdiCuSsCo53pYljmbuSRadlS1Q19OIBfJvmlKK3KVhrRriB+e5b fKF5NKYoUWV9pBB73iRggFtRpcJa1LzDXPGJcUUlZ23f/90ni91MDE1UWO+OoKPiDeYv /WVFgKVGcc3weqesUw17h3o50yCe1qfJgFWbCEvAobzy9giOkzZRJflNLXSKydQnovL9 ls0A== X-Forwarded-Encrypted: i=1; AJvYcCXc+vT/BnBRZJPvlNLx1N3rBiTQgquLEvirBUIF/kTP4Y2T5oUYjv5oW79/anZjw0/xOxj+TzvMNIwm8wPmN1SYilsaJ6CGnzGFaTvVXUocW33ZTvc= X-Gm-Message-State: AOJu0YwHjxG3dqHLHtJDObwD77Yo/tauFFrgTboPzMLDF2R/A0cwLJyC +Ya+caKVLSjsNnaSweZk1wqXlLL7UuK3ZmWRDgv1ueKwHlIHTZ7BjECXyS/yeic= X-Google-Smtp-Source: AGHT+IEx2KbRAk7Gdof/baHhrw8Y3qRBi2Hyio6LTg74NUhbwR1HRET1Zcy3yDqPrTQiSKqEfswRkA== X-Received: by 2002:a05:620a:1a86:b0:795:5d6f:8bbd with SMTP id af79cd13be357-798d26a4644mr1303274985a.73.1718632266285; Mon, 17 Jun 2024 06:51:06 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:06 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:18 -0400 Subject: [PATCH v3 38/41] iio: proximity: sx9500: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-38-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065108_017631_649EC7D2 X-CRM114-Status: GOOD ( 11.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/proximity/sx9500.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c index 550e7d3cd5ee..49f4ccd8a5c4 100644 --- a/drivers/iio/proximity/sx9500.c +++ b/drivers/iio/proximity/sx9500.c @@ -209,7 +209,7 @@ static int sx9500_inc_users(struct sx9500_data *data, int *counter, /* Bit is already active, nothing to do. */ return 0; - return regmap_update_bits(data->regmap, reg, bitmask, bitmask); + return regmap_set_bits(data->regmap, reg, bitmask); } static int sx9500_dec_users(struct sx9500_data *data, int *counter, @@ -220,7 +220,7 @@ static int sx9500_dec_users(struct sx9500_data *data, int *counter, /* There are more users, do not deactivate. */ return 0; - return regmap_update_bits(data->regmap, reg, bitmask, 0); + return regmap_clear_bits(data->regmap, reg, bitmask); } static int sx9500_inc_chan_users(struct sx9500_data *data, int chan) @@ -795,8 +795,8 @@ static int sx9500_init_compensation(struct iio_dev *indio_dev) int i, ret; unsigned int val; - ret = regmap_update_bits(data->regmap, SX9500_REG_PROX_CTRL0, - SX9500_CHAN_MASK, SX9500_CHAN_MASK); + ret = regmap_set_bits(data->regmap, SX9500_REG_PROX_CTRL0, + SX9500_CHAN_MASK); if (ret < 0) return ret; @@ -815,8 +815,8 @@ static int sx9500_init_compensation(struct iio_dev *indio_dev) } out: - regmap_update_bits(data->regmap, SX9500_REG_PROX_CTRL0, - SX9500_CHAN_MASK, 0); + regmap_clear_bits(data->regmap, SX9500_REG_PROX_CTRL0, + SX9500_CHAN_MASK); return ret; } From patchwork Mon Jun 17 13:50:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700896 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 28509C27C79 for ; Mon, 17 Jun 2024 15:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Tvabn+RMpG3uovvK1+JaZOuuhTQ0Y5v5qxh3XvN8Rq8=; b=LXyxfEQgQkUiZQC2MQ01TVRuW2 TgQBgA1PJxUTfray/syfKAxvpZ9NNe22s+ZIg+46LiNlJQJ14LawwA625xFpDQ7GfdLkny+N3SObw VWGD3BQKg5hAQ6bE+E6ewp3y1TG9h9biCacv3hk58GNf4U/jUufkbTWiIZVAjBCUS2NLN+TLpPDGx NkkX3ob7HoiFQiLY6d/JYA2Na2Lcld1F/w6g4flbcFsRsNwobm1eNaFT6T707uE172BjyKCoW0Z4B VutYIzxIVpL8WxzEZk4Jce8g74Zdo3/6BlYHgbMvEXv0IuVgzl/BfyfNtR9hhBhZN5gW3+GiL/Zed MBdGIxSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrd-0000000BKjb-28Cs; Mon, 17 Jun 2024 15:01:45 +0000 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClK-0000000Axrf-0De6 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:51:20 +0000 Received: by mail-qt1-x82a.google.com with SMTP id d75a77b69052e-4405743ac19so37286291cf.0 for ; Mon, 17 Jun 2024 06:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632268; x=1719237068; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Tvabn+RMpG3uovvK1+JaZOuuhTQ0Y5v5qxh3XvN8Rq8=; b=dlE1MbUV/3GchDyS0Lmy79A/NM8UfMItarSueaNGHATVC6HWI9X0tNztqcH2VVhvdo BwOy6ExxPHxbR9JE7iqC1yi2DsdXZ1zMXNzxcLf4WDpd8GGFInSr30iXyMLetS8kDL2p KE/WBRX1vyuzJygAnBizDsAMKjjBghuZu8EuyM5ko3Q3fbOteEXLlFO5PyfM9rKwmKEH al2gVyxpjvdJkxdiqgH3TJ9Mbu3MnaTERWKaN7SHZaFnzxQ6hKB+g6s2dMICQgnOS3SS i4a5kKVrFT6zc4Ixe25d/P4nmpqy0FVfOz3srpQJtERk5N0SFNGT1Jyo38INgHE047dy MqTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632268; x=1719237068; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tvabn+RMpG3uovvK1+JaZOuuhTQ0Y5v5qxh3XvN8Rq8=; b=ppUssrNiEBNRacHPw85KjuG5+I0uZYMxrd0+15P05Dn458iLXy+RrmtE+97EQzWygM mbsthCb+bRvhxnQ7Hnaz9cEnxSGUr8DiykA4YrQ1eNxC5WJSOHsfrMLADpcnGkKupYQn s2nxkR02Sfy6o0mwI26PXMF/K+5lX3O4iWbbToafFQd423+BHDSelAXQBfBB9KRV5z+1 ImdDdB6fyV1Lfdg8zfhhmMC0xyyWbIT4dBhy6Kg752Bg5avmXV85W8w3nKnT2ddzJQNo Q0y+LoovH0UcqEkf7YUwc7i0DnXlW1heDVB3JanEOam7jXI93aeF56mfM8WgYkFP4bHk 7Qcg== X-Forwarded-Encrypted: i=1; AJvYcCWqtE7C0SZXq+PTl2dJS1V0Oiq+MIp5WBUfF+pWuvCXKtHniVacdhoV5xi1VcdLP1cR/SpAHl5Du3Uw30k0Tjct40CLoRdU/tcgyPiX8Gp2PwOeH2c= X-Gm-Message-State: AOJu0Ywcg9lrcHzDyn2MBg9nLchBah9+nA7BZsDm9wFwj3FC5TQ3yKtB YZShmXS5WuES5oOJrMdPydmMBPSg8/x3jEXN5ubxD6FFj0SPXax8VjbmJYkneC8= X-Google-Smtp-Source: AGHT+IGCNTX7XI85nrdMwm8HgjdhSBF2upAbofRDQ4N0lo0/7MseIEDdacRNTzR/tFRJhwns3PxO2A== X-Received: by 2002:ac8:71d7:0:b0:442:198e:cb9 with SMTP id d75a77b69052e-442198e0e4bmr132788711cf.27.1718632268400; Mon, 17 Jun 2024 06:51:08 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:08 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:19 -0400 Subject: [PATCH v3 39/41] iio: proximity: sx_common: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-39-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065110_516346_1AEF0C2C X-CRM114-Status: GOOD ( 10.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/proximity/sx_common.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/iio/proximity/sx_common.c b/drivers/iio/proximity/sx_common.c index fe07d1444ac3..a95e9814aaf2 100644 --- a/drivers/iio/proximity/sx_common.c +++ b/drivers/iio/proximity/sx_common.c @@ -111,17 +111,16 @@ static int sx_common_enable_irq(struct sx_common_data *data, unsigned int irq) { if (!data->client->irq) return 0; - return regmap_update_bits(data->regmap, data->chip_info->reg_irq_msk, - irq << data->chip_info->irq_msk_offset, - irq << data->chip_info->irq_msk_offset); + return regmap_set_bits(data->regmap, data->chip_info->reg_irq_msk, + irq << data->chip_info->irq_msk_offset); } static int sx_common_disable_irq(struct sx_common_data *data, unsigned int irq) { if (!data->client->irq) return 0; - return regmap_update_bits(data->regmap, data->chip_info->reg_irq_msk, - irq << data->chip_info->irq_msk_offset, 0); + return regmap_clear_bits(data->regmap, data->chip_info->reg_irq_msk, + irq << data->chip_info->irq_msk_offset); } static int sx_common_update_chan_en(struct sx_common_data *data, From patchwork Mon Jun 17 13:50:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700900 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5A555C27C79 for ; Mon, 17 Jun 2024 15:02:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DYef8rADT2ijxxEcxYPLN7/oRY6yNh5EaRUGzmb2a/I=; b=G8ViZMEB+iWRPcYiCHUviB2ws0 BFK7JjqoVemoUFsJMUbSAFJK7EIiJPIWgrU9khHkFUa4uRBHPN3Y6M2b8Jjca/3Ewysb/+NuaUXqz 6N+xMqQJ4BR5Y8LGGWNDR6o7CjuxAiLBtlZq2X46D3aRhC96MgprciJw/4cKsZ1Gt+C7DO9kaSPrX EEsRCU+3i48KysZCk1m+owR/yioC1nzYgzpnAnOCJ1ihRo3wzumg0K7EPlZO58aE2mGuHfVSgxlOu VKEXqJ/qb3IMY3BRHbCV/mPBKRnxhFeS+vnFn9ig0wDC41jnI4p8P2snt8Q+1DuE97LNVmFsjfz0V JgKsWgwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrr-0000000BKva-3dL2; Mon, 17 Jun 2024 15:01:59 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClL-0000000AxtU-2zRt for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:51:22 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-7954f8b818fso290944185a.1 for ; Mon, 17 Jun 2024 06:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632270; x=1719237070; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DYef8rADT2ijxxEcxYPLN7/oRY6yNh5EaRUGzmb2a/I=; b=ipqFRZIl5dKVVXrBpKc5Qx7KQ3C2WGQnvnK5YVsydmN/vE8DXjxWRC/MXuB2f9O6W3 JU4sJ2z+qMnWj2kWAS5tDlAGxJ3WvRZ1pFZmMpn2cGqlFg6a5ODBJ2SlwEkwR11TiETt scZOSwXr0szHS+6b9dzkRvLgTjDHbP8MGbaoXDPUFkpzika+hZkYy+1KtP0wNJxN3qaL IwNXQokCeROeFqy29NrrwN7aNRRDMBu0xb0SLmIiZcWC3vtn3AqAluZ9WYPNtQG5rXfc boDTUZc9e4n/O+/Rz3Sw0TTEH6XjjkFx3wXLzB6rZtcEnhzdJmKtWdL7ftwOIoe6PhlY wnQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632270; x=1719237070; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DYef8rADT2ijxxEcxYPLN7/oRY6yNh5EaRUGzmb2a/I=; b=FkiSTti+eSWpXkRhw5vAQe/g6sjyXpGm4B3vArmengJNda4BhSdF35axZmIRStr4d0 OhL5X5jFkrYvKc5xnh2RrdPjDhi09wBVkWoYAZWolQQq2dFgcd4Yol8sxXHj1ijX/Qrc 1b39q+GmLbXbHJ09+VEpYTx573VFGw6ft9sIlsaOmZwqrmEZo0lvwqEoTTG3bvT8e9Yi O44MG6UYUEJtdZCEnhwz9+JyYvsoZDl530NvBoH4f3WSmlUvCwTJJkZ9vtQ+cy3g+xfu HaoBZtiKmM/sBmX1s0npTrdYOu8PVh1Dm8njtfoOhKBfNZ+8cltPpIygiNrTxQWrE31R j/yw== X-Forwarded-Encrypted: i=1; AJvYcCVj/Vw+0DIofk+VWt37+rfB7cGk+vmkMU3wytpgqv0wdJyl2l2HpcznHNdgTi5+P3RGOuoAp/1g+5r//SNuuAL+N6EQpCk21akDLtGcfep9IonCdVY= X-Gm-Message-State: AOJu0Yysq88feHl31JspY2CCGD3Qw1V0r8d+JCF0kOgPJ1iwjcLyCKHa ZXd2FX3IxgVJexg9GaNY8qFZLPdYZQvhj2IqntcZrbLecyCsUCSgEB9xdz7/hXc= X-Google-Smtp-Source: AGHT+IG+NTpXbmfTtgLV5kgHRYZJqicJgvBNrkkmD2PI5YKClqNlpZ4QFEOEqllRaBP9Jcn3G+Ldqw== X-Received: by 2002:a05:620a:24d5:b0:795:50ef:4030 with SMTP id af79cd13be357-798d242f345mr1050763085a.41.1718632270523; Mon, 17 Jun 2024 06:51:10 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:10 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:20 -0400 Subject: [PATCH v3 40/41] iio: temperature: mlx90632: make use of regmap_clear_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-40-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_065112_055448_437E3837 X-CRM114-Status: GOOD ( 11.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Acked-by: Crt Mori Signed-off-by: Trevor Gamblin --- drivers/iio/temperature/mlx90632.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c index 8a57be108620..e7de30f613d2 100644 --- a/drivers/iio/temperature/mlx90632.c +++ b/drivers/iio/temperature/mlx90632.c @@ -334,8 +334,8 @@ static int mlx90632_perform_measurement(struct mlx90632_data *data) unsigned int reg_status; int ret; - ret = regmap_update_bits(data->regmap, MLX90632_REG_STATUS, - MLX90632_STAT_DATA_RDY, 0); + ret = regmap_clear_bits(data->regmap, MLX90632_REG_STATUS, + MLX90632_STAT_DATA_RDY); if (ret < 0) return ret; From patchwork Mon Jun 17 13:50:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 538F4C2BA18 for ; Mon, 17 Jun 2024 15:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AKnuVsDBtdHGm81QL99oZtdVbIW3JEVTOu6hlNZPjXg=; b=ANeEzR1h8s/Do3R+fRxGBY9AoW 9lgI495sjN9wW37eBN9ycqc5Yi+Yq1qrcHsCihKC4HU5nryj6wTqUGhwv5oyOvy2Pfyn+Fa3RDlL/ SnRKwUqJbqGd3X2JtnkTXt7+UFSyXg9u1a8hBO9z8GO/X9Bp1TIiSCwRdYaB7HbCl7+8jJhmk+b3x 0qL785S2+M83A3PJVg6amZUcjzX8ReyyiDywHnkjeqf0vefqOO+s3SPXG157J6Afam8L3bEwkL6ly tdr8D0+/1t7BCb6TRjVxJ3G/a9pePUTEUvm6RsXTIqbIuuIYNB4SVkRpnKpgcncjUp16ca/jXTyKH zvFe39lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrk-0000000BKpk-2AsK; Mon, 17 Jun 2024 15:01:52 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClV-0000000Ay1N-2Z7M for linux-arm-kernel@bombadil.infradead.org; Mon, 17 Jun 2024 13:51:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=AKnuVsDBtdHGm81QL99oZtdVbIW3JEVTOu6hlNZPjXg=; b=H4JKiuf+/H2K2pDW7QUh8s/lry 1A2r/xlklaU2Wyjs+Ro+g0ZJ9T0MRGcRzKS348Un9e8wCxNhX42YRkU1MivwIWIA0qboEWDz6589e W+vGinfM/qbbVVkRsvj05KcP4lBRyh6RjlU3VF6MeI7ylvriYgI7DtPpQKUUoHWOkxA08ULAoVA6j 4kuvSS0CdQjHlJwDq8DrB8PoPEhTiln5Xmt0oEXkFW8nFqdRkdNJBEZyqE6j7w+VhWXMFOGe2Mo6H dwzx1z7xIrMEe9B2LBYsEP82yeVV8hbPDQ6AYm8Iy8Vgeh25RftSmlcnGp/jwcoyn1q9Lsh8LUYUe Ih5TT0OQ==; Received: from mail-vk1-xa2b.google.com ([2607:f8b0:4864:20::a2b]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClS-00000006RE7-0U26 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:51:20 +0000 Received: by mail-vk1-xa2b.google.com with SMTP id 71dfb90a1353d-4ee5662fde8so942855e0c.0 for ; Mon, 17 Jun 2024 06:51:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632273; x=1719237073; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AKnuVsDBtdHGm81QL99oZtdVbIW3JEVTOu6hlNZPjXg=; b=hvoHpOc6QZ+3tKUNT6L7zmg0si9jzTodZx/J7P/Cnf4N+u39FT8HbpUc4ysi5gkJZN 6vZqOfISn6P7YhLdjOGiDCuJuZzYEgBAy+ntiwUVtpcjnDDRB0ZaeaaN7CBTfCBo7a4F vexW/xDL0tk8+5FmTVtQr+Y45612FiDD3Z9qc0MrJ2R/mgjmuBN7SKW9rsTzLwH09pzd FfC6QZ2V1cWxcTXWOo+GwEUJCe4A/3yH3tRUfmnnCkGt7HOCjPKuxj5mQs3CT4nYCb/w LpPmXRWXFONhvZANXLRU//xRkleFwLrDVYpUdfI35ri5xB6fBhPx9YFR7sYpf1lJP1cp Q30g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632273; x=1719237073; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AKnuVsDBtdHGm81QL99oZtdVbIW3JEVTOu6hlNZPjXg=; b=gxz27hfFCA4cdniE6uOVetei8RYWhDRlh3dIZRAgWvNakhHXPuwvrLt3TxI90FpQZn sKvf8MwmKiUpt6KxOB4s7Bt3xAAbZO0TS+DA9yPh0yOrI9QcR+LC2I9HEoxxtbB+7DIA g7pudR4D7X2r/+rppHFNTMV0JFRgY1OwHGRUjuK5wuhi/iHtctAgHSK6BL0oNRzIt9uC GP0oFErj3TnF4/8T1oPSGYgvE2TPEGXi44De+QAvBN34+sIJn7HR9mLfMQ9+UjSBBuIM 2N7X4lZnD528HbDB58obqIOfT+KwfV2ZZQML2/X6omCpwmPRraphqc50WkuyaR9i2fqO Z60Q== X-Forwarded-Encrypted: i=1; AJvYcCXQLFn2bNu21g1teCxq4/DehcxF+VXJcuEw4x7Y6BqpHNfhaMuwDft1FogqVMtqtGWZ+o6drqQsK5eGk2HBtZ0nm/o/oeXW3jffK0gcXEQDPdFzrZk= X-Gm-Message-State: AOJu0YzsAgRBV4yK1qgoXFDhuFncCf3qsDJ7UB4Py/L4tWcvnNJ9HUOJ 9yH7hK2wbf4VklsskSk76l+1dJgf8WVlwEYFulQE1Ndk149JL7UDj5Fy05R1yvs= X-Google-Smtp-Source: AGHT+IHFy1tuFMwxa7P6sFsjYvAHUS1dIKxzAj2HLRYOAmnW2Gug4qjgVMG/WpGom5Qua5PdHz8vPQ== X-Received: by 2002:a05:6122:915:b0:4ec:efca:d2b with SMTP id 71dfb90a1353d-4ee3e59c40amr7925275e0c.8.1718632272678; Mon, 17 Jun 2024 06:51:12 -0700 (PDT) Received: from megalith.oryx-coho.ts.net (d24-150-219-207.home.cgocable.net. [24.150.219.207]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798aaecc004sm432892285a.31.2024.06.17.06.51.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:51:12 -0700 (PDT) From: Trevor Gamblin Date: Mon, 17 Jun 2024 09:50:21 -0400 Subject: [PATCH v3 41/41] iio: trigger: stm32-timer-trigger: make use of regmap_clear_bits(), regmap_set_bits() MIME-Version: 1.0 Message-Id: <20240617-review-v3-41-88d1338c4cca@baylibre.com> References: <20240617-review-v3-0-88d1338c4cca@baylibre.com> In-Reply-To: <20240617-review-v3-0-88d1338c4cca@baylibre.com> To: Jonathan Cameron , Lars-Peter Clausen , Dmitry Rokosov , Michael Hennerich , Cosmin Tanislav , Chen-Yu Tsai , Hans de Goede , Ray Jui , Scott Branden , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Saravanan Sekar , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , =?utf-8?q?Nuno_S=C3=A1?= , Linus Walleij , Jean-Baptiste Maneyrol , Crt Mori Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Trevor Gamblin X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_145118_481416_48DB642E X-CRM114-Status: GOOD ( 14.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König Signed-off-by: Trevor Gamblin --- drivers/iio/trigger/stm32-timer-trigger.c | 34 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c index d76444030a28..0684329956d9 100644 --- a/drivers/iio/trigger/stm32-timer-trigger.c +++ b/drivers/iio/trigger/stm32-timer-trigger.c @@ -158,7 +158,7 @@ static int stm32_timer_start(struct stm32_timer_trigger *priv, regmap_write(priv->regmap, TIM_PSC, prescaler); regmap_write(priv->regmap, TIM_ARR, prd - 1); - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, TIM_CR1_ARPE); + regmap_set_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE); /* Force master mode to update mode */ if (stm32_timer_is_trgo2_name(trig->name)) @@ -169,10 +169,10 @@ static int stm32_timer_start(struct stm32_timer_trigger *priv, 0x2 << TIM_CR2_MMS_SHIFT); /* Make sure that registers are updated */ - regmap_update_bits(priv->regmap, TIM_EGR, TIM_EGR_UG, TIM_EGR_UG); + regmap_set_bits(priv->regmap, TIM_EGR, TIM_EGR_UG); /* Enable controller */ - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, TIM_CR1_CEN); + regmap_set_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); mutex_unlock(&priv->lock); return 0; @@ -189,19 +189,19 @@ static void stm32_timer_stop(struct stm32_timer_trigger *priv, mutex_lock(&priv->lock); /* Stop timer */ - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); + regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE); + regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); regmap_write(priv->regmap, TIM_PSC, 0); regmap_write(priv->regmap, TIM_ARR, 0); /* Force disable master mode */ if (stm32_timer_is_trgo2_name(trig->name)) - regmap_update_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2, 0); + regmap_clear_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2); else - regmap_update_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS, 0); + regmap_clear_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS); /* Make sure that registers are updated */ - regmap_update_bits(priv->regmap, TIM_EGR, TIM_EGR_UG, TIM_EGR_UG); + regmap_set_bits(priv->regmap, TIM_EGR, TIM_EGR_UG); if (priv->enabled) { priv->enabled = false; @@ -498,11 +498,9 @@ static int stm32_counter_write_raw(struct iio_dev *indio_dev, priv->enabled = true; clk_enable(priv->clk); } - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, - TIM_CR1_CEN); + regmap_set_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); } else { - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, - 0); + regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); if (priv->enabled) { priv->enabled = false; clk_disable(priv->clk); @@ -555,7 +553,7 @@ static int stm32_set_trigger_mode(struct iio_dev *indio_dev, { struct stm32_timer_trigger *priv = iio_priv(indio_dev); - regmap_update_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS, TIM_SMCR_SMS); + regmap_set_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS); return 0; } @@ -683,7 +681,7 @@ static ssize_t stm32_count_set_preset(struct iio_dev *indio_dev, return ret; /* TIMx_ARR register shouldn't be buffered (ARPE=0) */ - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); + regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE); regmap_write(priv->regmap, TIM_ARR, preset); return len; @@ -757,9 +755,9 @@ static void stm32_timer_detect_trgo2(struct stm32_timer_trigger *priv) * Master mode selection 2 bits can only be written and read back when * timer supports it. */ - regmap_update_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2, TIM_CR2_MMS2); + regmap_set_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2); regmap_read(priv->regmap, TIM_CR2, &val); - regmap_update_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2, 0); + regmap_clear_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2); priv->has_trgo2 = !!val; } @@ -820,7 +818,7 @@ static void stm32_timer_trigger_remove(struct platform_device *pdev) /* Check if nobody else use the timer, then disable it */ regmap_read(priv->regmap, TIM_CCER, &val); if (!(val & TIM_CCER_CCXE)) - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); + regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); if (priv->enabled) clk_disable(priv->clk); @@ -841,7 +839,7 @@ static int stm32_timer_trigger_suspend(struct device *dev) regmap_read(priv->regmap, TIM_SMCR, &priv->bak.smcr); /* Disable the timer */ - regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); + regmap_clear_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN); clk_disable(priv->clk); }