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: 13700772 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 5DD29C2BA18 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: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=9ubWdYhll37Gj6Tpr1zMPKNDkc3JxNVr7I6fKidABxo=; b=dgopSKoCUWsEvz /ngiFtYA1CK0PpKHv+HMbPFnnhfX9IhLYddUI4/nSmhGXckKMMvfQ1Xkmz9y2wmz92Y3Up9DaIa+Y YJcCR9/1hk0Exurdp6vRadNHldCxg3gWj9m8bS/fVXlZmVqrGlGGeywuJohzKxThDYJSlbuzgaAAa g5nNVuQKLgin2tXUWHUv6T3rUSILoms4LgPvLW6U/Pysd7M6D0b+CSL8PQyl5riFk+5wV9uAStxw/ UX9C07UsMxyH48/cq6oFbh9gaCFz1yjuThwOrW7MmVLIY/rrTDXCr5jghZCW0goP4ENdHPhCMF6tr k25kxfDWxNGyT4+umMTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCkE-0000000Awq2-1b55; Mon, 17 Jun 2024 13:50:02 +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 1sJCk0-0000000AwgI-1DcR for linux-amlogic@lists.infradead.org; Mon, 17 Jun 2024 13:49:52 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-797e2834c4eso366664485a.0 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=R3uhL0bEKAHFCITcLFV4BSWr/PlGulxMU3g9bqif6cHq9j77mPWQJzbPUoH+yeBoNa KY4veuwram1xZGCL8Ztg391oHMwULgdz8kWLWQO0YtMuff9hUnIv9x/EFqmgGs+p6S9j 1x2sGv2kQQxYNbGTBmP7owjU//FqVEBHIopNyUtow4yIn1VhdeqjPZ62V4ntKt4rwPwG ydD1Q7JH100q391H95OiisbWqY29ZJgQrwxK5jAXQj28+rQWGdDVI8pHAT0mTcYF5GEK Duxhy76vjvOzy9XhOlQv9v2VKg+aVedtQrXpAoEZ9I9AQejl8pzd/afBq8lXMIeRf9Pv iDqw== X-Forwarded-Encrypted: i=1; AJvYcCUYEvEjpUuehHb/yjmLPl6DwM1cAQUP/8HRp0s8C03tZzYxCV9wTeEqAgKq+Jckh+pY14IxhKXJRjLoq7jh3pbrQnMZd91CfNAQD8Il/fsttWo= X-Gm-Message-State: AOJu0Yw4+dIDNz+CN6kvUwAokwXt4go3FkyE1cNH8qTufBd6TbRBz6sW ubIkWmpp6RMcEAHct16I1XjAzaPlE1CoNZbdVYJn0KXMZXzfGkVByWSdEAd+KFE= 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_368398_4213B646 X-CRM114-Status: GOOD ( 10.24 ) 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 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 Reviewed-by: Nuno Sa 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,