Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2164906imu; Wed, 12 Dec 2018 10:34:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/XkGESODDNNWPz06bV6g6X1yCgIFqN+1rPBlKUCfg+5bfqOF2fPcESgMc5NFobgxl2DpQ1q X-Received: by 2002:a63:585c:: with SMTP id i28mr19316233pgm.178.1544639648745; Wed, 12 Dec 2018 10:34:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544639648; cv=none; d=google.com; s=arc-20160816; b=S7t2ys1KxkDM1UV68n2zQR9woIdT4MVfEvPJ5QFPn+iAyHX0qh5Hb+nxFMd0l3C/dZ UGLIf0aXILys7wKK3AhS9JavinYRjZgToVELUlknPiHhOyPcVckdlrZ64a3I9n0jG+9L tiYbYzU7lT+GXmgsZCbZxyFOy8Gf/tOnBqe03wsyjWb/dVVIQ5hE2ts4JD+OXsuVpDq4 j6nWq23zZI57+0/e4mZM/6Qi1sE5EY+d/+O/ijDctIGDOqgwBSM76XTOS5yQZnqD7RgM uaUZBC2TvhvOf999MfRXW/6DvK8MiJ2alHsUbMuJ+2DHljZcbxpgJ0I4KBw8oYrtAImX XsGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=nxxaKgbAX4qChHGH7sDOvoBt3iGiOSlWDw9hwj1LuZg=; b=h8Z1f1D6YQStOXJK0YItqMtIxtL03neAhErnZYtntOCrxEdetGC6mcn8a2JLbcmlcq /QKW9mA3w8oFo20EwOMamokW+lDp9na8sVSkZfpkJ4LGa/kezarUwMn/pXjY0lUCkGrp 33otp7+uyC/OV5Z2Nk72FBgCIG076yOPQtln+3w55Q8Po2vrFORHJ3V0leXVweGDvkbL YzuLMRBA9xbmR3sY/fDugafpLuuGZPd/3IhzS8q/beqlferkzY+QrwwJpeaboc+pVpAU d27g3digKRiph2WImvezTf3UJ1hr1hMBhXfwVpmN+dCDdqSR868hZ8N5UllW70NO3agN jXJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b19si16801244pfm.100.2018.12.12.10.33.53; Wed, 12 Dec 2018 10:34:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728308AbeLLSc5 (ORCPT + 99 others); Wed, 12 Dec 2018 13:32:57 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:59186 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727910AbeLLSc5 (ORCPT ); Wed, 12 Dec 2018 13:32:57 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 4CBA180809; Wed, 12 Dec 2018 19:32:50 +0100 (CET) Date: Wed, 12 Dec 2018 19:32:53 +0100 From: Pavel Machek To: Rob Herring Cc: Jacek Anaszewski , Linux LED Subsystem , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Baolin Wang , Daniel Mack , Dan Murphy , Linus Walleij , Oleh Kravchenko , Sakari Ailus , Simon Shields Subject: Re: [PATCH 04/24] dt-bindings: leds: Add function and color properties Message-ID: <20181212183253.GA16578@amd> References: <1541542052-10081-1-git-send-email-jacek.anaszewski@gmail.com> <1541542052-10081-5-git-send-email-jacek.anaszewski@gmail.com> <5bea0eb8.1c69fb81.6b921.80e6@mx.google.com> <0a0b176c-4eb4-4b0e-6c3c-b3c6c8f5fff5@gmail.com> <20181212095929.GA13437@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2018-12-12 07:56:20, Rob Herring wrote: > On Wed, Dec 12, 2018 at 3:59 AM Pavel Machek wrote: > > > > Hi! > > > > > > We would also probably need different DT properties for different > > > > types of devices, since e.g. for network case the network interface > > > > name would fit better for the LED name, than the phy name, > > > > and we would need to know what type of device name we're going > > > > to look for. > > > > > > > > Pavel gave following examples: > > > > > > > > eth0:green:link > > > > adsl0:green:link > > > > adsl0:red:error > > > > > > > > So we would have e.g.: > > > > > > > > associated-vl42-device =3D <&camera1>; > > > > associated-network-device =3D <&phy1>; > > > > associated-block-device =3D <&phy1>; > > > > > > Variable property names are kind of a pain to parse. > > > > > > Perhaps when LEDs are associated with a device, we shouldn't care > > > within the context of the LED subsystem what the name is. The > > > association is more important and if you have that exposed, then you > > > don't really need to care what the name is. You still have to deal > > > with a device with more than 1 LED, but that becomes a problem local > > > to that device. > > > > > > What I'm getting at is following a more standard binding pattern of > > > providers and consumers like we have for gpios, clocks, etc. So we'd > > > have something like this: > > > > > > ethernet { > > > ... > > > leds =3D <&green_led>, <&red_led>; > > > led-names =3D "link", "err"; > > > }; > > > > > > We can still support defining LED names as we've done, but we don't > > > have to come up with some elaborate naming convention that covers > > > every single case. > > > > I see that it would be more consistent with how gpios work, but I'm > > afraid this does not fit LEDs properly. > > > > With power LED, you want to be able to say "this is just on". Some > > poeple like heartbeat, and have LED for that. There may be LED for > > "disk activity", meaning activity on any harddrive. And there may be > > activity LED for specific disk. > > > > Only in the last case it would be suitable to have LED reference as a > > child of an device... >=20 > Right. For all the other cases, why do you need any link with a > device? What we have today is sufficient and can continue to be > supported. A link to a device is only used if the led is associated > with a particular device. Right, so the link is only needed in some cases. So unlike your example, we would have: led1 { led-meaning =3D "heartbeat"; } led2 { led-meaning =3D "link"; } led3 { led-meaning =3D "err"; } led4 { led-meaning =3D "activity"; what-activity =3D "all_harddisks"; } ethernet { leds =3D < &led2, &led3 >; } Dunno. I'd expect all the LED description in the LED node, not part of the description there and back link from the device... Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --LQksG6bCIzRHxTLp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlwRVFUACgkQMOfwapXb+vIbZQCgt8YLRx2eloWKWKDuVk/pqwFO GFoAoLMT7OmBoasj+A1EwR1sG3/tNr/z =Qbpj -----END PGP SIGNATURE----- --LQksG6bCIzRHxTLp--