Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.43 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796407871; b=aTCZeTI4Jkac+28JpDLJTuuwK2LfmDl6OFAEGcxk/tdzaQkCHd+Hayzb2sderOSDjVEI WPWOkHe6QPvq+n4zB8lVcbxb8o/yTWXxofyTF1SKdqKKc4PL/Un6LHWdtAIAugKmeIkzK DTeK6J1hSRI6n5huDLaxs+1lf1ISsvMqRL2enUvcJnNfgmsHcnn6yvf52QrSxSxTZcvXM yQXFhFzfu5FlyWvlWvh1nqhUMBeG0xso1CGgGX3B4Y05miTVKqAr0L5IVqvLfgGhLhiUI 204+mDzzq4Qj4IARitgAbOQfgwRSndTtyDgQug3xxQ0h7WIHLKUTFrF0YenGYQA/LyQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796407871; 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=8UFXTVGeEYMHayD1UbtrkOtDHlqcJvMpfVPHO1a8d8Q=; b=zyScvnPvCn4eqMxsGfvdksM1gjLR6fssevrsflsyi9S+O78/HcHACrUXsfP5r2Qli92S m6gsX2QseyU6tMHoI1SYAKrI5ZlwfXv3osV7sQU1uzcb1t13eVGiANEPF0NLrWFcgcdhG UtyVYF4TAMgGzwsZ7GnPowUH2lis2nf4rqviQkMmO3kgwiT4vjBbJinRzqGVfG7ukdhFv 3ABelFFPdak6rF1RFuDbFr3GnMBmYY2M4zRRrova/TOtmhHHAd76wCi2PL3o/IsagrNxT yYXZ00c55tbr0Bh0FWEN8S8wHKibr/rk0Bvdu5DgkuVBJNfqs+hlBFVoaeAuHIC1zLA== 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=TybwxQ6h; arc=none smtp.remote-ip=209.85.167.43 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 69A56606A322 for ; Fri, 4 Dec 2026 18:11:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 69A56606A322 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=TybwxQ6h Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-5c1465bbbdaso918536e87.3 for ; Fri, 04 Dec 2026 10:11:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796407870; x=1797012670; 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=8UFXTVGeEYMHayD1UbtrkOtDHlqcJvMpfVPHO1a8d8Q=; b=TybwxQ6hXrmLzAOFVuzF9Rbp6JksHllP9CgnLHqkBoPqfRMHK8JsXz/M0ZT11szXDe VCKz1HIj4W6piAP+aiDyXgbRTKZyKsFpvnAmhOdFZyCn4uuAMfUZdxFF4PTtjuZ7XEG8 3nTFq6cE8n4qbjL2tzZkESz3ASpsgebm5Q7Wx7KOLoCFtvwd6gENCHRsMu8GOZ8WjZbt z6oB2iPBRtbNKLSEFPU8U50EYLS+ZW3ewteK/7R97/QynwfcNChAXApsjkUQiMZd2qM6 IXDJWLQdQwcQP0JWBhad4H9rOZwzvq29YiSr2lfRdBOwB2D3d2n+m6gb7KlFP4Hv/bMp FwUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796407870; x=1797012670; 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=8UFXTVGeEYMHayD1UbtrkOtDHlqcJvMpfVPHO1a8d8Q=; b=BANNSTnTfI81Aqhh6h2heWsB7lGuNe9q7u+t0w6HEXIgmVFuMgPW0gM7wTziYYKJbD AECw9Ar3CXWKV8qk07ahDT0QW53TcjrMNQwJQcv36W1MRxorat1Soy3yel9WJEwAICUN qHb/K3iQAYSOOi7N0gH0waqOMs1AGtuNw85voESlZ1DJTBtgM48WxONsf+3E6ORw45Pj JfIyFcLszMxNsgd9MaX4bG7a/Nzh6D9zYzTnZBHhpLCeb2Xeto8Io+V8uIWXNUeRVaVP 3HnsWoJGbAYh97HuRnfX9ldxlRAgk69gYqfDnYNpgsGhJ4r4Z0eqyo3e0Rq3iUniJBU8 oxcw== X-Forwarded-Encrypted: i=1; AL+hErFWOCBUAnuAubMd+8WDuFprMpfJNe8zS/Btc3wJ+Z4Hx8jr6l5ps4aCMn1lRlnX1R+TAsYdI52+RP4=@vger.kernel.org X-Gm-Message-State: APuU4Z/zc572x25TjcPk+8qqXV3HGiJ5mb/2VXq9576RqWsEppiyzcjq y3JaPQWOgQYfRFivJNVaz2iwS7AqbdknldivdWsSekUVaAXn8UHE2HlU X-Gm-Gg: AZFdTZd4gkOVK4IexEb9EDJPbKZi4d0FbGxqQOWsMlzsJLZ/1ruqdTA1xl8kcu/1hJH NyN/Al8agdm2jWWGF0t0v6NepO0Yzt/656+rkYJR9yneXW/aquKMr4hDxOl6Tdbmmm3P6Pvbpee LnTbpMX7w4vQlfOJhNkmM2ZSldT/VNLt0KrF1AFcHUgi3216dsiN5yoc10jZAYkLCeGh3NRd11E 3pKF5UDzFc1XYiSvk/Li10lpHfSEZmW1IFLNhUXOj4pq/QWfggq5mbJHHtmvqcqhapyCVaM8E+k LLA79EhxVBB8k5XXyDRFa9qLvlBYE8FajJ1AyDEoLgOMb7xQaY73kt9o7VACpcLXqioyQlSvXbD L+dpZrRJlEbMKsKYFZcioMbQ5gk7Oy/skcIyc+CtX03uNmrPSF0XAtqFokp//hO+UMqQwbWbLQR ffT25v5Bd7kvaw1G/jUi5xyscqdSsYWumy0lkyMmKI13+TILAQUXzNrFIh5CmsrRxWf0cN4L/6i bMokkdIaD/UqSGNgftRuKGdudacl3dvkY4lVhYHY05gDC7CWerHDlBkhnoDmsLgQB+qk8bKtdO1 vUmZU+Ft+9DO9CZaJipVooxJwOmGGUU4VrLwMZXGdVHmW4G8ZgvrTcSHXnAavFaLtV1I9//nUcK 9HzEmCaIhiQpJ+P2nYA== X-Received: by 2002:a05:6512:39d5:b0:5c0:1796:686 with SMTP id 2adb3069b0e04-5c385f40b0emr654116e87.4.1796407869396; Fri, 04 Dec 2026 10:11:09 -0800 (PST) Received: from yantra.. (91-159-24-23.elisa-laajakaista.fi. [91.159.24.23]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5c384aa37a3sm790311e87.67.2026.12.04.10.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 10:11:09 -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 v3 0/6] iio: debugfs register access through regmap in the core Date: Fri, 4 Dec 2026 20:10:59 +0200 Message-ID: <20261204181105.150419-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 implement .debugfs_reg_access() with 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]. v3: - 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 (6): 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 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 | 7 ++++++- 7 files changed, 40 insertions(+), 50 deletions(-) base-commit: fba506008a5b548ad2708bc2765a039cb00a47ab -- 2.43.0