Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3706990imc; Thu, 14 Mar 2019 03:31:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPGzlLLn0cLu1pavR7e6rh3VLP7PRDsP9TIhmheC1MYn2DLAk7HafghOxDmhggyTcHtc3y X-Received: by 2002:a62:e11a:: with SMTP id q26mr48049738pfh.187.1552559472015; Thu, 14 Mar 2019 03:31:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552559472; cv=none; d=google.com; s=arc-20160816; b=JMuVLYO/cvX0RLKp0KbZZsJ3F3BzgZQd+7gAuOX+LNWI37lqy0GTtlghZb/jXG97FE 8IcpD/A81G8X0rzGYSSFmXAapgL8l9yDEGspocsP4NdGBknARNyFhIcV6bWuL5H2MkVu dB4j0KoiCvUhDbyQUDnzrLI2HpLGmuoHybIH4M/v6S3kzbfVKp2NfYJxeD2+nMqu0nzG Wb/tAMMDKCJphR0yjUibk88K2tE99jp7VsjUuEt7wIKy7/CynMxacQ2sZ+qR03UnVmai HV1AsEjRZSiZJmtj5dvAZrKnk1ybdJxkRzUkI3KtCFsfydvaLENItMdqQB8JTaMPg9iR GQ+A== 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=xRAl/C5VYeyTR/6AK6H+ndLc0bkD7V4cyGXoJQGQnVU=; b=VWIigYPU/LWFirELiPGw3tL6BWgyczSK7b6szl9eWwoTHDACg2jvadvAwVcEGU2+6x gWO8SooobGl7WrtYgPWzfPTv4h5CJqfKQbiaeXwoq3zGPUvw12nJvp4HNuHJEo1zrwrO hN+JLQEjyLJBjzyo0xuNAnq1rXYFEOsAfnrlJikoh2HnQ+1BBFkihZrSa8rdGeECFGHK IhZuzdcLjlXOl+7Sy90l/rqjXIkfF35ctyj/M2yHfmibw/jOlovc9xwge+YwVflKXhbK ub8JX/eP7rN2ROwxtnF2ea2MoQZAOjcTzOfootrkVsBEtb23PvEnBmHOW6OA6cQyLU7a qKDg== 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 r9si12270389pfh.188.2019.03.14.03.30.56; Thu, 14 Mar 2019 03:31:11 -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 S1727374AbfCNK3P (ORCPT + 99 others); Thu, 14 Mar 2019 06:29:15 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:33793 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbfCNK3O (ORCPT ); Thu, 14 Mar 2019 06:29:14 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 9698C80204; Thu, 14 Mar 2019 11:29:04 +0100 (CET) Date: Thu, 14 Mar 2019 11:29:11 +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: <20190314102911.GA15173@amd> References: <20190311144227.GA4404@amd> <20190313202615.22883-1-linux@rasmusvillemoes.dk> <20190313202615.22883-5-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <20190313202615.22883-5-linux@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 --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > My main motivation for this is to be able to switch away from the > deprecated CONFIG_CAN_LEDS, so add an example based on that and add a > pointer in the net/can/Kconfig file. >=20 > Signed-off-by: Rasmus Villemoes > --- > .../devicetree/bindings/leds/common.txt | 17 ++++++++++ > drivers/leds/trigger/ledtrig-netdev.c | 31 +++++++++++++++++++ > drivers/net/can/Kconfig | 3 +- > 3 files changed, 50 insertions(+), 1 deletion(-) >=20 > diff --git a/Documentation/devicetree/bindings/leds/common.txt b/Document= ation/devicetree/bindings/leds/common.txt > index 7cb88460a47c..4f3a97e73417 100644 > --- a/Documentation/devicetree/bindings/leds/common.txt > +++ b/Documentation/devicetree/bindings/leds/common.txt > @@ -43,6 +43,23 @@ Optional properties for child nodes: > Documentation/ABI/testing/sysfs-class-led-trigger-netdev) > to reflect the state and activity of a net device. > =20 > + 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 child > + 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. 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. So this will need to be device =3D <&phandle_of_ethernet_device> or something like that. There may be example with usb port triggers. Thanks, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --liOOAslEiF7prFVr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlyKLPcACgkQMOfwapXb+vLlNgCfc3mopLHDPlDR1GQfE7Nv1dpU d0UAoJmgtJ2Wlbcb8+a2niNEHhkyAXXo =xX3T -----END PGP SIGNATURE----- --liOOAslEiF7prFVr--