Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.42 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795891231; b=cnnARsuD4mfKu7WIKjaLEMcmewhWBsjP36QCTUst+F5BXL6o5ZKYPA5VtuUXjtySqzZD 2i60UR6G2BgEm8BxJxltJU5YTrPn4w5jaEvKOpgXGTPGOciHK5UttgaPppxxHf/l8Te+P lh/zgFJGpBzzvUOYveSQp8PK3MuGLz0/chiMJbjxgQGcAzqxnL+BemH1gJxIKL9NUqQP2 SjbF+qCO4L9iBK2qL+YF2qdtjtjwSbUKeiffyfnL7JvL4OMiTXP6iJbUl4f2/yQS83OLv fILD5f3dsgu+jFsBOmyKNgKLhijWc2bzqascoNkVpFG+IIasyhh5EU8KVHJ5Ar0N3YQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795891231; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=cXoCfHO8zaqUJMfXtKFQy1yRP8aCLUmZUNCUVuB017g=; b=Fn4eDxL0K5FNauB5JYDCGzv/6dHFL2e9mnMwej5zDrcOW7/4aV+T+0H7A/aPwBS/Vd5j nRxscATrB5i7BNM+/POEygW8W9QeSKVSUOM8Qt0CZDXaJbSLxr10qsq8aLMHBOJtBjQIm CHYju+KUq1t7NBcKq/7DXk8yX28aADBonhPABRbgTXtrP7LGGUCivcecXyQEWPzUiIlSy WNHUyt0qas+sTqOCWktdjTrTJuUkH//IXC2hEA1BiFl4l8Clqqwh7b8sQ89VEKzTUFBoe oEJzwC4An1yZjrtvG9/5GrD33jHmbyE8w0J2fU6VKuCjz9olYXPgHIMPkK39sohdsfQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=EemgshtV; arc=none smtp.remote-ip=209.85.167.42 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1DB0606A323 for ; Sat, 28 Nov 2026 18:40:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E1DB0606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=EemgshtV Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-5c1a947b4adso7799758e87.2 for ; Sat, 28 Nov 2026 10:40:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795891229; x=1796496029; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=cXoCfHO8zaqUJMfXtKFQy1yRP8aCLUmZUNCUVuB017g=; b=EemgshtVJBXMA1IyhlGwI9iRiE6JE+fQtcDuvG4JFlLIs5IbSnI+62lUHf6KwlrXOA IhtB9XEVd4Qn76BeMrTs7sPnhLc0SbINl7x28IJI9u8xqtrCsbcfpbcFjKAPaG2qE+OC D2Ew6rDVv5P2Xhc10pHKBkQYF2fNIu1rnwO0IZPXIpYfpV28nGtMbPBbM7sqyJ3jcwsv l8R9nqUTi0H98Dn9Ah5E+O34ff8AMgQ//M2a+D/2Ntec5LQJqQdEZWuOvLhiQ5sP0O5K AeXJTthQgXoWWg2R5RS3P0xFnImxpitNkgZsGc1W7/zc5H102q1TNvUj1ZfktAofIIZQ gqWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795891229; x=1796496029; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=cXoCfHO8zaqUJMfXtKFQy1yRP8aCLUmZUNCUVuB017g=; b=gzvamyn+71qOuUCQz6DimNUmzx3L4BzbTpK27Cq2odffxSdVNl7ATkJCpzqvEibd+m YYuL86s51egzwmvwvaosikJdT5KMjQAthyOHTU+b8MBDCXO8gJAWe/nhsIgKiMVyWYEs YnZp49VEfKAM9QMMGTsrjJ+NkIzQUBhYKllTMOtg4HN43rVA4+A1MkZ3mr4A0g3HxLvz qh4uXas7jiwfWAROPODS3ZIhv+wak83cOM9Tk02Ti6FpBPwoxKp0xXoGER7RTKkrraur HkN/OGoiqZSax/beE7VRHzyj/ZbI9gqpq05qJY4S++p03odgkHGe7P46TUTwPQF/qvYl PiDw== X-Forwarded-Encrypted: i=1; AL+hErGT2p2epkEAUwTwiitlSR8MkUBXaWhQkOU6srJPQd+AFUK1o2uIcJAH3nuF4JIQBOjuqiLUoATzSU4=@vger.kernel.org X-Gm-Message-State: APuU4Z8Xt5I2KrYd63OV6BROyDJvYHP/DMF0Woem8NId4T9yruOa0sdb tBCm6xWpdn7dAfygsNNLLShRxAKk4Gx3YolAI1KbwUCfOZ5t1a17G1Cp X-Gm-Gg: AZFdTZdoiu730T5mBRy0S8vo2Q25p3b0S3t3wiUqbVH19qom47cGzNTCXQLkazZRzRo tlEhPwCKB9Bon7CyUk1Sz+E6h3ZP94WdFeFWkc4JzvNngVeBi/7rWuVehjEhw/GC3D3uvtTHGm0 612Q/hwFG4jUYr+CxcWJM8d6qXjYAjuGiouDpyWcLEwU/aSn/3/VOgifJ+Dxv+mz1+YsSTb/s+q 0Znwl0Ca5KjZCkyzVmAMRJfqsIaDKCUV+JdeWraDYABiVUnQXNtUQdG4jI5/U7sTnrhnOf6hMQT rTGWsLFqO074chuB/OQMa2DGO/FT1W23j0ErMWqFWcH8zvQ7OiT+PwgcADmzGWk+ib0Dm/xuESe qtZBDnWqn+2dAfe/S+rP0nUuNSalsSMWpw5hYvCaRjWGF3O2ohDGL7lTVBKHkR3t9xMpL2M+EUY IzBgnxMHpF37ZOgSJdoumt0Gip1uH1X5lLoTx6LwLUnk8jxVfGYR4wmeIFxPThrQIioXwuYofPR +OuTEkOdYWofKAJcsZYqbvKAtpvGCyiVbcReb3xf1DEP70SDF2RWa4aWw+Qj4p/W7w0ztbyty1o Y7OaeVyAx19n4R4yElsaHjs0JE+jUerjA+Ak4sHl5bxTIckJHzKkXqQGxAoEmb4huSOmP9xHHYs 5u9pqUu6Gz0RztfjAfjzqeFfFezO66CBm4YLZPQ== X-Received: by 2002:a05:6512:3d23:b0:5bf:f76f:b5ff with SMTP id 2adb3069b0e04-5c1bc8c950emr9362358e87.52.1795891228673; Sat, 28 Nov 2026 10:40:28 -0800 (PST) Received: from yantra.. (nekmmqv0jakeqhog8zq-1.v6.elisa-laajakaista.fi. [2001:99a:d7d:c300:c335:912f:e4f2:ad86]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5c1bcff8bc8sm7007006e87.20.2026.11.28.10.40.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2026 10:40:28 -0800 (PST) From: Rupesh Majhi To: Andy Shevchenko , Antoniu Miclaus , David Lechner , Eddie James , Jonathan Cameron , Lucas Stankus , Marcelo Schmitt , Michael Hennerich , =?UTF-8?q?Nuno=20S=C3=A1?= , Petre Rodan Cc: linux@analog.com, linux-iio@vger.kernel.org, Rupesh Majhi , crofts@kernel.org Subject: [PATCH v2 0/6] iio: debugfs register access through regmap in the core Date: Sat, 28 Nov 2026 20:40:19 +0200 Message-ID: <20261128184025.87548-1-zoone.rupert@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More than 25 IIO drivers have a debugfs_reg_access callback that is only a regmap_read() or regmap_write() on the regmap of the parent device. Patch 1 adds a core helper for that, patches 2 to 5 use it in four drivers and patch 6 adds register access to dps310 with it. The other drivers can follow in batches. Callbacks that take a lock or claim direct mode around the access are left alone. Patch 6 is tested on a DPS310 on a BeagleBone Black. I don't have the other parts, so adxl313, adxl372, bma220 and ina226 were run on i2c-stub under QEMU: direct_reg_access gives the same results before and after. Based on iio testing, which has Andy's split of the debugfs code [1]. v2: - 1: the helper moves to industrialio-debugfs.c and is NULL without CONFIG_DEBUG_FS (Andy) - Reviewed-by from Nuno on all, Tested-by from Petre on 4 v1: https://lore.kernel.org/linux-iio/20261124065016.185124-1-zoone.rupert@gmail.com/ [1] https://lore.kernel.org/linux-iio/20261127113635.1691512-1-andriy.shevchenko@linux.intel.com/ Cc: crofts@kernel.org Rupesh Majhi (6): iio: core: add iio_debugfs_reg_access_regmap() iio: accel: adxl313: use iio_debugfs_reg_access_regmap() iio: accel: adxl372: use iio_debugfs_reg_access_regmap() iio: accel: bma220: use iio_debugfs_reg_access_regmap() iio: adc: ina2xx-adc: use iio_debugfs_reg_access_regmap() iio: pressure: dps310: add debugfs register access drivers/iio/accel/adxl313_core.c | 12 +----------- drivers/iio/accel/adxl372.c | 15 +-------------- drivers/iio/accel/bma220_core.c | 12 +----------- drivers/iio/adc/ina2xx-adc.c | 15 ++------------- drivers/iio/industrialio-debugfs.c | 28 ++++++++++++++++++++++++++++ drivers/iio/pressure/dps310.c | 1 + include/linux/iio/iio.h | 4 ++++ 7 files changed, 38 insertions(+), 49 deletions(-) base-commit: 5ebd0bae9fbf9929c08280cf88aebaa41247c61a -- 2.43.0