Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3342446pxv; Mon, 28 Jun 2021 02:24:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsnJMEihuY3mCFsmvZBzm6ocjpxal9ClTPHKiLiyQRDDfFvOKKSEkNx/faflHTyTxozDbr X-Received: by 2002:a17:907:264b:: with SMTP id ar11mr22679170ejc.525.1624872287898; Mon, 28 Jun 2021 02:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624872287; cv=none; d=google.com; s=arc-20160816; b=0f8vIorWYerINdgjAoNAwlvM2oFkIrc+LQA1LuGb243ygdQdfR6fqIR6Y7aS1YFg6X QjptV+82InyCf2u6eHYUoygD6R3XNMq/v1tvDzUYOhZUw99wfM8WjN2UEqYIwyes6eEX vgJkGToKXn9WbRhHgwbEfiRGruTClUS5grThDWi+FcnCTDIIG/vp2ZclrqaPcLKwIGBC 2T8LdcpUFhzHFYEjQZ++yluiKxDhu5yhzEnzsGDji2YCF6jC8026K8gWJLGJ0fITxWNf 8HX9FpBvVxhdbjggZGi6OgZohx7WOHqPEntYl3uEDewp5RZuV3eIoTfVo5te9ljgNdDn O7Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=Nz4gBHNnVTKqYWPORJVI9vqQQJHDi/JvYhL68Opd7n4=; b=WXGLzqOvZOKn9nOLjOcmfjFWTL3QWCb4piufAXDo8fhbdZ5CFuIfsq6aBgTpjPgfog +9SWsU+SsfzACjszAVzMjZOdGm38AtAo1ClPmpwq3Fzyo1USLj4UO3GGfAZWpjyrdkGG 1QLq1KmtMZ2Mme+zxlouOUKiT6nt37B+geQvzdMHBqky9Y9Ht+hutxD5ewIoTiexHtgP h6oWrpW6uT+wxqzjeAjdKGoZVjbgxKIdgOdUnM8RCmbgcgZ42bsP2yhOfMh9dRZq3K51 +V7AfPhvlF0bPicOfxYaetxHdBlWP/Ka1CEl1urIJdnJtO/fMt3KLD6BL8MVWYcAkusK /0+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si12801342ejx.353.2021.06.28.02.24.23; Mon, 28 Jun 2021 02:24:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232480AbhF1JXn (ORCPT + 99 others); Mon, 28 Jun 2021 05:23:43 -0400 Received: from mail-ua1-f44.google.com ([209.85.222.44]:43673 "EHLO mail-ua1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230256AbhF1JXl (ORCPT ); Mon, 28 Jun 2021 05:23:41 -0400 Received: by mail-ua1-f44.google.com with SMTP id f1so6698323uaj.10; Mon, 28 Jun 2021 02:21:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Nz4gBHNnVTKqYWPORJVI9vqQQJHDi/JvYhL68Opd7n4=; b=IvFgFcalWBL7x6esMAIgxvDcOyn1d0HYuP8EfBdK6RZPIOq4ZtueVwcwyx8ir89Buw vH6VCkxDGeVUzpwsSNTumMx9gebCAPQWbrpRzUB5tXMh1vqT5zNRYMRb3U64GlkMPNm2 JAGCpX1Yfri1xdRCIHb7BwZDW+5clm/AaQXGQC2fjHs0vnX43NUA6W4BeHY0C7vFQQAL Sx8eQGkTogPRK49aBX/b8ChiuS57AiVLM64iC351u7Gej0uEdJyfQ1Pk/bl0gGXHwbwg /l4RtMOTcsd3Ee8h42vyEaqvOplG/8haiWjCejltmMuPeu5lr3J/5IVoj9POZuQO2Lo/ OofQ== X-Gm-Message-State: AOAM530HFH6SR2VB4xGCyWNhcSTW47UhPWFBvfvAkws10WtsFML67DiO kRgTmVW82t9qVm2YjVHeF/Y+ThG2ULTzbFm8VklD3FUwjJvpVQ== X-Received: by 2002:ab0:70b3:: with SMTP id q19mr19594260ual.2.1624872075339; Mon, 28 Jun 2021 02:21:15 -0700 (PDT) MIME-Version: 1.0 References: <20210625125902.1162428-1-geert@linux-m68k.org> <20210625125902.1162428-19-geert@linux-m68k.org> <20210625223916.7e00e710@thinkpad> In-Reply-To: <20210625223916.7e00e710@thinkpad> From: Geert Uytterhoeven Date: Mon, 28 Jun 2021 11:21:04 +0200 Message-ID: Subject: Re: [PATCH v2 18/18] auxdisplay: ht16k33: Add segment display LED support To: Marek Behun Cc: Robin van der Gracht , Rob Herring , Miguel Ojeda , Paul Burton , Greg Kroah-Hartman , Pavel Machek , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-leds , "open list:BROADCOM NVRAM DRIVER" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marek, On Fri, Jun 25, 2021 at 10:39 PM Marek Behun wrote: > On Fri, 25 Jun 2021 14:59:02 +0200 > Geert Uytterhoeven wrote: > > > Instantiate a single LED for a segment display. This allows the user to > > control display brightness and blinking through the LED class API and > > triggers, and exposes the display color. > > The LED will be named "auxdisplay::backlight". > > What if there are multiple "auxdisplay"s ? I understand the LED core will just add a suffix on a name collision. > Doesn't this subsystem have IDs? So that you can use auxdisplayN for > device name, for example? Auxdisplay does not have IDs, as there is no subsystem to register with. It's just a collection of drivers for auxiliary displays with no common API. Some drivers use fbdev, others use a chardev, or an attribute file in sysfs. BTW, I just followed Pavel's advice in naming. > > + of_property_read_u32(node, "color", &color); > > + seg->led.name = devm_kasprintf(dev, GFP_KERNEL, > > + "auxdisplay:%s:" LED_FUNCTION_BACKLIGHT, > > + color < LED_COLOR_ID_MAX ? led_colors[color] : ""); > > If you use devm_led_classdev_register_ext and pass struct > led_init_data, LED core will generate name of the LED itself. Will that make any difference, except for adding more code? Looking at the implementation, I still have to use devm_kasprintf() to combine color and function for led_init_data.default_label? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds