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: 13700771 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 36A55C27C79 for ; Mon, 17 Jun 2024 13:50: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=a4Rd0UPd49yFwtLyTnzOJp8kEsHRpcaNTAt4XwA2K4M=; b=k4E2tlhxSo6i5o h+2qt0z6o9LHWUigLx8FNb/Bwp1vChJSothKUIOLfRzFGcufPAatDU6F/bozA+uXwXN/6p/jnoEnB Zy1UnsMuezhsdx0c+L5UAM6jiU/iGPRQ5eCt9f7w+T6HfhNYZsPTtnIcfogo4KKJtYUqEtTt8F5pi BDlOi4FBVPxusltfAGJ83HlPKCnv0D1L+cCbIE/b9Nw5++mhjrKOeF+KegteGV9Tijv4NEtcctn1A wb/kRmRwEbTRpJszrp3Uq4ntdjYHEm/ICZ+DcKGqeSyZxlBJNSkpyOPfHhtp5vOSSixlWaAhstEsq m2b0cKYV8ABPqaaV/F5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkD-0000000AwpN-175a; Mon, 17 Jun 2024 13:50:01 +0000 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCk0-0000000Awgn-0cfG for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:49:51 +0000 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3d21e00d9cfso2635055b6e.2 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=LPtmvptyAuq3CZ05kmxRGTzV8Z+DFKM2gFHhxnX2OxARHZcQ0BA5Wqswc6LPFKc+Ey Kj8OChUnX7ZCzYq8YI45l52fgIhXie+K7DqyNru3NmblMWHQBuoYVrC35OZNgqeGTsHZ r9b0WIr3NPFNFVHMFZekxOqEJR3lQFNEFaGAzWIKbaWLMDFNu+hEPseF4gbLQ3Fl6aQF 6tpg/hmwE72+ic1pOoBfZj0BAE1Zlld3ESXNw8SMmaRx6pgxrCcalWFskwBWdY8B6XAP aIAy9qvH5ZrI4t8d+2ue+sGl6OxYg9u5+cu0ERa6OT+uSnzxafqr2LSs1OOe1sMCUQ90 B9Aw== X-Forwarded-Encrypted: i=1; AJvYcCWtmm61g6844GQl+bXvbmFAS3wl6mqFS9uo9G9gT0p3wbdas+9Ig9j0DjIxrsdRl9VhP0f/ABi3HZKxuUzSVeDgqaQ7i20oMCV/cIhu2wXJ+Xs= X-Gm-Message-State: AOJu0YyZ59EGP8gfG76RWDIua5nGpz2Kj1RxRinxRdTCkl6ijE/9nxr/ 4GwgrhExgYTeyCx4HrldFdg4vIirCLLiHzmKACNLSu2R1h5NgOnbu8USr3U6OC0= 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_236407_B16A125F X-CRM114-Status: UNSURE ( 9.51 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700773 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 31F13C27C79 for ; Mon, 17 Jun 2024 13:50:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=fwf8TBxcpdn8NBOXmyT8h96rldzhyFLVQSx6pxRDy7g=; b=PNHeR6u+Gkb0ft JhFuQAeT3+Jr2xSrzCbAG0EscBu8ROx0Z8/0s9iS4B+hzcT7kOc13BtsIEtPhBPZGXqc5zMxrU5cE w/Fpteqhtz0/3io58D8yTBv2cPm0OSmvtKZcPFdelCu1urkh/FFoZ+tZCi5swJPBT6Y1rsHY1Nv7v 9JEu5pWxByrF2DmRk/1VXakbvkwVKXfkwftEiIpdemd1zt5sef/6SoJOFtaB+86TbmoZ1lfV4I/rj Gm+RgIfIMtaKMHeJqDNFgWULUtWoc5UeRbi69+D400AoHXyl5DaSJgmZJ5NtoEvXdZaZKS35tahRv /gAHdh5X2p/0FkqCkoAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkI-0000000AwuY-3QQe; Mon, 17 Jun 2024 13:50:06 +0000 Received: from mail-ua1-x92f.google.com ([2607:f8b0:4864:20::92f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCk3-0000000Awhw-4BLP for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:49:54 +0000 Received: by mail-ua1-x92f.google.com with SMTP id a1e0cc1a2514c-80ba034bb3fso1369425241.3 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=SdpTMw1PGpviFGSnlUnCsGgv3t7mQqsw2WuxkLXGTpGFn3v00t+rErKU4NK0D1xzC8 1vEFH3tq1KVYSBss34ece4oWvSMF9SVgu82K4yV6lC+lmvH3NK+3g4wVNrVkgH3cs9tS alyAk45s62qgxbMBUt8wgiSjtb+asgsfCP/YTfRVRv9OvmLxAFCCsz7xRdZfUVQLf7sS dPE1TMTJIdr6ayRsdU2DQ+tpqofaSRZoT67ycQEAkVas1wQh+ZExTR5iHRYMCfB6e73e Z8iYP0nRHuX//7z0aPyymeYEls0gy8QjTw4EY9yXFtMxVd8agFlP3I4DA6yfdAklssAC S3lQ== X-Forwarded-Encrypted: i=1; AJvYcCVrmZwWTsBcM9iXLT0vIscPc4xZR51tK0P49GHP7zIothiwn8Lp6Oep6Z7T884QDdLLCqP5qJm7TkegaAps5o7wvdQqtj7VteK0+sITnfowlEk= X-Gm-Message-State: AOJu0YxbG5fSf5Miwz0rpJety6LyiaESADtlNJnNSlR41lnV+/7n4sSh iSNjduTFIvf9P2g4bQ50uUpXNv1QgyFAA5vEg0A5L/9bOM60yU8TE9DH247bJp8= 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_262974_3AE2CF9F X-CRM114-Status: UNSURE ( 9.65 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700770 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 21D2CC2BA15 for ; Mon, 17 Jun 2024 13:50: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=SYIFOTuinNWw9H0+koFafqPnGBUvI8/piBoBtG7nVTY=; b=dyUYUxxqT0hIFB +sP428Mp+XdIaLpqjFsl+2YBjuf0bZyFV2MPchWbiTWm8cHZ6he/YPDTgmbiz2LNeaI1Cce46YIBq +nJXE21HEQI6NzrdDvu4NoRftJj1y0Q+lh17dPi7sTDOtdappCstYKcJzmBjoxSpFiLZnmxZhSmJa GOHGk+w4xOmXcq9on4iVHl19R22Ne90Q5opll6KN1rdJUPbVsp+SLJYK5mlfA+ljPyE23eiVC4WmF 65HsPprNkdF+CjemuIvddFPIxxYf5+eq6S+5ajN21sAfH01pXomWZyQSEL4Vwx8cPb/GZgF5jQWwW vGcnz7Ogux1hV2EALsJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkF-0000000AwrM-2rWw; Mon, 17 Jun 2024 13:50:03 +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 1sJCk3-0000000Awih-44qZ for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:49:53 +0000 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-795a4fde8bfso264070685a.2 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=MWFfd8ZGegtUN7MDZ3C9uufiZlek74qzW0pp0uUZ5VHlTx7aksqxG2FK+efedN7aL4 tmXh+twsGyglNb1GT6FsYD+2+qfolIljKF0BSDCB5dr6Do6+UrTkhT5FTCU/u/u36Qaj iLKV0uRgIxGVEvgwG7wunzLQbYxN/PE73lrX8SE2YKoJ+CzQoj1CiaOAMUzkn0Se7JmT nonAwhHeNJBfo+VM6gbjuykJm7n2FOa96jxaZxOHxRS6FGfpOK2uzxhsxR7c7DzPigAa +1TcxOQH9dnK+8KK8L34wsSw+TBvXee4N5r1ORCyJBrfjtLJwiUHTPDL3O9iK4JZJ19C as5w== X-Forwarded-Encrypted: i=1; AJvYcCWtpcFIaF/KPPuk1e0KlaODEcrHMdoWtgIvzgXGHOUTyYcs0icnxgKn6lWvYaO83kQjWXRx62M+tNE+pwBpsXM3Qj4vXN6W2BhazVO74XLKpE8= X-Gm-Message-State: AOJu0YxdXP5uaRNGVsO+EHHMcxWbOCenkEhW2+l+coQNLBQH6Ptcjmh/ HdcCHqIRSUT2z2gjSfJ7+Da7cKh+HwAPgnR7obqT9vxzOjlTq70KSMIIsary4/0= 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_232640_2EFB7347 X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700774 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 51772C2BA15 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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=rjMLik7gl9RTTgRDjpva/kTZfC+rXvE2TljqGwJvGYQ=; b=X2dMm6b05M82kl qBK11+yyK1C6CJKCvVjukIeeuwdG9r1+bRRgFj2gIe5aVPxwFyDY4vnsKQ7VCEg1SWVYWbjwecsFN qRMMZ+gsvNgEOQCFeBwE+3V0i9e39o6zAPAfFOVALmSamFbLkmmgGmGTzeT7FlB7REWHY8jqdvEvp IXG5huG6gb/SIzAOc47pl2aFgGassJYWte0dTEiQXjHe3hVGcaQP66qlujAbSaTJ33oNYL04MfCcu rpK+d7LtcA7btJyuLLwV+0UlT1y5T/zqFbW6rw2Mf8LZt9eWiVV5dbcsKti37R/AiqEloY2Mrn5jT XsCD771etXGcVPmceSmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkO-0000000AwzH-0jJv; Mon, 17 Jun 2024 13:50:12 +0000 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCk6-0000000AwkX-3VrM for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:49:56 +0000 Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3d227b1f4f0so2385960b6e.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=TnnP7MnqDbMrEUBoB97+pS6jK30ZrFndunAwd8Gv5cdY41y311y8xiZXwBS1TxcC1+ nNEF+0zgp7fI738zcw2eoXTn2u1Q+JSImg9uy5O1p+USr0DejPn5vDDVh/JlMaIASMxq 3UfLwpmPf716tTzn75U7++AKPyU6vhImWf+JBljQnVxToxO6a2aD1kgdCXyPqyCQSJzc u6hdCDvj7GMiQrfwzfvkq0KJAppCNqy+WLsyEmwM19jqVpITFnqNhck43cGLMAubqeSr 66FWUWBRem6AtpEyZCZ46ZXd9A0cEPy10alVrTGoval1ebY0sDhJ/7OXQ7JYuCr69XaI CVPA== X-Forwarded-Encrypted: i=1; AJvYcCV7ila6uV3O+/54Y9aC8CBrjYEhnDEjfQVeqvSXeSvwto8oQJ9MLl7GbRUIpCx6RhIuPQiXTfxj+lwVMkaBHNZ0DwYnFBod2FJw50N31hQBM4g= X-Gm-Message-State: AOJu0YzYBRhpFyi779dT3wrzXj3tAN5o2PIhFJnmGO9YODVM43K7zg9Z znGoqMWc3ZseKSjBYTzvSh32ApMwjO3fK4GeENwS9nDjmoO7r6/NpeAhsEDVeQM= 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_084262_C317BA94 X-CRM114-Status: GOOD ( 10.44 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700775 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 9CB49C27C79 for ; Mon, 17 Jun 2024 13:50: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=ZldQVknX7A1fT+Dk9le3szaxWPs3dos9cm1iksar+Ik=; b=U9ypaIsC/wdBzp dWZQanqM5C6hDAGm7ZIpMZwhfJlpFhkji68F3YVw55p8NhAZeYovrWxTXN5P2BjB9kk3KP/GspCQo wACeAJcOq6LRQkwHnRVPpwpN3JjCPfM846SJtrIhkB6huAu+8NOW0iqkPHviibPJ/rXfjsXh8UeaW khAJrr0m2nu0P0o/Dil+e1381ezgsm4h9+6S6CbqAntxwSFa3ElxP92NiwpmyuDwFue8dN4du6Ss1 jwGGxrZRsq7PeTu0rfE5VNEQGdQS1TkbGw7ygbjJmXaNmrdu7geOyQNY1peyB4+KotQ+Kkb8XXoGs QenpNETyOz5v37Mn3Hsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkV-0000000Ax7i-2wtZ; Mon, 17 Jun 2024 13:50:19 +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 1sJCk8-0000000Awlm-1ZO4 for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:49:57 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-795fb13b256so419680485a.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=wWw4cPYK5ljadhzFBhewlPNoRCd0i2d7z3jd0PWA64Qun71OGaM0vk31u9F0aB5g0/ 4dhs23/BXj+IXZL1/LFv13lx7/GuCRhblZqAJCX3gpW1Equt/PsQgMJYXIaQTvVORiRI t+GoZLEriX3ITY1CPJ3cJliq5x4jiUaJleX3S/E9ZroXA2zDDFgrClNuFkyKGZ61SIrf lYYaH936yZNaD/o2kgB8mjpmsyfDcQUmsHGqp8+IzC25T6qYX09HJSNN3pD7Jf9bFTja r6uoj2Giw1pSbRPDjE/xBOMz/rWXI886ZH4cuA8c9WSAd3Bf90F1Hey1XRBJz0qSRbic MiJg== X-Forwarded-Encrypted: i=1; AJvYcCUXhCSnzwruVYpJdAho2Kmubrc33wn/E9cusGzmw9TWTHINbuM8PoOzni7xWUEF2v0/VvdbBzu0fNl/rwmeKVySQ76YLzaNhx0We3Efc20usyY= X-Gm-Message-State: AOJu0YxbgZmePA09xJKaqRnLISCoMnZsAal//8+hQIfERHPZ23Zu7N8v kaUSksbotqF9dOYpvbGlQwj/v2nhxC5fajMc9YMOKbZRyPptw7q5e7JqkysptgU= 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_064956_461287_4C20010D X-CRM114-Status: UNSURE ( 9.30 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700776 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 9979DC2BA18 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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=WeZKIWYBvEc6pmXHulXD23/Cub67+7Nh50ngEjwZYWs=; b=daN90e4OCDrDKW h2O2VeC6kiXdjkOAXe9386x+mCRP7qh9Ycij4ji/CQa/V4l2O8y8kEKSVQBbVuZSPtlwh0dPa8TKU Gz/sZkjSOpn0HL2gFBnqlglu6rjbBb9Gv4kn4GGJ759O1bIbjq6dzS443HsmxprPF3ey1qBdHnJ6f HZVDghhJSHqzTlYtEImbIOWyBgfi3M9TqxaJzicIQYui0UBib8NRWlPPW2bUukk38mVrit6q3JdQj MJowYQWtDxzBDnSKZpk8vnacx6sHpodkDeXhTfpcmsFVr9J6h07+4NtXf10bf2DhfFK1l3nQiuWfO HMEejDmakBP6Neo47f7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkc-0000000AxCm-0vyv; Mon, 17 Jun 2024 13:50:26 +0000 Received: from mail-vs1-xe33.google.com ([2607:f8b0:4864:20::e33]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkB-0000000Awms-1PwT for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:02 +0000 Received: by mail-vs1-xe33.google.com with SMTP id ada2fe7eead31-48d9cbfe0ffso1586566137.2 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=m/Ny+M2r/wRLuAI/4nhctt3Qdut+hv4G6JF4AsqBhRp5gkrTclWvRltoZYeAKT3eTM BtZX6MsVHSGB1QyZBRC95Nrfxv9DX1dmhwZPlnW+1mXHmMFUH14bbGWVpE7KTnZ7uewI w2QQnQW48bp82cOzIWdH/17IIBCgDCmvn25T4NXPTZrKBfddpXSPFwRDBT64H5Uyov8n hXpbBoSAu8sZisX0ayxe3NoXu7XNJzUKe1AUIYpMof3QAFb8kO1alSu5ZM55NojHt3p+ jAyfcKqBPuXYaQCuURWoxf+DQKBd/LyfDf4y3CrlamRfpxA6yZBAe+mxzJVfYhU/CNFo AA4A== X-Forwarded-Encrypted: i=1; AJvYcCXFQimJPg7j6Y1mtWHnTEbsKE0dPn7G/AdlxS275vCnnTX7gX1BMl7rFQ/i3gAYTXlZYSD4aeHvqHhPONyTH8OrFUhV0hheZXljOAzh3Qw34LE= X-Gm-Message-State: AOJu0YzgF+avmsd3Uuf8+KDjHohhfFtiK6r2QzmKw8iAksypVK51kfFA fy6M+H5yqNBVUaY45aYKBzIiYh24moIZ1rRDbMKuaj+5NwVG/Et2XffcMHzmwoo= 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_490412_E016529D X-CRM114-Status: GOOD ( 11.14 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700777 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 8C8D4C27C79 for ; Mon, 17 Jun 2024 13:50:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=8tTuMurwVewa8TSv6lZRNCYd2ok9C2jrdfh2bqJkvjg=; b=DPXa4arzaN+GpL BL5Lw/HURdVcUmYGH9FF/2k9BAjfzg6H9db8/kyrwvBfToGmbD8zazh4LD/hhCoKEEDP937GG1HFW KKULQryMzMo0rIxDelYATye7S1GtacPkxEBxWNF2CJKj2YOJghrcd6So18qjJ1C8eos/TilxV2IEz V+8lnzLYPTfNsEQraczPbzHqO+mMcTbpMpz8C0/JiUyes2C/2W7dYjtcXgtWWsw+MgpDeY171OwCp O+ookdvWCzYHsFShmODJjLFxe8IivxMNO+n1UUIqIQRJA8cUP2gt5h3oqhs2ypK7iEbH84jhMy7s5 uy/hj3Kwdk8J0bEO6ULA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkt-0000000AxTZ-0APn; Mon, 17 Jun 2024 13:50:43 +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 1sJCkE-0000000Awp1-0ibZ for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:04 +0000 Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-7955af79812so246233785a.1 for ; Mon, 17 Jun 2024 06:50:01 -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=BpzKNmL4atXSfArmbpr0DzJDUuVG3BC46j5Ik81mPq5N7o84SEI3T3C89KzvsNN05T 7hZWzOsjGzEEsmH+PcuuZuqCoOYfySjSbI56McxAvbvcURyKnvPigCxR+12E2IjOQ8l0 YXuov3BRjfz2HnZrBWM6LTpukUcKc+3hAhCRbFsn7nrG8SWEGWs5OvEs/CuyMLnmJB2y r3ouRZoQuarWpEGVZCHWqzGt1SnP0mAprmu61tofq3n2DUJO+5HCeQoFo30LR9G+tmwl /y5fBc2D1sylpJKQh9q5PI8NogrdPM6VETrcX+hkl75eM+h/G2eItwL2ixb1no45oFz0 hIag== X-Forwarded-Encrypted: i=1; AJvYcCWlC0ndL+xkD386McMkTDbdZqIzzvO4nXY6EUE9mxpk6k8q9QhADTuuaNjID/Ar96SfA8YKVdaem4zrla89NoAYGPK6z8D81QIuoE6mLEEk0fM= X-Gm-Message-State: AOJu0YxokCUsz8GIAdEvP1oQ7yVnzOIiry8MiX/xs3Acx8T1RVYFOhIp Ju3tUjDitN9qG/MGkRyrMQF4TSd83bwCG2pDE/KeYIvFoc5+2T74AiljlVhZC1w= 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_065002_470808_4412ECFE X-CRM114-Status: GOOD ( 10.40 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700778 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 E63B8C27C79 for ; Mon, 17 Jun 2024 13:50: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=7o8aHylO8oHvC66W5K9+/dh5P+0g3DtNdYwnPOLcXIY=; b=elVLx81AyqpgVE wxdZAS13XWEM1xlw348oepUq4lumR9o5y+5ewnIOCD1d5twUKQtkJJIcaXP8Efi85Rs96n1eVEz2p cBhnEp5zTuzHNwJJ/yGjmFNy/1MVP5angaD9Cgvz2SV/u0MWz0KT9fpoZcvb9g2nyFr5Hxf8mrDD9 WZHlFr/zWMu1weg1/quvgzuxa84b6Z9EAB6z99aMboVw/pDgqIty/kcfRZRlOas5YdVMgMnFAVnSV fIOtq/9R0gjfVtURkVQRHVv4NlJBs2Ljm5sDtNCTlr3oItQKoajQEpv7ftvwwabRLgjul7A/P/rLn rwkhjJQBFyBQK1nr5CqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCl2-0000000Axc6-24OX; Mon, 17 Jun 2024 13:50:52 +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 1sJCkF-0000000AwqO-1oh5 for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:07 +0000 Received: by mail-qk1-x735.google.com with SMTP id af79cd13be357-797dcb558ebso286406785a.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=VidjXZtsMtI6uK87ZW9MBqChrhZ9s9WgmtLcR5X9p0WQJNGxu+VMi7lev8ZIWoFl92 Ykl3O3p2pgW3FDg0A9ar1MNkfsFZmwkwGiO+JMSIfNxLsOwBplxv/QETO4IaPbaPDsum 6bwVEARrxa9S3BesKjm8hNnKCHI+65zUk9WCL6ZXYlO78hk3tDYdYyQhoAS2z4Q9G6qB HMNndP+IuHH3/Q0+y3g6kElc38i1C1K2mRELS7Vh78P3f+oxroQDunYzOAkOIZlV2Jmi zlMS2s6gHfWEsvTk9enXm4oGB+IuZ/Mqfpvm3K3LBelIJk9rxNsTEz7XJeQgAHt4vXyU e4+A== X-Forwarded-Encrypted: i=1; AJvYcCWH8MawagFFE8dvqfvNqQlmFlImkmtGMM1bGbDPFu6YBYgM1gPW8KhLQbf2XO4xnwi/DVUAeAptOpsHQgzfMm1Z2ZU6YqRqGZhg8+TnqQyNFGs= X-Gm-Message-State: AOJu0Yyo0W2dvk13UVojTyetboPws3ApNmDTFOf7iSEXHX5tCOXjWl6s Nv4OpvuO2Bpi1LOa2E3inh8TsxuGsOqbmixLVIRu7bLNM1s5c3frT8Dohf6aAE8z1gTjxJWMbuG gOT0= 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_697428_D21C9807 X-CRM114-Status: GOOD ( 11.50 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700779 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 03943C2BA15 for ; Mon, 17 Jun 2024 13:51: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=8z9oNpUUz/ASqoIOGoyT8kAEkzzeVM71NXW61sPS29o=; b=eQUxGzihJJGMWf faLaoa9uAMnwEtdJ9aChRnsXM7GZkH+if5BGTzgw2ERiUEc0hQWzxv0KweguTjwCffbd46U6aF5n1 bYc/q3mhLha74VpSLKyLKclgMKUvhkJgMBkopF1abxlwhp1uKrv2o0z5BTHkrLMOHc8FNB9Foncbn jA4DiOG2QbFHpJ0f9IfnOxS47vmzOceITg0mQ3UIH06V6jRoY4S2udgP10aJ6XHTeZnLZ9Z/KOi5f t8GppPP2jjaMDNirzFrTUD8sGGnnSc3JKV8mJdW9Az6fGQMHheXdPBJnIgkQGk4mkLUPkNd8IT6Lf 0/x1tQ3kiqro88oRQF/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClD-0000000AxmO-3IoV; Mon, 17 Jun 2024 13:51:03 +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 1sJCkH-0000000AwsV-2ue9 for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:09 +0000 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-7953f1dcb01so389035285a.3 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=Tku54kr69MfTIusI+kBLvU45+w+6BAhsJEAX8xNHTWfVYJVbdA2j8K9KVAx6K8gNZS z7CSL3X6hlEUnXfVnHqhkqu3ON0HBj4Ls8M5GaFZTYv+S2ridSbgan5i3tdGTDPNLka7 xYMXCgAQOWRYOzV9qOfYTw3QwcG6s5OUDvGDY0J20uSU0RAUTcLW+iyXTO3EGuGvZti3 ykRRAxHtiysypCM7y+iavnR/u8m2j5yTzXq5hTdA0Ee2L2RWWyNeoeGcTnMt+BPUt77j nLGWlbxt2tVioi7uZVbbKe2JNTN38V1F6MrfpDLbCeIKz8jd2vPwTiH1nvTf3X7BkS1Q bBCQ== X-Forwarded-Encrypted: i=1; AJvYcCUvQhqt77XdZHcyfo+4b7yjq3qdBi10zISFfYE6+p5PUVa+86dEqKKnNI9puiG6CgbW0MGKl3SUof3IbA3eihBasfnz/dOab4V86GG20Qzza6Y= X-Gm-Message-State: AOJu0YwFfUN+mXdcl02Bd8hGAFW4h845ljviZetSJNQ7mzaY4eYAiESH PS+2gcbNuBU5OC+jG7jX+xr46+7sq5sHDhp4c1qJFLQ39nxGLSQsup6MRZDzTDA= 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_419288_8D31259B X-CRM114-Status: GOOD ( 10.03 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700780 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 9D984C27C79 for ; Mon, 17 Jun 2024 13:51: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=46eXasSDcRrsg87oH+gbPHumUXdfNkrpkHDT5JJSZSc=; b=LkBW5dZOoSJ58c V+u5rf+9Ma1/YH9STUrkY/8ApDuouUHtDMHXSYNHaYnpQAWybfcipxuoIWnJ/drMaK/qNXxv+z8Ma t3ZRComYHz2b5dToGl7+4dMs4DZd2WdTnynf18kymaBtObdvFGVkOrgy6ZDmAQPEESzVPDSMhNDEj XtsLbOlSl/+34kQybO76zWp5U/E6DB230YVDaPAG3lz57vyF7HGfEoA/yUsrctiFsEgOt3HlV6TZB Ob6ip/fMEO/vJr9Je7zbZhJnDB0F0JbtbENTlygzwUXVJYYrNzOq7qcwXYfI3mLAXIbaq5GpEYkCK RwCX9QQdv0zBG78aBypQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClE-0000000Axne-3qGk; Mon, 17 Jun 2024 13:51:04 +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 1sJCkJ-0000000Awuj-36SN for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:12 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-796df041d73so313356285a.3 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=UGJsNz7R3H1hxU5nloOoV7Zhiew13LtsjT/QD3wCzuotkbi7bcQuqha3iEoLDJfE1W PX2wH0r+Xvnyluahy1OjRfGUTbF6eiBibdfPkftWd0q3O4VjGyPhNZAW6fQAAAKMSflB xri5Vf6koVu4SPMONMn5t2EOiypn5Hewg0s8w+V+14rllRMpsweGqbwbGf8dSKrPOsxC rbFAth21ki2WfZdnkn9fCbO6tXiC3Uatb5rvNI8Kgqrk0Jiuamk58DSNPBaGB9Ybai7a uqvT0LfIfLk6bxYKNnUO5tv2jrMIrhUUXpDCmfLo9AJCF4tpGQxeqyJ3VlMzvsi9IXyH K97w== X-Forwarded-Encrypted: i=1; AJvYcCWFbZ4zpGGvOjQdDUZ6As+bzeJpSjierT13mLLaVRnijqSLFU5iOePGsZLRziYr+PBNzZF1n48oFI3DDgP5JnbXO9Swa3j43JQdlN/PN9EY3DQ= X-Gm-Message-State: AOJu0Yz13XbMB76zuAt9b0avtqPnCJo18lgrCAfW8jtWzCWt4FG0tcqz huuivajKqTLl0DkgKmUyLapGk02MxpGXjYq/FIzX6FCUZc/cW9r/aDc/GleOxxA= 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_187898_57938425 X-CRM114-Status: GOOD ( 11.00 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700781 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 01BA9C27C79 for ; Mon, 17 Jun 2024 13:51: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=x6K0OvKH8ursNmxUuCynY2JG/lLTCyTaF+RmXXnmz/s=; b=n9v2G0w3PrOpcz c0XbQYdlHw6ZwmbFlGADZtU7lXFbHuSAbvAK8jGcxKdx27KuxHNfO9Ap8mkokHi0LC+f6ldF5glwA lWKJtszlklMUCRmeCFiB8WBlQzm3G6CfMAy1doQnfCNQGL77XaVnJ1z46d3XkpkkANVP28ZV8u8z8 TJqTzjK7/DQWjuVpNr4uuoUb/8IrrQcc1YA6tpCFkZ3aZQv2sZVP0dc8yVZf0bmesbT2IIZuy62vB vrul97YsSLW9VI0TyRwFydyg9hi0HSlV3eW3sg4Rutol9kLnPqgZV68d38T4Ia2q+JUf7UuCbCSjg +UGJclcUi+eFPusNxamg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClX-0000000Ay30-2nJ6; Mon, 17 Jun 2024 13:51:23 +0000 Received: from mail-ua1-x931.google.com ([2607:f8b0:4864:20::931]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkM-0000000AwxF-0oJM for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:13 +0000 Received: by mail-ua1-x931.google.com with SMTP id a1e0cc1a2514c-80b9c393cd3so980250241.3 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=mpdTveEh0ILociHLQ4iUi+6CujTnG1AaOaq4j7woZVG4ovikl9koswszewz4BrWIbA mc1QNYCmaRX2qEq0PnP3Z9Y2j3+5kEgT8GNBhwGqVLbDv+QR0NHcid9aiHM4RXHprqCE 7arPNnWJq5ZeTzTou/RGlYC4htiMHsZrSZ/HFQk1t8Sym3tlrs9Ze0h7AcnKjlJ9W/EY 3gX50K6E9kX8+kU3jdfyOgJndvxUq+qfNPXMqAEFGcTcVIB2LPFmYr5lVPe5z6ZfEdgS VZEJRejTGG5Q/B27xYQcJG0kR+GTv4dbg8fA2rg8EIZm95qYqYahGAAxwHICCjitqx6N sspA== X-Forwarded-Encrypted: i=1; AJvYcCWfIXNgoMBbH9vIbuf6c00ot8T7T/rKZ7xOxKci7VYT4SA8nELaFoEosVWCLfq3/TXzOeBifGMiRJ7scOBWcrwAw12I/Lbrk+CJaIUAlRZ6nm4= X-Gm-Message-State: AOJu0Yx1drdvI8GujGzPf5al6igT1vQZ2+iJXNkLKMTjzjcbQqy4AlMd 8lSG4iQowhLm9xD3PTgBk9hFZIORrgZ94vOlV+nzxZUVzBfzp4w6+/8j7C+WXik= 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_788149_9F0655EA X-CRM114-Status: UNSURE ( 9.45 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700782 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 61EB7C2BA15 for ; Mon, 17 Jun 2024 13:51: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=Gxj2qgoSgEHfxeYfVmlU8iWxz7cOUEI2AiscqLypEfI=; b=ZcO0mrpug1V+hm RjuvmDmSSv2VqUJvvJtp2nzFTSfP8hwaYWAmYVVtDxvTIih5XE/vWj9QG7gnASHSGAaOoD9d+98pe ZKqG656PykqwyqeCaqzfGR7PR8BaLYdm1UQOToNItbbrUoKgpyi14/I1bqNr/BTuy+YhdDkkuzW1C BCSCmXmICg2/JvFd/4M3b3F2iGUdfPTup5DOiAy1S8x16myb8+7zqa6J+Y7fhNY0gMe5bDG6VnEhr 6soSiVULSQQ46GkL2U1hs/Fo1QktRrgEhfulQtZzMogwhn6yyyeV3BDZesq5vmV9YZi8nLDJFornj aPvkaR0qR827sxCTRqpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClZ-0000000Ay5C-31EY; Mon, 17 Jun 2024 13:51:25 +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 1sJCkN-0000000Awyk-3kan for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:17 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-7955f3d4516so481862885a.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=UERpO6mxj4bTc5CDfgkWBx9dDaeuKHyJemAMeEcBHUvRb4z6sf9Ay4gwDLcWhBpUsW 2RAVScCYvIMyWQxQzFRctiwvxb6FFFE3DLlgKfDHtiF1/exAy3p0wvkSeJP6uY55ktvQ /HlLFg7/YKub4w4mIwMuN6UfRofjc+SV96RMB7/eoBg4nkXxcqWhywY+WjfO/fm4pX15 MDzsd5O+OsAAPhjwTD8QCtRvhB61FDNjX21rsHSW9oltlRP/ej6ysMf+p3hgJdaVnM0A sJ96egU/3kndOtdwDdxD74WqLf3rmJXF6tnCc/Vx3r3nP/IhXnnd+gZPcQ6wNoGUnYMA fDSQ== X-Forwarded-Encrypted: i=1; AJvYcCVrF9boCaujinYdtAy9cYagWxPXHdQVebE1OTBDmjSTbpiSXUwQ+CfFTS8onPj2WA5AGhe4fmt9hx/uVYiZlntzlax9+LLeNkzNfamlBgNvZAo= X-Gm-Message-State: AOJu0YwISAIx4/i4r2UujsBkBPFII8JalJr0rFn9tt3IHTAl6AvEoPuC jr0QbFu5AuN37SCSyr4PUQ5Ww/R1tpncm868rEgNvtv+bJ6u5/wYeEH/0gamCO0= 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_290352_0BE7725B X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700882 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 08CC4C2BA18 for ; Mon, 17 Jun 2024 15:01: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=kU0XcXdqHMAl4vfivAdklLdCUxiFfdKhEQBWsfOUjck=; b=AXZcdgScSGaZPQ Vj6sy+mnS/9Jv/mFC3ia+7W6eWwUsrjOyGtbDaCfijdUaCuC+ShE8qqsLgM+w4cOQxxrgpvhbZqPa FRfLCYTyFS9JV9wCBxDYZpa7LGGYzlUpceHGcuUZW1rnUFqwlK8VHGJdKGqww2mfajrJK+ZTSjc13 GNBobamqjAeFuG8nZ80TSjBYyQDB10dCz2s+j8uuIbn0Yi6jDTvxKGiB706b6rqCBvs/Hz3JNdAOD l/WzOLUGaTRNfKjqkBN5hieIETUS6Lo7mDvlLBVkOpTZ7WgBp02VV8/vSaUNpexlxGO6IHAw6KWw2 nfsDdAEzqaEOFVyimQrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDr7-0000000BKJw-3kN9; 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 1sJCkQ-0000000Ax0y-01pV for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:26 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-7961fb2d1cfso368628185a.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=ec776en4diFHIzcRXJSCnB7bLqgPNfGxiIV2S6m2P4QI7wn3VD/XmXiJ312kzD1VJw RqvGrgM4l0wqyO5s8GR+t/MEutjNR4nq/lUXRVZLSiOE3cVzd4MVDx7/cMljwr9UMAdC rYWwwce2XU9TOlw8fd8s8OzoO7ov1vZMHteRp69myQuIgAtInHw8gmNDj6s3roBUxnPN HUc8lU90eX3SsM32hkDELxhVMwv7hM2x7I+6CHj4v65+NkAwr0ptcknaJBhbd7+gN+jY McGEhlqADxXn6bqgzIeIHBuiTACpYB8VRPdSikq4tROYESXEFU/WsHH2FlyWzdV70cg7 R/xw== X-Forwarded-Encrypted: i=1; AJvYcCUaKYOSeAAoaNlycD0CVZypPsoGMbD/op+5tev2nQ5s8PnhmXtry7E1yA0RYLZxKCHXABPjqnzfGGi96u8JR0YvgQ6NAky/mz5PdXSrLKM26pw= X-Gm-Message-State: AOJu0YwNT25V5QRc5vCFXL5oqstPP5C9gSncr0FnR7UrcqbM0+WfEzQx udM0As74LAL28tASL1LH2pixdrqI7lyA9gvZn1hzIrudIMswwR/+0arGUBy6ApQ= 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_748382_D4F988B8 X-CRM114-Status: GOOD ( 12.93 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700877 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 AA39BC2BA15 for ; Mon, 17 Jun 2024 15:01:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=/3FUZ/Q4rePrvcubGJGUPnGwRjoQWcfhpLvIg1Ml36A=; b=vwBY0iMjQWolwf 7Jc6qqxnPBB4BougxhBXquyrOgAMZbK7YZbordYF8pKkOe6cSJwsA1Gh96w5Zs81iasbAj5c9taUY b7+A+oUTVIAwgC4/7YBWUguJPvX0bDSnU3EdROafnfmup+2k5N9z+pgbwtLe1+TWlvoLDfIvMkJ2D bmHgUWWcqbvcPNMtBCFkEW8PtRNjRvsfC/SqiSl2idV3jmz0mk9DD4sPN2NQZG8GmN0NKDB3zRkPa iRp+Q3nneMQ5CeY9H4kyhrv4T3tbmJPsGe/Vq+RLOsBOy7d4vDlTrF6wEi90XO97JIkeoTe1t7TzC jIMCWzxAfip2AxE8JBjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDr8-0000000BKKJ-1s66; Mon, 17 Jun 2024 15:01:14 +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 1sJCkS-0000000Ax3Q-177h for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:30 +0000 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-797dcb558ebso286427885a.2 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=nThCNnP/0yhnY7dqpAOe6QJ3efLAmRoiUecLLn3LqRV/Rk7ZuMzdLmeOepG0+wcQcb W/wVFZ9GaZu89Z4ntrN1IOd8Q5vJjVkwYGqgLCoy0fuCTAEj9daDdqkawi+iSfuos2iO NglgLclUaSXlu7HnUc8lxDbpAsVpA4wWhW508yLwZsuQdcuJsvyVimEGP7Fj7P8RRB9N 0Z1Jr28nmS4TqTudpoNohN8XKw0c+DSc6Ww1/0vEKGjw2aZ1HGkaT1oRTV8fwApU9hxi ihmFVm3iXzvhSJK3irGoDngkxOLELyqqJJyT/42Uw24s83lWKvnFcR81QcCTKLjQAJ7d 9buQ== X-Forwarded-Encrypted: i=1; AJvYcCWTl05n8beJ3uIY9ZFLwaWdZTYC/UaX7jKlJp0OHMj2Sq0y/n+RR5Iw8fYO+Z6zzS0s8QAbHMxwTmzPASCpS5/os5G1OBpokAzGtTda9itjcgA= X-Gm-Message-State: AOJu0Yzi7+kYCspe41GtCKPYP3lgdg4sfTQw/taxkzHc+2b3l3UdwFzp DPyITJeUWxl90S2DJMesgCoYj6N9uncpMRqfjXAWNCApKcR4h2p5DBOrvQRtwC0= 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_753243_B9BD3B3A X-CRM114-Status: GOOD ( 11.09 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700879 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 610F0C2BB9A for ; Mon, 17 Jun 2024 15:01: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=SSmg/6RRZrA3vYwawcKn00YQYpnLMOz4UuLub2zT8bg=; b=M9h9TkkjDLORI+ gWJLiyAtJazbiziP4hE1U24I6wmCRYr++/lZiJTWEmQi8QSV6ukguWrQ3oDE9+jHrX5xwn87wcYZz qsJHNpeswK2I/rw0EdPs4ccVBgdzGy5dKZQqbvFJFK7qD4jb6Ps6a9RH9AEXyJS5l35WLw4c8qMFc pmL4JI2K51uCR5BnLaIh059DtTZdBIVf+TyayfbXYS293uLy6OJm9ZrKfMY2DSGndAuBdHl15r1Ry nEDdlWu5qBpWxcyvcYpzRGE35unXin1EYaRSwvAYJVSgon6CL0MIGA1EnRf9SPtgwVPjZ7pye3DPX vnKJstrhXiOJ0EHU2oTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrA-0000000BKLF-0swv; Mon, 17 Jun 2024 15:01:16 +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 1sJCkU-0000000Ax5q-0uZ6 for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:33 +0000 Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-7954f8b818fso290886685a.1 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=aYItOuibz/HxOFQmvDADTJ75YqkLceJ2MjV76aU/q/hQxp12FdJYRc9hQ0xt3Xd5ln iszkmWuu2NvZcpEvixlfhkhrrTFq2MmsSycFdnjW/iHA/eel8YyDvc0DEHEZ+uXllaTx y3qc2YOOktHgzDX3/OW8h4TV6j6CVLmkIxlfeXq7PBGuHrpSamq7KkEWYtLPdAanCmlG QwQA2tulCR+ftnIGbqNw8PQPioQddmR0WhDV/Q+qO0TL9K41b14NqR9Ydf/0jXZ34WqW 6eQUiSY2slFP6zA1gTZcHaK6G+Hyu/O3rkjZhhXtxDt5YkIyWoDH8HZ1BLrr9aaNu/0i E36Q== X-Forwarded-Encrypted: i=1; AJvYcCVeyRKdHBa8a5XMBTnoihQn6QIHAZ3TcvH0h0u92PwHgpcb34CiS1o/PuRCNPA2fa8JY8ZiZ92YwptX26mbRXgQQgyr5w00pJqe6eXfUUQmtOU= X-Gm-Message-State: AOJu0YxzjI1mw/uUkB/NhkBaGEYv+fzivdCaIp616B3TUMk6JaX1u7ya WV/eRbl3gZS/Vd+AqaBqPvk/zpzS4b0O5Uho8EZQMpDLMjeFTEi1LWJ8zTcvKGs= 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_472675_B05B5B86 X-CRM114-Status: GOOD ( 10.91 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700881 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 5415DC2BBCA for ; Mon, 17 Jun 2024 15:01:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=NjLCEm3jmGOyhYeUYWUhLV+zNVssXTnehPCbQJEdIRU=; b=LdVV5PSP27lvjj GgpgZT0jf/v4JdK3K4QWnw0zuVsxGakfq/4mUeL+kGcH/rmOwXxgg0iDjsTaC3Ey0ljkZWTwSrtBf Hkn6kHpCDeAJOZGiS0STaS1zyESmy3+ucb3mKB8nrNDOhGg0CNEVZ1vg6DIsiPchKXJyWr7MbD5lr nxnlCxTXxOobfSGfPP8NmONfLYPLVvi6kJkeLmIhafYGxro/wvubZkCCxF5WAZvKfBsxS3PQSCacN fdxlywyMcjyOTTB7JsY34Cq3XAFVVwQ2/VgULltcp0BXT3aOQk8cYNq2pmCpi0yDwqSRLi8Ssyd8m 15CHastixZOW5L/ww1Ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrC-0000000BKMm-0VwP; Mon, 17 Jun 2024 15:01:18 +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 1sJCkW-0000000Ax7l-1ZoC for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:35 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-796df041d73so313372385a.3 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=GHTGnSAQAkv8UBQ4YvtG9xW9MPhc4VEbnLOI7EmLdFjOHxx30RV0U3hdyVIlqCsH8h iqDfBejm8odNFKi9mJbhxMQVtEuRiPTL1APYUPFEEZr+v5p2dKbZHUBlbm5G/TpLyDa+ wq7d9MhNYmhBoUtM/pWto/j7MhruSjPjgCxCIP3ENGsLcVH/88u2Ih781Q5PQoeQVHMn yMJKGCH8oAV03tFxNfXPNhyRcZnd3nN09j60TGdAJL5lUd7V2yqpr4/FkOp1mFHL/x9y W+TeelM8OKUDw+hFZzejw71eKSNZix90BEJkNiku3PDAjBd3v81r+hZVZkoOmuHFQCh8 ufJQ== X-Forwarded-Encrypted: i=1; AJvYcCVkoqXTxWhzp3TR0m1TPIO8ckei9gFjfD3kcv3cjwLDGE6MrtSWigLSKx4+oNzTEXqtsaymVf+dCJMmzAMO2ZJzW4/BXksuuYMcFpnPs8qCVV0= X-Gm-Message-State: AOJu0YwtqWaS9TWGf79cMS8I4ztmyKsNRomdJs4Jkp/nkEqv0rRgcEUx ZKu71o9+rDatnAyFa9wCDLF2BPoZEvkT9pjxAQE+MovqC5ShUvujuJIqwuSkiRw= 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_134458_25E3F554 X-CRM114-Status: UNSURE ( 9.45 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700783 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 8577BC27C79 for ; Mon, 17 Jun 2024 13:52: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=9CxQxygNbSNzPkx4T6CYELMBOUqrGwYs+zIn8+7XnvY=; b=R4yIU4Br/jXQkr DO4bXZYK3rNgSjkPaqpz8iv2QJ0UXSqHDR76nncqf1hLTGZ+75IGulNXQdk7l755kjNo+a1dqaeCH JFiKlinfrcC9YpiQjzPafOUdtIRkvr8xUvpPhm6H0alqHvHj4yJTIbiTSsR6ruN+s4kGtePimY0AB ZAuucrELhuxM/IlieVeqwaM5tRdw8NeiU0mfc0nYqERZRRJaGsMsBvsxf6xy6KpDI9BajjYG+jf3D mdeUJ56Dp3SpyOlfnRdrJsv0b+Pp6NGcf1Ix+FY7GjZRjIVWQGa889JMGGwATFbLwUARM2Z7Me+gO Lvm6+veZCbUsDsgrsw7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCmN-0000000AyY4-2ofV; Mon, 17 Jun 2024 13:52:15 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkZ-0000000Ax9p-1HGF for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:38 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-24542b8607fso2288757fac.1 for ; Mon, 17 Jun 2024 06:50:22 -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=wDt+zSYZDH3J9YgFeIZq7RqiWx4QYNgMJzbj37ZSZRRvGxO3Bb/1FtACGq55SgPTYc ZkfcmqHtAds6+dvNatmkeRv/tP4tfuNBuqUMcl2ITKrR54ttw1wLznmqAeacVAE5DhiF cs+3RwoiaH/9FrqEWPH1N5ULCIW2+Hq3XwTohs0xufkzAsvNhpzWPz/FCHpv7E+dwIXY tFiJisMVuMNRPz2YwC4lWfmXBrA+f4fUilFvElDj4FrPQFe2jVjLvcbxgwZands4y2K9 ECDrOSXHPFr7LyCM3hw9M+ThqWtZpB1IZTVhFQ8LdObBmEvb+SIj1TZlcLwc/hHf9bu3 on+A== X-Forwarded-Encrypted: i=1; AJvYcCXZNI+V8TabyPIFq+ysu2gPb8BRDAkRWUwoWKf6wqn7m0tMMSx59z4WfMe11zSCbrTqnB4gJUiMqOKOKIEdbmmUnACsCV2x9oWSQ3lSl0lwkms= X-Gm-Message-State: AOJu0Yw4xB3kFqC3qbRGEGeFP0q0FtRiOD1XIi8iAr4xSHgA3vUH0HyC jTt0VWEuj/kCq6bU6kdpFTv7ZW6HlYe9XzsmhR4fUJd2HI0p289HwMF1s1Gc4Qw= 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_065023_705932_7F913AA2 X-CRM114-Status: GOOD ( 11.52 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700880 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 703AFC2BC81 for ; Mon, 17 Jun 2024 15:01: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=RFjXujGbmKSF4mSftDNwpGnvEQOGQ9JNxbBABDjRITw=; b=F9Ot5B1q+Igkuf 2lKR2Lb1LOpbsFFSAAQGCQdcEvZ+ma/BsVTcpDedWeA1Lj6y6RC7C83Y1udSdUvyF1a97vePMAjdY NO8/mFhND6HC+NbQVAoESV+4olL/kjVPhhxuNM+1Oh1JL4PgyuX3EnGSSrztVvxuzkeY9W7Yj8qKA XfpI3N8gcvUFlJ+ZmvBubhc/6onpYXrT5cpgHukLvg61Z9wIE51wzL27DKBww8D7ZCLxFKGAglZg4 Ppy/EjNnhtIoj9FFjqIx+pkpBfZaCfauObgjS1A4zkIOcLebQ4GlK+9OqKjqPRmGK6XbDiXdFrJlR NbM+ddmbnMt1Lpe22kQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrA-0000000BKM4-40TV; Mon, 17 Jun 2024 15:01:17 +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 1sJCkj-0000000AxJX-29uw for linux-amlogic@bombadil.infradead.org; Mon, 17 Jun 2024 13:50:33 +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=l19FGmHt7cx9Y1e6lJcD6lg62Kq+f+HHsekNkW7FIwQ=; b=fFGjk4RRmLuODoItzc1qpf/a4R EYCj2tEdlw2HLdzTI0au7Jw1aIHgknpmGqijiqHpS4qPm8ckf0tQOF/vQWWaTR1uvFH5oe/t+r1t6 /cPA035DzrnoAfLEcbPpUM3Bqd5HGefm/0Pw1ZwV/e6eaGQaCqCa0/OPIWC40rdbB3+GgkHXyhlGY nJtPuQiMxEhTRqmRBtv1dIyOp3pqD3XHr+4KnmnpIAGRR0C9+fpqe9b0ckClHLHVrIcw8ejN4KlIl vRaHI+JQ2ooMWXOtv7vwAEwTa6OaZZnhcUeAjFgkW8t7zCvGEuZIeqC/FEPUhlHxpPBrMiOg+Wrwu 4NncfZWQ==; Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCke-00000006R9n-2poF for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:32 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-797f222c9f9so258868385a.3 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=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=imssEAFT6d9v52jPqDofI0pTPzbWhHDZCMHZuSFe3NSpUS5eQlPA3PAfzJbA+UuObk +kBYqPVBl4yzqLjJrE2oDXje7gWunOBg5iUVkka9pjff10C5UFt/AOgH6qiAwMGGq+NK wwXppLRch0/AJ//5lMijyyVJBLrAM1qAYsTYIlt0aD5HlZpqwa5jhWDBiJQqYcobKnn3 LfYOtd6Owsr+z7/iHX7FrK3ByzF1biGRnOwFCAPGa83qK2jsuS5KsUx9fBwSR0kd0McB WBTHf0JP03lFnzpdL91v1nOIM+II1AB+2uKVXNoYTBV5+wO4Cn01BCrJq/CSDXy2uBY9 v/1g== X-Forwarded-Encrypted: i=1; AJvYcCWeQp9rOgHfGiJ7mAkff0NXV8hRn+wxUodCpiEJLYy4G+qJqwb5M99D3WldOJTaW62ZIrbRaAyuuWkumUdThfayg6uoZSenY8etvYQ4sjKr/b4= X-Gm-Message-State: AOJu0Yx0RnFK/CVl8CcAMnmbRCvvGOzJDUh+Zi4AdKAWokI8vKTSCgUW Q9SzI0gmzCxlhWiDBhxtj+E+XzynkGnI54SwbR9Tfkr2+d4YQ8rO6u4LcqRwKUU= 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_145028_907782_26E13488 X-CRM114-Status: GOOD ( 11.17 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700878 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 33E24C27C79 for ; Mon, 17 Jun 2024 15:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=d7RYGuW/Vd4KXfQigumJ7eMa3du7RhHiCfp0gcGCkCU=; b=PWM3zRh0RtOP93 VXn4jaqBCCIFSjOGu0LDWGcafEbQ/00zGMVLrlzTOCyHMbaGOaDxnjT+n8/nhfIOL8GBFB33llEXZ /SJlZombza4A1CuhsOJEQ9s7me9jj1a1Hl36zld3ywzHepeY5+4Sg95X/7qtpnvtFPVxKen91BRiS bhDzNbnlT+2cHQamV2snfBlmjtjZJwUhTMTgvPcAX7hoj163qElEnG3cOeyi5aVMY5pF6BducC3XQ 5j4w+ZLvl6GE58MPDdhGJ4/znGI7RB/aSgSaROgvo8B3FMSxLbzVMwX2OQnNArREQtG9+Okw9wHFT hBdlFH7dJBywldx3kwww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDr9-0000000BKL1-37ct; 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 1sJCkh-0000000AxHz-3nET for linux-amlogic@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-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCke-00000006R9m-1tYG for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:30 +0000 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3d226aff122so2395645b6e.2 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=rDDy2kGFz5/RaguuzW7fY5UostrD8yQ84tD1PcVQxWTTXhnYF537L3p7kVtPM+K3kW MkvH/3J2sV2WRzWaE70oBU5eLqllVgN/YAR+5Ff43w1lwYTDYkVmkm65BW8s5El4WyAG /D/2QJZs6vECIuq858iT/x0CGuto2IDzI39E93hCkHnVvpDpBBuQHpLqxkNpREKo3Qcp SqW90sLGI5cQfitmyKzuNxhICpQmW4SmZ9CybWMish7VDxguUWNF/eOHX7pLlZkA9dmb BssayJu2YVZNg53ukPFfHT4FDjcegLv8SwiIfv8/UJnHjUpPzbZqmwgrDklnoSoMJHvD XAEg== X-Forwarded-Encrypted: i=1; AJvYcCVAUrw/mqeak3o2HwRMqEeyZhxFt+Quhez8ADLlpmmKIzQHm3pQGEGi7DIiJwQhLucolXe+HGxEOttp+WWptd9+s8SE25PIknPy3gYyLdCNq+c= X-Gm-Message-State: AOJu0YwB9n6Zcr2yd56tfLml59tgyB2uGS+/awleezVQITnT9D90tHr7 h5e9vdGOs9k5ZMsV21Ha82iAJd2FfK1wult6+yhRGnTDXYhMIqdFEHmt8UuLmJQ= 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_701663_9DF52ADA X-CRM114-Status: UNSURE ( 9.94 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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/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: 13700784 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 9169BC27C79 for ; Mon, 17 Jun 2024 13:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=B0DHYaBhSJ4cvW7/FSy6BQFoUs4R+i7l2xsOgRmhapI=; b=cVtw17OoJazxVS Wd7jbB1qYjuu7fjoRQKTbuYNLn+WrojeJheCWpDVNNZbisfY0v/FwpYev1zLm1/IvqhYVJWRg+Czd nLGo3VJfjEnBRsY2g0jJXQZHT3h3gqCo24o6dqpYgWsKzZKs33ONR3hO7ucl0cZTGnfMYOEAfCzFO rFBheuJN0epcoyk0VbUULaS8ziYnYB2ZtUlKQ0S7804B913dHElaAoBoUQ1ISaAkiT3oYbQzkGALO KEkIkyGwSkAFDdVgVmtS+S7GCLihw2CfY7GVCRolUvo9y0R0TL7gD6967pb0XcdS/RWVME+bqhobV em+pg+7yQqS8nQQHDupA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCmU-0000000Ayd4-0hjS; Mon, 17 Jun 2024 13:52:22 +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 1sJCke-0000000AxFj-3wxP for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:41 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-79767180a15so302145885a.1 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=vejyEOsDU+k5TUQDbKbyGkLFgEbvDxtrALAPWDhIvxyqZ58XYi3tANIMkdwZm2Ifzd 1OgchVYeS64qEwyexuNVhdPl39lJI8zttIs3rSx/iSpdPo3jq48w+i4BwDzO3SFJ8XPL tPot9MDFmV7ViICV7PNXrJ3mF2dEoFv00ZcyP1iRURVKHqg4gjKeNcOz69gzY4tJmQNC ANY6eSpx6vo4iMFwEjD//khBwmBnHWV+IvMySrsprxJXHOCoCtL0gCG4pOUBZ6mfZNQE C9SzoS759/K0Gi/0VW5ZFy5+hGanNCzhYCa+qf770sgx19PxH0mfZomMMzDUNNReDuv+ ESBw== X-Forwarded-Encrypted: i=1; AJvYcCXmi3LuakkKPWM6AdpbQdr3/2oaQzvY1AToH9Vz+ciHQkqv/UYba4VNH/XiGjJwApYoOj87d4FH/IQtJjfIdw10WoYha5NtezjSgYuAlr/O7dM= X-Gm-Message-State: AOJu0Yz5EkQaNXzjR8wpFhir0q726yLGxFyV+wXR8r/m5/zXPiDcrlx0 iZPSeHW5i6km+LUk14+bmp+vg6r1DHTnlHaFPG1kfwtyXNoyfODwaRAtov7jnbU= 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_431937_D81B257B X-CRM114-Status: UNSURE ( 9.93 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700785 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 77BE1C27C79 for ; Mon, 17 Jun 2024 13:52:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=k3MwfNC5TvONZNcpeJaEaTN24hdSVabAeWUodJq3dAE=; b=bYO9i0MrDDKqaw l9UpohnYtFEr+7tw7VL0dgY/bli5AnoSKKRFIon9/GR2tfFJKHZsXi/0QVQMxQsi28bzW+58vWQkn UJMWDOv/Jj0iVrPzpEMeA+HYT399UioVKtM/u+n/y4aFyQBaCuVuANt55B0/hD3Nit/QMymBXMyEl l8f8qo/p2Ex4TpcyKVvbhEnSjjYh3f38+vHGXQbkRul0WTpJsSBOOk/8e0gNsnoyMH9WClAWrYqFC riKGJiepoYzUlgl1REhZJrHwtimysgnK4hh3ucHOpSN/E5CpEvWhcfu+qECwS7uUMWk54L0g1IBPW 2SyGpBXPMOpq0eK+mpKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCms-0000000Aytw-119A; Mon, 17 Jun 2024 13:52:46 +0000 Received: from mail-qk1-f177.google.com ([209.85.222.177]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCki-0000000AxHr-0JNt for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:42 +0000 Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-7954f8b818fso290900685a.1 for ; Mon, 17 Jun 2024 06:50:31 -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=vxPSgup+JlhR5zLgVq1jMe8H94KnUEucKQ3ifPC3dhfcfGUewq8m8q7Bn5hQwiwYtI Kb+IwtIuwNk1DYIkMXSwXT70CvT9WWOUoV9T8rVWIBA2JtdZ4qVbM26hNmpGHhugNn2T 4LETe1FEOyZ+GM/dCOVQaXiRmx4Gj6ZWnKx6FK7XN8QS65aK6I5QP/zNuN9UoRQGnwL3 d8Ruit1H3MnM1kceqQtAzJKD3lcn8J0Gjz07qGqCIR70ld0waMmgN5aU7+0YRG7Dytgd ur0hcfIijq42mnfBzWmoaY/GSpVJYvtnVo80ydG42h1+ioprRLsLjWOV+jdjiD/LMW4R ZqvQ== X-Forwarded-Encrypted: i=1; AJvYcCWFVRYAwYnxqokQQgEYod7HbaBFVYTT2SyOYza+izbfGmw7Wb1KzAgE26Udnrh2tpxbXaSHF7r2/MrNUy0JdnFB4nRygabIreynN1CY7XAiKNM= X-Gm-Message-State: AOJu0YzBC4ZsZY4aYZePQGDAqPJs8zUF7Ez7sMv487gi3oYIRwqANwQ5 jD/Zxd3z644Jo/6TDV/5DFPIhli9IeTRxI7OFGKC0YKXHKv0LN6Rbswdq/DE+JM= 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_581481_CCE3B095 X-CRM114-Status: GOOD ( 10.66 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700787 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 0B7E6C27C79 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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=pTLeQVUwEDz3wC+N4uZJw4XBeffjUuw10vx1l8138xk=; b=tmYyYAqCGrsORU dpXKovltJTqpYl1Sa6HEOiIbwGUn0gh2m1d5DwLcGghJ/ejRqKzSnKBZsAQzoWOP7RML1aXA1So4K ojGbydoPUezXJ8DrhmVDnhpgbNhvZaJXPtcf4ZZoHlswhJZ7BqBI8yAZZGW6tNe/I+gn61M8Mhy8n x7fy9FwyCNMSBY/kwVxTjiK5BQx3AhUA3hJNJgWDhzkN7Mkcnt+li6cIjmSjdOEGJrpEhnXnOyRmi 3S5i5Mbds/O+46Uv1cK7BJxj7iAC0jQPScAZVp3KOHwIHbE6+3kl7UzI0JkZDPJMI3ahCMuIIqXdz bGI9Yp2dTnQjroMXrO+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCmz-0000000Az0r-49C3; Mon, 17 Jun 2024 13:52:54 +0000 Received: from mail-oo1-f43.google.com ([209.85.161.43]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkk-0000000AxKB-1IX6 for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:44 +0000 Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-5b9794dad09so1997541eaf.3 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=YJ2lOhjW96Zn0Q40K1hV5ySAerg/HLDVXBKEXt1KGPMDGToXQxjhfP3zHmPWlLG0AQ tyQGzXDpwbPjhl2v7mN40ag4HpgxcXnJQ2lCBcuslpAnjSPmvXu+gqUhm7b1RA/Ohp9k 4UE5RSdIYS1vfxKghmu2j2ZqPKxzH2NZ+mIv+yav8BCivVyDW4e0swqYCkmvUAXmnFzC 3k1iclJMH0uOPTNMeRIYv7QhBRUqeZ84zc/g5NDLZQKU+AT3aXh4F1UxdmQPL9tfQ9hD WlDSYRGVZOGGcSPvXsICrFvuA15L/lit/rxPbgDGWLtMB+EH/7QfXEklw/b0JQml+DfN iSTQ== X-Forwarded-Encrypted: i=1; AJvYcCX21O+2+zTXLb8tsxjgo7bSxpMLaL2cLPeAUPLy9yGqNMiX5snbeKGeZEm9qPnF0Cd5x+yadsV/iT03AIPywASMp64YXZ3V0p/1oqGEjZlIhPw= X-Gm-Message-State: AOJu0YyGACWb+LG8H/VseywPmMSxWNfq/RLyxVwCxLTUEX+6XG+gSKlj dmRCRVu4zOxQPOE59lfzzUy0gv9G1Yp9RN3SFljgdtPHOKT/NYH6TxqlTcl2DTU= 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_659462_9F703A80 X-CRM114-Status: GOOD ( 10.47 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700786 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 400E4C2BA18 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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=d+LRLU4CC/G/41vNJNGZlHYge7OvmFeeggBUKTmK6mU=; b=QD52nm9wWk+SVi yMEbyiQPJ++ucFm3W6HAwT8LC6dIQ7rz8g26xfwZ5WrytEDpmAx01qPsSuuUYccg4rplvyAzN+GQT p/kSywyOohxIBqyleDQn13RuuYOPvnSVjSVNvl+hw+xIRBb9X626DBqDdIsBCELSKxd5am+4XsHg3 U4feGwvkQp0/6HFpuGlh+9ca+ul6cjC1NbDJSq8fZG5+IwURgEI5nUIasSlVTkyNwpnCrm0BxvYDp gYlJXE131VlHOkRNE2CI1wkG6oLMGzmwfwuTDSpcTCtXq0yiLkTroteHG/y5ZLlc9KzyhetaFi9MX KPdQkbgB132VV3OGYGDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCmt-0000000Ayvh-3VGA; Mon, 17 Jun 2024 13:52:47 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkn-0000000AxMy-210j for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:44 +0000 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3d220039bc6so2467514b6e.2 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=EBx5XtqnSq6GpIGc1NrMhtPdrJ8HtXVD414pM0SZ3QhJfOf13KBuI3DnQyG17AHq7o oNqxbjktglAIKIftGTGsHkOAa+LbhCZiToyDG2SwigvfwKd3YgvKOfTUfugKZkV0WiQp bOA61zAEmxATcanqCKBvdBWmJ27aPepOZVd1tjb9+LkKeHK9b07AU9MBFl2L9xWcdGdY uh1wF+GPbh7XlwqBhk8x1PFu8dSj6Hi9VtGS4OYMoB7E+3S2xxxZiX3pjHjPyGvdozUz LEXJFAskq07kdolCUjyMJqyFxwdIDq+lfcTnMqGMfevAAAF5SGCr3mu0eLHzkwotwhP6 ANsQ== X-Forwarded-Encrypted: i=1; AJvYcCUjVsS/zqdzQuQ70B2WB2arukD1zPNduVIks/TpFKE4H8SySZ8cq/YxDWYaMmFhOpQZzxSagR3fjktUffSS0nBt/RL/qyDspn/r7iohWe5ghMc= X-Gm-Message-State: AOJu0Yzuu3c3DrhPFeHhQ2LIe4VTjVvrpC0eTXlhJAaU2U2UYXqNFAmY Bsghnaoo4/5I4RqE0HF6FNVSvtNcwjORlzBMWOMHyf+P9o6SKjJe13MZDjovP00= 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_065037_856407_7CA1E539 X-CRM114-Status: UNSURE ( 9.54 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700789 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 F2581C2BA15 for ; Mon, 17 Jun 2024 13:53:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=qJxmNEavPx6due4CMPsHAHdfzBF+CIQn8709/BG4NhI=; b=YKorSc/hRazDPj EVfDlQ5fbEfNijciG7Bycd6p2B9LkuoeBNPdtIVDuxksTi7QZyYeM9Lz3r1EmgrgHa4VaKfrw36G0 fd6g+2Q73NHoJltD0u/UsLFg+g1AQ0QjLgbvm68CnXY9Q8X/Ap4lc6zLPM7Uk2s7r+anqijotg8Nc /XN7swW7Mt8OeqXb4T2xgdOVQ41J9wmg9xRYdVYgDHsRtiyTT5KH8Ks2FjmQTRWde59zevaaY+i+/ HAkr0VIUh0gzIweu1rEqXkqaRqHPlfJ26G1G7ptjhvyXqgbtaXMcem2615rmy0naQjaPkJBUEu7+H Y2MccCYlt1d+WgCboE3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCnL-0000000AzIs-2dQe; Mon, 17 Jun 2024 13:53:15 +0000 Received: from mail-ua1-x92d.google.com ([2607:f8b0:4864:20::92d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCko-0000000AxNT-3HSD for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:47 +0000 Received: by mail-ua1-x92d.google.com with SMTP id a1e0cc1a2514c-80d68861bf9so1534835241.2 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=iQ6olsuKtD5SkDO5mOdrzo8lHM6m/ge73ROMsxb661FD20vpiLgqMxcAISsWQ/aqyA yjycKL/3XPXPgkv9Nz2guiNrELWjywrmKXzCqg8IOHAGuK9105Cko52dwlpDiNwljRkd 2sS09/YYL2d0BDMc0gkYXpCuHmhUuicYbDCZaz9V9yL40KHrDkbvBO5SsAeghzGbwjTN DuVzUoBx1PG0V7TYOzZJ2k8IMSH5He74hMWwek7stcJso1CQ9knBV2LGW7abM75rIpmi UXO1Fw2DcwzhahkQeIJbNXScLsfaFRqOB2bA9ETdubiCFFSkI0HKWZ7kkXBaYa/1lNS+ gx5Q== X-Forwarded-Encrypted: i=1; AJvYcCVlMq53DQY/PoAWzWz3BidAFUXQxUzxSqo/huwgDhe+9BBjXxGFau1PtDYtjDfpxNTpG+OPvSSJneczWkX5ix8/UXgsYIIF1jyyiGSnEn2nsn0= X-Gm-Message-State: AOJu0YwHc+e4y84Cx2XAGtW5kp9veD33pH8cqZ7ACk2cubPx++Ew6a3g VIj6sDF1TDtNbNcxnEZJ/ee1DzpEC3TMP20+r/V8Ffe2TmeAEmP1apLbSOJm0V4= 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_413512_4562E5A7 X-CRM114-Status: UNSURE ( 9.54 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700790 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 996F7C2BA15 for ; Mon, 17 Jun 2024 13:53:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=YxEi6VOvUhM1YMeB6SvW6nYQP+gbjHnjTQyy8bGsAlQ=; b=HukGJmKcabgOrk jFCdpuM0AkyVewsMVvoSzh8Ia2L0LLQ0eqsgYX684utmqgRhkTxb5WQgIPYh+yR5P5ImAsC9wa9us +PhmQp8daSsRxzcndMgVfxr00MXetoKLsxs6IsYvMFQlebooWQLpfvQ5YSkMsjqyoh4ASrqLpyOom pUMK7mQbrbPkyQkCO/6Cm7/mW5yuzctPbKTR52xrmVJbxPws0ulxXbZjDraZPFJN5Z5918yqlEBXL mlNaZJCXvKgxHF3Ls6tk0iMd/ybFnItx+O1fGRVcT0keBuulVbWgGcWHcn6OSrtP9uQcTZsrBgixd o5YM29C0z+a5AVEq/MjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCnP-0000000AzML-39BP; Mon, 17 Jun 2024 13:53:19 +0000 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkq-0000000AxPP-2mM1 for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:49 +0000 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-795502843ccso252193085a.1 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=t8ZxtAefZl7MjLVJeJkX751W2trB17yOnF3DP3ThGxW+bAbrPS8Q7tzUd5uUUc7mWw 0eZhLUAtsqQkUdjNT7/UJwQ53KsB8xTRjkbR8p/+hKEq78ddKlOp4X3ef5Q1+USnGE4z jGnymoKUvzzxdHPzvKdwZl191jd1icZxOljxxl2pxlBzYNvuuYAnDvJPWu3wdC5yT7Id rEV7EvlHXic4cxlVwoqzM0aGBDVEj2vllk/wF1yiqV8dFTaDpPV1f9dP5yP6Y09joEzv z937EBN4gaIGoPZXlwlW7q4xzmnFoeMyTOzAC0bstuNm0z9ac4Gg7MkP5psWE5e8Dt17 vVXg== X-Forwarded-Encrypted: i=1; AJvYcCWy5BMBY9WCwfM2sfUfn+qUtjz4DRhcojYTIM1WW3m+Z8uCOAEWuR290HZTG+4FUH/QXHoWj60Y3YWwbMUmLAAgub/2nyVXe2cu80DxsEzNOm0= X-Gm-Message-State: AOJu0YwR4ERvW4xiG5r4ggeJ55yV7Sb8OgDPkmOw98pya5hfYXjhVuWg XFNa/XsQnfyb4JD9lmoFhChGOhqT6Rp4kOgL/YR/2fN6LFJDQdPJ8pdpL9LzIPw= 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_065041_349210_4DF94971 X-CRM114-Status: UNSURE ( 9.69 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700788 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 E745CC27C79 for ; Mon, 17 Jun 2024 13:53: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=j71bLT3ewXVsMn2ZZjlEb22NMjoa22JX6S1tbmvOVEw=; b=U5+eguz1ErdJgM FzT0MbZzIq3CuHT016OxtAdqWr/VxtnyX1WWXc2UvD/ATb2S5t3l0gs0VVSLqqjcofkQpd/uk4Ilz p/QelcNhfPGQn6uU9aY+ot4aD3gE+aiidyNHNparoCB5FVRiXCSaN3lHwL4X0E/KNezKNbH5a8Mzz 9rV7V7CxJrkCA8rL1F8328nYe5QCkpEUVh7YUeLHJj3z5ZRD3iUKZIKmmM19hTnLTZwxP176MBhdQ +qAtZb53HQR1HCKrgI0hezH7iiOoIBfCpOUJGF9nx3KH5vTmmT3NhjCBd2s7Dv4h/Wvf1qOIJXazE VfOQ7ZT/z/nZrOMMTgnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCnJ-0000000AzHN-1zf4; Mon, 17 Jun 2024 13:53:13 +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 1sJCkx-0000000AxWs-05CY for linux-amlogic@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-x72a.google.com ([2607:f8b0:4864:20::72a]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCks-00000006RCG-2z3w for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:45 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-795fb13b256so419738585a.0 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=CAYME6abnhXqLxcsg9tGyW+3yDFM0lIXpVw6zAJk8A632u2EaVfXaQIWAsI9rwDg3o KDCx8m1Pb+yDDYLcQntg/ocMQozbgziDH1VMFWZK39b4WEi+fXyeDN5drzxINyD6u4Ql n0qqK+ZM7FqjM5h2utAgLR6N4QF0x7DxOWjASrE5sLq0/xVC2PHz1rpRRwOR5nA9x56U 3mbC53N+SudI47+DpTcLJOgfk/MnCZrXMmped/zid4PD/fIN0xu3hCJRYuAvi+vmPkzp UV6+NDSXX3SWPPguxNKrodKZvtnC8izcnMMG8y2RqUdBBxS/YkvZEyQ6+xmnP3fzUlmi Ox5A== X-Forwarded-Encrypted: i=1; AJvYcCVkBMl2esKP/9os1cW5q3nfwKg9TqMMUEqAIxWY4w0VYb5Igprhq1rMR1hCVKvHF1idF++B9wZStV6URRn1Jwa+EUOH+x7cBMSZkaPkF5tu4pY= X-Gm-Message-State: AOJu0Yz3TQ6SMPeZlAjfER2mWL57vCXQPXkQnZIAgpELGdp8vVUq8DTM JrR/v/0fWNXV6EFqT/+2Co5KyDFI2d5H4n7qNws+Gs7H3mJBSjDzJdXHw7rqUtE= 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_761701_58297B15 X-CRM114-Status: UNSURE ( 9.24 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700791 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 DB21BC27C79 for ; Mon, 17 Jun 2024 13:53: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=ecwEV98KNSDy29o2/YhzRsJeoZC6zHnejhQuILaNP2w=; b=sltBa7vg4rguzy ZqoQwjYLKF8BiPOilDary2BTcHoPmtQC2xmpS+XyrRB2ikBqAIX+LalG6m88kI90QYpbZI2WAkReo q4FRl57d5XbC+TZ6xqgLOXTTYAYGs1zNriHd5HF+cCf5k96xesImfmHkm8utvnn+uJyqfy9OhG/F8 E/5eNKkli9Cc2w5xO5JH5w0GIqZ7RvU4BWutgXFUo6/RSA8yO2rywXJtwqdtLKykJ43nO0J7AHUFv RsrL2iM7wX8DpEx8Glf80j1Voz0fzUzejaa4HCpNwxqkRG6agxTuA6Gdujs4p+AFnJ1ciKgzyk9hf ov40rgUFD2kRXCUhMOWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCnR-0000000AzNg-22rF; Mon, 17 Jun 2024 13:53:21 +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 1sJCku-0000000AxU4-08UJ for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:52 +0000 Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-797f2d8b408so310935385a.1 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=urA1H+9zCiVOZtbEnGt7Xsl5q+vcM/Phvaz9VNT3leuZkOANc1cODaDu/KYy9NXJUD 4j5S8L9gGtrxKBZtS43+VLjcbYk3LzIgrCoRvJNF7vcSV+PQIpjP0sE/XAfbStV/dzKo TyT4vm0t9grQXPCKZRe0SF4mngsvY1VxFfZj3Xe+cOLlRfMBDvx5hq04BMZjNBq2mf8m IZgMc7+CPG7W8W4th5Co2GL8PP/4F8YmRA0ODuHqmgzs0b8qpnRXyiNUUW8KOmh+2FD8 N9pv/e3hTQToH3p5vufXC7wqwZoD4EsFnlUvVXxgr4RRoF+KtMEl1amIKAQ5VN621REF d+ug== X-Forwarded-Encrypted: i=1; AJvYcCXqyLZqz3k8ux2BrANOS8LgUA+l2xHBonzXOHmuO0tFJQAJfGS8fdQyKWSSQee4iGltxMSPDeL6IWZ25/R3G1ZbbK3WmF81bCjWRm0/h2Zf98M= X-Gm-Message-State: AOJu0YwCs89pPRI9kY3VoHb0wbGp4DMO5Pp954Iz7XcIW5CJO5VHfFUW 0fe1cS1k3FcqnjTg0BYMqmkDVMKNcb6Rwa4kwlbgtIOEBf96AjThcsNG6K+ri4o= 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_065044_416358_B59222BD X-CRM114-Status: GOOD ( 11.28 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700792 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 D9ED8C2BB9A 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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=3+cAdZgQxh6A41KeUHcfZxWjqyDBpjYwEHULcHub6dw=; b=n3TD+nMW7Ap/OE kmml40CJgQSrao1/aT4jkPsiVBdtM4WKCxClBynBkcSV+fap577/waw8c0f8j5ael9QZ2jP6MF5IM 5wQ/nHtTxCKead4cEbnGfKnXfLIex7S1zN/4ykFuUx9yTxx3vQf2dUN3K4Vf68lyW6VdhNlFe1LiU bEPVwbaDGtfQ2TWsZEdHPdZizZTvzWeC1JfaRMJssMjDVEr/mLXW6vt3ZHHD/9+H4Jh85cdpf3ym2 E9MhJLATG+NkJjYglZSmJcmeXR/dUQuYDs6YUtWfjSgmaOl1/fEqsuQPhD3PIFW1ybBokN4eL7z4f dOIR4KkyS3JI6gU5RhOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCne-0000000AzYp-0lEr; Mon, 17 Jun 2024 13:53:34 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkw-0000000AxWO-3fGu for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:54 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-24c9f892aeaso2293608fac.2 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=CsGZJMTmXoAV8Prxf87+4jedfxjtWaljy04Q4WHMOPzQkb1m+u8VjfDaFd8SkJ93/k oaUoUUgtrQyZIwLaty/feLG07Sa8PCdb7du7r5v0WeSoeDo8EF23jqv6mTcvJ9cFXjA5 x7lADvZbO3lttL9q0SE0mWFt+LhDFot6HjtQSG+vasQVKRgemhAuSdiagXf4YbswMsN4 bYpzsPBbQbzGahRbebyLMVNVPnV2D+60u8w29VwMoTxYkxaOYMYAMBcYGgdC3J36rcVi m1524WjufklOSFZndR+3P6eMcpTfni208uMC9k+A7cAdi0spDLAMjo5Rh4dd5QKKWfut QnYg== X-Forwarded-Encrypted: i=1; AJvYcCWPa7H+0OuBw+FarvBe0PvA1Ws5La9Tu9ygL+KBap8XtBV40X7dldOFgG7ZGUJkvcvlXexiIRqq4WiadPD8nDvDxUT761UTmSSLmIaGSZrPeTk= X-Gm-Message-State: AOJu0YyAkvytt1mtMegbxWiIFbLozrK/PqX1jRphA0/KjNo+BaHMIs5v 1Y/ffaLY0KGGSOHxEZgNLqgKZ/seA0Usadt9QK0/JNZqdddBhGv9wgwYeuEE+M8= 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_554787_2A51FE22 X-CRM114-Status: GOOD ( 10.42 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700793 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 11B4BC27C79 for ; Mon, 17 Jun 2024 13:53: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=wF3vdOViNuSZHyOEpmAAcheUvRTK8pguc3p24rzfUPw=; b=0oaLIIaChpCQos 8+1c2IHvoQLjMPAITWVT/ao7DQoX9yA0FQvXIPdafta8EJPAz6mLJ3hhQOSMsclzYLKyIcO1nrajI Tq7dI9O7+eCb3kc2LOPbtwGErZZnFhtVhz8e1UCgKyweNhn767lOpa4PLAPCT3x5h4eFvkvNkyANr 64h5X+WlgWuVYCzfG+lC09L3qIDEUAXe8lDijUf/nDflLcMOMV5TvpzZYipnMMg3rbFqD/knyMbVL 5lYOWaPSQ1HBAhftqRgtnZbyph7FOCr6r0nplk6WQj+0HC5c7uGCfhzw+C3zoX0Q07VDn6+hAYZiO fhheq9aqjeJPK7nfEG3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCnf-0000000Aza0-3ddp; Mon, 17 Jun 2024 13:53:35 +0000 Received: from mail-vs1-xe2c.google.com ([2607:f8b0:4864:20::e2c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCky-0000000AxYO-3ihh for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:55 +0000 Received: by mail-vs1-xe2c.google.com with SMTP id ada2fe7eead31-48c38cc7810so1292392137.0 for ; Mon, 17 Jun 2024 06:50:47 -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=LeK7lpr1LZDCKrVRQP2Q7DeK/pNNr3V56sZ1khypXVQfK1aAK1cJkRSrQmeYZ3+DaP y+Oo68Ek/iJzzRcET2MHPGOXyzex0yIJdAoGdNb7qU/2xSqRh7FW3ja6jkKDzOhFRrcR jSYwEgWUZuIpSfw7VA0UPSsfBuTmvOxHF+rFa62v9qAL5+xKnbKVNIUKXhmDUfdP0Dkp mkkJVvVWJBa84YYAhAhEfFi/wo4XMj+8IqXRi/3OHw9SgpWab7QvfQLiBkmBRyFv7ZTO 1Rf8f/JeoRUVhvjIuH8Cmcp/ZeCbP7RV7KjZqzB5bDik+tZx2XSKlmB9Cioj+gzmkUU+ 8JzQ== X-Forwarded-Encrypted: i=1; AJvYcCUJXD8YxSK6/uiGBqmmDqZwxZH5aAmwzBrnqiTGV0uqTcU+wWwLPNFviuu87dW++/waacVfzxcarP5hmjXWORfgvLAe1d5xAKGKnB8Rw0lYWl8= X-Gm-Message-State: AOJu0Yy3KS5a4LV8jedqcWeQw/Pz81RDUB9rjnuWvv2L35P88+7KV8EI ISZSc+oGRzNoFxD8VYCZIMCiQv57q/5zTXSs6NBdp96Fkyxs1aCVa+uhJNIbsCI= 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_156283_48161C3A X-CRM114-Status: UNSURE ( 9.77 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700794 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 B8851C2BA15 for ; Mon, 17 Jun 2024 13:53:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=ALfFpp8X60qA5ypnYVP9l+58Wle7Hwbf7iKvkpHKJFY=; b=lrmNLwaJk+Gxvq XEPFfZ+eE/8npsQgMIbLgDyvZWK4hReFyrNLOo4Vf7Od7uhhUf9IbvKaxBnE6dwjNhfa8BjT67NWo M3ApLCdnKymuD3e677Z8VQVhNIP9A51Z3vvTVmfv6vHrGFM9tgfcpHp5T4m9OTO5DbiRZjxqH2mL8 y+46hLPh8y3+Ndq6OAZFdWPCdUbHlMigROSrH6fyoCTcBqSE8wvjXFVGTQsbpXM8fdtfTg3+mxSIW s1gdpi0TBX9baGqbftsxTzFm4aACI/UKbVVdTXdFmUD6bFSOJ1H8o9aa336EbVzVr7kjUhSvNMPLe OjBlSqu/KIBJ+MgLxLWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCnq-0000000Azkd-2yc2; Mon, 17 Jun 2024 13:53:46 +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 1sJCl0-0000000AxaR-13VN for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:56 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-7960454db4fso263137085a.2 for ; Mon, 17 Jun 2024 06:50:50 -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=AEOi9BWIqRC+39AX/SeMgk33lERGnyQL2gnfphG3ISJJ5TMFyHoS82dshxdSlnWMcE l2A3R8BI0oRBdQmVwWBbYPkIPB9VI4+mBwraV1/75uuKXag50KsqJJN1uIruifRJZ3as 0ITC71Hj1p6y6tBuU1sCcpBWHSbwP98OHp3/ZQL2h/DDNdipibwcKEJEcNCweHQgY/sd jnza6tcscl9roZcN80hjSXRuGIXayZkAh7GKEixnp6qm1hkdrDhhvpJi3dqQD03dguUA WSEvRKdUpsdWKhcYh321g9TplfvvgNW7BSd7zDWsTQPscqtin/nmKAOs51CJbrmeGHCM hzmA== X-Forwarded-Encrypted: i=1; AJvYcCV0Zb9zLJ3+PdnZF+Iq9JTkSVUoGBFKP9r7LbZAf6jc+W6Eg5XL9S+VY93ULjQlds35sdfv2huP/+E174KokFix0kovAcXm22Abl6g0sM+6cy8= X-Gm-Message-State: AOJu0Ywtf1Eu1H68RL8X0W+X7vJwfEDtbuWXrgXaie2HkXL2wM01Owo9 mwyuSZl1qzVPIbjncY1U4Knjv+mAgh/cNEkvLFw2f/2wfW5xrWFWEMmIFBpLkIo= 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_578927_125A56AA X-CRM114-Status: GOOD ( 10.27 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700827 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 4D6CCC2BB9A for ; Mon, 17 Jun 2024 13:54:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=t8YULb8v1sn3GDlNsUVTylV3HxE+kmj1LUMr99y6lFU=; b=XbWQjhTLYpzA0d Dg+sQ0o9I0iOR/0hAlM1rqF9jfqN+gyDHpUyZlZLSOhstd5EDZMaZXOaBaj8w52hHP4c0nWsGREf5 Ash6nybnYk70k0NC64rU9FWPSOmwjULROATcxYintmwLrmQ4nV9AnRtSNUuuXp8HM8A34RKqM/gey 3sQzSCK+5DaZUVpkRdVTVx/vLyAJKXV/nhv04NCFjA0V/59mRb35iLMjuN3UwBz9vDvKli2dnhoYK Bz8+rl5vybClKf+yTegdn0eATijWptTeYC0Fmbw+HIkeNPDlQWUusdFYPwhc1WZAJ6njf4E3/GrXG /XXG+aK2oAZTu2+/8b/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCo0-0000000AzsS-12pd; Mon, 17 Jun 2024 13:53:56 +0000 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCl2-0000000Axby-3urt for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:58 +0000 Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-7955841fddaso361935285a.1 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=CVVdsZZEonvW9wkn/qjthdAD0ah6pOtsWz4gZqqOt3gvsfv8Zjm1BPFTXCkQ5FkjMA r/36WW6dxNLF4w00LpthtMqJDjm6uDTQI0bnAjuHy+osRHOCXgjsgFgTGPGjAdmAEJjW UHrxln7NC6QLgYvpOdDvuvJG/xpMIJHgOdmQrDr71QwEFyxdViDQjG5RQHdc34uk6k/D dEL79YOs/Oms9GK7ArlMl3kGS3znQYUUI4xz6cOQ+EuRJmHFOlk5EpeRfTWuiGKyy+wS Bb04JOmWCJNXCNdrE5epHfM2wU//yyLis2tc8x9pGGnBuUDhAZ5zWfwISCYphDMAQ2Yq j1fQ== X-Forwarded-Encrypted: i=1; AJvYcCXpX9BTlC1bq1KlDu1pr2U82bhxcD9NfSt5n8RoYqlR9IQa0uImrlYkG60w0DH/o1AiheNDSc4exwn4D4MtQjaIbF1aGfzBj05kbtCmEKKLjwQ= X-Gm-Message-State: AOJu0Yym9o58P8paTAs0eGbqdpG0lyxinUYH037G+hPi+/PKOeU4nEsu lxzjR8nyc137oY7xwOQpPXo6BzWcYGLadckRnbQez/9wmUUfbjTAh5oYtJiX4Eo= 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_065053_315826_5D1F29ED X-CRM114-Status: GOOD ( 10.23 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700883 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 D41CAC2BA15 for ; Mon, 17 Jun 2024 15:01: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=08QXOZBJmU4+vBpXX4tKZc8tisInklcsqG9vgwaV3AQ=; b=HgIn3CzjnSBB+K OIFE10iPsFVYVz/Ef0oU/GmaFBN946nbfXt5nvLYreiVuWlufiM0Dh8+OGLNoPMTEwYQEAylkDwk4 DbUC6LzGyL9SkG8hykwaYCeFnbqKpKJ5XGnvqPBV4XU7f7LVRISHWrsq5gYR8lRgkPf3bZvHdjRcf AO5rOtpGo4mONBKhen+3x/W0Id7u6FyjaNufKX3I/QvFS5xU9QZGwZHpA8YYofovI+v4lFS8h57ab w2QM2HrV/vB2pVt/kVDM9uudRlBoLAMNXYqjwBS/VHZyg8mTHYltfUETwZbEMPD6ob0y/Nsi3fgTV TxMFVK7se9m5P1GjE0Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrI-0000000BKSK-30fX; Mon, 17 Jun 2024 15:01:24 +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 1sJCl4-0000000Axdu-2CTg for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:50:58 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-795482e114cso363679985a.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=bciOk+QTc2Buvg+I5KCNqGh77zwYjkfESckOBKXxxxc/+7ker1/dPYaYWW9Gyat1Ox WZ59MEuLnzBc+cqnEvHjmBYRArNQ3RGlzJCHcbh4hLitXrgKWTuBOCfR9/VtewFw6Oyx uhaZBYA9RYpOB4z35ZT6ChubrTnPW21ZOQA0Q5XcgZWR310UeakRbelWYJh/7OpGgsTH YYckI5dUlgZkltaQ3CnlYZNtXZjSmO9+U994s64eN5OBvOw6klePk5+bYkybQeCgpiS5 xpKeJP+mpFLcn6BL1p9K1Kgo6a7CouA++qkzjyZWiCD7JT8VJ2Ic9nJOffXfdLb8r/ts nLNQ== X-Forwarded-Encrypted: i=1; AJvYcCXzV/ddwIRj0845t04CMo36bkPsVl5cK2zknVX9fDPRoz1MOXyDM4BVh4FDWokp38b0eiXfmadSn/tamxz36ZmirDAwKigxdv/ntuasqxAg7Ik= X-Gm-Message-State: AOJu0Yz1odh6y0dMaAgc0tBoUB3eWrEReaoWfKwmGeYOJR2L0X4mEWbt 9lBFJtt5BdVV21WzGAupu1z6lPj5psp/oArCATpZr5dFEJpHvWMwKmxApnCNdOc= 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_706439_5A6F37FE X-CRM114-Status: GOOD ( 10.68 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700828 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 EE6CDC2BA15 for ; Mon, 17 Jun 2024 13:54: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=hOYYIaGQSUAaSr4e+aKTZieRH2OvyJZtIrOMfp9XLxo=; b=c4N4UJVlrjf6r3 0rTKsP4nz3X4JG9tTXQEmMNtK2bhWa1rQzrmFRg6alKIIKml243rBB6iNl/2DRseiVe3SSAW3tfcl yIUqbDffmgcKx6VBtwS+ZD0SKBUKn5BdJfshev/7WPnG/zkxSmx/eJ6zBEb41q4fnbup9WYHzZ2TE mUamMP90yjXeI4SO9ahfDRdSoLir98W1p2144spxoqujpeB3CczLuxOl7CUP3BJu4ue/XFg/xGHtC KAYhMlSZ9PFLRnXJt29mYjvgt3ETzPDvEwPe4Ayv5Gt8A8INsSZYjZnqyJjJ0550irjMSKiJj5xgQ RdyP3DncVngoakj6MksQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCoG-0000000B05s-1Hua; Mon, 17 Jun 2024 13:54:12 +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 1sJCl6-0000000Axg8-3iaY for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:51:00 +0000 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-797b24b8944so418430285a.0 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=K4rdS9kL48CbnTOIblZWdYIYRQWeE3kOZT0P4cpjPxOm1Yk23VuXALPexge67dN49c m7KVuQmFy7spQBxF0B0rWa9mMtPCjVup5aP+xr26yBaw+y8OwvuU8SH+gLRaEswcib7b l3losfgQwYGPUxX7cym/FICVI3b3C1Uolxd+58HFxP5sFiTI9y1znANBn3PlitwU2L6m W83Zn1aE0TinzWTA2OQYInrP9S4vYvaLK17zIfxNvT2xapAHKiEy7wuoPMrWrwSpg4pI 8BtMSV7KobTQVAnhLQ6VyJ3xX9CBvIbWaJejMMk7PzTIORGdOVyn1wPrtEfJx7kZ1klv 7ctw== X-Forwarded-Encrypted: i=1; AJvYcCXZ7bsYqLgb46j1/VY+UUS9yEim3StGQBqqWNqnjvCTNdpbJleYUkV9k5bHOhxuroDyfWzuy+RnvwdwL0XBHMDr+WrJlC9nxZY9IhRmBzFLQ10= X-Gm-Message-State: AOJu0YyzNOs1tppSGhqgX/WS0beJGQwMOl8gaT3YO/ydLb8tLA6bh61J gp3HzwDa8E9lPKmCBhcUWN5XN2V4+367FHEZEhYpCBHYpU1JlAM9w7NxoAc/6Q4= 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_636314_97C603D0 X-CRM114-Status: UNSURE ( 9.50 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700829 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 4633DC27C79 for ; Mon, 17 Jun 2024 13:54: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=KAKJcn0PYzxiAcxEcEJo7UjFOo/7VFRuqMv09dDkxtQ=; b=VzKJy4FUxCwxfS Ckbziv8tWLPfifu80DXcLiPnBFOGONCppk/6SNy1YstvoxB2TbLziYWd2kvd5atZYn1DluvbnV4KK wBvc0mbqeM8q0EKrsybdOpDTOqrJfP/OetEXPow3P61c7itvnUAWATwEbKiGCmRU4/MuXFNaKim9F gJ0KtS3GNZ6++1QSRHzme74ueIyhrJuQwyYkKBYvw7u3G++oCASkp9bzXxy/p8taAKsVHBwRzSUBR HMTo340caRqDxvDh0kmc/bi+i1sE+pH6NJwMEqWwToHXLC1UjZlYiIFfr/ydBCKo7wW5lhdz1MCaz mNJyo6sa37ZZz270MTCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCoM-0000000B0Af-1do1; Mon, 17 Jun 2024 13:54:18 +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 1sJCl8-0000000Axht-397n for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:51:02 +0000 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-797a7f9b52eso343353085a.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=fhmNLHbC4VbrC4Aax/K37rSK0XPySMDXwFKOHqDUORNkIqUMktLrqH2eKXHtj5L5Dg kQIbuhZXbBfmejXmAzBZrH7rCFvqxYzknCV1plsa3yCVfzU6WRyqrOjkYE/rgKhOX5qR iBiGf0agGMIqlSxiJEil+/5ApjH7ORoMOe8Di9WV/u+tzUCLBrmLu4eHpVjPt3hDt+h2 ESd6oXBQwXU8XBpEzVvGh0ZXAfWBT06maJcebgsTlrqm4yB9vtZefKQGBpq43Dh3eXVi zKFFW7OJcfsz/AjqVAcqvMgbHz2CThn4bvy54jhQc2AHKLkwBAbMpqjUVN7yZUEZh9jJ o2Hw== X-Forwarded-Encrypted: i=1; AJvYcCUfqfsj54xLF3FcvkqZRsAixMG72A9HRQv85EcoJJ4+kBpcdmgIgzXwQzNHnOdq+4sT0+i7W1HGPpMP1uHTm175R682gbCsq32KzIqWMx0uJ7k= X-Gm-Message-State: AOJu0YzY5ilcmxNJxGnHsZiMazPs05pmpocntUgrPY0hk4u/LwRipR0D rk6fC3LeSEBV1NK/K915T+/q/0ZgmlGtuq6dGYeP3c2my4G1DeIz4i2MrTzppiE= 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_274912_2FD9608E X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700830 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 5FE67C2BA15 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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=/sR5DszQHtoCmo8dtBxhUUNvDIUexTfTu18TQieq41s=; b=dY9Ng0+P8yez1t WHMZVCyXgBu77a2+3BhscuUwBxM61O2XrvHzEu1urHPcrjbU2v3Ge1H2LEkrUrgRQv1f2vDjcNdp3 JIJEgptbCClZazikk8sa7O7GyWxUTLnKaXCty4p0WwEpw60OsKqj45WTeI+qedCZLdVs22i3CcGyJ 3TZTU7jcINBZp+2AeA2TqTAQ9UAbfg8H/v1LsfwDFJ7STUWvlqzjpFSmfErz8g3LSQASNtyZPOOCA I3aYOeIommK69OCz7goOvHUImBvYs4Mh6Rg0DYJQImnZD9e4l4RuR7rXgN6GvcgzK/z8Ei69yNxwc lehnnd2GPGWguF87p2dQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCoZ-0000000B0Ka-0idA; Mon, 17 Jun 2024 13:54:31 +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 1sJClB-0000000Axjm-0pIu for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:51:06 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-795569eedcaso228741685a.3 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=o/M7AeQPaj/jqpAcsV62UXXDpiaTSo6yrzikCRRXKyQ+y9wdiwT938LggifBfAiViN Tj4b/JdTVYyKiyGisRxWJjOc+Am1+Y8i4H5PVlrji6MfnNrsa6gBtBBOzw9lxOW07hj9 el7cdaSFsFY+5wQEos1WqJTi3qForXaCn1khQnZ4kJEF3QNPnhJvjCtVYRAFqHnaE2dS FaQoGXak1GOeFmY3abFjg1lsdJVWNNH6AgbvIt/0Ajx5C1iSh7ExaTAqEaG/A/G4IKBa kEG+5TzLrM2Z2NZ0Gwoxfn85vhzJB6ThvPvos+RoL08H++I21o7BiPJxB/Abca8YsVVZ aPSA== X-Forwarded-Encrypted: i=1; AJvYcCXRgCEJGxzGhgPiTWlSRNbiMV49YIO4eNfmhcE+p1XKJsdxM+/W6x4exwChCNehue0XPRVh9LW6vKgETA5gjGar9k0DUwgt4xpB7nVer26DQwo= X-Gm-Message-State: AOJu0YznAliP8UDpAXoka7fishZKQHIQyLUYHpdga/BzsKL5YQPmH+2O haDtpZVBk8jUjJ71TED71gh/Mj5NrbSDNqXzOSfayO+sbqQbZX7tZ9yarq6ayCk= 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_727970_26D20203 X-CRM114-Status: GOOD ( 10.22 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700831 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 5011DC27C79 for ; Mon, 17 Jun 2024 13:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=qo/PF/ij93vFYVsvLyEj2QNN+F9BShGxjDwA1M0OshQ=; b=NGxR1f7W94GUpn OJYm+gKyu4TZOcfvIOKyqLkEzRyrXczhhjFO35yNiwegzpd7Y/klc9Chw7oRtU1oreFw4lsM8rQ4k iSMLw6UbznW0IyKPM45DtoNCoZaMHLvxrTjQ7S1ZcYl1Ip568cYi4rTirWzwLO6dJdZO74i3LyBMo YrXiyT2ouFGGWky9oTxD/+e+ABmczWV69oy9F5vGZN5HrJMGt8B0v6wuGuANvkIT3y79x6PSoLfeJ Tar8oWPUQNtfVEOOYMxl+zzIH+dXRjyNGajkVONg27eMNdLLbqc5pdaQmYg4uKLrTnATG4UFHp+Ra MSyi8kmCHgkvmtR6RKtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCog-0000000B0Po-04rz; Mon, 17 Jun 2024 13:54:38 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClD-0000000Axlb-0lyG for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:51:09 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-254d001d03dso2082880fac.3 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=UGxdZPLPxK9tF9UwfgQNtIB07LJXTqtvAMBF/dh15l578fU/njNh12lV9gtNIhDPGf OQOPcmHvU+dkxoSr5+wdptVF4Y8ULPv2zPLiRyaEgG7uzReU+ezJWDoWUtqEa1Ae5KlJ XbzLlQUmcdsqc3ODdSlEOSwDAMADL0fwDbV27EmpPu3cpyCRo77Omw987KtMIZFwIQv6 PVZwMDQ8/Lu32CvBoConJ7zVceCtLnR+PMC4p/1OpysAGkNUU+0Cn4veNbrYgkTWTdCa kTIf/W7tayInANI2agKS6QbeFjfV19Ib9hsN+fhDL9U+8iuY2AqzQwn0ABWQeS19GHL0 9WeQ== X-Forwarded-Encrypted: i=1; AJvYcCVoF7nkTwX5MTUD9fkf+Xwwv2t1IhCGgn5zVTM11q5dmZi2Zz6x2wJmmF1wNbXADFqHz4YQPOvWKAsxnk8Dfpxv7F8U4OJyRy3tBfQT8J9aemg= X-Gm-Message-State: AOJu0Yz+mUW5OqQdPKO2TrS+uCZWE0VSmI/ke63abZr3tmsIzLv4L+nQ xW1fE24vBlFJxgDEam9rGhqQWlyOSE3MbJX2nYDKf96uTVA6CiAmQ7Xxorh/6T0= 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_525498_0F559E1A X-CRM114-Status: GOOD ( 10.12 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700884 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 A6D0CC27C79 for ; Mon, 17 Jun 2024 15:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=FVOFa9CoB4BVtI2co11Vm8tJJSCQt4IlfBEChqjf44Y=; b=WxUOV7KUdANpay TP7mn9XysdBDFJagNaIL+TdlBIjtA0wb/1ToN4H1lmdNICukTCOigJ5gus0TdI8qmoO/LxdcjsSUk ymZuqzpTSYbnbeNQEaS1FNnlYHwM1Oq0s5kE6pSMhf8ReaQymvqoGJbSsyCr1FwGbNPB+o5VDwXkf ub2Ys6A5w6+Ujj8jNDC9SlPrpFXigjCBAodXNsfWafagEIdeMG3LDmWQA632fHN7aWvYrl2N9eG0n 4o9vQQjYsMuP06PBJhCHxxtol3i5eFPrpEKQGUnQUacWPigS4/pgJwZF/IUx7BXcE0UCAKLPxGBCA E8tmD0QGWNXp6wDm9T6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrR-0000000BKa8-3ptW; Mon, 17 Jun 2024 15:01:33 +0000 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClF-0000000Axnb-3NPF for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:51:14 +0000 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-254aec5a084so2101326fac.3 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=FJN6/LY9ZZ7LE//2oRaNr2JiA/tafh6UwQu7s1SBNu3F6xa7GdBUMbT3H0mGh5Pv30 rgofrUeAoQOxpHqUTnZ1cEN9656aEyk3RvuHm7QmbUPJfaiwLDwX02uUgQ6Ca9Wi5bSa 9v/5AnV+YDO2Is2WhRiRnZx4xuWCxUoSEO5kRPdbsgborLp0HmKFRqGM1YKSGZn7Z+Yj wSkNIH1bbJAIf+pB3u0hXHwcHQy5fkAYUZqgAQfRa+7mVwtP4dBM9argI/nal/DELJyP qxv5qpXX5XMTVe++771W+OFk8ggXz21KMJYQfAswBJcWkY4s0ifqkgB3rziWmDpRdgLS irnQ== X-Forwarded-Encrypted: i=1; AJvYcCVz6IxfXTSF2RqySERt11E7JEVuO74l1pbz5e7qzKqjBlGlrvEFPMgJmdqm6QwMSA/VarvUVDFWnVnw7f84C+JWu+p/pTw8NeaF/ZHyBEpEVlE= X-Gm-Message-State: AOJu0Yznx9T7xlRP6lMcTYV0hhFT6/ST+9FtM0v9qefRn0CJXRqM324A OvZ0LlJd5R8MoWvA1K3LCa2Ih2QDxZJeXKBzX+2MpFlXJ1d6BXzEen2XoB5tAtE= 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_065106_391382_6F6E1F8E X-CRM114-Status: GOOD ( 10.12 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700885 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 CD4D5C2BA18 for ; Mon, 17 Jun 2024 15:01:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=guHTld2YLBlWsQMFvw6nrl24A0Om54kQRLuqW9KQnlQ=; b=rIlhcW+eWJqKi9 L+4wCkVdivWAPwRfYYzKjWETCZA3UdY2cKVP/cUhtQ3RUFyvdCN6b6qoR489BqNQ7KVHn8RzHRpRt 1E9hqJub32bEqwtV+GoC73/ZV3NrwDxyhttSO2Eo1C6C0H3LNn3WGNdSs8sPgPXSg7ygZOCGecSYl V92mq+2YJfue3+LSm7clsfzrbOak8p0IBjG5Wxftj2ZZkqwuYocwcNRvDjyYrw9eLg76MWipvOZDD cbBk/39TyFUWatGGcWVhDUkrqD9sCeWjzika0QeTYbPTVVQgxElK5e/1JCFiSjNSPTcCmGs8V49Od 7FTIDf9uOWS4svZztecA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDrY-0000000BKfZ-2O4c; Mon, 17 Jun 2024 15:01:40 +0000 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClH-0000000Axpr-2fbk for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:51:17 +0000 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-7953f1dcb01so389095585a.3 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=Qoj1WI6O44veV29CreVsKIulZ3AArdJgHSDOlCEm0us8KHdDPyNUBYNCebKJc1Lqpr xPGrcwXlLOgLng1M0rYd9tBsqqBGX3fZtxupYeMMjTNxKCDq4ulcS+EBZqpG2R8UHszd ZFKFOd3zS09tB4mnGu8pAEePrTvLZbXh677EKYNjzbp9a1qF8/3nXpWjmEx7U+9iTTsB j7IlAjAR+Vz4a/eG+NOkrK/yTlFatqkIc7Xdjjlt3y6/qTGM9WhCP/aItvHDwAA+QxDd QD3Vue+CU5OtSUCjEyfsj8Q2LqNAvVXNhWGUf+ng5KUO139aJE5vs9uGPTuUPokxJtPG vv2A== X-Forwarded-Encrypted: i=1; AJvYcCVYYUV02LTug8Ny0SZ2Q1VRLDyCokgAPRwF2TIPpHfH5xVpb8FJB+UKa10eAWUivL7lwziTpEVXApkLXnGnYh5qLeRYllCF68fst1WStLbIlkE= X-Gm-Message-State: AOJu0YzSJsbVxbHujV3CSWfJySx0e5z+d525QVy9jAy1WuvJt843mIUG wK+6DD7KSjFYYZ+PUVZ2byAsCRGKmJmahgq+Pvq7cFxRqWvYYXjKtyT/jFmkbJ4= 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_022122_F3F45D38 X-CRM114-Status: GOOD ( 10.16 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700886 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 B9526C27C79 for ; Mon, 17 Jun 2024 15:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=nJc1oHTHUhBETRHL3c1nje1bxd9wuTSKHCprwANWEcI=; b=3TBLXM7RapMIme X1NfL006g4WDuRh7kf9Gcy4OPzevDR4vhC+uxOFrN/vm+9WQTm9YJFq7WNjb3vVBqoFLR3LH/VaYU vRlbYRIPSFN0Dy9YjjSW4ArDxwnAtj0Ib+vCcrncCGWr5Ngfdml0pyDuR7mqT7so5D3oDAqpZNXCY uEQw+TRfTHLZ2ow2lVkNhfaQPGkCZHwuQGrXzBx2TxSJr7u6SUzDPhSQHnA5DznZJXJD9IrO8dZHi hdKD0i6wP8fZAxzNQPMZD8hkUgejzFuLFLuZ+/8/VgBEnlmxauDKEvztAjxVIRgzt4hHU2rNBtE3I e95Ct3X/Xdi2SHMMgCCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDra-0000000BKhe-38Oe; Mon, 17 Jun 2024 15:01:42 +0000 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClK-0000000Axrg-0LN1 for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:51:19 +0000 Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-4415e623653so39613461cf.1 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=hPAWYduWbuvGsAtnOrau7bITtmk621Sf7aNqzecOfBVvSNLaS2HMd1W9REzKEjNWbB S9ooTEVbqIMsPZxv8KLY9RffnqzX7T5VU1H0FyL59PttsVeTLVdux1g7Y+FVeXoltvaz 1iMDJ6+8b3OstTG2E+XZzG3qmu2nQeBceyOv/xyNhLFhBgiM7fn0DMVMwcIH/kHuzaa+ O7g+kuoDKsM2iFEGgb/QNPSDkw3vydh/XcaUUXKc5sLYVyxaDsOYSejOn1e9yzI+XhTo XOnMN4L2MjPkRfN2BUKQapBTGVouzoGPBdtSpOsVRq5dXXAnI+TIZH/iIW5mAjQ92xD1 dbhQ== X-Forwarded-Encrypted: i=1; AJvYcCUDeAtLKZFOQHWiKa+MVgW03BZeEmI5wxcJ+PJasEgArGVZFVKwYz3AvZRmkFrDmDgCJk1970jSgsPvtKbe3Y8hkYYhUl4dh4IO2/EkyQb8B7I= X-Gm-Message-State: AOJu0YwPZ2+0IQJ21SwjHaiPrXlNxYWdeDdVdb0DlFd87mYcENnXoo6h 9El36mZ2LApbGqR0FWR9DkiGwzmdU8N/953OqMJRJTudHB7Jyw1Lz4U4V1bUBQc= 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_384929_45F8DCD0 X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700899 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 0F39FC27C79 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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=pvHhlFxUasN9YPUtJEfIB/P/zOp/MfCUVmmtBBBgeMg=; b=eivB/E7tymPkjH moO+pXV0ZKm3HSTA3NU5nrWmLZEREQ4wiDLt/GJCZE9+96ZXMxo25amWICc69H6GGO9Pedd/yeeOs RnM25wOVQBOv3b3txDZh7lKxDVvy40HofIVsoab0dK0tZ/aD6supKdjbhRaBBucF2JSbL2eXxeF1J tsAHmU9IcUszzBlLRFvFTjTzXWG0FNQRbtiTPofnKZsaCzXMzeRghr0L+BeVFBGd1nIxNeLWOa7ew KpxIchI5jWyaW6qN+LeiVYI+1tQnJRnUM3A6ujXmRgeMrzb7Ma++XaethpBWPXD/MYR+06hcb+Jzi edeA4UT9z5h5jITWfDdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDru-0000000BKy7-2hXU; Mon, 17 Jun 2024 15:02:02 +0000 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClL-0000000AxtV-2Wt6 for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:51:23 +0000 Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-79550284502so267291185a.2 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=Al21/Sh05iAHmvHpjhtge6IACT8/Z1b1t9+DyYrIrQhjYX+v0ZceOmiLbs7CXMi/1Y +sZowBsCLMYCCsoTrTwIuI6cc2kITNkWjutOpKc7i8sDeewd2SmtftbBabt5B3Q9CQYF 6F5825FKtmAuaA0K9moCy28/gAOmCyvRi0/u7gijFaXT6dHC0Lv2v//vV2C+Z/ATNKeC Bor4KpQrozRSM4vsmUwD57Msp/UrmaLCi1vdObeU0y97xFlswzH1xQtSM6nrToTxFiBj 46Z1FvoFXNEHGWhzv2lJ9n4j6v+C1j63mT7kuDOZXub9d0fO9RM6sZSmRBCri5kMJHib ORjQ== X-Forwarded-Encrypted: i=1; AJvYcCX25OaTdbxHQumlaVTvXBgZz/Iqw8vBlILfpoI8508x5mov2KV3ZZ5qHn3S4DItNiyKNNyDVeshwk9qn+JxDH4/GUiiSuoCpFEkV8++VbrM2ro= X-Gm-Message-State: AOJu0YwtmKOKKvsEQpYTBpxyScHw2hyQxuvvyrr72FUhYvaoaNmndgTm AZpVjr1axT0d7wvtk6CDeHhOF7enNyQ7HF9JMTs70YyA8woLXMpg9z4LOnFPvGw= 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_293329_E5087705 X-CRM114-Status: GOOD ( 10.54 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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: 13700887 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 09653C2BA15 for ; Mon, 17 Jun 2024 15:01:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=osgwKwCWpXNbY8NIYMIShx0Skwk7Qe4IJ5ZWVPz8Qog=; b=egajteAlL8Q3iX 7d4EdVVNdYWQnsU4s5hojQjUV/M2W4m3zjdAVNFwPmTmP6OSgVaJrglk+Ij9kapxvhXzU0RntsD4c EUHe6NbwCbQFV+4CAF9XErfBWrOXE5kMyEa3q1GNzMkDxNHjBkrK9Zeb7OFR+TA+RWHxnNrWUTuGV /wDZFPMA3zVj95m9XkeHz0eO1QNJwKfyysUYDiGgyetlLBWNkK/6VlJi4eOje3MxPFKOQhzOzh5ul C0kUKCEki8WibutrPtYyBETd4F+nLefXkojm6p5bw9no8xYj+dRMO7oJCin1rjyHUs3QJd/karkk2 yzJEPqTO4qBhbaNYdgnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJDri-0000000BKoC-0k27; Mon, 17 Jun 2024 15:01:50 +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-0000000Ay1M-2ast for linux-amlogic@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-xa33.google.com ([2607:f8b0:4864:20::a33]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJClS-00000006RE8-0Tyd for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:51:20 +0000 Received: by mail-vk1-xa33.google.com with SMTP id 71dfb90a1353d-4e4f0020ca3so1319448e0c.2 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=OL9G8ZmxGH0d6yS9AX8i3Uz3epduldZnUq832FlfPPZx6jGYhcpTZ6lQIA5G8lIqBa V7M5D79kPqy07BGofRO0XPLbhEtrzSxzxyqVi3yPEqNVV3XjFHteinSptdyIZfJKXP4d VyPPjBILoiTexpnatKpRaDuOQWovXL2og1jRPdrZuCfZjlRRY3vDZLavKtXQcxulIDwl ZAXukT7ua2r5M5Tag5tVRK0QDK+w0+qz6HiPx4mGRboiLRjKHmgXjROpbasoS1gWVzQ1 tXJizp1f6qF9/d+du8aDIqZ25i+TScaA0HNWB5Fp8ouNlpNT7jEtF9WBWGoUa7DmCAyA 7TzQ== X-Forwarded-Encrypted: i=1; AJvYcCUb0PK4g7RRdgASOlJ7qutMrufy8+oshMn1ZJ9XShs6ApTCAgsN6CcvPFSPZ6P+KO3ikCw/ycYATaat7hLJAM8fTwVFDFeh28IPeEaW1tZjcAw= X-Gm-Message-State: AOJu0YxFnxdvrqhnW/kXuzw5nu3HhktlWRd1+2pBWPyNU35zNQ/GRmxK jOh9dfnbSe3GzOSei2mJtZoQd3IHDvkAs7V7EQwi7qMCYy4HnK5jORfTBBufM7s= 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_500834_6801E6BD X-CRM114-Status: GOOD ( 12.89 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=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); }