Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp807569rdb; Thu, 22 Feb 2024 23:48:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU/njtp+1ZxMLq4tTYtVg+pmeIW6xexlSYG40MxWTbqq0Fb9IRNEDJ1+9dWWUKeTSp6XiVnYbFPyaKzZO/VMjOhCsmRfQlen9ZTXRg75A== X-Google-Smtp-Source: AGHT+IGfCuiZLyAXx61+xw1YYciWhIM0RRt9iKIJxyQ39VRlX4lNV+l78v9kJpJszE6S0e3/eqMG X-Received: by 2002:a17:90b:1110:b0:299:32ee:a426 with SMTP id gi16-20020a17090b111000b0029932eea426mr859967pjb.32.1708674487449; Thu, 22 Feb 2024 23:48:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708674487; cv=pass; d=google.com; s=arc-20160816; b=pK2hyEbDUFHNpsvCXk1710ZEspN7ybcYu3oUNTL37sD7wTEnUnCmW7VF9hja45/sBh lZ+6eIzIt34derV27FaDUDf2/mloyzKg5BI6guwI2WSl1FqG1HruBZklfhEZhj5UBt7Y Wguw3tcW4DFZTW0xnGd1Q3A6Tfyin7w88Xr+xroJ2BlTMtUXzFQ0lzEoqhVhnRmmhfUp qjq0xzH4lPZQqcXKau20lkWkcwCdjxBKlnzK2WBWeOqpaI4OtINGQVUBxeVNlBmpn2xg Yr5TOHdjJigY8kz/hadJ1uhgBP9JV4iH8etTmjnVH/H6N/iTV6RPZAKBxA/lscuFYDz4 5XIQ== 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=Ce5HkTYASA33I56IAyhmdG33rVUQPOyGT/uJIx9/trs=; fh=NcXgyEgx3q71WZ0qUvnow+Q8x0D5glGRWxsnRT4B4BE=; b=bRko6cVtjcQzxnYWgxqOT3NQqglgoT581pZgWmQgvOKQB8PHh6ffHf4EEt6KBrMt/5 QDzypFmGnZfsVA60kTvUlZ3gf9A3sI7I8xogmZ7zCgSePIICfbhgXZxVcKiS0trucG5A nOAvNFVTOMzntMXQkhQKRJSKYv8XItBdfu+iTSx0tESxkI20r0waYDUyTBK3PTtFCbK7 m0uj1sYtehm6CtfdgPBGWp0ESeD2tARxFs+TL8BQ/x0oo8mlbT/aWV9iM9AQ3cWeKO/W H509/IUdeEALCOX0stlqgvxSWL1+kbxKSiUIi10Pp3BRGXQXGTBzHoHdo2X+z2jek99b xygA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ucw.cz header.s=gen1 header.b=Vq+fZKmD; 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-77882-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77882-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucw.cz Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h10-20020a17090acf0a00b00299f94aa44csi729625pju.86.2024.02.22.23.48.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 23:48:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77882-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ucw.cz header.s=gen1 header.b=Vq+fZKmD; 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-77882-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77882-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D3BFDB22E52 for ; Fri, 23 Feb 2024 07:47:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7161914ABA; Fri, 23 Feb 2024 07:47:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ucw.cz header.i=@ucw.cz header.b="Vq+fZKmD" 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 BD69314A8C; Fri, 23 Feb 2024 07:47:35 +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=1708674459; cv=none; b=Qxt/G/U12VxOzgMyxo1Bxz6excbNtdpSmZuAjFEIt+VVd8zj3XgcuN3AEdXc/DhpKblhXGufPV7Nn0JKPTWvsydaKsYngG9UHUl5I1AQDOcSTTug9fNpK+x7j9BEr89+ULqqfv/K1FNFBlFwHnrhX4y5LnLa1UG8z2VNxpONPpA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708674459; c=relaxed/simple; bh=dakXAoUwybWwoGMWZfdTc8ldPExi8xKCBV6CWj3leCg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BLQoKmPXWTOloX39yfNk/3IED7Pw/idYDcLgM2BF2/PjKyQYykDOIK0MD9ZB5U/HfZI4tgYmcNW3jT6lEiRFAnnIjDiRg5gttCyOKzs8rWQRHHK4qw8w1KA7+yFS1+qwa//fIiExkk7O3rWYIn5W942D1hsb5kvKCQZF0xykUsQ= 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=Vq+fZKmD; 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 50CF41C0080; Fri, 23 Feb 2024 08:47:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1708674453; 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=Ce5HkTYASA33I56IAyhmdG33rVUQPOyGT/uJIx9/trs=; b=Vq+fZKmDjInp+2GboJUiFHaP9nTcpq47lLljE5/ryHmf4shX02b9F0N5mpS7URFic4p06n 52twNA/Dgwu4QV18jBf4KL8O6Pt9fxk6KzQROLWCs8ilEgpXe6A3rFqf1gKpD1VIMIyK05 CMFYGW97zmVteb5cD3oIzFY+hz5asow= Date: Fri, 23 Feb 2024 08:47:33 +0100 From: Pavel Machek To: Chris Packham Cc: Andy Shevchenko , Geert Uytterhoeven , Krzysztof Kozlowski , "lee@kernel.org" , "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> <9d00e1b1-120b-4c2b-89c5-0ac736bf6441@alliedtelesis.co.nz> <2a8d19ee-b18b-4b7c-869f-7d601cea30b6@alliedtelesis.co.nz> 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="E6eqKPZfu8IShWOk" Content-Disposition: inline In-Reply-To: <2a8d19ee-b18b-4b7c-869f-7d601cea30b6@alliedtelesis.co.nz> --E6eqKPZfu8IShWOk Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > Right, but also with some additional properties, like > > - type of the indicator (7, 14, etc segments, for now we have only > > these two supported) > > - use-dot (+1 led per each digit) > > - characters (how many digits we have, so we need respective amount of = GPIOs) > > > > With this it's indeed belongs directly to auxdisplay as we have almost > > everything is done already there. >=20 > I've been playing about with this. I've got an auxdisplay driver that's= =20 > basically working (I won't bother spamming list with it yet). But I'm=20 > wondering how I'd represent multiple characters. I kind of feel the=20 > natural representation would be something like. >=20 > =A0=A0=A0=A0=A0=A0=A0 led-7seg { > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 compatible =3D "generic,7-= segment-on-gpio"; > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 char-0 { > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0 segment-gpios = =3D <&gpio 0 GPIO_ACTIVE_LOW > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0 =A0 =A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &gpio 1 GPIO_ACTIVE_LOW > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = =A0=A0 =A0 =A0=A0=A0=A0=A0=A0=A0 &gpio 2 GPIO_ACTIVE_L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A0=A0=A0=A0=A0= =A0=A0=A0 =A0=A0 =A0 =A0=A0=A0 &gpio 11 GPIO_ACTIVE_LOW > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 =A0=A0 =A0 &gpio 12 GPIO_ACTIVE_LOW > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0 &gpio 13 GPIO_ACTIVE_LOW > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 =A0=A0 =A0 &gpio 14 GPIO_ACTIVE_LOW>; > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 }; > =A0=A0=A0=A0=A0=A0=A0 }; >=20 > But having those sub-nodes means I can't just use devm_gpiod_get_array()= =20 > instead I'd have to use device_for_each_child_node() and=20 > devm_fwnode_gpiod_get_index(). Am I missing something? I could do away=20 > with the sub-nodes and have properties like "segment-0-gpios",=20 > "segment-1-gpios" but that feels awkward. One solution would be to treat separate digits as separata devices :-). Other would be saying you don't have hardware for that, and make it someone else's future problem. Best regards, Pavel --=20 People of Russia, stop Putin before his war on Ukraine escalates. --E6eqKPZfu8IShWOk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCZdhNlQAKCRAw5/Bqldv6 8rq7AJ9pBX3jWCZOuYr6ImDa9LPgqwb8kgCfYRQsL9gOcZVAvjG7CU18xj2IY1Y= =Gbls -----END PGP SIGNATURE----- --E6eqKPZfu8IShWOk--