Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1458932rdb; Mon, 2 Oct 2023 10:03:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoFsUgWtvrMfkfgNddJ1f1TtWcmQcOsHpTvulEIXfC3PW9gyUaWH0/3doQlzvKB+S8A34m X-Received: by 2002:a05:6a00:21cd:b0:68f:cd32:c52d with SMTP id t13-20020a056a0021cd00b0068fcd32c52dmr11503827pfj.14.1696266227534; Mon, 02 Oct 2023 10:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696266227; cv=none; d=google.com; s=arc-20160816; b=UMeUtAajl/akh/PMy/rwXZi/BVtlDWVTycezhxIrKruoqTztyVxeEbmq2vcnH7Cux2 A+esjmsYwXXQviOatCdER0CBmH5CGKu/LwOKI+fyXmATeYL6OxpIawrmus0U5d6Zrhyn w9k4W44MShQufp6NwmafihhcF/q7INTtbKFTNLmoFAIiqOmEY2nkU/3x+izOEpRcL6oi lpfca86awUTgkrYe3+O8ZCN7l5ujXhuIhPExikA8sSw3gSg55zBeJ1nwq6aZPFV7xqye g6tBYeaqSV3d753AWmldlObJStsU9fyp+aeJmcoOrAwu3mK+ep/3PHh+J5cdRftoDBwi ultA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from; bh=8UePuRfs1HLXRD60sYH3jRJJWvWM8ozoiv03K0h+EBU=; fh=H5vFtbmA00KNEL11b5e2x7foKviTthnHjCQg1u1gfmM=; b=cM34B8LMLdxZBnpAoGHEPGquoaTHaF6ZvNbHdA5290cKvtrHmsgDLKehS5MGcYi29t B+uryKcD4zqtWZY+WpwCh0cpFOAHxCMO3VKJFSc4ZyV4bhsKf3hqZF7ySP6C2/4DnjrJ OLtLVMg4dbVNqnDCyZZH6jvlRDBxHdbmoSZCBSzzZgMxB3DmT9ZGbZjD8N1J9gPQMn67 7dviOMHaqviR6ykwrc7d7jtmUxKQahsIpD6NVkj60ofrBTn0eCPMD5si3X1n9XaodnrR +ISwZp713Gw8vnyItaPK1hDYG3aoXJud09G61YT+vyUF0CvHwPc28LFJzblGMvJxs60j +KgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id l65-20020a639144000000b00578acf1e8a4si26978108pge.573.2023.10.02.10.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 10:03:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id AF611805A78C; Mon, 2 Oct 2023 09:49:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238475AbjJBQto (ORCPT + 99 others); Mon, 2 Oct 2023 12:49:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238336AbjJBQtm (ORCPT ); Mon, 2 Oct 2023 12:49:42 -0400 Received: from smtprelay07.ispgateway.de (smtprelay07.ispgateway.de [134.119.228.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21E86A9; Mon, 2 Oct 2023 09:49:39 -0700 (PDT) Received: from [92.206.139.21] (helo=note-book.lan) by smtprelay07.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qnM6w-0005X7-TD; Mon, 02 Oct 2023 18:49:34 +0200 From: =?utf-8?q?Andr=C3=A9_Apitzsch?= Subject: [PATCH v6 0/2] leds: Add a driver for KTD202x Date: Mon, 02 Oct 2023 18:48:26 +0200 Message-Id: <20231002-ktd202x-v6-0-26be8eefeb88@apitzsch.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAFr0GmUC/2XPy27DIBAF0F+JWJeK4WWnq/5HFUXDq6A2TgqOl TbyvxeyqK16x0VzuMOdFJ+TL+RldyfZT6mk81CDftoRG3F49zS5mglnXDANPf0YXT3fqJLacOw cl8yQOm2weGoyDja2efN1UsfwiSUes8fcJi7Zh3R7dL0dao6pjOf8/aieoN1uWyagjAYLPQ8+o HPdK17S+FNsfPZX0l6Z+CL3DBbJqxTW9IZZZNy7rRRrqRcpquyCNXuwWjmBWylXkotFyipBho7 LoJ0UZivVnwS23la1fyopERxTwP5tO8/zL41gmGGqAQAA To: Pavel Machek , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Christophe JAILLET , =?utf-8?q?Andr=C3=A9_Apitzsch?= , Krzysztof Kozlowski X-Mailer: b4 0.12.3 X-Df-Sender: YW5kcmVAYXBpdHpzY2guZXU= X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 02 Oct 2023 09:49:55 -0700 (PDT) Add the binding description and the corresponding driver for the Kinetic KTD2026 and KTD2027. Signed-off-by: André Apitzsch --- Changes in v6: - Remove un-needed inits - Narrow scope of variables - Release of_node references on early exit - Pass child node to dev_err() in ktd202x_setup_led_rgb() - Link to v5: https://lore.kernel.org/r/20231001-ktd202x-v5-0-f544a1d0510d@apitzsch.eu Changes in v5: - Restructure brightness_set() + add comments to it to be easier understandable - Add some line breaks + remove little line-wraps to improve readability - Move parts of add_led() to setup_led_{rgb,single}() - Move mutex_init() to the end of probe to omit gotos - Fix grammar - Set initial intensity to max brightness to avoid LED staying off when brightness is changed after switching to timer trigger, because of zero intensity - Link to v4: https://lore.kernel.org/r/20230923-ktd202x-v4-0-14f724f6d43b@apitzsch.eu Changes in v4: - Annotate struct ktd202x with __counted_by - Link to v3: https://lore.kernel.org/r/20230906-ktd202x-v3-0-7fcb91c65d3a@apitzsch.eu Changes in v3: - Add r-b to bindings patch - Replace .probe_new by .probe - Link to v2: https://lore.kernel.org/r/20230901-ktd202x-v2-0-3cb8b0ca02ed@apitzsch.eu Changes in v2: - Make binding description filename match compatible - Address comments by Lee Jones - Extend driver description in Kconfig - Add copyright + link to datasheet - Add unit to definition/variable names, where needed - Define magic numbers - Remove forward declaration of 'struct ktd202x' - Remove superfluous comments - Get rid of struct ktd202x_info - Join ktd202x_chip_init() with ktd202x_chip_enable() - Return the error on ktd202x_chip_disable() - Remove unreachable case from chip_in_use() - Rename ktd202x_brightness_set() argument from num_colors to num_channels - Forward errors received in ktd202x_brightness_set() - Remove variable for 'num_channels = 1' - Add some explanations to blink time calculation - Remove unneeded lcdev from ktd202x_blink_*_set() - Add define for max brightness and replace deprecated LED_FULL by it - Move setting led_classdev.brightness to ktd202x_brightness_*_set() - Move mutex_lock inside ktd202x_blink_set() - Add comment that 'color' property is optional (allow EINVAL) - Replace escaped double quotes by single quotes - Avoid overloading variable 'color' - Do not lock during probe - Remove usage of 'of_match_ptr' - Document interrupt and pull-up supply, like done for aw2013[1] - Fix error in num_steps calculation - Link to v1: https://lore.kernel.org/r/20230618-ktd202x-v1-0-fc182fefadd7@apitzsch.eu [1] https://lore.kernel.org/linux-leds/20230815-aw2013-vio-v3-0-2505296b0856@gerhold.net/ --- André Apitzsch (2): dt-bindings: leds: Add Kinetic KTD2026/2027 LED leds: add ktd202x driver .../devicetree/bindings/leds/kinetic,ktd202x.yaml | 171 ++++++ drivers/leds/rgb/Kconfig | 13 + drivers/leds/rgb/Makefile | 1 + drivers/leds/rgb/leds-ktd202x.c | 625 +++++++++++++++++++++ 4 files changed, 810 insertions(+) --- base-commit: 165adeea3617ea22dc49f8880474ebf3a98b696d change-id: 20230618-ktd202x-546b2a7d240b Best regards, -- André Apitzsch