From patchwork Thu Mar 20 08:21:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 14023500 X-Patchwork-Delegate: geert@linux-m68k.org Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 E9C252135A1; Thu, 20 Mar 2025 08:21:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742458873; cv=none; b=uwsiuXGc16EnWh4mghAclzRfh8k0gQlMAh3ew8jVTiaYyfDbkFPnRwgv3npWOiIeBGeicgvhXd0tkiXi8gdnAgzYj8KeVcObkjvEZUUppSDqqytkFWV1ba2Nfuv4TSC5UXaio0T86s3jcTyXAsHG37A3xkoPYgTnaJrr8E5B/kQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742458873; c=relaxed/simple; bh=9RDEkfUAtOtIDvk2ej8pElhGQ26MOiuQJ/PWR+OiWEk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=saQd4jNIOnn4jq3i9oJszmGMOEEfdFoPPgcMmWl4c4IANtakaDAolV9PCpCxLEiAgUkmnvPB+gflSnGgXReiEjzUVZx9F7S9cmiAX4y7ZN604KjvwMxP+OMltTYeoybWPK/KfVnSWarLF/NhN/PW4uGFzgLUhiC/XjQKVl7Gvs0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NgvVMNOW; arc=none smtp.client-ip=209.85.167.50 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.b="NgvVMNOW" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-543d8badc30so652221e87.0; Thu, 20 Mar 2025 01:21:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742458870; x=1743063670; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=o8YCQKSCMbcpjqvqGVAud+bsNcc/Isbjy4a8q5O0R/8=; b=NgvVMNOWrK2s8/dPr5JqlbGGlig+dLY4/cXervoZ+A9c7rj6/iF3shIwfFcqzbPTKL H6JKgeJuiolVWweTRZV1+tMfPiMmRhjds0+860i6Iwyi3YTjM4lOa+6qRMhdcFdbJHRA i7N5VjSKIZtc2epUpq2ijw+OvVBqV83Wf3hdMDH9/liAFUluukxmXvjHEkO2dXZb4MzW 7f92dQE0flACrneey0ToLtJ54mEj7DJ2bpB0vT0gfQD7ovE7T/ApC4zXHrGT0oulPau5 8x+aDLyBMyeyySyGh0wuxHeyFmbN7zrbIhrL3WuftCejxb1V2J/Xi9PBiLuFn/5js3uC 46Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742458870; x=1743063670; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=o8YCQKSCMbcpjqvqGVAud+bsNcc/Isbjy4a8q5O0R/8=; b=OBJwIPCMd5aUZOwQZN2NqgK3uTGcrvcnirEZ7SDwjH8iS27pZr+G9p0fMLMTnbRwPK i+NCnc1EI47Yo/ssTGBWFtWLv1DUqpQOk98LaSbb8l3r/HMerQ9h6utRsxANqRxpi2sz ZDPyVWkYHnilZCNrSmnahW3Efx0/dJ9mreGzMn2gXz79dmUj/HNzbQ8EkPq4nYMlRtzI +N2SAKfsigXT7dkSqzCS63/f42fcCHjqXUmeTQzsoyHzHjfwoIQPlinfbRYAvoVAKRUk rAG+c2yy5u32IGXX9JgZBrjc3UoZDWW5R2oIwhBKsyemgMpsi9AKaaIauftjNYKAW2jw kKTw== X-Forwarded-Encrypted: i=1; AJvYcCW67GvEEiPeHdfOSfQ/fG4az4r0wonIoe+gVgXnZWdmH5WnRGF6uFMpwLHqR9YZt0riR/ENoZH0+Uqz@vger.kernel.org, AJvYcCWMx1rSV/7bdzlnt+swyU8J2GlN5QkoET+vW2Jyhd4ArzINSx8rilHsmynQu5jRiSLgYQ8ZbqHXgOmEVA==@vger.kernel.org, AJvYcCXUSP8NPO3keFS6O9guBcW1I1MThUmbvtHPOss+/f+GRG38meTlc7Z//8vpaPQLtNekYVdhj14f88zOx0v6Y/vQQ2E=@vger.kernel.org, AJvYcCXqTYIu7rs2DhDsHRE0YH199biAePa9mtzLL1EIvr+6y8HHi1h3TENGJehTygDVJ5XcS81PAGfbsuQv@vger.kernel.org, AJvYcCXtlsdTG2wz/sTAECrVIZOfnkSrlDHfG2Gd0wU7Aixbe46jtvEkHtRNWZtueZGcuAXReOezgQEI4/PnqYrQ@vger.kernel.org X-Gm-Message-State: AOJu0YxSdKJlPdrNU13PmfVzXFlxjQ45QXBc5MKuDjsvbjADBJwbA0Tq 0l768xO6BVaUyb2SQuxD4XJcBb8R0eWFq0jDN4Fa/82gp+mBNzQh X-Gm-Gg: ASbGnctlh1XMufV2naLg+hJZe6FridNICFwkAr76+6LrVZ7OabB4TP9qobN2ur9zvBg isTwCbl3mwb4Qv/M0/9wcAj3qUjL5l7Q0DtREpnFqbVTlpFpoa4592oIlq/9XWGONYhNo9mnI5j R5+0Weimd6TRab+gt1w1iW/x+1+IQ9+NFWtV6s7/ijkrlEkwOmvmaPERRj1qya/hX3NeApu13Cu n80dRJ4YZOHP04+UNaaERfHiel91ZjfpPDUjoJku/9yJCLcgp2fqhOgzN7IS0FBwkRPFsQhJrn3 D3vKiA96h9//2iKHlF3eDJNXTb5Ml0sF8o65//hVN2uzksSw8pY= X-Google-Smtp-Source: AGHT+IEtQcDT1hKcr/hyPc4GQAHaaV6Ce4tKlVEIYYQ9CJsshWPNPgEWDxvASx6328HXCmwcR69h0Q== X-Received: by 2002:a05:6512:ea5:b0:549:8d16:7267 with SMTP id 2adb3069b0e04-54acb1a3327mr1879960e87.10.1742458869558; Thu, 20 Mar 2025 01:21:09 -0700 (PDT) Received: from mva-rohm ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-549ba88536csm2134374e87.177.2025.03.20.01.21.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Mar 2025 01:21:07 -0700 (PDT) Date: Thu, 20 Mar 2025 10:21:02 +0200 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Matti Vaittinen , Lad Prabhakar , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Nuno Sa , David Lechner , Javier Carrasco , Guillaume Stols , Olivier Moysan , Dumitru Ceclan , Trevor Gamblin , Matteo Martelli , Alisa-Dariana Roman , AngeloGioacchino Del Regno , =?iso-8859-1?q?Jo=E3o_Paulo_Gon=E7alves?= , Ramona Alexandra Nechita , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v9 2/8] property: Add functions to iterate named child Message-ID: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: There are a few use-cases where child nodes with a specific name need to be parsed. Code like: fwnode_for_each_child_node() if (fwnode_name_eq()) ... can be found from a various drivers/subsystems. Adding a macro for this can simplify things a bit. In a few cases the data from the found nodes is later added to an array, which is allocated based on the number of found nodes. One example of such use is the IIO subsystem's ADC channel nodes, where the relevant nodes are named as channel[@N]. Add helpers for iterating and counting device's sub-nodes with certain name instead of open-coding this in every user. Suggested-by: Jonathan Cameron Signed-off-by: Matti Vaittinen Reviewed-by: Andy Shevchenko Reviewed-by: Marcelo Schmitt --- Revision history: v8 => v9: - Drop the fwnode_for_each_available_named_child_node() as suggested by Sakari during v8 review: https://lore.kernel.org/all/Z9mQPJwnKAkPHriT@kekkonen.localdomain/ v7 => v8: - Fix the example in fwnode_get_named_child_node_count() documentation to use the fwnode_get_named_child_node_count() and not the device_get_named_child_node_count() - Fix the rest of the new macro's indentiations v6 => v7: - Improve kerneldoc - Inline device_get_named_child_node_count() and change it to call fwnode_get_named_child_node_count() inside - Fix indentiation of the new macros v5 => v6: - Add helpers to also iterate through the nodes. v4 => v5: - Use given name instead of string 'channel' when counting the nodes - Add also fwnode_get_child_node_count_named() as suggested by Rob. v3 => v4: - New patch as suggested by Jonathan, see discussion in: https://lore.kernel.org/lkml/20250223161338.5c896280@jic23-huawei/ --- drivers/base/property.c | 27 +++++++++++++++++++++++++++ include/linux/property.h | 20 ++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/drivers/base/property.c b/drivers/base/property.c index c1392743df9c..f42f32ff45fc 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -945,6 +945,33 @@ unsigned int device_get_child_node_count(const struct device *dev) } EXPORT_SYMBOL_GPL(device_get_child_node_count); +/** + * fwnode_get_named_child_node_count - number of child nodes with given name + * @fwnode: Node which child nodes are counted. + * @name: String to match child node name against. + * + * Scan child nodes and count all the nodes with a specific name. Potential + * 'number' -ending after the 'at sign' for scanned names is ignored. + * E.g.:: + * fwnode_get_named_child_node_count(fwnode, "channel"); + * would match all the nodes:: + * channel { }, channel@0 {}, channel@0xabba {}... + * + * Return: the number of child nodes with a matching name for a given device. + */ +unsigned int fwnode_get_named_child_node_count(const struct fwnode_handle *fwnode, + const char *name) +{ + struct fwnode_handle *child; + unsigned int count = 0; + + fwnode_for_each_named_child_node(fwnode, child, name) + count++; + + return count; +} +EXPORT_SYMBOL_GPL(fwnode_get_named_child_node_count); + bool device_dma_supported(const struct device *dev) { return fwnode_call_bool_op(dev_fwnode(dev), device_dma_supported); diff --git a/include/linux/property.h b/include/linux/property.h index e214ecd241eb..3e83babac0b0 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -167,6 +167,10 @@ struct fwnode_handle *fwnode_get_next_available_child_node( for (child = fwnode_get_next_child_node(fwnode, NULL); child; \ child = fwnode_get_next_child_node(fwnode, child)) +#define fwnode_for_each_named_child_node(fwnode, child, name) \ + fwnode_for_each_child_node(fwnode, child) \ + if (!fwnode_name_eq(child, name)) { } else + #define fwnode_for_each_available_child_node(fwnode, child) \ for (child = fwnode_get_next_available_child_node(fwnode, NULL); child;\ child = fwnode_get_next_available_child_node(fwnode, child)) @@ -178,11 +182,19 @@ struct fwnode_handle *device_get_next_child_node(const struct device *dev, for (child = device_get_next_child_node(dev, NULL); child; \ child = device_get_next_child_node(dev, child)) +#define device_for_each_named_child_node(dev, child, name) \ + device_for_each_child_node(dev, child) \ + if (!fwnode_name_eq(child, name)) { } else + #define device_for_each_child_node_scoped(dev, child) \ for (struct fwnode_handle *child __free(fwnode_handle) = \ device_get_next_child_node(dev, NULL); \ child; child = device_get_next_child_node(dev, child)) +#define device_for_each_named_child_node_scoped(dev, child, name) \ + device_for_each_child_node_scoped(dev, child) \ + if (!fwnode_name_eq(child, name)) { } else + struct fwnode_handle *fwnode_get_named_child_node(const struct fwnode_handle *fwnode, const char *childname); struct fwnode_handle *device_get_named_child_node(const struct device *dev, @@ -210,6 +222,14 @@ int fwnode_irq_get_byname(const struct fwnode_handle *fwnode, const char *name); unsigned int device_get_child_node_count(const struct device *dev); +unsigned int fwnode_get_named_child_node_count(const struct fwnode_handle *fwnode, + const char *name); +static inline unsigned int device_get_named_child_node_count(const struct device *dev, + const char *name) +{ + return fwnode_get_named_child_node_count(dev_fwnode(dev), name); +} + static inline int device_property_read_u8(const struct device *dev, const char *propname, u8 *val) { From patchwork Thu Mar 20 08:21:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 14023501 X-Patchwork-Delegate: geert@linux-m68k.org Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (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 258BF2147F8; Thu, 20 Mar 2025 08:21:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742458886; cv=none; b=e8ErPHWUuOCST/AM4wOIQypEd+7tkcJJ3Ewvf5RaduqLHms+BzeEv/FmCRdXJz9koO4MoxyrGHRBny084Vwuozy/EgrAR1yT7mHD+pUyowq40/tOy72JAeEhD6aLbiLSVLuipXWsJIq0pOGwV+uNvKEsrSewGHsTPk7z7rwO350= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742458886; c=relaxed/simple; bh=5c4sx8lxPu927ub7j2zSMTttb+wbAmNDHYG9xeutmh8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NZQL8OxpWYOE67Fe3Geax94l7lieTrhbCxMmwOe5m8eD79lph115v9vtSI313unjvJTmHOYCSpg+5hSY+CEYU5SvUX5h51Askku1iE22KhgHs3TU9g4cFjyjk15pTUDWyh/arZMPmAIdtsbmmc9ibuQPWsGGJWgDJ0sX/tPfP1k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=S+xe7+7e; arc=none smtp.client-ip=209.85.167.43 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.b="S+xe7+7e" Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-54996d30bfbso508326e87.2; Thu, 20 Mar 2025 01:21:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742458882; x=1743063682; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Yh/aY3YPLr128eeDB6TiMpExF6OYM+MKvRvuZdF7Mjc=; b=S+xe7+7eXTuEo0pU+j7zm6k9c5EMEvEewQpYbhlY/2o//th+25BSBOx7x3bj4TR5mA qUEG4uN0ecnzz8mjA/0d3jbfy/A22QLAiIytlzfM7iNcZsWG7V+ykUlwsUR/VJPDJ3G8 TG9lQhp4jmSSj0ZerxjH/2NZ4dOBlyKoiWpuyLOBku0V566/LmOba6Xj7Ie8SI8VBTzC OAHWmA0+N49FXgLGmw9rjutqZxH1kug4A35uewyqW5EmphVl1BWCrl0xmqWfWkCr+y1s 8UsQO++aKYCFpjoD6LrDvla2psfSxRvyc45rL2wBaaYEow+CTRke8fyFceyK+BpuA0q0 GlDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742458882; x=1743063682; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Yh/aY3YPLr128eeDB6TiMpExF6OYM+MKvRvuZdF7Mjc=; b=MJf39sJ6mxfDjMuq7THE4DN+8TCgUQ5JpozizZFlbBi71vVhFQ+qpK43HhGTLBJnZk U62zz6i6vvCJxpYEiIDqt0CQl1RR4yr8dmQR0cWKnUhMPlPNYnAgOQukyevW0n5af7au sE4CS/7OZ0kcEFY7Vf3gaYHFOoLTAb7KpxI79dHiG8W5lS0xzEMtvyCkXAKmsvt57h1M WMnveNJBcyTM4yqytwI0ntNQEsuFVjTXif5YQejxd4i626KsRqm4344iA87gUzxmNs70 kqYkgRlTYPvwGW5Gi8bdP3vKOhXYOV8l+VRJMUxfhA+fNuLoLtRf2pHy7GN+Av3KH+DU wkIQ== X-Forwarded-Encrypted: i=1; AJvYcCUnE0UgBHQB0s/YJjVhEGcxdRY2+yOIC2aiTo7wpVHHNHhtVv9ZY3ELBm3oxDvNqYMqVi1RzFGbq3oPTdVb@vger.kernel.org, AJvYcCVzSbb6jbOg7mgETqpOp9TYoEPJb4ysZcNgK1ht4qX35pTA/LzjYXMTcVSZTA1lTifdPm7OjBOPiGAcGWLedqNxROw=@vger.kernel.org, AJvYcCW44QhvdpyFa52B7GlqrJjchb1qoZhUnQK9jH4cIyQDHfSpz1u1EY/oAl0BG2F12aOniF386M/5l9Qc@vger.kernel.org, AJvYcCWhonrsFtlPCenLV51H5VCpGtH+mFmGVWXRB6Ywa0hxzoAlfVK5kEIlDCWZdEnTHaH5+hEtvm3Rq/D7@vger.kernel.org, AJvYcCXn4SjmsQI1uDQC5LWG+hvJal6JIGubNteWyquAnv26Z53Rp7sqN4xgHxOc5DcerguF9g1ZBprPQQE/oQ==@vger.kernel.org X-Gm-Message-State: AOJu0YxYYjFxBDK/tB0TvyLLIWvwflnpIH4RX2DixkY8MrQd/v5+8BWn 8MKk14xyzD0rBREYALCIUR06CVf7Eg4k5KExMnn7ljxUmhH3jCBJ X-Gm-Gg: ASbGnctXNUsFDWQWA5oZ/89bHLgA0hIWFuGWU08UGzeJ28x17kafLXAuDF0yEaoCIcB Avyp/BxutOC6x/ZOldJk2KRtNSQrJ0FAPvLFCv2gdXwQ+TCvDxsdzU7UVslEcQxb0PtXsfI2OWU OCrtSe0ihiWFi2dGuh9vzkaATUJdZE9DL/c3oqlbamcKPDqgRDX0IiIhgGyacCOyMIx2t9dkTzW V1Njh4890ZFmuKSIbwzgubYaWODN8ca2Psba5pH3DZ01P4yfBulDzGWrRTYltRB6LABvlsdmEsD L2BiB5n+SgNOwzKHcMP/SS69VlwBoy46zvRA2PFbS9mnuOD2HmU= X-Google-Smtp-Source: AGHT+IHeGKxlOEHY1CvTb3t+asOzrM/2sZpLzoi3Px7HFPqXXPcThNk4Cky/x2Ts6rByEpk8KRr1cA== X-Received: by 2002:a05:6512:304b:b0:545:5bd:bf42 with SMTP id 2adb3069b0e04-54acb21aca9mr2189060e87.36.1742458881710; Thu, 20 Mar 2025 01:21:21 -0700 (PDT) Received: from mva-rohm ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-549ba885129sm2145851e87.184.2025.03.20.01.21.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Mar 2025 01:21:20 -0700 (PDT) Date: Thu, 20 Mar 2025 10:21:16 +0200 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Andy Shevchenko , Matti Vaittinen , Lad Prabhakar , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Nuno Sa , David Lechner , Javier Carrasco , Guillaume Stols , Dumitru Ceclan , Trevor Gamblin , Matteo Martelli , Alisa-Dariana Roman , Ramona Alexandra Nechita , AngeloGioacchino Del Regno , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v9 3/8] iio: adc: add helpers for parsing ADC nodes Message-ID: <299f990caf58d77cc24200e8d75655661f16050e.1742457420.git.mazziesaccount@gmail.com> References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: There are ADC ICs which may have some of the AIN pins usable for other functions. These ICs may have some of the AIN pins wired so that they should not be used for ADC. (Preferred?) way for marking pins which can be used as ADC inputs is to add corresponding channels@N nodes in the device tree as described in the ADC binding yaml. Add couple of helper functions which can be used to retrieve the channel information from the device node. Signed-off-by: Matti Vaittinen Reviewed-by: Andy Shevchenko --- Revision history: v8 => - No changes v7 => v8: devm_iio_adc_device_alloc_chaninfo_se(): - Treat all negative values for the max ID as 'don't care' - Return -ENOENT instead of '0' if no channels were found. v5 => v6: - Adapt to changed fwnode helper names - Fix spelling v4 => v5: - Inline iio_adc_device_num_channels() - Fix Indenting function parameters - Combine the max channel ID checks. v3 => v4: - Drop diff-channel support - Drop iio_adc_device_channels_by_property() - Add IIO_DEVICE namespace - Move industrialio-adc.o to top of the Makefile - Some styling as suggested by Andy - Re-consider included headers v2 => v3: Mostly based on review comments by Jonathan - Support differential and single-ended channels - Rename iio_adc_device_get_channels() as iio_adc_device_channels_by_property() - Improve spelling - Drop support for cases where DT comes from parent device's node - Decrease loop indent by reverting node name check conditions - Don't set 'chan->indexed' by number of channels to keep the interface consistent no matter how many channels are connected. - Fix ID range check and related comment RFC v1 => v2: - New patch --- drivers/iio/adc/Kconfig | 3 ++ drivers/iio/adc/Makefile | 2 + drivers/iio/adc/industrialio-adc.c | 82 ++++++++++++++++++++++++++++++ include/linux/iio/adc-helpers.h | 27 ++++++++++ 4 files changed, 114 insertions(+) create mode 100644 drivers/iio/adc/industrialio-adc.c create mode 100644 include/linux/iio/adc-helpers.h diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index 849c90203071..37b70a65da6f 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -6,6 +6,9 @@ menu "Analog to digital converters" +config IIO_ADC_HELPER + tristate + config AB8500_GPADC bool "ST-Ericsson AB8500 GPADC driver" depends on AB8500_CORE && REGULATOR_AB8500 diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile index ee19afba62b7..1c410f483029 100644 --- a/drivers/iio/adc/Makefile +++ b/drivers/iio/adc/Makefile @@ -3,6 +3,8 @@ # Makefile for IIO ADC drivers # +obj-$(CONFIG_IIO_ADC_HELPER) += industrialio-adc.o + # When adding new entries keep the list in alphabetical order obj-$(CONFIG_AB8500_GPADC) += ab8500-gpadc.o obj-$(CONFIG_AD_SIGMA_DELTA) += ad_sigma_delta.o diff --git a/drivers/iio/adc/industrialio-adc.c b/drivers/iio/adc/industrialio-adc.c new file mode 100644 index 000000000000..b4057230e749 --- /dev/null +++ b/drivers/iio/adc/industrialio-adc.c @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Helpers for parsing common ADC information from a firmware node. + * + * Copyright (c) 2025 Matti Vaittinen + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +/** + * devm_iio_adc_device_alloc_chaninfo_se - allocate and fill iio_chan_spec for ADC + * + * Scan the device node for single-ended ADC channel information. Channel ID is + * expected to be found from the "reg" property. Allocate and populate the + * iio_chan_spec structure corresponding to channels that are found. The memory + * for iio_chan_spec structure will be freed upon device detach. + * + * @dev: Pointer to the ADC device. + * @template: Template iio_chan_spec from which the fields of all + * found and allocated channels are initialized. + * @max_chan_id: Maximum value of a channel ID. Use negative value if no + * checking is required. + * @cs: Location where pointer to allocated iio_chan_spec + * should be stored. + * + * Return: Number of found channels on success. Negative value to indicate + * failure. Specifically, -ENOENT if no channel nodes were found. + */ +int devm_iio_adc_device_alloc_chaninfo_se(struct device *dev, + const struct iio_chan_spec *template, + int max_chan_id, + struct iio_chan_spec **cs) +{ + struct iio_chan_spec *chan_array, *chan; + int num_chan, ret; + + num_chan = iio_adc_device_num_channels(dev); + if (num_chan < 0) + return num_chan; + + if (!num_chan) + return -ENOENT; + + chan_array = devm_kcalloc(dev, num_chan, sizeof(*chan_array), + GFP_KERNEL); + if (!chan_array) + return -ENOMEM; + + chan = &chan_array[0]; + + device_for_each_named_child_node_scoped(dev, child, "channel") { + u32 ch; + + ret = fwnode_property_read_u32(child, "reg", &ch); + if (ret) + return ret; + + if (max_chan_id >= 0 && ch > max_chan_id) + return -ERANGE; + + *chan = *template; + chan->channel = ch; + chan++; + } + + *cs = chan_array; + + return num_chan; +} +EXPORT_SYMBOL_NS_GPL(devm_iio_adc_device_alloc_chaninfo_se, "IIO_DRIVER"); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Matti Vaittinen "); +MODULE_DESCRIPTION("IIO ADC fwnode parsing helpers"); diff --git a/include/linux/iio/adc-helpers.h b/include/linux/iio/adc-helpers.h new file mode 100644 index 000000000000..56b092a2a4c4 --- /dev/null +++ b/include/linux/iio/adc-helpers.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* + * The industrial I/O ADC firmware property parsing helpers + * + * Copyright (c) 2025 Matti Vaittinen + */ + +#ifndef _INDUSTRIAL_IO_ADC_HELPERS_H_ +#define _INDUSTRIAL_IO_ADC_HELPERS_H_ + +#include + +struct device; +struct iio_chan_spec; + +static inline int iio_adc_device_num_channels(struct device *dev) +{ + return device_get_named_child_node_count(dev, "channel"); +} + +int devm_iio_adc_device_alloc_chaninfo_se(struct device *dev, + const struct iio_chan_spec *template, + int max_chan_id, + struct iio_chan_spec **cs); + +#endif /* _INDUSTRIAL_IO_ADC_HELPERS_H_ */ From patchwork Thu Mar 20 08:21:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 14023502 X-Patchwork-Delegate: geert@linux-m68k.org Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 22C4920B81E; Thu, 20 Mar 2025 08:21:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742458898; cv=none; b=DUs98vbx/C7bHlNIYCgkhDg3Ki/tikvtv43ByiZZ62KWsWpWC6N/SnGrWUDzWTx4HfhjCrskOlUbaz/lCgTmEEoX4avdZWbAolyFv4us9WkLgwEVmjWKqRJcdD5yEz14z1/DsIBLajKxaQDs1wCmq0SaN3FvsYJKwVEE5BYsrio= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742458898; c=relaxed/simple; bh=5s+1olZvrfDepZYolF+XZxcPNp0eu1iVp32/XZsDt88=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eeSbEsES1b46Ca//NNDNLApt5W1ndsrh7hmSKmECPBBBkpWVzy7zKBHvV4pyiwe5MVz1mquTH17AdpOnoYjtUuX0dEmNORHCtzWh6kmkYKVG6HzRo37LMaG7NTxZ6aEC4uRctxuhWHtQjHdMGF+9U8JrNYq9qlOtPlOYt8xFUNI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dxPQQWuK; arc=none smtp.client-ip=209.85.167.53 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.b="dxPQQWuK" Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-5493b5bc6e8so543117e87.2; Thu, 20 Mar 2025 01:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742458894; x=1743063694; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=PHn5LS6QjK1roaVwIQAN41urQFISbkKM+favVVAYAjs=; b=dxPQQWuKBxmMbsteRZTGx6KFuFzeHnrVyQJWCdEYi2AmeKCnNMr2wh+Pkve8LFCMH7 OVuelnY7mJyKSrCMJfeMyeKrEDBhYJXcHyZezOVtCnIyUewZ5lNKF29kGm1HfNPJZtZb S+gGEqbTkBv2oPyOsNZrdRAVy3OwOYL8rBKCxbsDo6GE00UUJo1DgRxlSNpWiPbWrgBn +96v1D71nYGOvW67gdpvgJ/gzy/k00B+ObxP8XzDBmzBT/Jyy15HTSoqqcOTcLDbDNDL umB3EX1pVr7DDMADmwRNmVejaBBoS1fbkg8cCT8xFIGSiz7YzmkWMZ8drWpNnsJ29927 XjGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742458894; x=1743063694; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PHn5LS6QjK1roaVwIQAN41urQFISbkKM+favVVAYAjs=; b=AxaUBmKf+g48ZJEfZoyMmcEPQUezw/p3wI05pcAakP6cpaZ7fFT2yLXMOZxS+lB+ZP OQ5/zcjwLEifsTvaEd0wn/fh3KWr1s7UiHTVB657RnUvYNf9uVC6L7ol83SB86/uj8kc +aya6QuYOE1L7aS8wizWHrvjehT1vktlEKd8IheigINzdnoFo6td3VDigz4PwbknQiVM dc7RGnkf4zFYl/7xiLQreBvwO/aGAwfYwWVFIV1HsfGH7JMrhMLsejgKG7F1mdTpjXHa SJlu8+lL7Dpo0LCHjlHBWNWNxD20Z7OnzpUTnH89krocYt8nNnRGgTYxz95LkkKxZHDi M7fA== X-Forwarded-Encrypted: i=1; AJvYcCUW9k3xE2n1MZYmaEJJNSw8UEvjUED01cXLOm+BQPR+tw7VBIg7Fopb3P59AnrELDg0re4g3eb+aOU=@vger.kernel.org, AJvYcCWglMllZ/iJHVkGF5q7RGjRF5DZSFNNn6Yic1PyQMEFUUEyyy+XQtsrIMnpnbgIO5ow0lJUVQAzXrkZcGV9Kv7jfa0=@vger.kernel.org, AJvYcCXrrvDmVjg7CKFgosPIFvFfQV7S75s+x4TGDEU1OnRCBiImITw6SpLOyVlOk4fWZX4MbfAvcUMN1r71fCOB@vger.kernel.org X-Gm-Message-State: AOJu0YzTKnwCZavWXwzmYLafuocyKT+Ktv+AaSL8jybBzuLj8CC1Bhzj LD0g0a8MOEioy3NaSLZm3gmLoAWhQTkCKssWtypEvhRvsl+1kihC X-Gm-Gg: ASbGncv11X7R6eUPi/XLk9u7FlM3Vgy6aEMfrw8hvL+SFcXHWkmpVZbEdLiJ8zUTrC2 hYmN5JlQTpf8a48zOfCS6vatV3/ZtBcYpf6jpptcflekzDK4NSiafyCxpgywC9HSVUAuaSYuH/t pcyN9KEE+JHF5/STX9drzN25H5kWeXQ/Xzn8HFrwPL2AsbIAf8qgV2Hyzcdz2fCrkXIJfwnk90H eANYdsv4WTpeAn1xkl8F5UhmG2uEL1XgXkNPAm2QKr1pQcHXmiPd0j7yHz5kIOagQN1tFnvaDA9 eaON8zY+lKlN5UV0mXl0T/cs57A8qN1DJcEbmho0uB4Anz3i0r0= X-Google-Smtp-Source: AGHT+IH6fqyrgkSGKtXPSSRg+UaxhjJDwQO8+OiM1mUCfcH7FhAMZW5Tt3ZymhgCuqoN+F+bt02DKA== X-Received: by 2002:a05:6512:39c7:b0:549:2ae5:99db with SMTP id 2adb3069b0e04-54ad068651fmr788267e87.45.1742458893832; Thu, 20 Mar 2025 01:21:33 -0700 (PDT) Received: from mva-rohm ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-549ba7a86c1sm2209974e87.21.2025.03.20.01.21.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Mar 2025 01:21:32 -0700 (PDT) Date: Thu, 20 Mar 2025 10:21:28 +0200 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Matti Vaittinen , Lad Prabhakar , Chen-Yu Tsai , David Lechner , Javier Carrasco , Guillaume Stols , Olivier Moysan , Dumitru Ceclan , Trevor Gamblin , Matteo Martelli , Alisa-Dariana Roman , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH v9 4/8] iio: adc: rzg2l_adc: Use adc-helpers Message-ID: <9a3a11561dbd3d5023da2da05cf2190793738242.1742457420.git.mazziesaccount@gmail.com> References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: The new devm_iio_adc_device_alloc_chaninfo_se() -helper is intended to help drivers avoid open-coding the for_each_node -loop for getting the channel IDs. The helper provides standard way to detect the ADC channel nodes (by the node name), and a standard way to convert the "reg" -properties to channel identification numbers, used in the struct iio_chan_spec. Furthermore, the helper can optionally check the found channel IDs are smaller than given maximum. This is useful for callers which later use the IDs for example for indexing a channel data array. The original driver treated all found child nodes as channel nodes. The new helper requires channel nodes to be named channel[@N]. This should help avoid problems with devices which may contain also other but ADC child nodes. Quick grep from arch/* with the rzg2l_adc's compatible string didn't reveal any in-tree .dts with channel nodes named otherwise. Also, same grep shows all the .dts seem to have channel IDs between 0..num of channels. Use the new helper. Signed-off-by: Matti Vaittinen Reviewed-by: Andy Shevchenko Tested-by: Claudiu Beznea Reviewed-by: Claudiu Beznea --- NOTE: This change now drops a print "no channel children" which used to be printed if no channel nodes were found. It also changes the return value from -ENODEV to -ENOENT. Revision history: v8 => - No changes v7 => v8: - drop explicit "no channels check". It is now done inside the devm_iio_adc_device_alloc_chaninfo_se(). v6 => v7: - Fix function name in the commit message v5 => v6: - Commit message typofix v4 => v5: - Drop the diff-channel stuff from the commit message v3 => v4: - Adapt to 'drop diff-channel support' changes to ADC-helpers - select ADC helpers in the Kconfig - Rebased to 6.14-rc3 => channel type can no longer come from the template. v2 => v3: - New patch The change is compile tested only!! Testing before applying is highly appreciated (as always!). --- drivers/iio/adc/Kconfig | 1 + drivers/iio/adc/rzg2l_adc.c | 39 +++++++++++++++---------------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index 37b70a65da6f..e4933de0c366 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -1222,6 +1222,7 @@ config RICHTEK_RTQ6056 config RZG2L_ADC tristate "Renesas RZ/G2L ADC driver" depends on ARCH_RZG2L || COMPILE_TEST + select IIO_ADC_HELPER help Say yes here to build support for the ADC found in Renesas RZ/G2L family. diff --git a/drivers/iio/adc/rzg2l_adc.c b/drivers/iio/adc/rzg2l_adc.c index 883c167c0670..8097e59da516 100644 --- a/drivers/iio/adc/rzg2l_adc.c +++ b/drivers/iio/adc/rzg2l_adc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -324,48 +325,39 @@ static irqreturn_t rzg2l_adc_isr(int irq, void *dev_id) return IRQ_HANDLED; } +static const struct iio_chan_spec rzg2l_adc_chan_template = { + .indexed = 1, + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), +}; + static int rzg2l_adc_parse_properties(struct platform_device *pdev, struct rzg2l_adc *adc) { const struct rzg2l_adc_hw_params *hw_params = adc->hw_params; struct iio_chan_spec *chan_array; struct rzg2l_adc_data *data; - unsigned int channel; int num_channels; - int ret; u8 i; data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; - num_channels = device_get_child_node_count(&pdev->dev); - if (!num_channels) - return dev_err_probe(&pdev->dev, -ENODEV, "no channel children\n"); + num_channels = devm_iio_adc_device_alloc_chaninfo_se(&pdev->dev, + &rzg2l_adc_chan_template, + hw_params->num_channels - 1, + &chan_array); + if (num_channels < 0) + return num_channels; if (num_channels > hw_params->num_channels) return dev_err_probe(&pdev->dev, -EINVAL, "num of channel children out of range\n"); - chan_array = devm_kcalloc(&pdev->dev, num_channels, sizeof(*chan_array), - GFP_KERNEL); - if (!chan_array) - return -ENOMEM; + for (i = 0; i < num_channels; i++) { + int channel = chan_array[i].channel; - i = 0; - device_for_each_child_node_scoped(&pdev->dev, fwnode) { - ret = fwnode_property_read_u32(fwnode, "reg", &channel); - if (ret) - return ret; - - if (channel >= hw_params->num_channels) - return -EINVAL; - - chan_array[i].type = rzg2l_adc_channels[channel].type; - chan_array[i].indexed = 1; - chan_array[i].channel = channel; - chan_array[i].info_mask_separate = BIT(IIO_CHAN_INFO_RAW); chan_array[i].datasheet_name = rzg2l_adc_channels[channel].name; - i++; + chan_array[i].type = rzg2l_adc_channels[channel].type; } data->num_channels = num_channels; @@ -626,3 +618,4 @@ module_platform_driver(rzg2l_adc_driver); MODULE_AUTHOR("Lad Prabhakar "); MODULE_DESCRIPTION("Renesas RZ/G2L ADC driver"); MODULE_LICENSE("GPL v2"); +MODULE_IMPORT_NS("IIO_DRIVER"); From patchwork Thu Mar 20 08:22:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 14023523 X-Patchwork-Delegate: geert@linux-m68k.org Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (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 3D4071EBFFF; Thu, 20 Mar 2025 08:22:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742458945; cv=none; b=SKOTAxHxdCjUuBHRUr4wKezCMSagfmS81M0ud/Th8WlSCofn9Vc2NIFJkEu9Zz6lj/gjlLQ957SeQQl+uUu0N0uxdRTHPeCiabstVOBKme5hq2OUlGVTdySA7Osw3soKPttaxq25oMP2JCIkYMTkSEwowRYoPoJnqxqHpXk7zfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742458945; c=relaxed/simple; bh=LcKythHWTu3cvrkJmA/M35tDVU9XgXQ2PjiWeTXt5E4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=p1j52eozt3HknvR1nRlqSD+nSYVj83dAjBYeqkXCiX493/FCswsA9vn8vVrf05WkYHw+/KUSbypBmMORn4cnoj0xLnvNRyL1ZT0nX6zDFziVUhlMnE6LpYVKYPxaS/HCZPmrhuiOgTAyrWeFX6nOwGmSBqywEFNgbHB1IZHJnOQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CPX3pBL1; arc=none smtp.client-ip=209.85.167.51 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.b="CPX3pBL1" Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-54ac9d57173so1787241e87.0; Thu, 20 Mar 2025 01:22:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742458942; x=1743063742; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Pmd/n1xd7k2T8XMZPqYkLOsLsUUybFUobREHXbcUvsY=; b=CPX3pBL1Ch6amIXSdTKt/v35evaoMMfQSbvkEBNkW5M+1/MC2AWMUz/chGrjL0CnOm GDj2P7bxQmivPR83EwSJQopOsdVLFdawsuFlQY5qs60CT1tSRcGcScc/mPQ4CEm12dPS yP29s6Qx8Bu8hUbpRmTVvTpsL0BmffyoLxQiO9U+sczCGt4jz0SNIA6c2Of63r404+f5 9MaWo7IpJXa8u8kYFRc1A4i1ehtwsuFTSpCx/ggFptECHjn4Yc+vK+Ip2P66O05df+al 23VF6JTN0N/Yai61pmmipkZ+CRE5VAa1lES9ha6df4pJuI6cbpSCJa53W8X9tUvEdWTW PE7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742458942; x=1743063742; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Pmd/n1xd7k2T8XMZPqYkLOsLsUUybFUobREHXbcUvsY=; b=n1XpzgFVLhDidYuhCi7NOQR51JzNDB1sxreyFmzz2mhg3x6bk56G+pznPgTDcXZmfW EiREcE70bSewZbRCydvlL9hfpNaI4Pyg7XcaP+2LLGReAIib4aRYOj/59gxWWXuoDeK0 Z0dV4HGztp9mJ1hNt4e4WPy6tOAFhHBLsAdZ4xns2Yn2cshwyQaR9OolQZRWtEwapbc1 Ytl6xtsEViGG+zffn61WJg57B/Db6cc/tsPcCeGxH8Dh9djiq87HtCz0U3s8xebjs3vO 5A8Ay/ojYzcMny8lXumzGQP5lwB3kxJ0ICmoPG8X0QcyRd5GbXmMhacsBPNMVqZqRN2H 6wrg== X-Forwarded-Encrypted: i=1; AJvYcCVNg1bud73dKcn5oFJWDzL+w41VHuVmpwCF2Yie2wIilxr+ivXmQnudxxbwlpnGXBZ+oKLNZVzfiVCv3Op3I+Fa2Zk=@vger.kernel.org, AJvYcCWVYVq2AsxnqGi5WiGEftXbDUGwd53Rh4rUn38rFIY9RbEb92VatpF2ZZW1sOa6P0nmX//4NedRiBoFxQ==@vger.kernel.org, AJvYcCWVYgWmX0CEKzTQ/vvEd9KtE9fPYSHXM++797WBDO6ADjnTV6W8c3C/hT+0KwkO+ffbRdTAXP8zWIl3M40h@vger.kernel.org, AJvYcCXJ8HGSD/tnZGb8fliLL9DNCTTko501mWCKAANsvf+z2FR4+/ETrrpWPTeZGzhf3Gs1QiAw4/UW2xZo@vger.kernel.org, AJvYcCXqEDM9D9Om65UFRL+g/WZ2PwMC0dS+YFAWZz6gg9F8lzDI0sEfcCxPw38joiM9v4QV1+eDI1hWmj6M@vger.kernel.org X-Gm-Message-State: AOJu0YyA/t18TN8GSV2Juq3NSfE32CL0HMyu4M5z/u52+dt3/0mQxamS QGnV/52R1bjH79WJovdmPlHc6fDQOx5ExubOW6nG+JyiBovyz3lI X-Gm-Gg: ASbGncurbgTsyZmGZRj0VPDvQLH/WM21g0/YOI+VPdKkCCEXp5/FfK31SVgsvBmgMIC WANs6d5x9tY6EfsePrnBxZRBjFXnoaajHXwvuPIpNWjDHePlj1wFRVWlwvn4ImZO5bS7bZjvB5L IYu6mjRTTYI6FKqqhrSh+rJCMuCulGFpJir6MD7f5kawOi92/cmZqkBtKGI/SSiOJ4G6zf0RUNu mZ1iH04U0nXByAE6VNrj+apmU3NYYfVLx+ky0gmepUIbbeDFERIuB1eYtA23+0O8ATymoca3DO+ AvnfpW4PZ3xD2hIZytTUHLRjm8h+7rYsiYbziBagEMJVM90wFRI= X-Google-Smtp-Source: AGHT+IGN7jQq3CGHj0RH91IeY9Q032+tQbArvaah7gKQeusMKWEMnoW/5Hlgr2n0AqqsWIEjFWFNPQ== X-Received: by 2002:a05:6512:1596:b0:549:981b:169d with SMTP id 2adb3069b0e04-54acfa81f3emr851829e87.3.1742458942033; Thu, 20 Mar 2025 01:22:22 -0700 (PDT) Received: from mva-rohm ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-549ba864d7dsm2141832e87.130.2025.03.20.01.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Mar 2025 01:22:19 -0700 (PDT) Date: Thu, 20 Mar 2025 10:22:14 +0200 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Andy Shevchenko , Matti Vaittinen , Lad Prabhakar , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Nuno Sa , David Lechner , Javier Carrasco , Guillaume Stols , Dumitru Ceclan , Trevor Gamblin , Matteo Martelli , Alisa-Dariana Roman , Ramona Alexandra Nechita , AngeloGioacchino Del Regno , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v9 7/8] MAINTAINERS: Add IIO ADC helpers Message-ID: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Add undersigned as a maintainer for the IIO ADC helpers. Signed-off-by: Matti Vaittinen --- Revision history: v2 => - No changes RFC v1 => v2: - New patch --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8e0736dc2ee0..5b96fb864227 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11208,6 +11208,13 @@ L: linux-media@vger.kernel.org S: Maintained F: drivers/media/rc/iguanair.c +IIO ADC HELPERS +M: Matti Vaittinen +L: linux-iio@vger.kernel.org +S: Maintained +F: drivers/iio/adc/industrialio-adc.c +F: include/linux/iio/adc-helpers.h + IIO BACKEND FRAMEWORK M: Nuno Sa R: Olivier Moysan