From patchwork Wed Aug 11 09:57:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 495302 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A023C432BE for ; Wed, 11 Aug 2021 09:58:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10D0C610A7 for ; Wed, 11 Aug 2021 09:58:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236777AbhHKJ6c (ORCPT ); Wed, 11 Aug 2021 05:58:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236521AbhHKJ6b (ORCPT ); Wed, 11 Aug 2021 05:58:31 -0400 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33234C0613D3 for ; Wed, 11 Aug 2021 02:58:08 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:438:1ff1:1071:f524]) by laurent.telenet-ops.be with bizsmtp id g9y4250071gJxCh019y48L; Wed, 11 Aug 2021 11:58:06 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mDkzr-001zgJ-TO; Wed, 11 Aug 2021 11:58:03 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1mDkzr-005NOP-At; Wed, 11 Aug 2021 11:58:03 +0200 From: Geert Uytterhoeven To: Robin van der Gracht , Miguel Ojeda , Rob Herring , Paul Burton Cc: Greg Kroah-Hartman , Pavel Machek , Marek Behun , devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 03/19] auxdisplay: img-ascii-lcd: Fix lock-up when displaying empty string Date: Wed, 11 Aug 2021 11:57:43 +0200 Message-Id: <20210811095759.1281480-4-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811095759.1281480-1-geert@linux-m68k.org> References: <20210811095759.1281480-1-geert@linux-m68k.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org While writing an empty string to a device attribute is a no-op, and thus does not need explicit safeguards, the user can still write a single newline to an attribute file: echo > .../message If that happens, img_ascii_lcd_display() trims the newline, yielding an empty string, and causing an infinite loop in img_ascii_lcd_scroll(). Fix this by adding a check for empty strings. Clear the display in case one is encountered. Fixes: 0cad855fbd083ee5 ("auxdisplay: img-ascii-lcd: driver for simple ASCII LCD displays") Signed-off-by: Geert Uytterhoeven --- Untested with img-ascii-lcd, but triggered with my initial version of linedisp. v5: - No changes, v4: - No changes, v3: - No changes, v2: - No changes. --- drivers/auxdisplay/img-ascii-lcd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/auxdisplay/img-ascii-lcd.c b/drivers/auxdisplay/img-ascii-lcd.c index 1cce409ce5cacbc8..e33ce0151cdfd150 100644 --- a/drivers/auxdisplay/img-ascii-lcd.c +++ b/drivers/auxdisplay/img-ascii-lcd.c @@ -280,6 +280,16 @@ static int img_ascii_lcd_display(struct img_ascii_lcd_ctx *ctx, if (msg[count - 1] == '\n') count--; + if (!count) { + /* clear the LCD */ + devm_kfree(&ctx->pdev->dev, ctx->message); + ctx->message = NULL; + ctx->message_len = 0; + memset(ctx->curr, ' ', ctx->cfg->num_chars); + ctx->cfg->update(ctx); + return 0; + } + new_msg = devm_kmalloc(&ctx->pdev->dev, count + 1, GFP_KERNEL); if (!new_msg) return -ENOMEM; From patchwork Wed Aug 11 09:57:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 495296 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91141C4320E for ; Wed, 11 Aug 2021 09:58:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 79CFD60200 for ; Wed, 11 Aug 2021 09:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236963AbhHKJ7M (ORCPT ); Wed, 11 Aug 2021 05:59:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236563AbhHKJ6d (ORCPT ); Wed, 11 Aug 2021 05:58:33 -0400 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 363A2C061798 for ; Wed, 11 Aug 2021 02:58:08 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:438:1ff1:1071:f524]) by michel.telenet-ops.be with bizsmtp id g9y42500e1gJxCh069y4zf; Wed, 11 Aug 2021 11:58:07 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mDkzs-001zgL-FD; Wed, 11 Aug 2021 11:58:04 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1mDkzr-005NOf-Dp; Wed, 11 Aug 2021 11:58:03 +0200 From: Geert Uytterhoeven To: Robin van der Gracht , Miguel Ojeda , Rob Herring , Paul Burton Cc: Greg Kroah-Hartman , Pavel Machek , Marek Behun , devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 05/19] auxdisplay: img-ascii-lcd: Convert device attribute to sysfs_emit() Date: Wed, 11 Aug 2021 11:57:45 +0200 Message-Id: <20210811095759.1281480-6-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811095759.1281480-1-geert@linux-m68k.org> References: <20210811095759.1281480-1-geert@linux-m68k.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Convert the "message" device attribute from sprintf() to sysfs_emit(), as the latter is aware of the PAGE_SIZE buffer. Signed-off-by: Geert Uytterhoeven --- v5: - No changes, v4: - No changes, v3: - No changes, v2: - No changes. --- drivers/auxdisplay/img-ascii-lcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/auxdisplay/img-ascii-lcd.c b/drivers/auxdisplay/img-ascii-lcd.c index 2b6e41ec57544faa..2b5640b638900a90 100644 --- a/drivers/auxdisplay/img-ascii-lcd.c +++ b/drivers/auxdisplay/img-ascii-lcd.c @@ -326,7 +326,7 @@ static ssize_t message_show(struct device *dev, struct device_attribute *attr, { struct img_ascii_lcd_ctx *ctx = dev_get_drvdata(dev); - return sprintf(buf, "%s\n", ctx->message); + return sysfs_emit(buf, "%s\n", ctx->message); } /** From patchwork Wed Aug 11 09:57:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 495297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D6D2C4320E for ; Wed, 11 Aug 2021 09:58:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E919F6101D for ; Wed, 11 Aug 2021 09:58:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236925AbhHKJ7G (ORCPT ); Wed, 11 Aug 2021 05:59:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236872AbhHKJ6g (ORCPT ); Wed, 11 Aug 2021 05:58:36 -0400 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07724C0617B0 for ; Wed, 11 Aug 2021 02:58:09 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:438:1ff1:1071:f524]) by xavier.telenet-ops.be with bizsmtp id g9y52500a1gJxCh019y5RX; Wed, 11 Aug 2021 11:58:07 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mDkzt-001zgN-2P; Wed, 11 Aug 2021 11:58:05 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1mDkzr-005NOs-Gw; Wed, 11 Aug 2021 11:58:03 +0200 From: Geert Uytterhoeven To: Robin van der Gracht , Miguel Ojeda , Rob Herring , Paul Burton Cc: Greg Kroah-Hartman , Pavel Machek , Marek Behun , devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 07/19] auxdisplay: linedisp: Use kmemdup_nul() helper Date: Wed, 11 Aug 2021 11:57:47 +0200 Message-Id: <20210811095759.1281480-8-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811095759.1281480-1-geert@linux-m68k.org> References: <20210811095759.1281480-1-geert@linux-m68k.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Use the existing kmemdup_nul() helper instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven --- v5: - No changes, v4: - No changes, v3: - No changes, v2: - No changes. --- drivers/auxdisplay/line-display.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/auxdisplay/line-display.c b/drivers/auxdisplay/line-display.c index 4b97c20ac0b381ee..3f35199bc39f511f 100644 --- a/drivers/auxdisplay/line-display.c +++ b/drivers/auxdisplay/line-display.c @@ -91,13 +91,10 @@ static int linedisp_display(struct linedisp *linedisp, const char *msg, return 0; } - new_msg = kmalloc(count + 1, GFP_KERNEL); + new_msg = kmemdup_nul(msg, count, GFP_KERNEL); if (!new_msg) return -ENOMEM; - memcpy(new_msg, msg, count); - new_msg[count] = 0; - kfree(linedisp->message); linedisp->message = new_msg; From patchwork Wed Aug 11 09:57:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 495293 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C251BC432BE for ; Wed, 11 Aug 2021 09:59:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B826360EB9 for ; Wed, 11 Aug 2021 09:59:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236776AbhHKKAO (ORCPT ); Wed, 11 Aug 2021 06:00:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236798AbhHKJ6c (ORCPT ); Wed, 11 Aug 2021 05:58:32 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4F33C0617BB for ; Wed, 11 Aug 2021 02:58:08 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:438:1ff1:1071:f524]) by albert.telenet-ops.be with bizsmtp id g9y42500j1gJxCh069y49C; Wed, 11 Aug 2021 11:58:07 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mDkzs-001zgO-H9; Wed, 11 Aug 2021 11:58:04 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1mDkzr-005NP0-He; Wed, 11 Aug 2021 11:58:03 +0200 From: Geert Uytterhoeven To: Robin van der Gracht , Miguel Ojeda , Rob Herring , Paul Burton Cc: Greg Kroah-Hartman , Pavel Machek , Marek Behun , devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 08/19] auxdisplay: linedisp: Add support for changing scroll rate Date: Wed, 11 Aug 2021 11:57:48 +0200 Message-Id: <20210811095759.1281480-9-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811095759.1281480-1-geert@linux-m68k.org> References: <20210811095759.1281480-1-geert@linux-m68k.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org If the message to display is longer than the number of characters that the display can show, the message will be scrolled. Currently the scroll rate is fixed, moving every 500 ms. Add support for changing the scroll rate through a "scroll_step_ms" device attribute in sysfs. Signed-off-by: Geert Uytterhoeven --- v5: - No changes, v4: - No changes, v3: - No changes, v2: - No changes. --- drivers/auxdisplay/line-display.c | 37 +++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/drivers/auxdisplay/line-display.c b/drivers/auxdisplay/line-display.c index 3f35199bc39f511f..03e7f104aa1add32 100644 --- a/drivers/auxdisplay/line-display.c +++ b/drivers/auxdisplay/line-display.c @@ -19,6 +19,8 @@ #include "line-display.h" +#define DEFAULT_SCROLL_RATE (HZ / 2) + /** * linedisp_scroll() - scroll the display by a character * @t: really a pointer to the private data structure @@ -50,7 +52,7 @@ static void linedisp_scroll(struct timer_list *t) linedisp->scroll_pos %= linedisp->message_len; /* rearm the timer */ - if (linedisp->message_len > num_chars) + if (linedisp->message_len > num_chars && linedisp->scroll_rate) mod_timer(&linedisp->timer, jiffies + linedisp->scroll_rate); } @@ -149,8 +151,39 @@ static ssize_t message_store(struct device *dev, struct device_attribute *attr, static DEVICE_ATTR_RW(message); +static ssize_t scroll_step_ms_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct linedisp *linedisp = container_of(dev, struct linedisp, dev); + + return sysfs_emit(buf, "%u\n", jiffies_to_msecs(linedisp->scroll_rate)); +} + +static ssize_t scroll_step_ms_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct linedisp *linedisp = container_of(dev, struct linedisp, dev); + unsigned int ms; + + if (kstrtouint(buf, 10, &ms) != 0) + return -EINVAL; + + linedisp->scroll_rate = msecs_to_jiffies(ms); + if (linedisp->message && linedisp->message_len > linedisp->num_chars) { + del_timer_sync(&linedisp->timer); + if (linedisp->scroll_rate) + linedisp_scroll(&linedisp->timer); + } + + return count; +} + +static DEVICE_ATTR_RW(scroll_step_ms); + static struct attribute *linedisp_attrs[] = { &dev_attr_message.attr, + &dev_attr_scroll_step_ms.attr, NULL, }; ATTRIBUTE_GROUPS(linedisp); @@ -182,7 +215,7 @@ int linedisp_register(struct linedisp *linedisp, struct device *parent, linedisp->update = update; linedisp->buf = buf; linedisp->num_chars = num_chars; - linedisp->scroll_rate = HZ / 2; + linedisp->scroll_rate = DEFAULT_SCROLL_RATE; device_initialize(&linedisp->dev); dev_set_name(&linedisp->dev, "linedisp.%lu", From patchwork Wed Aug 11 09:57:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 495295 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01B1BC19F35 for ; Wed, 11 Aug 2021 09:59:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9B7F6056C for ; Wed, 11 Aug 2021 09:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237085AbhHKJ7Q (ORCPT ); Wed, 11 Aug 2021 05:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236864AbhHKJ6f (ORCPT ); Wed, 11 Aug 2021 05:58:35 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC421C06136D for ; Wed, 11 Aug 2021 02:58:09 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:438:1ff1:1071:f524]) by albert.telenet-ops.be with bizsmtp id g9y5250091gJxCh069y59F; Wed, 11 Aug 2021 11:58:07 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mDkzs-001zgR-ON; Wed, 11 Aug 2021 11:58:04 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1mDkzr-005NPK-K0; Wed, 11 Aug 2021 11:58:03 +0200 From: Geert Uytterhoeven To: Robin van der Gracht , Miguel Ojeda , Rob Herring , Paul Burton Cc: Greg Kroah-Hartman , Pavel Machek , Marek Behun , devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 11/19] auxdisplay: ht16k33: Remove unneeded error check in keypad probe() Date: Wed, 11 Aug 2021 11:57:51 +0200 Message-Id: <20210811095759.1281480-12-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811095759.1281480-1-geert@linux-m68k.org> References: <20210811095759.1281480-1-geert@linux-m68k.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org There is no need to check the return code of input_register_device(), just propagate it to the caller. Signed-off-by: Geert Uytterhoeven Acked-by: Robin van der Gracht --- v5: - No changes, v4: - No changes, v3: - No changes, v2: - Add Acked-by. --- drivers/auxdisplay/ht16k33.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c index 99daf1974980b435..8c9acc4800bc94e0 100644 --- a/drivers/auxdisplay/ht16k33.c +++ b/drivers/auxdisplay/ht16k33.c @@ -378,11 +378,7 @@ static int ht16k33_keypad_probe(struct i2c_client *client, ht16k33_keypad_stop(keypad->dev); - err = input_register_device(keypad->dev); - if (err) - return err; - - return 0; + return input_register_device(keypad->dev); } static int ht16k33_probe(struct i2c_client *client, From patchwork Wed Aug 11 09:57:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 495301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED89AC4320A for ; Wed, 11 Aug 2021 09:58:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC9B160527 for ; Wed, 11 Aug 2021 09:58:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236838AbhHKJ6e (ORCPT ); Wed, 11 Aug 2021 05:58:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236705AbhHKJ6c (ORCPT ); Wed, 11 Aug 2021 05:58:32 -0400 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAC82C0617A1 for ; Wed, 11 Aug 2021 02:58:08 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:438:1ff1:1071:f524]) by laurent.telenet-ops.be with bizsmtp id g9y42500P1gJxCh019y48V; Wed, 11 Aug 2021 11:58:06 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mDkzs-001zgS-Gb; Wed, 11 Aug 2021 11:58:04 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1mDkzr-005NPS-LO; Wed, 11 Aug 2021 11:58:03 +0200 From: Geert Uytterhoeven To: Robin van der Gracht , Miguel Ojeda , Rob Herring , Paul Burton Cc: Greg Kroah-Hartman , Pavel Machek , Marek Behun , devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 12/19] auxdisplay: ht16k33: Convert to simple i2c probe function Date: Wed, 11 Aug 2021 11:57:52 +0200 Message-Id: <20210811095759.1281480-13-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811095759.1281480-1-geert@linux-m68k.org> References: <20210811095759.1281480-1-geert@linux-m68k.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org ht16k33_probe() does not use the passed i2c_device_id, so the driver can be converted trivially to the new-style of i2c probing. Signed-off-by: Geert Uytterhoeven Acked-by: Robin van der Gracht --- v5: - No changes, v4: - No changes, v3: - No changes, v2: - Add Acked-by. --- drivers/auxdisplay/ht16k33.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c index 8c9acc4800bc94e0..8c1689b77db95676 100644 --- a/drivers/auxdisplay/ht16k33.c +++ b/drivers/auxdisplay/ht16k33.c @@ -381,8 +381,7 @@ static int ht16k33_keypad_probe(struct i2c_client *client, return input_register_device(keypad->dev); } -static int ht16k33_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int ht16k33_probe(struct i2c_client *client) { int err; uint32_t dft_brightness; @@ -523,7 +522,7 @@ static const struct of_device_id ht16k33_of_match[] = { MODULE_DEVICE_TABLE(of, ht16k33_of_match); static struct i2c_driver ht16k33_driver = { - .probe = ht16k33_probe, + .probe_new = ht16k33_probe, .remove = ht16k33_remove, .driver = { .name = DRIVER_NAME, From patchwork Wed Aug 11 09:57:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 495300 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C3FEC43216 for ; Wed, 11 Aug 2021 09:58:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 739036056C for ; Wed, 11 Aug 2021 09:58:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236945AbhHKJ6j (ORCPT ); Wed, 11 Aug 2021 05:58:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236869AbhHKJ6g (ORCPT ); Wed, 11 Aug 2021 05:58:36 -0400 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF25AC0617A5 for ; Wed, 11 Aug 2021 02:58:09 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:438:1ff1:1071:f524]) by michel.telenet-ops.be with bizsmtp id g9y5250031gJxCh069y5zl; Wed, 11 Aug 2021 11:58:07 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mDkzs-001zgW-OR; Wed, 11 Aug 2021 11:58:04 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1mDkzr-005NPf-NF; Wed, 11 Aug 2021 11:58:03 +0200 From: Geert Uytterhoeven To: Robin van der Gracht , Miguel Ojeda , Rob Herring , Paul Burton Cc: Greg Kroah-Hartman , Pavel Machek , Marek Behun , devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 14/19] auxdisplay: ht16k33: Move delayed work Date: Wed, 11 Aug 2021 11:57:54 +0200 Message-Id: <20210811095759.1281480-15-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811095759.1281480-1-geert@linux-m68k.org> References: <20210811095759.1281480-1-geert@linux-m68k.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Move delayed_work from ht16k33_fbdev to ht16k33_priv, as it is not specific to dot-matrix displays, but common to all display types. Signed-off-by: Geert Uytterhoeven --- v5: - No changes, v4: - No changes, v3: - No changes, v2: - No changes. --- drivers/auxdisplay/ht16k33.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c index 75d326a823543898..c7a3a0e1fbb5d03e 100644 --- a/drivers/auxdisplay/ht16k33.c +++ b/drivers/auxdisplay/ht16k33.c @@ -65,11 +65,11 @@ struct ht16k33_fbdev { uint32_t refresh_rate; uint8_t *buffer; uint8_t *cache; - struct delayed_work work; }; struct ht16k33_priv { struct i2c_client *client; + struct delayed_work work; struct ht16k33_keypad keypad; struct ht16k33_fbdev fbdev; }; @@ -117,7 +117,7 @@ static void ht16k33_fb_queue(struct ht16k33_priv *priv) { struct ht16k33_fbdev *fbdev = &priv->fbdev; - schedule_delayed_work(&fbdev->work, HZ / fbdev->refresh_rate); + schedule_delayed_work(&priv->work, HZ / fbdev->refresh_rate); } /* @@ -125,10 +125,9 @@ static void ht16k33_fb_queue(struct ht16k33_priv *priv) */ static void ht16k33_fb_update(struct work_struct *work) { - struct ht16k33_fbdev *fbdev = - container_of(work, struct ht16k33_fbdev, work.work); - struct ht16k33_priv *priv = - container_of(fbdev, struct ht16k33_priv, fbdev); + struct ht16k33_priv *priv = container_of(work, struct ht16k33_priv, + work.work); + struct ht16k33_fbdev *fbdev = &priv->fbdev; uint8_t *p1, *p2; int len, pos = 0, first = -1; @@ -462,7 +461,7 @@ static int ht16k33_probe(struct i2c_client *client) } fb_bl_default_curve(fbdev->info, 0, MIN_BRIGHTNESS, MAX_BRIGHTNESS); - INIT_DELAYED_WORK(&fbdev->work, ht16k33_fb_update); + INIT_DELAYED_WORK(&priv->work, ht16k33_fb_update); fbdev->info->fbops = &ht16k33_fb_ops; fbdev->info->screen_base = (char __iomem *) fbdev->buffer; fbdev->info->screen_size = HT16K33_FB_SIZE; @@ -502,7 +501,7 @@ static int ht16k33_remove(struct i2c_client *client) struct ht16k33_priv *priv = i2c_get_clientdata(client); struct ht16k33_fbdev *fbdev = &priv->fbdev; - cancel_delayed_work_sync(&fbdev->work); + cancel_delayed_work_sync(&priv->work); unregister_framebuffer(fbdev->info); framebuffer_release(fbdev->info); free_page((unsigned long) fbdev->buffer); From patchwork Wed Aug 11 09:57:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 495294 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90877C4338F for ; Wed, 11 Aug 2021 09:59:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6623B60527 for ; Wed, 11 Aug 2021 09:59:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237082AbhHKJ7Q (ORCPT ); Wed, 11 Aug 2021 05:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236837AbhHKJ6e (ORCPT ); Wed, 11 Aug 2021 05:58:34 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71337C061387 for ; Wed, 11 Aug 2021 02:58:09 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:438:1ff1:1071:f524]) by albert.telenet-ops.be with bizsmtp id g9y52500C1gJxCh069y59G; Wed, 11 Aug 2021 11:58:07 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mDkzs-001zgY-QE; Wed, 11 Aug 2021 11:58:04 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1mDkzr-005NPn-OA; Wed, 11 Aug 2021 11:58:03 +0200 From: Geert Uytterhoeven To: Robin van der Gracht , Miguel Ojeda , Rob Herring , Paul Burton Cc: Greg Kroah-Hartman , Pavel Machek , Marek Behun , devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 15/19] auxdisplay: ht16k33: Extract ht16k33_brightness_set() Date: Wed, 11 Aug 2021 11:57:55 +0200 Message-Id: <20210811095759.1281480-16-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811095759.1281480-1-geert@linux-m68k.org> References: <20210811095759.1281480-1-geert@linux-m68k.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Extract brightness handling into a helper function, so it can be called from multiple places. Signed-off-by: Geert Uytterhoeven --- v5: - No changes, v4: - No changes, v3: - Use "err" instead of "error" to be consistent with existing driver naming style, v2: - No changes. --- drivers/auxdisplay/ht16k33.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c index c7a3a0e1fbb5d03e..928ac9722c142855 100644 --- a/drivers/auxdisplay/ht16k33.c +++ b/drivers/auxdisplay/ht16k33.c @@ -113,6 +113,22 @@ static int ht16k33_display_off(struct ht16k33_priv *priv) return i2c_smbus_write_byte(priv->client, REG_DISPLAY_SETUP); } +static int ht16k33_brightness_set(struct ht16k33_priv *priv, + unsigned int brightness) +{ + int err; + + if (brightness == 0) + return ht16k33_display_off(priv); + + err = ht16k33_display_on(priv); + if (err) + return err; + + return i2c_smbus_write_byte(priv->client, + REG_BRIGHTNESS | (brightness - 1)); +} + static void ht16k33_fb_queue(struct ht16k33_priv *priv) { struct ht16k33_fbdev *fbdev = &priv->fbdev; @@ -197,13 +213,10 @@ static int ht16k33_bl_update_status(struct backlight_device *bl) if (bl->props.power != FB_BLANK_UNBLANK || bl->props.fb_blank != FB_BLANK_UNBLANK || - bl->props.state & BL_CORE_FBBLANK || brightness == 0) { - return ht16k33_display_off(priv); - } + bl->props.state & BL_CORE_FBBLANK) + brightness = 0; - ht16k33_display_on(priv); - return i2c_smbus_write_byte(priv->client, - REG_BRIGHTNESS | (brightness - 1)); + return ht16k33_brightness_set(priv, brightness); } static int ht16k33_bl_check_fb(struct backlight_device *bl, struct fb_info *fi) From patchwork Wed Aug 11 09:57:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 495298 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5397C432BE for ; Wed, 11 Aug 2021 09:58:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A7F4360527 for ; Wed, 11 Aug 2021 09:58:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236988AbhHKJ6w (ORCPT ); Wed, 11 Aug 2021 05:58:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236924AbhHKJ6i (ORCPT ); Wed, 11 Aug 2021 05:58:38 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 035E2C0619C1 for ; Wed, 11 Aug 2021 02:58:10 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:438:1ff1:1071:f524]) by baptiste.telenet-ops.be with bizsmtp id g9y52500H1gJxCh019y5qN; Wed, 11 Aug 2021 11:58:09 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mDkzs-001zgd-SJ; Wed, 11 Aug 2021 11:58:04 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1mDkzr-005NQ8-Rm; Wed, 11 Aug 2021 11:58:03 +0200 From: Geert Uytterhoeven To: Robin van der Gracht , Miguel Ojeda , Rob Herring , Paul Burton Cc: Greg Kroah-Hartman , Pavel Machek , Marek Behun , devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Rob Herring Subject: [PATCH v5 18/19] dt-bindings: auxdisplay: ht16k33: Document LED subnode Date: Wed, 11 Aug 2021 11:57:58 +0200 Message-Id: <20210811095759.1281480-19-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811095759.1281480-1-geert@linux-m68k.org> References: <20210811095759.1281480-1-geert@linux-m68k.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Extend the Holtek HT16K33 LED controller Device Tree bindings with an LED subnode, conforming to the standard LED bindings. This allows the user to exert more control, like specifying LED color, function, and/or trigger, to extend LED functionality beyond a simple display backlight. Signed-off-by: Geert Uytterhoeven Reviewed-by: Rob Herring --- v5: - No changes, v4: - Add Reviewed-by, v3: - New. --- .../bindings/auxdisplay/holtek,ht16k33.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml b/Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml index 6baf1200c9d8488e..0f1414185fefc1a9 100644 --- a/Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml +++ b/Documentation/devicetree/bindings/auxdisplay/holtek,ht16k33.yaml @@ -48,6 +48,11 @@ properties: default: 16 description: Initial brightness level + led: + type: object + $ref: /schemas/leds/common.yaml# + unevaluatedProperties: false + required: - compatible - reg @@ -66,6 +71,7 @@ examples: - | #include #include + #include i2c1 { #address-cells = <1>; #size-cells = <0>; @@ -87,5 +93,10 @@ examples: , , ; + + led { + color = ; + function = LED_FUNCTION_BACKLIGHT; + }; }; };