Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp616102rdb; Thu, 22 Feb 2024 14:00:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVbiySAUgyVxqxlB3n0l6eYXFb+/YafNyMKi5yrUeTyan0Pg6AtnrlB1WB3DpdHOZYc7orWifwXAVKVIO7DtA79MKjubq6Xzgi66JSP8w== X-Google-Smtp-Source: AGHT+IHBpB6RgdrF71VLH1mn02skGote9qKn4/DPg9bTL34qx5Nd+aiVwj+vkAEufWKdPd/K+4a9 X-Received: by 2002:adf:cf08:0:b0:33d:3bab:fbb2 with SMTP id o8-20020adfcf08000000b0033d3babfbb2mr243407wrj.56.1708639228440; Thu, 22 Feb 2024 14:00:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708639228; cv=pass; d=google.com; s=arc-20160816; b=wRQ93gN84psQbABd+a99a+uVBzlEBna5tIQkn27eW/KWdUI8z/vYtI3q7bqJw/O0Co cT4oy1jSWwVWPrqkg4eqlPIcfXfijBIJfALeU8CSOfH8eZDxLDPMre8NbQPxnJ08i6o5 0L1IhkqtkZlblO6A1QZCcilo4LAISKX5YZ4tRb3CTmpzdYqcJ4zWIvJL6AFmQfw3wODC 5y6iCzhaQOvi0j5fXtdT5O4udxtSJdLsn7O9Fgh/kkXexGNGTKc1AxAdvggDJCopLDLu YkyHFjo0eNycMTPFUEat7tawenlZTHq/4TDMjwyUfnzoWuCM/kK0n92LgS9JfoyCr8te IzKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=pxdI0YOnWrToH/6X5U1/eKzH7bdwsSPGxAIQid8eQTw=; fh=NIMWDFAwOKx1hmDfr6hSr0o3srznir1HeTAqiIsaATY=; b=dPahNOnvLwXwxoAA74aACSRVLxleGhhFKwQ1lU5NYJR/ILSSiKVRMI6WEa6QZXGKVm IavsHXUtVdHaw9IAQLqdDR2RkkTbVntPfoO54zyHjQzkOMoWUS4xWDCa8Fiu/I+B3V2M 10eGGDCzNfMlV1VMCKkJFSjN9qko1EV5s8UeGtEI0HKmj/eCKee4YtLP6xDoyNf69G1i LoJw93FlLDG5JrJnJNhmhKSijbAuinG6F6n21ut9z/AATdG9Q9tg67TGVdtYQLatvtNX U8Q+0GnpnkSikNzb20SI32ByuLCi6wq8nllNZnkrx7lHlk/QC+gREJ7CVKcefXcUAhXu fxvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EIaUSC+Y; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-77432-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77432-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hv15-20020a17090760cf00b00a3f4f612765si1464328ejc.902.2024.02.22.14.00.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:00:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77432-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EIaUSC+Y; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-77432-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77432-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0C0A31F25FBB for ; Thu, 22 Feb 2024 22:00:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E2E8612D216; Thu, 22 Feb 2024 22:00:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EIaUSC+Y" Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54BE612D1F8; Thu, 22 Feb 2024 22:00:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708639215; cv=none; b=TYvUfwTEfXRXHLC5KCKGiY90sUVWmOJ+uzuoWIDAMznf9r9VFaa/X9aTklomwxbY8MnUPVgHiMBL6qJ9SuGK/XJFC5v9NmiRhUfnL69EeQuCBVpcimMb02LnsEcIv94IrzdShQrm7KOlOwR/ZpCwwIsyn0fUK79i8pg3j4P08tQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708639215; c=relaxed/simple; bh=pxdI0YOnWrToH/6X5U1/eKzH7bdwsSPGxAIQid8eQTw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=IPYe2BJCxEOwXtif38svIoF51bVM/hlYidiZEZeHn0vfKuzfIF5Al7Xr++OIejsqfm0NKAOhd1um/fww0lkXUrZkio+HZzzeX7Wzr0ZlbYT+iD8OVcCyhyqLJWwVMHAvCiGwQO7WeZq/n8HxXw4nTao6kw0VMLwGeozp+r9md7c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EIaUSC+Y; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-512cca90f38so317708e87.2; Thu, 22 Feb 2024 14:00:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708639211; x=1709244011; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pxdI0YOnWrToH/6X5U1/eKzH7bdwsSPGxAIQid8eQTw=; b=EIaUSC+Ykd6+JfoUxfmcy9/IlOZDm4iZWGqxgFykB552Mon+K/VwXxqPLq84MBDFfg XUBzUUIg+sSsoySoXLaNsaDDD4UPDk7t3VIM9mNxgfDcTsa2mJfnUSgNfRyyxmgOWANv NAgMa+NXAl+ENFqIBTNz+4IvRcG4PoGOpocR0lnHSGdGY9Dr63FkfeNmIttHXnWWMvS2 M06dvDO0/jln8VB/Zv1BdFvdlihYtKgmCTXEDHYoDq7XeNmJIcTyWt9ayYf1X4kFqGrl F6QRz8xU9WUm/HQBc4pcOuzH2NqrJGM+73F8jjgMRqArg8oRQJMSalRkW0rvBo9Z5Zpi i0/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708639211; x=1709244011; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pxdI0YOnWrToH/6X5U1/eKzH7bdwsSPGxAIQid8eQTw=; b=uH/hoboIFYiCbPIZJHblYUE/VFSQi1ZJpTuMg95yTIkhoLBC9jKJfqEnlOApjicSod 4UTxpw6w8lAY9Z9LLHhaHRr50E96VoCtIrCpKbF3G5n+1ZbAyp+C2jyMQCMsNUcjHMol gqSS2GFoTsXS4ggkRrkCbeyOMz5M60iOHvNDoFl8mvj0xIeeavogIzXtWbJtAbXHWkSx GY0ksuiabM9x9hporXDb51T//cZyTWRvrKodGRq8BlTceOL6VV8P9dqiB+fWNH3UtPTs XreCi9gvBkkhu0IqXIH6gHEOQUTC1mdzUT5VqjzliNtn3rK5ePzO2Lhp6olh4Z1rHAaQ raNA== X-Forwarded-Encrypted: i=1; AJvYcCUXyaC9TEN5V7IqCv1xrQF7T8rVdTVH4izU5KIojnVpC3WpjvN0VmcQjZB6VaXYsr8r/byeZXf4AncdDGt3cwvpUzf0goot3fXJV8LNrscosi+gvaNx9c0m3aeP8pcj18s4f4etDAI5Nw== X-Gm-Message-State: AOJu0YxfTypeIxycONWsUGaBbRmP82by02nselWsQbwmw4Rktw8xcXIS Cv8JW5IGccDiSCZU10gMQj3Tp5+ci6XxJHhcbArHrY/xmN2O3C0iCDQgTcFaockj0O51XTrIqJo uvS/FO9FT9lhdE2hUIWu5ydG/xVQ= X-Received: by 2002:a05:6512:1308:b0:512:b915:606a with SMTP id x8-20020a056512130800b00512b915606amr312553lfu.12.1708639211180; Thu, 22 Feb 2024 14:00:11 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <1f598a72-dd9f-4c6c-af7f-29751f84bd23@alliedtelesis.co.nz> In-Reply-To: From: Andy Shevchenko Date: Thu, 22 Feb 2024 23:59:34 +0200 Message-ID: Subject: Re: Linux support for a 7 segment LED display To: Chris Packham , Geert Uytterhoeven , Krzysztof Kozlowski Cc: Pavel Machek , "lee@kernel.org" , "linux-leds@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 22, 2024 at 11:53=E2=80=AFPM Chris Packham wrote: > On 23/02/24 10:34, andy.shevchenko@gmail.com wrote: > > Sun, Feb 11, 2024 at 08:46:12PM +0000, Chris Packham kirjoitti: > >> Hi Blinkenlight enthusiasts, > >> > >> I'm looking for something that I figured must exists but maybe it's so > >> niche that no-one has bothered to upstream a driver for it. > >> > >> I have a requirement to support a 7-segment LED display[1] (one that c= an > >> display a single digit from 0-9). Hardware wise it's just a bunch of > >> individual GPIOs connected to each segment (plus an extra one for a > >> dot). I can't see anything obvious in drivers/leds but maybe I'm looki= ng > >> in the wrong place. Or maybe it's the kind of thing on PC hardware tha= t > >> is just driven by the BIOS without the operating system knowing about = it. > >> > >> Is there an existing in-kernel driver for such a thing? > > No, and can't be. Here is just a mapping table and other drivers that u= se > > 7-segment LED displays to be connected to. > > > > What you need is something else, i.e. special case of leds-gpio (which = should > > be somewhere else) that does something like this. To me it sounds like = a > > mixture between line-display.h (from auxdisplay) and gpio-aggregator. > > > > How many digits do you want to connect? How are they going to be connec= ted > > (static display, or dynamic when you need to refresh in certain periods= of > > time)? Depending on the answer it might take one or another approach. > > It sounds like a auxdisplay driver might be the way to go. My hardware > happens to have a single 7seg block but there's no reason the driver > needs to be restricted to that. At some point it obviously becomes > better to fit something like the ht16k33 to offload the character > display but for one or 2 digits a PCA953x plus the LED block would do > just fine. I have hc595 (SPI GPIO) connected to a single digit 7-segment LED. Since it can be also serialized, line display APIs seem plausible to fit. What we need is a proxy between the two. And I think gpio-aggregator is the best for that. It needs an additional compatible string and the registration for line display (overall something like 50 LoCs). We can even call that hardware compatible as line-display-gpio (or so). Cc: Geert and Krzysztof (for the comments on the idea above). > The information we want to display is mostly static (basically a numeric > unit identifier) but there are cases where we may want to alternate > between this and "F" to indicate some fault condition. --=20 With Best Regards, Andy Shevchenko