From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACF23C433E2 for ; Wed, 9 Sep 2020 21:16:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A07820BED for ; Wed, 9 Sep 2020 21:16:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599686167; bh=pfXjIpMYlZ55bmsEAOyUaolxQWqi4XSesElybOSoqYk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=DCer9yX25RkoMHHGVXvlskPPO8C8SKiUCJ6svRAzOxY6+8mzFxBVWywUutBdd8Fj3 GdRfRsj4ud2sr5Bw1C0ihJQ/PvHVduwErjwm1BG1GeAz9eHpxRK8O62Avokd9bW8OE gCdw9BrzJKAZLQfBUcRh6eNOW46Tyd9RwZ+OFO7k= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728626AbgIIVPz (ORCPT ); Wed, 9 Sep 2020 17:15:55 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:42936 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbgIIVPz (ORCPT ); Wed, 9 Sep 2020 17:15:55 -0400 Received: by mail-io1-f67.google.com with SMTP id u6so4764951iow.9; Wed, 09 Sep 2020 14:15:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=lyqQQMVpyPt4g281ZC1tAF0lH2Dn5fwBGNRSkwvKTw8=; b=qOBBGsyFrF/7AiCYA8PXJr8phr+Qsu/Jk2/VQTjPmOlSWiI4igeUDwTchcRdMQR0wn F3oBI0NLNU+6crWYi5C4qJoKPcIfDzCLGV4uQonP+MXQdoT84XkWDuzffVe2NZcn5BRn HUNPN9CYoJ4ZaP3SWSuBGLxR2p/Ov0XMrveDz3gLg5DTR3Jre2dHXMKnjDtkUA9OA4+T OIUnWj735QSg0pQbRF7RvpqxYw9/Vt+4bD560O02/TbLkQ6Sgn4jA2qbFy7ERq/R1PlA /3DMUMGrBLk2DKKw7PY68EViEEkYvRBiOTuUfGM0f2iyBwx5951kQqrNj4dNUe/DoQlL /V0g== X-Gm-Message-State: AOAM531fMYjFIj0Sxdy5uWZ6mWADLf4aQqxr+BYX7CmxfoNcslgEolp0 D2GQpjEJ0kp1Em/9vsz3AQ== X-Google-Smtp-Source: ABdhPJzSTRSFo7o8vKMpqBaz5cjJ4sWQ/Y9MvwYh1ZFwZFWnbgymWaBDslRLk7NL6zP+xpbdHWcdCw== X-Received: by 2002:a6b:f801:: with SMTP id o1mr4962313ioh.43.1599686153545; Wed, 09 Sep 2020 14:15:53 -0700 (PDT) Received: from xps15 ([64.188.179.251]) by smtp.gmail.com with ESMTPSA id p12sm1279074iom.47.2020.09.09.14.15.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 14:15:52 -0700 (PDT) Received: (nullmailer pid 3087549 invoked by uid 1000); Wed, 09 Sep 2020 21:15:52 -0000 Date: Wed, 9 Sep 2020 15:15:52 -0600 From: Rob Herring To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: netdev@vger.kernel.org, linux-leds@vger.kernel.org, Pavel Machek , Dan Murphy , =?utf-8?Q?Ond=C5=99ej?= Jirman , Russell King , Andrew Lunn , linux-kernel@vger.kernel.org, Matthias Schiffer , "David S. Miller" , devicetree@vger.kernel.org Subject: Re: [PATCH net-next + leds v2 1/7] dt-bindings: leds: document binding for HW controlled LEDs Message-ID: <20200909211552.GA3066273@bogus> References: <20200909162552.11032-1-marek.behun@nic.cz> <20200909162552.11032-2-marek.behun@nic.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200909162552.11032-2-marek.behun@nic.cz> Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org On Wed, Sep 09, 2020 at 06:25:46PM +0200, Marek Behún wrote: > Document binding for LEDs connected to and controlled by various chips > (such as ethernet PHY chips). If they are h/w controlled, then why are they in DT? > > Signed-off-by: Marek Behún > Cc: Rob Herring > Cc: devicetree@vger.kernel.org > --- > .../leds/linux,hw-controlled-leds.yaml | 99 +++++++++++++++++++ > 1 file changed, 99 insertions(+) > create mode 100644 Documentation/devicetree/bindings/leds/linux,hw-controlled-leds.yaml > > diff --git a/Documentation/devicetree/bindings/leds/linux,hw-controlled-leds.yaml b/Documentation/devicetree/bindings/leds/linux,hw-controlled-leds.yaml > new file mode 100644 > index 0000000000000..eaf6e5d80c5f5 > --- /dev/null > +++ b/Documentation/devicetree/bindings/leds/linux,hw-controlled-leds.yaml > @@ -0,0 +1,99 @@ > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/leds/linux,hw-controlled-leds.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: LEDs that can be controlled by hardware (eg. by an ethernet PHY chip) > + > +maintainers: > + - Marek Behún > + > +description: > + Many an ethernet PHY (and other chips) supports various HW control modes > + for LEDs connected directly to them. With this binding such LEDs can be > + described. > + > +properties: > + compatible: > + const: linux,hw-controlled-leds What makes this linux specific? Unless you're going to make this h/w specific, then it probably should just be dropped. The phy schema will need: leds: type: object $ref: /schemas/leds/hw-controlled-leds.yaml# > + > + "#address-cells": > + const: 1 > + > + "#size-cells": > + const: 0 > + > +patternProperties: > + "^led@[0-9a-f]+$": > + type: object > + allOf: > + - $ref: common.yaml# > + description: > + This node represents a LED device connected to a chip that can control > + the LED in various HW controlled modes. > + > + properties: > + reg: > + maxItems: 1 > + description: > + This property identifies the LED to the chip the LED is connected to > + (eg. an ethernet PHY chip can have multiple LEDs connected to it). > + > + enable-active-high: > + description: > + Polarity of LED is active high. If missing, assumed default is active > + low. > + type: boolean > + > + led-tristate: > + description: > + LED pin is tristate type. If missing, assumed false. > + type: boolean > + > + linux,default-hw-mode: How is this linux specific? It sounds device specific. Your choice is make this a device specific property with device specific values or come up with generic modes. Perhaps 'function' should be expanded. > + description: > + This parameter, if present, specifies the default HW triggering mode > + of the LED when LED trigger is set to `dev-hw-mode`. > + Available values are specific per device the LED is connected to and > + per LED itself. > + $ref: /schemas/types.yaml#definitions/string > + > + required: > + - reg > + > +additionalProperties: false > + > +examples: > + - | > + > + #include > + > + ethernet-phy@0 { > + compatible = "ethernet-phy-ieee802.3-c45"; > + reg = <0>; > + > + leds { > + compatible = "linux,hw-controlled-leds"; > + #address-cells = <1>; > + #size-cells = <0>; > + > + led@0 { > + reg = <0>; > + color = ; > + function = ; Reading the description of LED_FUNCTION_STATUS doesn't align with how you are using it. Think of it as user alert/notification. > + linux,default-trigger = "dev-hw-mode"; This is deprecated in favor of 'function'. > + linux,default-hw-mode = "1Gbps"; > + }; > + > + led@1 { > + reg = <1>; > + color = ; > + function = ; > + linux,default-trigger = "dev-hw-mode"; > + linux,default-hw-mode = "activity"; > + }; > + }; > + }; > + > +... > -- > 2.26.2 >