Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.208.180 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796551414; b=wWG4C86/pObAMlWY5emo5eE8HRyEzBgvhI70U1eBwKNMVCrvdC4y/hQRB1wcqS0SdWIM ZFCPuGxTa9NakUMGhcq1DCxi5+CFmproqDXCms3jIu6pgDBsZvUtaSskY0+1PyiqSA3IX pnRkrGY6qQUjLiuJiFiX+CseYln/lz18kFAZDsDYrEcBYHHx9HwBoFXuwYcRSGnDhedsv 6DRbClthVFWkV2hnveKAYeOojuJquVhhiGufDTw2Ikj+n0dUF+5E5eeDe0r7KzTRGeXTy QIAvJY6mNJFIr14uVgDITCHv+PKGKOSqHbVRM/BcQNdSWspMV6bXf919XFoBHVlT8Ww== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796551414; 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=8DmuZAQQA2xjhZUzUXRmc8r4EU3pwnb2oerE5z9bxDA=; b=HSCCb895Ob710JOBVOisTzz+XuvjtRYhNZkYHL8fQ4gV3niOuwGRYrpgGPhNWYZCd6qi tDPs+40+1xp0yXYyaLooUiAozQiTUgF8GJ4UFwgg/9VUFjCVqIop81yxcgWPgrpZzH+Dv hERRqZRLYGNNmxxjxGBaV0eY6C4+PMDmgqvdO7kyYFlye6ICjB42mkRksepNSgbkx/sL/ wOOWNYfi8TMpS2UQfEPlQJOtS2s+9QRGNaSKPGqUK9osSnC4Btolw1TkkAXMpxiypJ2uM Ro5cbBkHDeCis4RCBYYM4W31bBRlTYtica0AeaFr2nCfZx11ogczwBSiWR7vZF3E97g== 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=a162g6Lp; arc=none smtp.remote-ip=209.85.208.180 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 629C1606A31F for ; Sun, 6 Dec 2026 10:03:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 629C1606A31F 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=a162g6Lp Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-3aff83e1c17so20342881fa.1 for ; Sun, 06 Dec 2026 02:03:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796551413; x=1797156213; 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=8DmuZAQQA2xjhZUzUXRmc8r4EU3pwnb2oerE5z9bxDA=; b=a162g6LpY/bB/eWuWQRT++NLiGp9Cjax8kHDjnjeNDY8DnFfc+iEbjCjo+We8ijqXb cq/n9BFoco6LiB7kqwD85Oy356oQ5oHwxVUKkU3G0ta27+lVj7sObmo8ZVJmyfbZCBvc GwmmHs85YRHQOOWALSDyiMh7lXuj/124pVkaZZydpYwhOGXkE/cHXLy3gbasey0UiAhk BJNxO7Fllyb1dulXGEB6jCzaSRqtmp7glBJCmM3fopBghZBNjsmzbr86dgT2aLEmgGDa mM+o/UEmnUKmzwudFepY1UsK7SGD8GViWGsaQePzAnnsehi5Or0CrTic9yHZomBDboFQ VWUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796551413; x=1797156213; 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=8DmuZAQQA2xjhZUzUXRmc8r4EU3pwnb2oerE5z9bxDA=; b=cBbwBq0FxqV5dv5muheZdNNxIPvrmYgm/OSXavYqK79hBDvPGOWh1ON96hje+7owAq zSGjwCvLF8sLd5o3toamwmDEPYnh/SJ5t/dpQl1A7QTDN4Nasa1GcWx4ZtGNUkD4UJBP Q37g9GnqX6xf9JDcMrhow4JStIIdC681FR9Fj047o7KXR/d5LtGNQOOO8tXBAF8/tG2E NjwtFPh/gEUwSCRK7gPW0BlqJoZbei3dRDCHloiXLHBNgwjxG2SQf77A6eFnejF0XwjN +Yrp0H67GRhPtOJV0QP+3wJQPa3uHzGrdSfYRaBGvyO6OVN1Huw+4j9ReLxuP7Xr5Lpz SlLA== X-Forwarded-Encrypted: i=1; AL+hErHErgOpHk8sV5AacAt119HLn9kf1bmLTACGQl469cE/dDxeKoVpOlggiZ1X5kFh77rEVMzCSQX2kyM=@vger.kernel.org X-Gm-Message-State: AB4q+uH3iaSZmKbLJxtTkbJjHg9x+KPG5GxK+qUFcZR2uLTVcEd9rBaU ulBggucIgzbetnt3VQNYtYRTXhiZTwUMPrxF3a4PyUbN6DIwIk0Snro6 X-Gm-Gg: AZFdTZdrTinSnj0jikgaROkEonunGngvGJmCqT5IMYJtfXnCkUmbyxK+wR25H/3hMlE uScHloNjq27iCHAZYU8T0exunwqV0Qwqgh+frPfW42MbC1yhOEfu5xaIgYHqpbTjwJ80KxCSVt0 Lt+zdJc0WhbdCdU00a4hatGHoM1BeG7cR7xs5/gN2cHEB1qD4mFPqApeEiZ7U4pD4ZyR3fqGwuB uE79FL8AdqV3KEtuAqwu6Hv9srbMFYTg+h5nYkvhovC4rzjcpxtVwhMDbfOSMnRZB3MG8YvFPvg sg05KYzmUH/rckiobtenziiA4U2/UWObdrGAC3LaQIVPovaRj/fRnSexJz8bQ6jzWSMrglI7uXV QCS+or7KIZf0xDMQrn+jJjzkLSLvWb5FgdRgfIA8NclKh3oQS89bBd0EAd3tUBGXWN0iY8nlXJ/ rDzq3Spff9TPd06pXrDBOuwIIcZ13b0PXxiPE3L02GgcYGZ8uhbL5nLRX+U9PIP0j8dDw2l6GXx MPxL1c703prXD855bY2Wjyyv8FY0OU1Fdae0F9Bc6ojlJCvfENFzCujjgiaKiUjxeNkKaeP//Pp 6TxnuJ73eqt10lCX2NWq7AHZcedwg0dfApOMn9+A4n08qygbJH01eo3S1khGWE75ijaOJdz2Pi5 6s1Svna4jbMZ5rXmigfpVS9t737wmhomlqmN/rLQ= X-Received: by 2002:a05:6512:2204:b0:5bf:b6e9:7d58 with SMTP id 2adb3069b0e04-5c3861e93a9mr1784484e87.46.1796551412280; Sun, 06 Dec 2026 02:03:32 -0800 (PST) Received: from yantra.. (91-159-24-23.elisa-laajakaista.fi. [91.159.24.23]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5c3849a69fbsm2223243e87.10.2026.12.06.02.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Dec 2026 02:03:31 -0800 (PST) From: Rupesh Majhi To: Andy Shevchenko , Antoniu Miclaus , David Lechner , Eddie James , Jonathan Cameron , Jonathan Corbet , Lucas Stankus , Marcelo Schmitt , Michael Hennerich , =?UTF-8?q?Nuno=20S=C3=A1?= , Petre Rodan , Randy Dunlap , Shuah Khan Cc: linux@analog.com, linux-doc@vger.kernel.org, linux-iio@vger.kernel.org, Rupesh Majhi , crofts@kernel.org Subject: [PATCH v4 0/7] iio: debugfs register access through regmap in the core Date: Sun, 6 Dec 2026 12:03:19 +0200 Message-ID: <20261206100326.45569-1-zoone.rupert@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-doc@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 implement .debugfs_reg_access() with only a regmap_read() or regmap_write() on the regmap of the parent device. Patch 2 adds a core helper for that, patches 3 to 6 use it in four drivers and patch 7 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 1 moves the kernel-doc of iio_get_debugfs_dentry() to the C file, as asked on v3. Patch 7 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]. v4: - new patch 1: kernel-doc of iio_get_debugfs_dentry() moves to industrialio-debugfs.c (Andy, Jonathan) - 2: no change to that kernel-doc any more - 2: regmap lookup split from the declaration (Andy) v3: https://lore.kernel.org/linux-iio/20261204181105.150419-1-zoone.rupert@gmail.com/ - rename to iio_access_debugfs_regmap_reg() (Andy) - 1: kernel-doc of iio_get_debugfs_dentry() moves inside the #if (Andy) - Reviewed-by from Andy on 2 to 6 v2: https://lore.kernel.org/linux-iio/20261128184025.87548-1-zoone.rupert@gmail.com/ - 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 (7): iio: core: move iio_get_debugfs_dentry() kernel-doc to the C file iio: core: add iio_access_debugfs_regmap_reg() iio: accel: adxl313: use iio_access_debugfs_regmap_reg() iio: accel: adxl372: use iio_access_debugfs_regmap_reg() iio: accel: bma220: use iio_access_debugfs_regmap_reg() iio: adc: ina2xx-adc: use iio_access_debugfs_regmap_reg() iio: pressure: dps310: add debugfs register access Documentation/driver-api/iio/core.rst | 2 ++ 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 | 34 +++++++++++++++++++++++++++ drivers/iio/pressure/dps310.c | 1 + include/linux/iio/iio.h | 8 +++---- 8 files changed, 46 insertions(+), 53 deletions(-) base-commit: 27bae9cc834c13108eb5f362da8f3fa5904a4955 -- 2.43.0