From patchwork Fri May 23 15:26:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Adolfsson X-Patchwork-Id: 892145 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2076.outbound.protection.outlook.com [40.107.249.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0900D21B9E5; Fri, 23 May 2025 15:26:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748014002; cv=fail; b=kLR37ggMDyyNajc5bLBS3g7o7Rv+MR+DxKNJ1SQyCs/2bOb+RsM6AsmDDGXsBf0fx6Sa6dxYKeOW8uD4c2mk54kSTczHTzhg/UARx5RtFoNXk4ak76QXImzEi3DWOProMg9ksuB/47gT15QdZRtdbtaAgM03QbpWtQuhh2W0LX8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748014002; c=relaxed/simple; bh=rpBEWzAMTtwOLzgJONSLm3+B6XKYf8u3EQiAzYtPVas=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=qXYMrO1LddoRodnaAVQr3dt7uEFy8C1NqebfOMbJSDooV0cRs4ygHQ4hymtIQey//mcbzZSq5JsaMVpSDI9C91urv9JKKV0XN9KUKEG/NmHVa7T0h2YP/QuGYsUuOj7FsVpl8obgZqmOU+lilXzTHcyv3TkZ8fuDqe0UvOqQFAE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=axis.com; spf=pass smtp.mailfrom=axis.com; dkim=pass (1024-bit key) header.d=axis.com header.i=@axis.com header.b=k3iVTxmR; arc=fail smtp.client-ip=40.107.249.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=axis.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=axis.com header.i=@axis.com header.b="k3iVTxmR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cMPrn4fWcL5HuXbey4Uck0K0ptel7nqSkRkMnLGAapVcPNOjgzA2KYV6xWCcxqknFW66TCSYUVV/0oX65iliZdqyFTdAgtuNQEUv3N71MZeT8ntsOGDHIIff1kjuga2OmaEEEfq4xS+6JyfsgJhjIj5FKSa/UOtTEv6UDFmF2f55i0dMMmLA9yZEwV9PW5zbEZfP8QFrefyMGhD4XoJT98eDwpvjm2ejMq+/yjApxxG4IdfVSiz5/YLo80Ezkkq0dGDv9T8KiamSc88t4Qp8r7G6rOGp28O/28DXp/oXoDRHeD9Pu8pg16Hg2LddRho7dnSiO9kyxc9uV1Nqh4L4ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=St2MUIDS4Ve8WSUS/6sGoU0M7rest9FRet7CC4wN/U8=; b=NR0rdewPcWdQQ7i4260JYpwDZdaje9mrtM+6fC8Bkb87GVH+mjE/SnLcAT5UoDONsQOYeCOrAhNolyq2ykXi05d5wErxcLIwnPQZ2s/V/jKndcMAoBq1wrrVVHZGtRRihvFoEw5dNuX0mfOIq1UEwF7NaNKjFup/oLz6RYXj8xm4+dt1Rpud2Sc1c+entoseiFdv8sy4YR1yl9DeSiVE9ggc0BttXPQFjLKNDxjvNSsvg17ZSRFi7698MQsvVFnvhTPeM40rJUL8vYFlM/edkniAMTV6zuy0TBqiZ9JJcYtDwPiif9t/CgSM235CIH2ncJeb5ZBFyVZHeFmv+AUgmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=gmail.com smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=St2MUIDS4Ve8WSUS/6sGoU0M7rest9FRet7CC4wN/U8=; b=k3iVTxmR6MI9JMOKJ6c5ha1nk8jH+UVRjQ0uAt6aBpokL72HTkzQ2uG+Ytyg8sHmSbzq5oQHzTHPNteMNqUg0TY+r1XPi/OvSz1S4LPDxC+aQtWR0g67F7B1VNJu47FxQlyURwErX6/A5YWqosb18DouRxNvBL/pcR+7rM4/BGE= Received: from DUZPR01CA0028.eurprd01.prod.exchangelabs.com (2603:10a6:10:46b::7) by DB4PR02MB9310.eurprd02.prod.outlook.com (2603:10a6:10:3fe::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8769.21; Fri, 23 May 2025 15:26:36 +0000 Received: from DB5PEPF00014B95.eurprd02.prod.outlook.com (2603:10a6:10:46b:cafe::92) by DUZPR01CA0028.outlook.office365.com (2603:10a6:10:46b::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8769.18 via Frontend Transport; Fri, 23 May 2025 15:26:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DB5PEPF00014B95.mail.protection.outlook.com (10.167.8.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8769.18 via Frontend Transport; Fri, 23 May 2025 15:26:36 +0000 Received: from se-mail02w.axis.com (10.20.40.8) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Fri, 23 May 2025 17:26:35 +0200 Received: from se-intmail01x.se.axis.com (10.4.0.28) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server id 15.1.2507.44 via Frontend Transport; Fri, 23 May 2025 17:26:35 +0200 Received: from pc51235-2237.se.axis.com (pc51235-2237.se.axis.com [10.96.29.3]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 61A183145; Fri, 23 May 2025 17:26:35 +0200 (CEST) Received: by pc51235-2237.se.axis.com (Postfix, from userid 3319) id 5BCE54033C86; Fri, 23 May 2025 17:26:35 +0200 (CEST) From: Johan Adolfsson Date: Fri, 23 May 2025 17:26:27 +0200 Subject: [PATCH RFC v3 1/2] leds: leds-lp50xx: Handle reg to get correct multi_index Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20250523-led-fix-v3-1-86d2690d2698@axis.com> References: <20250523-led-fix-v3-0-86d2690d2698@axis.com> In-Reply-To: <20250523-led-fix-v3-0-86d2690d2698@axis.com> To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Jacek Anaszewski CC: , , , Johan Adolfsson , X-Mailer: b4 0.13.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5PEPF00014B95:EE_|DB4PR02MB9310:EE_ X-MS-Office365-Filtering-Correlation-Id: d433f45f-306d-4ddb-b0e1-08dd9a0e3520 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|376014|7416014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?F9WnLZyT7sv0xM2m6rcnIYt9FN2xR9u?= =?utf-8?q?UTCGuIiDviNITgMb8gRpOsvLtqVsUxX3u9n+m8xoHwlyjfd+QclHKjPYvvOR9RWl4?= =?utf-8?q?6vMJxcZ/zkLAAzv20pEWG3idDxMZU4Tp7RNgOfTUzxhWiRZ+vSsYh66VFi0hpYLqy?= =?utf-8?q?4FJMo+d9ME/u5PovqLYGQH5omKM2kQD6b3dCOxfsu2MLJh8TAAYnrCsPhJXEHr/e0?= =?utf-8?q?1pvkkT9Jpy2F9OouXVrhEkrRzt6i6rjLeZY8Fo4Si+7VDlJx0E1rGlrHIzY0tnXgb?= =?utf-8?q?NX5n6kiuvLFvhieD+74JZQR02wtnPeIAVPjQ09MM7uOiDlhCL2PlvyA+MwNh9NR4A?= =?utf-8?q?MEInQUgQY0V/1G0z+f+lKIwviY5a2oasy3NnXeVYHoipcXoVPLHmwzq1aUAkxinnD?= =?utf-8?q?cNMds6z1C1ev0aOLNQHeLqtgtZEbqHMlKvqoRRa1Ny42x3vcSf828e4x3bF8zlxJz?= =?utf-8?q?E7rLBm9RP5jxwZM9loVR3VU3sYIKuMe7mflCOUp6xqI2GrcHnKNE1tDrKQ7SCueGh?= =?utf-8?q?OHnvBUxtyLYXoy6UY6SVnyTkuqNHUyGcu+tR1odupITsAyoCC13WXewmYAsUWESRv?= =?utf-8?q?ANwFn3ccc+Wek5XrrarPAvCz7nEOM54RMcgOl+ZjIv7ZFDBKR9utRpN5OzzSRy3xt?= =?utf-8?q?I/DRXf1DUrKNNFbYjKa9+9V0nxPEOpVYRz1leyozjWs1jq+WInB6TQlAKX3KiD8Gz?= =?utf-8?q?uJ04d7owg2MdqIuGDCcNeAaYAaBI2sASFM8N44GPKGzpk03W71ClcxBu2WTc1IBj0?= =?utf-8?q?LhIDXpcplbG6Ad0mK+UPgD5bfGzNv83PfB2okvhwkhs0ALZvu37VUITF3VZOx+w0D?= =?utf-8?q?ZySa1tNBx0nvHi5mOEX3tC2aVScuWGivEO4tNiqbrr6BO/Ibt5lu9AqINF60tYsLX?= =?utf-8?q?P3Ym/eu2N1qrT0vYGSj4/1dByWykVWQdmZTDJUF84NcZDhROTlw0GvDdZlUYeQ1hM?= =?utf-8?q?fhMFljIv9toviy0HJebWPcY2BUbCwmabphuHvKSEPeqP4rQdTqXQ6QVXUD3RQQEhl?= =?utf-8?q?HitRZ4uVXsSeWmpOr7n4pXs5OCEDQISuoML0amgUbiGNBuWPTpsHMNP6UVPOwGofy?= =?utf-8?q?6QOF9bkBwRx7XIQRaKdySOeWBs47aTDlKeIOiXq5t2pnK2mjfrnwDKXwbYfNtkQc9?= =?utf-8?q?53O+e0/t/bI3cWP78Jj2PAxug74Npxa9KMxiATyWohQ70hO4cnX9JGI+l/jPKzvk0?= =?utf-8?q?a3A8H3ixMolHI++tVCqW+ULuNXo/YJIad8ACiC6TK3uHUV/R+6a0iez5OIC77H28F?= =?utf-8?q?1hKg38gsKeR7TBIVLMfl1nsGKa4v5Adk67lLH8nj7ZNm2MuaJJG7cl95pIyJJo9Xh?= =?utf-8?q?0d7bL7xnBHwObxXq+ibonuZRwCGFjs3pnMIYggQ3E/K0qDL5DZPO1o5Jl7NEaaBw5?= =?utf-8?q?mQ2hTjjRh8UuHjVFU92pTLMcsJj5OOP1pNsGuMfcF6OZzT2dy6K8WNuqrz7NkEEj/?= =?utf-8?q?fdq5KhM2y7?= X-Forefront-Antispam-Report: CIP:195.60.68.100; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.axis.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2025 15:26:36.7535 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d433f45f-306d-4ddb-b0e1-08dd9a0e3520 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af; Ip=[195.60.68.100]; Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DB5PEPF00014B95.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR02MB9310 mc_subled used for multi_index needs well defined array indexes, to guarantee the desired result, optionally use reg for that. If devicetree child nodes is processed in random or reverse order you may end up with multi_index "blue green red" instead of the expected "red green blue". If user space apps uses multi_index to deduce how to control the leds they would most likely be broken without this patch if devicetree processing is reversed (which it appears to be). arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts has reg set but I don't see how it can have worked without this change. If reg is not set, the previous behavior is kept, index will be in the order nodes are processed. If reg is out of range, an error is returned. reg within led child nodes starts with 0, to map to the iout in each bank. Signed-off-by: Johan Adolfsson --- drivers/leds/leds-lp50xx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c index 02cb1565a9fb..8067aaa916bf 100644 --- a/drivers/leds/leds-lp50xx.c +++ b/drivers/leds/leds-lp50xx.c @@ -476,6 +476,7 @@ static int lp50xx_probe_dt(struct lp50xx *priv) return -ENOMEM; fwnode_for_each_child_node(child, led_node) { + int multi_index = num_colors; ret = fwnode_property_read_u32(led_node, "color", &color_id); if (ret) { @@ -483,8 +484,13 @@ static int lp50xx_probe_dt(struct lp50xx *priv) dev_err(priv->dev, "Cannot read color\n"); return ret; } + ret = fwnode_property_read_u32(led_node, "reg", &multi_index); + if (ret == 0 && multi_index >= LP50XX_LEDS_PER_MODULE) { + dev_err(priv->dev, "reg %i out of range\n", multi_index); + return -EINVAL; + } - mc_led_info[num_colors].color_index = color_id; + mc_led_info[multi_index].color_index = color_id; num_colors++; } From patchwork Fri May 23 15:26:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Adolfsson X-Patchwork-Id: 892326 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2051.outbound.protection.outlook.com [40.107.103.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2753128819; Fri, 23 May 2025 15:26:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748014002; cv=fail; b=bM2fnbch88U/9ngyuhUYJNJWbJ+0HecddnYaX3EtMLLOJ5n7JvC0NKCi6mkWXpuv3Oy/UwMs040OWQpjuyajAIdtuE/uzIVhm8ZmqjY/5efrTSqXNMpyyJ/tcQdVghqXWG5L3jJhasHqwJ74BJ+dFL7e5IjO/QtnuoN6wAmg+P0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748014002; c=relaxed/simple; bh=yVQk/aDCqy3+ve1iH0j2cGrtfFjTKF7BBOA82Z9gW/U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=Jm79927AhhErkdNxJH2gvEEr7tvYg0bfaoHxrLWXh8LdpO3YlV+/RfdURQD3sbiyvt17FjKJzfKXwTY2UrmDNtHwy839Z1Zf04tEYJVrLouxQ3dbUFe8izPpA1gWHEFBW4iTY1cjs38mnt2a+UYo5EpFPNK4OYUdN24DHLceu9E= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=axis.com; spf=pass smtp.mailfrom=axis.com; dkim=pass (1024-bit key) header.d=axis.com header.i=@axis.com header.b=CcIwvqzU; arc=fail smtp.client-ip=40.107.103.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=axis.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=axis.com header.i=@axis.com header.b="CcIwvqzU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kImDf22JxGO6TMuKG3cVKdD/uZyFs9rMZxUECcJ5mHGo5ahyE1hp62YAcqzVm3tUIadPK60ohdBcDqlMehBiduZDu7o8dKg9drnOyplS8BcwC0BU2osKEU0aRTxsUpCeeBXZvyXGuSexejsKypx+sziJtbfzLAVYhDvCyN7tlVnbUgUClhnrEVqDi2WonmWW27xwB+bhlZSLtaiMXj+QqSDdRvzbKArPLQbHNdNA0/bMdI0434ajYPth44DBfXnFlO8CKvIEbMZ3Ih4MnJCeLoyXSOMU+Hs4ogJb763kgT1Jxu5bXAa9ZdKGcmVIq5/i8rjet930MzBRf8/XR/EUQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MhdbDi+aRHt7jsxtxO5J6n3+C61wT+1ITJLlT9AgoDY=; b=KDK1Ar2hLErL/ruKNSCGeT+TIZndhj3JSoB2OcLcgvQCS7sfG5Kmep2P4n9H/FW7EglURbRc83Wc5wsFEwnSP8vmMRYOauRsGWu2ir2ubTUJqijG3NFsGmAHGMexfa7pQv/VEXUTrClB04gRRhg1kauBJlXcVdQ/rDgT2SQRzCLoy0iHIfCynIgPu5DX5HsRKXAejzcp0VHQR4eqtB904F8hC6+iKCXrYcc8L8iS1YFzHN3EdmtQkLGGiejaO71zb4TQ/ZlQAtLTEulqXHfc+5qCpp9rHZ0lnpXy8I5H1Udd8psIxplPijyFppzup6NJwk8Q+TDHoHPD24/+Q+Vyww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=gmail.com smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MhdbDi+aRHt7jsxtxO5J6n3+C61wT+1ITJLlT9AgoDY=; b=CcIwvqzUIoW1/1jNNb8cekx/cab6sZI+Yys3whdIuznWOwl1JUMFhhaBRgpnj/9ve4XRKpOr23DTetJbAkaSkoJs5we2oNtWoB4rkoiy/GFjq7UjeSUTf5PvhGld+sfmqXSpfUVy0r8Drb04cnPewWyp/ApctE+LkGmX4ofw6X0= Received: from DUZPR01CA0018.eurprd01.prod.exchangelabs.com (2603:10a6:10:46b::6) by AS8PR02MB7336.eurprd02.prod.outlook.com (2603:10a6:20b:3b3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8746.26; Fri, 23 May 2025 15:26:36 +0000 Received: from DB5PEPF00014B95.eurprd02.prod.outlook.com (2603:10a6:10:46b:cafe::45) by DUZPR01CA0018.outlook.office365.com (2603:10a6:10:46b::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8769.18 via Frontend Transport; Fri, 23 May 2025 15:26:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by DB5PEPF00014B95.mail.protection.outlook.com (10.167.8.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8769.18 via Frontend Transport; Fri, 23 May 2025 15:26:36 +0000 Received: from se-mail01w.axis.com (10.20.40.7) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Fri, 23 May 2025 17:26:35 +0200 Received: from se-intmail02x.se.axis.com (10.4.0.28) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server id 15.1.2507.44 via Frontend Transport; Fri, 23 May 2025 17:26:35 +0200 Received: from pc51235-2237.se.axis.com (pc51235-2237.se.axis.com [10.96.29.3]) by se-intmail02x.se.axis.com (Postfix) with ESMTP id 701DD2921; Fri, 23 May 2025 17:26:35 +0200 (CEST) Received: by pc51235-2237.se.axis.com (Postfix, from userid 3319) id 5D0EB40364CF; Fri, 23 May 2025 17:26:35 +0200 (CEST) From: Johan Adolfsson Date: Fri, 23 May 2025 17:26:28 +0200 Subject: [PATCH RFC v3 2/2] dt-bindings: leds: lp50xx: Document child reg, fix example Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20250523-led-fix-v3-2-86d2690d2698@axis.com> References: <20250523-led-fix-v3-0-86d2690d2698@axis.com> In-Reply-To: <20250523-led-fix-v3-0-86d2690d2698@axis.com> To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Davis , Jacek Anaszewski CC: , , , Johan Adolfsson , X-Mailer: b4 0.13.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5PEPF00014B95:EE_|AS8PR02MB7336:EE_ X-MS-Office365-Filtering-Correlation-Id: 585ab02c-e6fc-4cdf-555f-08dd9a0e34d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|7416014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?q?hBy2V6YWKh99d10pqtTO/PLNzGJmmfU?= =?utf-8?q?dpCAG6b7WW/2L+maAm+VG/qwnFdF4Ii9obTThlVhuWz35EMvqq95XKVjkn20YUFyn?= =?utf-8?q?F6uQdC3sixXOfcSXerOFQ+7RVT5d7LUNDPyQlrgyq4ASPBDkFz7lnBOTihl29SCSn?= =?utf-8?q?QP6SfpH9fodrSUf9mVbNHI5zYnA5e2sIYjpmVqcwvpcUsoVYYLsZnf8qgUWTidbMx?= =?utf-8?q?rzFytj+Pex6ctWiEJ9Se1uVFYXlxPP6Q3SZC5y4r0m2YBTv8eQgrQNjsrgeuNx65g?= =?utf-8?q?UpK6G2iJkYYravFQwU5hR45Ie4cvOam09VnhJ9q49tWo0n9caN5KLUS+irUtuwekY?= =?utf-8?q?MU52qwdjPFmzVf3oQTVbdVutw+fplSaVexzYKzZ0JZFywtQeHXz31qQ6q0aonrWWW?= =?utf-8?q?dA+UeK1omvoBh0tmWwcyiaQn9CQy/PeScKI7wmrHQH/04Y1G3pmcdRIStFQNiAXVv?= =?utf-8?q?oreyLLbV0b/vb7KhEMmqyoDSGjuTkUvICZRy0MkTz3HqioU3GOX56jkmkbgqpBGXO?= =?utf-8?q?VcpUWq5ZPfbryIkKf5R6XuAaPKUpAP29cMvKkVBRu3qor8cnJIxgnrwgbddLepiem?= =?utf-8?q?J52fvPXXzYhnJdQkWwiWHIid29wsKyuzja+SCzUmLZvtQ7Q97G9vmRWimlfnt8Yce?= =?utf-8?q?HNGnXQ29g+GliQTQaIy14XEgQCi4nmgCmXBRIjJFF4C1vYuwrQkI8YMv4+OdsrFFQ?= =?utf-8?q?XLvZLzU1Nm/IrqoCJFeM7N2wBJhw2pk4hHIqX3KJl0WUtG8YG0NZff9UDZ2zMBeKI?= =?utf-8?q?YlHz4yy1382OMk6t0mXVpplyBXqtmcLMl59YnFeacoNxKvOSOLNxcrmJyOY98MVB7?= =?utf-8?q?xy6wSKD7uIvD9WPUety0hhjPSMAP69iTMb3wjN+jaVJ54hq18DQblhWuq5BOSksry?= =?utf-8?q?aRXF7e0r7LRoH7STCiVflmh0DuJE/rFARLhx2LUtbUBqtagnWwAHl6UwWDjxRY6nQ?= =?utf-8?q?KoHAamncjz0CllnIN6S3xNy3DpUvwtJxSZZPxWnFKVhPCxs2rbqIMhWQ927yPIib5?= =?utf-8?q?UlvzZ6psVmeaCYuTMalaGMzqFWkhJeWTnPyu1of2y6EbQ81zQ/27LkkZ3iEfhhTN/?= =?utf-8?q?oyQQA9HtIK26Om12Lgf8muIxbgIyLJ8+Wl91Ttkv2E2mQYUSvoAtseEVFrMuatOP9?= =?utf-8?q?sTEeab842MsnPIOpdhStEWAbfXHTCWDXPbgQqEX4qSQM1GzECEyc00Hk6+SI5hhmr?= =?utf-8?q?WZCz/iOc1CjOPl8G+wl2W6Nb6NPZuKCEx6U3uLyT1M4COHQvop14z22H7kP1UU+wr?= =?utf-8?q?Eu/j7b1H436q77p3xYb2Px2dV197iOnYcRK63vmBCZk96PyYiTiOlyYQIQSlkItKp?= =?utf-8?q?OjO4ZiLaUYQktG+MdDp2O/lUqjPHnRCDFVXl0ckCEOge9UHugV/5xxI1doIGOizx3?= =?utf-8?q?4OVdu9jKR8ve7s5/K/u1xiiQ3BDmTH4pJZjz2mkdkpTJwy87uOtB+4lNVTQlMqpbr?= =?utf-8?q?FLaoc1YwUo?= X-Forefront-Antispam-Report: CIP:195.60.68.100; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.axis.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700013)(376014)(7416014)(1800799024)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2025 15:26:36.2771 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 585ab02c-e6fc-4cdf-555f-08dd9a0e34d8 X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af; Ip=[195.60.68.100]; Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: DB5PEPF00014B95.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR02MB7336 The led child reg node is the index within the bank, document that and update the example accordingly. Signed-off-by: Johan Adolfsson --- .../devicetree/bindings/leds/leds-lp50xx.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml index 402c25424525..15dcda96e867 100644 --- a/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml +++ b/Documentation/devicetree/bindings/leds/leds-lp50xx.yaml @@ -82,6 +82,12 @@ patternProperties: properties: reg: maxItems: 1 + minimum: 0 + maximum: 2 + description: + This property denotes the index within the LED bank. + The value will act as the index in the multi_index file to give + consistent result independent of devicetree processing order. required: - reg @@ -138,18 +144,18 @@ examples: color = ; function = LED_FUNCTION_STANDBY; - led@3 { - reg = <0x3>; + led@0 { + reg = <0x0>; color = ; }; - led@4 { - reg = <0x4>; + led@1 { + reg = <0x1>; color = ; }; - led@5 { - reg = <0x5>; + led@2 { + reg = <0x2>; color = ; }; };