Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3771390imc; Thu, 14 Mar 2019 05:05:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8Ub84sDv80EtCUA31Q4A0bwqK6y9mtM9pPt2/D6jYH4uH2LAQHKQaUqqZAA0OMzskkL8G X-Received: by 2002:aa7:8a81:: with SMTP id a1mr48914048pfc.246.1552565132758; Thu, 14 Mar 2019 05:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552565132; cv=none; d=google.com; s=arc-20160816; b=z1R+LzN9hG+lh/SOp3xg+xNUW0j01Ms8xnARACKj1Xv4uXwzfh7sjqCoT7LISqMlvT 7rhMbNezO2djDOF1vjx7EsAFDkH1NtdUagd7E7KCk6yoC1GhdhhnIGDj8vy8pVB6KoQm T+LYst0w0Tl/PtjuGFHEM9Gnq/pE3UT/DxYVxM2bO5WDF5MvYJTZnRBTSsxauPmNoeWn 86xEkN/HkdDDVrqlbgn10grBWUZdHHpSYHRRKzb00URVLE3oyBWGFSk2Jf2ponL05IeK btkGbrLXsAY58O3ImdEkrUNbcoQ5skOGbM7HLZisRv+FbumyMpUyMDp3PhoJ2ktyvVnW KOSw== 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=SzmtmG+iv5OUqMsysamkjDew52ti496Vy07NC9f4KDQ=; b=vyxUsQfZVtfc+hrzSengaNKzJIT869svaJiHHwkNp5OBjhgjKjX/RRbvgWpcbf+aKm xsRWS00+mM1wnNeYnDF9riPZWNKT03HH80FDKZUBY61dPvm2zQ1olU6i/THHq2mdDRfM +pX2cstRxluckkdSOMT1PlO+smjxWrtg2mNtDDK2jkgGYLc0ltozWdg3PxXsdQPHgTNU K5GG7ZHZLVnKsIS5ZrpV7EXl7uHOKOdSIYk4wvlsKLxdN/xKwc/LmhnhJZ40fJvcMKcx 9ULklCgnuzh5aJRc1sMFxhV8551UVg39PYLRlNifwlgTB8EbH+fDfZ9t2RLKwlnqAcXJ Gu9Q== 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 132si5310680pgb.105.2019.03.14.05.05.17; Thu, 14 Mar 2019 05:05:32 -0700 (PDT) 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 S1727617AbfCNMAw (ORCPT + 99 others); Thu, 14 Mar 2019 08:00:52 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:43027 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726777AbfCNMAv (ORCPT ); Thu, 14 Mar 2019 08:00:51 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 45A7080435; Thu, 14 Mar 2019 13:00:41 +0100 (CET) Date: Thu, 14 Mar 2019 13:00:47 +0100 From: Pavel Machek To: Rasmus Villemoes Cc: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Jacek Anaszewski , LKML , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 4/4] leds: netdev trigger: allow setting initial values in device tree Message-ID: <20190314120047.GA19072@amd> References: <20190311144227.GA4404@amd> <20190313202615.22883-1-linux@rasmusvillemoes.dk> <20190313202615.22883-5-linux@rasmusvillemoes.dk> <20190314102911.GA15173@amd> <6fb71b90-1ae3-9d93-6e0c-c95e441ced7a@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline In-Reply-To: <6fb71b90-1ae3-9d93-6e0c-c95e441ced7a@rasmusvillemoes.dk> 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 --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu 2019-03-14 12:26:38, Rasmus Villemoes wrote: > On 14/03/2019 11.29, Pavel Machek wrote: > > On Wed 2019-03-13 21:26:15, Rasmus Villemoes wrote: > >> It can be quite convenient to initialize a netdev-triggered LED with a > >> device name and setting the rx,tx,link properties from device tree, > >> instead of having to do that in an init script in userspace. > >> > >> + The optional child node netdev can be used to > >> + configure initial values for the link, rx, tx and > >> + device_name properties. For example, setting > >> + linux,default-trigger =3D "netdev" and adding the chi= ld > >> + node > >> + > >> + netdev { > >> + rx; > >> + tx; > >> + link; > >> + device-name =3D "can0"; > >> + }; > >> + > >> + can be used to replace 'linux,default-trigger =3D > >> + "can0-rxtx"' that relies on the deprecated > >> + CONFIG_CAN_LEDS. > >=20 > > I'm sorry, but no, not like this. I see it works for you, only having > > single can device, but it would quickly break with two of them and two > > ethernets are rather common. > >=20 > > So this will need to be device =3D <&phandle_of_ethernet_device> or > > something like that. There may be example with usb port triggers. >=20 > Huh? I have two CAN devices, and there are two LEDs on the front panel > labeled CAN-A and CAN-B; my device tree nodes for that are =2E.. > and this works just fine. The only change from the old DT is the > addition of the netdev nodes and changing linux,default-trigger from > "can0-rxtx", "can1-rxtx" to both "netdev". Yeah and now insert the modules for the can devices in different order... May not happen in your case but will be fairly common for ethernets. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --UugvWAfsgieZRqgk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlyKQm8ACgkQMOfwapXb+vI2kgCeI4eLitwds68MutQltj+a4klK xT0An1vLH+H/RtsLkTkIb2mBueNE1jsi =BBl1 -----END PGP SIGNATURE----- --UugvWAfsgieZRqgk--