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: 13700728 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C36FD19B5B4 for ; Mon, 17 Jun 2024 13:49:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632188; cv=none; b=U/l7JT7Or7Ae+M5JTVPpwDmeU/cVMtdKw0NNRhA/qQyuNYA2JS14O0uL7uDRB5iBY/TA4dSTgyjPjdMGzPwQ9azfMFP3GUB/GjpIRdR+3bH4Pldrf39UverWPJxcXwhATKOqOoBqvQBxkk5kg29hIcVeSiF4+hic32X+NVXCamE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718632188; c=relaxed/simple; bh=+vMkV4nmlC5o3WoCL8T3Cf/sOOrCOwcnxXg4rxYbHm8=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=JFNjYRdleR7TPveJ4enXzpoJmtA/098bVwGigosziIyE/AJxvlxVRnw85qfIRhKQ6tr3+EpuyY/w2H0QJmPzvTUiFHXm8wJy1FPHFcUeay3QWfCV9mXN+70yIMSV4K8dxSvErOP3qcrU+VT3CriRygdZLJMD2+L/SbYDbbjf0Ys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=klzuVS5H; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="klzuVS5H" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-797e2834c4eso366664385a.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.linux.dev; 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=klzuVS5HLKto8k/O2Ug+GXrSvYRH0utqmy8L2bsu0t/KdnrFQmv/nXAY10qzWLrO1J PLHVg3EZX9/7Yemt0/extqCabyFFILUEXR++ZP9IuLxzP0vSWH1Azae0J8mueZAtDO3/ HESPB/R7YjKw7/wl5GGik4kQCljsBGomi3kdn0z9TuYg25+Y3OUUxM8TEm/jjYx3AQL/ ddNXatxOHgJJ8Cac331Q2RZr26uNbDedwApOg8NnqT4UqkiJ1Vfj/1Y8yXLnaOipXBCv Icb4Z6ZTyBvkJbG19aZsuYvxbadc8SyjKFBIFwoifflW77Z4xzJ21V2JtgV1Pso1jBZ7 s9cQ== 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=HK34dH+NW3yP/6zMlf07Q3stjVsOja2uPg4x/ash71M/zqJIqgGG/PuNKVs9TQ4GoV tus7DucNlxJc5rd1e+FQE8PDTcCoSodB463oUElKJ4AnztUl6bQUjOG5HGPRCxm6swtZ 6D/1xRPnarzdAt/208B9i3Q8Qd5G2x3gvRmV5ty7bJSvF9lh1KTHdwSaKgfLX/eEAsBN y+uQ9Qb6McqAgdIRYLjp7NUolv4nAUVWt4PNVpCy8OWbi+6dF06g4Dm2ArRaDVUXwNsf AsPMe0w4cKUda38GJN8kWlr0BlZ8XLQ2n05MlQU5sQsrNIDaqfJuKSVRieGscIYL4/ou KQhQ== X-Forwarded-Encrypted: i=1; AJvYcCWRbK40wmnNtkO1H8O4CJLSbPxIY2VhRWPtq+RO0sfNRhqskcxLWnYDl6c9myx5vZJSKYwcE0KLH0HixvOENv9JTNUe X-Gm-Message-State: AOJu0YwlfwHpYooj6nh1nyV84L4DieOFbiHlVkEiEmPZg9zd9RX56hnZ XKGnlRBhjqxsSZsnFBTQ9WaCFXkiqh6Vhh+bw0EGiwnT1gfN+qjc7/9IovEdLPg= 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> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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,