From patchwork Mon Jun 17 13:49:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 13700796 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 ECFC3C2BA15 for ; Mon, 17 Jun 2024 13:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zEZzvAHWKcqdW88FUmiOeBtiUSRBF94/JlX6CLy/U9k=; b=DyhunOw62XwRZb /7vO4c8GQfLR1qS0MzuFiMM8SoBp6GFBiWSyHDEat5QQ/nbuk8iCl1sy5opmy9ocKIuWLsL3EdIFr 4f3TTZPfqx4Vs9wpghuVD541/ISH5PP6wBNfx0b1Db2rgy3woSe/LzCPIlvOe7DfroQePm3Yb1OlX r/2v4pxB8r0JyaSzClg1H3+rweVCkRF/mMeLamsCYI8VPWRDD+On5N8gGA8urS82NG4p1cHWN3W5D dvM5JlfyKpbWd4LojJpY1n7citWeB+AmXBmCClYuP2jvgnUlKqOtnlEJcAQYIpmk4gY6Yw66HAjBr +958uYFOUofJvtIUDOKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkB-0000000Awnm-18Jh; Mon, 17 Jun 2024 13:49:59 +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 1sJCk0-0000000AwgL-0ZeP for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:49:50 +0000 Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7955841fddaso361853885a.1 for ; Mon, 17 Jun 2024 06:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718632185; x=1719236985; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=zEZzvAHWKcqdW88FUmiOeBtiUSRBF94/JlX6CLy/U9k=; b=uUuq8G1+n8Bitl4QO4X6Zam3w+9UFOj9r6KwNWyDeumJkDL/YE00/qmZFzkcgFLE7G tbSw5pXqpxKO60gV9rLqI7tp7TPQuT8p70NyqewdeorCCwtnSx+nCdg7RfbvVpiPyd7p LEfUxnIS6nYdc0FkSLP+q6v2VLkkr865ptkt8an7CbuGo//Ii0PG4xRzZRqrjt/Ary1A 5OY0ZZmcott4NcHvdkVmyLMpIR3yR+SnkY5SKZes+HXWxWlwKSdlA1eh+gCZYv4Wfjwl 5/NpYwNy8aYoe5UbXPx+1h1W967TCOtbZBfUaNqKn7GwlP4hUjlqipzf26IAHN5IbPW2 mt5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718632185; x=1719236985; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zEZzvAHWKcqdW88FUmiOeBtiUSRBF94/JlX6CLy/U9k=; b=WqdGRJAvcae0PFJsVSxLG1Mp+baPVL1MrLp9qlWmjl4ISitX826anVf7hvFW3wQPu3 wOB6ZNV/yjVV1ObYKXoi0CzCziGLaCs8Kzb8tyy3UbXKHNaAdlQDt1I1BV2w/UgKbtum agte1ElTJibNnRFskZtfgwILb4++BqAQgxTd9exhnM6yRzpRE9ZbE/Dv3S2HDqXNoRzp aPZT+XTd/EUKh5tlizmcWxV84owLTf9XBXlZTLtsukhLiX3jx4nA7S7LJxvNT+58kXr9 0n5/XWy1gD8QlH107q/Ag8xW9CkUUbyF2W1mt2MbTYnavKQhZDHaHXYynQGUq7qevjIn Ueig== X-Forwarded-Encrypted: i=1; AJvYcCVU5tglzgrxOyKQkDuj0ezOSgvAruw389/W3Q6CNmjzEMpCyTQ42gymnoupkiQlMvb7J3AQbrJ2+mDvYhhoxXHibMk4g2zH2ORw/fmpStCvxJ11yRE= X-Gm-Message-State: AOJu0YzK0Mh/5yXJh1LdUFqUsQdaCwZJMUh/5yCEjBz2bjZ8KQOiwOD4 ssXZSBwCLhUEhsPcHt5P31JS8NB+Fof07mDKAVbuWU5W4OWpacwWKSOygPHR+gs= X-Google-Smtp-Source: AGHT+IGl+FE2+2KgsFe4nDCWU6ldgP4GuYAR3dN1AUsj37hFWlNJf2lL8nOBoXUFKBqFYKKh6gBcWA== X-Received: by 2002:a05:620a:24c9:b0:795:233c:6980 with SMTP id af79cd13be357-79810103071mr2016071085a.20.1718632184654; Mon, 17 Jun 2024 06:49: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.49.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 06:49:44 -0700 (PDT) From: Trevor Gamblin Subject: [PATCH v3 00/41] iio: simplify with regmap_set_bits(), regmap_clear_bits() Date: Mon, 17 Jun 2024 09:49:40 -0400 Message-Id: <20240617-review-v3-0-88d1338c4cca@baylibre.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAPQ+cGYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyjHUUlJIzE vPSU3UzU4B8JSMDIxMDM0MTXZCi1HJd81QzgxRDU8tUc9MUJaDigqLUtMwKsEHRsbW1AEPlT+1 YAAAA 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_220646_6EF21FD4 X-CRM114-Status: GOOD ( 11.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Simplify the way regmap is accessed in iio drivers. 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(). The series is marked as v3, but the previous two revisions were single patches. There was also a resend of v1 due to not properly CCing the mailing lists on the first attempt. Trailers were pulled in from those where relevant. Link to v2: https://lore.kernel.org/linux-iio/20240613133927.3851344-1-tgamblin@baylibre.com/ Link to v1: https://lore.kernel.org/linux-iio/20240611165214.4091591-1-tgamblin@baylibre.com/ Suggested-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Trevor Gamblin Acked-by: Uwe Kleine-König --- Trevor Gamblin (41): iio: accel: fxls8962af-core: Make use of regmap_set_bits(), regmap_clear_bits() iio: accel: kxsd9: Make use of regmap_clear_bits() iio: accel: msa311: make use of regmap_clear_bits() iio: adc: ad4130: make use of regmap_clear_bits() iio: adc: axp20x_adc: make use of regmap_set_bits() iio: adc: axp288_adc: make use of regmap_set_bits() iio: adc: bcm_iproc_adc: make use of regmap_clear_bits() iio: adc: berlin2-adc: make use of regmap_clear_bits(), regmap_set_bits() iio: adc: cpcap-adc: make use of regmap_clear_bits(), regmap_set_bits() iio: adc: fsl-imx25-gcq: make use of regmap_clear_bits(), regmap_set_bits() iio: adc: ina2xx-adc: make use of regmap_clear_bits() iio: adc: intel_mrfld_adc: make use of regmap_clear_bits() iio: adc: meson_saradc: make use of regmap_clear_bits(), regmap_set_bits() iio: adc: mp2629_adc: make use of regmap_clear_bits(), regmap_set_bits() iio: adc: qcom-spmi-rradc: make use of regmap_clear_bits(), regmap_set_bits() iio: adc: rn5t618-adc: make use of regmap_set_bits() iio: adc: sc27xx_adc: make use of regmap_clear_bits(), regmap_set_bits() iio: adc: stm32-dfsdm-adc: make use of regmap_clear_bits(), regmap_set_bits() iio: dac: ltc2688: make use of regmap_set_bits() iio: dac: stm32-dac-core: make use of regmap_set_bits() iio: gyro: bmg160_core: make use of regmap_clear_bits() iio: gyro: mpu3050-core: make use of regmap_clear_bits(), regmap_set_bits() iio: health: afe4403: make use of regmap_clear_bits(), regmap_set_bits() iio: health: afe4404: make use of regmap_clear_bits(), regmap_set_bits() iio: health: max30100: make use of regmap_set_bits() iio: health: max30102: make use of regmap_set_bits() iio: imu: inv_icm42600: make use of regmap_clear_bits(), regmap_set_bits() iio: light: adux1020: make use of regmap_clear_bits(), regmap_set_bits() iio: light: iqs621-als: make use of regmap_clear_bits() iio: light: isl29018: make use of regmap_clear_bits() iio: light: st_uvis25_core: make use of regmap_clear_bits() iio: light: veml6030: make use of regmap_clear_bits() iio: magnetometer: ak8974: make use of regmap_set_bits() iio: magnetometer: mmc35240: make use of regmap_set_bits() iio: pressure: bmp280-core: make use of regmap_clear_bits() iio: proximity: sx9324: make use of regmap_set_bits() iio: proximity: sx9360: make use of regmap_set_bits() iio: proximity: sx9500: make use of regmap_clear_bits(), regmap_set_bits() iio: proximity: sx_common: make use of regmap_clear_bits(), regmap_set_bits() iio: temperature: mlx90632: make use of regmap_clear_bits() iio: trigger: stm32-timer-trigger: make use of regmap_clear_bits(), regmap_set_bits() drivers/iio/accel/fxls8962af-core.c | 18 ++-- drivers/iio/accel/kxsd9.c | 6 +- drivers/iio/accel/msa311.c | 8 +- drivers/iio/adc/ad4130.c | 4 +- drivers/iio/adc/axp20x_adc.c | 5 +- drivers/iio/adc/axp288_adc.c | 4 +- drivers/iio/adc/bcm_iproc_adc.c | 8 +- drivers/iio/adc/berlin2-adc.c | 24 +++-- drivers/iio/adc/cpcap-adc.c | 46 ++++------ drivers/iio/adc/fsl-imx25-gcq.c | 16 ++-- drivers/iio/adc/ina2xx-adc.c | 3 +- drivers/iio/adc/intel_mrfld_adc.c | 4 +- drivers/iio/adc/meson_saradc.c | 101 +++++++++------------ drivers/iio/adc/mp2629_adc.c | 19 ++-- drivers/iio/adc/qcom-spmi-rradc.c | 50 +++++----- drivers/iio/adc/rn5t618-adc.c | 5 +- drivers/iio/adc/sc27xx_adc.c | 41 ++++----- drivers/iio/adc/stm32-dfsdm-adc.c | 29 +++--- drivers/iio/dac/ltc2688.c | 5 +- drivers/iio/dac/stm32-dac-core.c | 5 +- drivers/iio/gyro/bmg160_core.c | 4 +- drivers/iio/gyro/mpu3050-core.c | 33 +++---- drivers/iio/health/afe4403.c | 9 +- drivers/iio/health/afe4404.c | 9 +- drivers/iio/health/max30100.c | 5 +- drivers/iio/health/max30102.c | 5 +- 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 +- drivers/iio/light/adux1020.c | 13 ++- drivers/iio/light/iqs621-als.c | 4 +- drivers/iio/light/isl29018.c | 6 +- drivers/iio/light/st_uvis25_core.c | 4 +- drivers/iio/light/veml6030.c | 4 +- drivers/iio/magnetometer/ak8974.c | 11 +-- drivers/iio/magnetometer/mmc35240.c | 8 +- drivers/iio/pressure/bmp280-core.c | 4 +- drivers/iio/proximity/sx9324.c | 5 +- drivers/iio/proximity/sx9360.c | 5 +- drivers/iio/proximity/sx9500.c | 12 +-- drivers/iio/proximity/sx_common.c | 9 +- drivers/iio/temperature/mlx90632.c | 4 +- drivers/iio/trigger/stm32-timer-trigger.c | 34 ++++--- 44 files changed, 273 insertions(+), 347 deletions(-) --- base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0 change-id: 20240614-review-7e60d159e75d Best regards,