From patchwork Fri Nov 17 11:38:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1865060 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=AC7aXXOm; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SWw0J6Vlwz1yRV for ; Fri, 17 Nov 2023 22:38:56 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CC84686F7C; Fri, 17 Nov 2023 12:38:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.b="AC7aXXOm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0F409874CC; Fri, 17 Nov 2023 12:38:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,SPF_HELO_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20724.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::724]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1402F8700F for ; Fri, 17 Nov 2023 12:38:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bYSQRg8gPIWmj9+BW3wS5g+i5A/em4cfMmxT5jsdOYO2NvOWMTtt23S081LHGDZ+WgugwgkKvGxGil3FgMgwPYVEARYPeE9q9SrChHbUnsfd4MtLWBYupv0psuRlv8S6r9WlIv1anv2hZC6RogNaT7nG+uoLjDjgCHdNiE9QL7QcP7BiDM2crIjIkJdcR5Urm+bgg/7nzfGcMMBGX6Pp+6DQcyLU2OAQk4nezQ0Z0OVCKlTNKMXg1JqL3ZV7ZcJCWmP6QCzGDiu6FFEQEF9kgvPasi9b/wSHi39LwHjhnYQ+/KgOkNv8dp++yGrSo6kfkKi951AS6lyFzHIS5l+Ycw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=kXFu3YiUcWPoo760f09aohTJrzgxZNux8JAr4QqwshY=; b=UKlH5ze2N0RHkm1/cqMoOxTSeV0R8/UASThi7e9AMSvWzI7pQmn2/nTPqijtoSMy7mV0VlVj+QlgoJAjDD6DVD3Z+O/cpOhXn2nBMy8g9K2JyLIWgGcEPjlSr+pPKtBWwoGzmBXSj6L4pVLjJLNawgZ4oVzjsh5AxGW3vjCoKiq6fe0rkWNJUajgqLIZcgCq9faLgQYImJft02n7v22s83DXnegCgrW6ppK0J+5hv29WXQeMTJah2D/IG6louueNVxRyiCptDO3K1StTUbGZOuCHswzwcFEnqINNq8oewgmrlxpyXVSY3onVHq8igWjnIIhul7ksw/H6FbRFun1r5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kXFu3YiUcWPoo760f09aohTJrzgxZNux8JAr4QqwshY=; b=AC7aXXOmRpVeyC9FpmDTqJEeGijsGZOEofNMFLJCPuDT1IEzx5KhlwrgzrhWq/e7cKZAK48IHq4sYhQObyGb1LDt3mkRQly3PWy9fbMLp7nCtKW/Sx+5kyZzSkmVJOx/ZpubS9LxpPHrm+WrwLcIVV/fHBwC5WONHVpX/OCdiao= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=prevas.dk; Received: from DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:45a::14) by VI1PR10MB3664.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:800:13f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.23; Fri, 17 Nov 2023 11:38:20 +0000 Received: from DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM ([fe80::8bd9:31bc:d048:af15]) by DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM ([fe80::8bd9:31bc:d048:af15%5]) with mapi id 15.20.7002.021; Fri, 17 Nov 2023 11:38:20 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Marek Vasut , Philippe Reynes , Doug Zobel , Tom Rini , Christian Gmeiner , Rasmus Villemoes Subject: [PATCH v2 0/6] some LED patches Date: Fri, 17 Nov 2023 12:38:05 +0100 Message-Id: <20231117113811.149329-1-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.40.1.1.g1c60b9335d X-ClientProxiedBy: GVX0EPF0000FA93.SWEP280.PROD.OUTLOOK.COM (2603:10a6:144:1:0:4:0:16) To DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:45a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR10MB7100:EE_|VI1PR10MB3664:EE_ X-MS-Office365-Filtering-Correlation-Id: 3d9b7968-a3c6-42df-6404-08dbe761b2db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 99346qXMUsQ/CAD7S9dHXpDVYtUPqDF1JUz1Imf6eIhB1F8NP8oqmnuLnAHEuFHpFl+amToxy/NCC9vQgF3Ko/ySNIc+1qLU+vAa+n3kueFVBalgFp08G1EnhntIBXTttm6C3+ckivMmOuKKgNZaKxPJodQBiT+AKEqafmy3qMlE4j7tZUDT7mFnQarVPdeLt2bKgKL5/Fo8fybZpfLVYsGH/FdAWmUJblHQRAv28pCLGGRE7jt3avifqQG5EIwyZcGCRmPMuxzGrlOFrtw7LHjtihJGdh2PUH88ToZDhoFOBcvlQ95NZHVSa/NF4yyomNWZOifwjuMSKl1f5YDDEdZhQbMBow/v4GVTvrizeBpFIV3cZR4o+2yW17Jf83QtvnjaCl/JZHepegA/GzWjoLw8b6TsdBi3CrWxadxqOay8THfCPbZGSlrxgQIPs4CBpphesLP+LYtuwyQ0TFMrLzcZ2cxvrFN+EaCMERR7EZUyoO+rDUaKp+5Yu+lQZsKLir+/2pjQrR1v+QhfeIIDqso3tpvTWokOTmFV3+Z/+pRQwOVTvGgpJLgGZKUOIXSuBeF4j2GZKoSwX7oPW2EuQhnxLzfLjFPU5c5X9/JHfXZQoKmKHFW1RO/xPGIdLtpB X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(396003)(366004)(376002)(39840400004)(136003)(346002)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(38350700005)(52116002)(6506007)(6512007)(36756003)(6486002)(41300700001)(8976002)(8936002)(6666004)(107886003)(5660300002)(86362001)(1076003)(8676002)(4326008)(38100700002)(26005)(2906002)(44832011)(83380400001)(66476007)(66556008)(54906003)(66946007)(478600001)(6916009)(316002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ERa57LatEZi2GHxziCuPrbwNiyZhMo6kQlv4MaBOMw86ui0NiZ6zl9cQdZtB1W9/vCPxtT6cw+No8VFw6lhYFFB9lr1FuiXu+R5/hYkisvFXZ8GuhUKAw7J1YeEtWRO1y5FQhhfhB05W/WeYZ/Lki7JXqSD3Qst473iUOvSedkK42kkNpJRgl32CxL/3yzCR+35WFZOUYwSUvZtJ5TtVgK3hd9CoGkwlD5n7v+eGb0ha6wCCA3Fhe8lmEEwrMJHHTuvqAjqB7kgHibwK10R25CXRiEII1VOy+mkptl2+H7WfbdQHx6hoaJChk3mKibmRYfMGRiAFIne/tYOenqwE0ZCS2L6LOoH1VFQ0oc+hC+JoDXwzKGHN62fNgfAF4xKbvqclNMnC3o59F9/0wWre1EPU8rWEZIO8rj17gtGHYp+lBQcsRfpePsuvhmpsv+8b5/pELT0CdD2WRDonaY1xPTOmF71NMRr/sJsvFRjSDN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HwobYNSxx0D47W7zUjeGL1gFd/VA99tw2dB1nlDp6xTaRZyJ66q1q0gfdJ69nw== X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 3d9b7968-a3c6-42df-6404-08dbe761b2db X-MS-Exchange-CrossTenant-AuthSource: DB9PR10MB7100.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2023 11:38:20.2803 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BX/i1RL4PbnP+RJVS7uq2g8+Ahpt4aYS3eWlzF4O+rhenPqrdshXyK2gApKd8gc2f0BCchxIPotImeartJJRPNjaSZ1rDqszlj55AN2GmFI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB3664 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean I wanted to add support for ti,lp5562, and found an old submission from Doug. While trying to modify that to work in current U-Boot, I found a problem with the "move label handling to core" patches. Patch 1 is a prerequisite for the ti,lp5562 driver, which turned out to be needed by Christian as well. Patch 2 is an attempt at (quick-)fixing the mentioned "move label handling to core" problem. The real fix consists of changing remaining drivers to not bind the same driver to the top node as to the child nodes, but I can't test those other drivers. Patch 3 introduces a helper which should allow removing some boilerplate in most individual drivers, and 4,5 apply that in the gpio and pwm drivers. Converting remaining drivers is trivial, but left out for now. Finally patch 6 is the reworked lp5562 driver. While I've changed it to match existing DT bindings (with the goal of making it work with our .dts that is known to work with the linux driver), most of the logic is unchanged from Doug's original patch, so he is still listed as author. Changes in v2: Interchange order of patches 1 and 2, add a few R-bs, and try to trim down the commit message in patch 2. Doug Zobel (1): led: add TI LP5562 LED driver Rasmus Villemoes (5): led-uclass: honour ->label field populated by driver's own .bind led-uclass: do not create fallback label for top-level node led: introduce led_bind_generic() led: led_gpio: use led_bind_generic() helper led: led_pwm: use led_bind_generic() helper doc/device-tree-bindings/leds/leds-lp5562.txt | 63 ++ drivers/led/Kconfig | 8 + drivers/led/Makefile | 1 + drivers/led/led-uclass.c | 22 +- drivers/led/led_gpio.c | 15 +- drivers/led/led_lp5562.c | 578 ++++++++++++++++++ drivers/led/led_pwm.c | 14 +- include/led.h | 8 + 8 files changed, 681 insertions(+), 28 deletions(-) create mode 100644 doc/device-tree-bindings/leds/leds-lp5562.txt create mode 100644 drivers/led/led_lp5562.c