Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1878273rdb; Tue, 20 Feb 2024 09:31:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXeTi0fow81iK+gLCPFvlhJXTR03xapFKjvzmLrpe3JktilAB0arfvHmwYiNIKwdqco8R7n37z1VmPr2PQiEpU4v6xUd3cHxYtqrPiUjg== X-Google-Smtp-Source: AGHT+IHpj/H0Hh8ZSI2T0qai3cjJrKy93y2MOblKMRUIcnFR7gRyD9WuezCj7CO7h46seFITJoJC X-Received: by 2002:a05:620a:4046:b0:787:1f70:5a9f with SMTP id i6-20020a05620a404600b007871f705a9fmr19418390qko.71.1708450275115; Tue, 20 Feb 2024 09:31:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708450275; cv=pass; d=google.com; s=arc-20160816; b=G92DPqi4NaQL6hYK3U0dS8jzSAU8/wqpxUxMRx/a+r7otutDHxImyRV8Fr/u/wxEKB rafIXU6l33pFTkBwx3Hlk4gw8VVp+GEKAmYo+ac8kOMwJjXfPrYj0NldSCIdewzaBw4P e2wjPB3is5h6NhCdCfBxaeQZkqARQtMO+z4w3nMQTXE93ZXGM2MAZ0ZkO4oXkQt5+/qJ 6TGtbD3ApNAiATIpDf4bOWmpYlhQA2PaRZXtJnxzheKV/Pfx3RMj2A2uAxC1EvFFvFLT fTNQUOBn9tc3X8e65Lc76ZYdebd0bynA43wsuAfO5RA4RNzDdmVzlqb2kceyKfybQ+Cd Nhcg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YqG2bsKElbhecX39OojR5haoXbZVU9kM89vDnjokXvU=; fh=1cA7XGckj3lduumJ/hFshjdhsy1b/eXndR1H9OJxa1c=; b=Kz6+BphMoAInjMc0O0jg+BuLoZtMNXu/8pQeWiiQ16scPfFuej2hK3VQ0OMeEJkPDn 6uksB3mmtw/ENeHU+3lDapnr6bx/2KR4d7D2GvQAieQ3JAoxplyXacSyIWT3Eey1TW6t HGeFp7pMfaDIu6I058d0aGKGI3KSAG1/uOpSGqYB03UwZhvUfnirW58636SSFmcT55PH Wj8ZrizV/hp/PnXEGUcqztObZjY2QHTq+XlTK2+qU/0th/1e6n2CndSGUXunTjkvbWRq fuW+rmeVXXjBUVwX3dULWtac3r471484F8T53YqLvAWERm/dyS4vxwf/ao4ZOBeBLBpU sa/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ucw.cz header.s=gen1 header.b=RsBYWQFm; arc=pass (i=1 spf=pass spfdomain=ucw.cz dkim=pass dkdomain=ucw.cz dmarc=pass fromdomain=ucw.cz); spf=pass (google.com: domain of linux-kernel+bounces-73446-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73446-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucw.cz Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q4-20020a05620a0c8400b007873be48b6esi8570792qki.79.2024.02.20.09.31.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 09:31:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73446-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ucw.cz header.s=gen1 header.b=RsBYWQFm; arc=pass (i=1 spf=pass spfdomain=ucw.cz dkim=pass dkdomain=ucw.cz dmarc=pass fromdomain=ucw.cz); spf=pass (google.com: domain of linux-kernel+bounces-73446-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73446-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucw.cz 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CD5611C229F4 for ; Tue, 20 Feb 2024 17:30:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B390E76C9A; Tue, 20 Feb 2024 17:30:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ucw.cz header.i=@ucw.cz header.b="RsBYWQFm" Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03FE9768E7; Tue, 20 Feb 2024 17:30:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.255.230.98 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708450230; cv=none; b=axT6FTbfrta0nkHHOR5seb/V52lFsSH+OLaaXcWyQlLC65risdFS2C6rIOapozeueJ/UPcjIKz33nW+Sg/YrELryrATRp0gVp7kGAsxHO6erHnhqTAVKkN0Vpwslk3plC5JM3zziJaNUo7LibIlOnfGXqbDD5Qf6V82N2FGA+Lg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708450230; c=relaxed/simple; bh=6h5vfjAgCeXYbBUZ5XCBp/nzNrxSqsTFEsdFP92UxL0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G9GA5tnGp1fxNEPt3kZ2vWOP2q8vbBAJ75lkBuQzwLKireXs6CQ9mLwJ/lKffsF/5hYhWnVoUjJS9qbs44f9SWhsT2THsAPvYCwD60jCgzeR0qb3QV7NAum8810O0eiexhpTNULNpMZqMcHC90GtQtpX0f3z5yHc5PDKZGuxl6M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ucw.cz; spf=pass smtp.mailfrom=ucw.cz; dkim=pass (1024-bit key) header.d=ucw.cz header.i=@ucw.cz header.b=RsBYWQFm; arc=none smtp.client-ip=46.255.230.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ucw.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ucw.cz Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 70FC31C0080; Tue, 20 Feb 2024 18:30:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1708450220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YqG2bsKElbhecX39OojR5haoXbZVU9kM89vDnjokXvU=; b=RsBYWQFmky+d5tNsbJOc5d99mwYzrN/LNQKMddaZFoYDI2mz98QFRwnHZQMqUomOvKIxMG 1aGU5tNRIylD59znlh/DW6bGVDslPRoo6zOxiiUnvsiU6edAwUBpF+OrGz04fshwMWv7v6 GYS/d74uokghQ61Nu7JH5kO+LDLFGtE= Date: Tue, 20 Feb 2024 18:30:19 +0100 From: Pavel Machek To: Lee Jones Cc: Chris Packham , "linux-leds@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: Linux support for a 7 segment LED display Message-ID: References: <1f598a72-dd9f-4c6c-af7f-29751f84bd23@alliedtelesis.co.nz> <20240219151332.GC10170@google.com> <20240220081842.GF10170@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="scxsMsU9D8GBkCKm" Content-Disposition: inline In-Reply-To: <20240220081842.GF10170@google.com> --scxsMsU9D8GBkCKm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > >> 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= can > > >> 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 loo= king > > >> in the wrong place. Or maybe it's the kind of thing on PC hardware t= hat > > >> is just driven by the BIOS without the operating system knowing abou= t it. > > >> > > >> Is there an existing in-kernel driver for such a thing? > > > Why would LEDs connected to a bunch of GPIOs in a specific fashion > > > require a hardware driver? Doesn't drivers/leds/leds-gpio.c already > > > provide all the support you need? > > Yes I could expose the individual segments as gpio-ledsbut it would be= =20 > > nicer if they worked in a more co-ordinated fashion so I didn't have to= =20 > > care about the individual segments and could just say "display 7" or=20 > > "display 0". >=20 > Still not sure this sort of thing should be kernel-side. >=20 > Sounds more like the role of a library or middle-layer. We do already have 7-segment support in auxdisplay. We should simply use that interface. Simply create auxdisplay driver that uses gpios and provides interface similar to what is already there. (Of course, just using gpio library for userspace will be easier). Best regards, Pavel --=20 People of Russia, stop Putin before his war on Ukraine escalates. --scxsMsU9D8GBkCKm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCZdThqwAKCRAw5/Bqldv6 8gxrAJ4tqC8nc64FZB7zheh/HrZrHNQIVwCgj4qctDPPkAFQ1pRuMie0lIAC39I= =nym6 -----END PGP SIGNATURE----- --scxsMsU9D8GBkCKm--