Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp2507296imc; Sat, 23 Feb 2019 05:03:17 -0800 (PST) X-Google-Smtp-Source: AHgI3IbgKE0eqQPoJWqbPg4IsCef1cTcg1R5wWWKSdpdM8wBJ/SSJM8BxNBEsI62G1+pJzix2qYo X-Received: by 2002:a63:8f45:: with SMTP id r5mr8625912pgn.222.1550926997164; Sat, 23 Feb 2019 05:03:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550926997; cv=none; d=google.com; s=arc-20160816; b=uLDMijPlQsdYPGr9m0zZyVLoQ1uNQ/drX9Qw8LsjADykKmpfF3P5/6BzGZoFe/ABks Z4rXanfq+Hk0EaqQRzirYXSDr0662uKy0EJn1yaeLXaQ7fCneZJo0WqD6cqmvv8WRHHm eQVTg6EJ/K+wcTmW+2M9v9doVq2kgdmlaUAYwYuQgw9P2H2Y0FWakWfDR1fiCBmjX9lR cThg3iE4890Rjz2lQw5w6eSqO3vXpUKHpqc4MiDl9+E0aHsUtcenNIB1IrTLBD95zzkK tFslfHCuKd8GjIEpIHrCCHsTQAVhBJn3gd5H3eHT1vfoBhuPFmVXQ7PrqxorU/W1Kdhm 4dOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=pg0qPK/7ic2gH9jCLEPOmJCLbTatvZOgY7K0zD6ap84=; b=PtIdWqmeHfnKNWhpHMG+EYoaGyn8AEWUmcLjjYIJkq+/vwAYIOzt9kRbFt6t/Ov+c+ 3QEdIDSiDwpj56cf24qn7sFKyZv91n+g7kHzDYY46l2V2NIA9c3Tq8LUsQMZ5tBldXXJ 6Z1V3v4jP1OaySMbEsHowdISUULqDXr+mfQPMDTrQTjHAgW3plYghSwm2WFv5BaUtXCB dzYq0EZqTpDDCM0I0VrflDC5zz7od953rVYJnojnJqp4yL1PlW7iSep6vT6/JLNeiDhk cvO1X/yfhJr6RUNhP0wk5p9NQ4MKxKMzLbOCkziyWTqgrFjy9An1fBhrFkaiWJOuCU2s xmWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gDDGKAZu; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si3766793plt.115.2019.02.23.05.03.01; Sat, 23 Feb 2019 05:03:17 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gDDGKAZu; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726592AbfBWNCi (ORCPT + 99 others); Sat, 23 Feb 2019 08:02:38 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35382 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726043AbfBWNCh (ORCPT ); Sat, 23 Feb 2019 08:02:37 -0500 Received: by mail-wm1-f65.google.com with SMTP id y15so4272311wma.0; Sat, 23 Feb 2019 05:02:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=pg0qPK/7ic2gH9jCLEPOmJCLbTatvZOgY7K0zD6ap84=; b=gDDGKAZuArjq6zH7AdO381l6tZQ0mA17Ns6KM1gW7kJjrP52DucMMNvcbVd6LwYqoH FQ8oev6BeEhCihNvxvDvyw7/jLweE2TjE4kYz2xjm4g2VpPKJOEsswhPd1qMnyRxw+0Q 8RjoP1yBRIlso0RBQSEXj6DpN67LwZBw05COWOaccsQ2hFswYAfbVqrWtaYUgDQPFFq3 y2Tel7JUVlhuuY8tD84Mug6Nuk65/Ix3pNmWkdqz02/Nti9NC5HjzvNgTFJXsW1HlUof Et70iVdBBtAk4WaogtIrSbwP0/SZx4MwSNN2Pzq0GaI8rUG5Y//Oav9zJro1MEWhMpHd M3nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pg0qPK/7ic2gH9jCLEPOmJCLbTatvZOgY7K0zD6ap84=; b=WVNijhSEPoNUVd1tL5izVGs/XI5LJjVBcggPYtHWczqxejSko0YZOiY0H5xcl1tvMV ne1dExx0bgftlcmvZknn9+THMp7FUb7c3cR0THvofZjjKlaDptKZqoKyfRb3s9LxXB24 XxvBG+QZGBjEUpwiUkhP7YP5lQ/pBvWxkViEEI21q01ujfGD8DzG5q3ba0P2EdMJQ0tA 0zplCla9/1oaV4OTWClfNkE44/qXwXkR/mEou/toTKlya8nVDlSXs7xzeeWifOF4Z1f6 uhALBnzFr3hnLEzTZF13tTAcSiEhundfShRo+PUuD1li98XWkFshTFCASvQ241yO3sz+ k9Iw== X-Gm-Message-State: AHQUAubGDr9XPITF7NaC2hPoEQJJOItHvJfy3kXD9d73zD0mR+yXjHvy vLHGgNx04qIrHdBW/2Bd5avxBKY9 X-Received: by 2002:a7b:c5d1:: with SMTP id n17mr5440121wmk.152.1550926954757; Sat, 23 Feb 2019 05:02:34 -0800 (PST) Received: from [192.168.1.18] (bkp90.neoplus.adsl.tpnet.pl. [83.28.183.90]) by smtp.gmail.com with ESMTPSA id l129sm2918259wml.42.2019.02.23.05.02.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Feb 2019 05:02:34 -0800 (PST) Subject: Re: [PATCH v2 3/8] dt-bindings: leds: Add binding for axp20x-led device driver To: Rob Herring , Stefan Mavrodiev Cc: Pavel Machek , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Lee Jones , "open list:LED SUBSYSTEM" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:X-POWERS MULTIFUNCTION PMIC DEVICE DRIVERS" , "moderated list:ARM/Allwinner sunXi SoC support" References: <20190215115013.11098-1-stefan@olimex.com> <20190215115013.11098-4-stefan@olimex.com> <20190222195109.GA17753@bogus> From: Jacek Anaszewski Message-ID: <07d9d8f2-6263-8966-19da-ecaa761b3db9@gmail.com> Date: Sat, 23 Feb 2019 14:02:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190222195109.GA17753@bogus> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/22/19 8:51 PM, Rob Herring wrote: > On Fri, Feb 15, 2019 at 01:50:08PM +0200, Stefan Mavrodiev wrote: >> This adds the devicetree bindings for charge led indicator found >> on most of X-Powers AXP20X PMICs. >> >> Signed-off-by: Stefan Mavrodiev >> --- >> .../devicetree/bindings/leds/leds-axp20x.txt | 74 +++++++++++++++++++ >> 1 file changed, 74 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/leds/leds-axp20x.txt >> >> diff --git a/Documentation/devicetree/bindings/leds/leds-axp20x.txt b/Documentation/devicetree/bindings/leds/leds-axp20x.txt >> new file mode 100644 >> index 000000000000..5a83ad06796d >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/leds/leds-axp20x.txt >> @@ -0,0 +1,74 @@ >> +Device Tree Bindings for LED support on X-Powers PMIC >> + >> +Most of the X-Powers PMICs have integrated battery charger with LED indicator. >> +The output is open-drain, so the state is either high-Z or output-low. The >> +driver is a subnode of AXP20X MFD driver, since it uses shared bus with all >> +other cells. >> +The LED can be controlled either manually or automatically. Then in automatic >> +(controlled by the charger) there are two indication modes: >> + >> +Mode-A >> +====== >> +- output-low: Charging >> +- high-Z Not charging >> +- 1Hz flashing: Abnormal alarm >> +- 4Hz flashing Overvoltage alarm >> + >> +Mode-B >> +====== >> +- output-low: Battery full >> +- high-Z Not charging >> +- 1Hz flashing: Charging >> +- 4Hz flashing Overvoltage or abnormal alarm >> + >> +The control and the mode can be changed from sysfs. >> + >> +For AXP20X MFD bindings see: >> +Documentation/devicetree/bindings/mfd/axp20x.txt >> + >> +Required properties: >> +- compatible : Must be "x-powers,axp20x-led" >> + >> +Supported common LED properties, see ./common.txt for more informationn >> +- label : See Documentation/devicetree/bindings/leds/common.txt >> +- linux,default-trigger : See Documentation/devicetree/bindings/leds/common.txt >> +- default-state: See Documentation/devicetree/bindings/leds/common.txt >> + >> +Optional properties: >> +- x-powers,charger-mode: 0 for Mode-A, 1 for Mode-B >> + If omitted, then the control is set to manual mode. >> + On invalid value, Mode-A is used. >> + >> + >> +Example: >> + >> + axp803: pmic@3a3 { >> + compatible = "x-powers,axp803"; >> + >> + ... >> + >> + led@0 { > > What's the 0 for? A unit address without a reg property is not valid. It was done on my request, but now I see it was an omission. Since this node describes a LED controller, then it should be called "led-controller". >> + compatible = "x-powers,axp20x-led"; >> + status = "okay"; And below part should be in a child node. Stefan, please compare Documentation/devicetree/bindings/leds/common.txt and other LED bindings. >> + label = "axp20x:yellow:chgled"; Moreover "axp20x:" part should be removed from here added in the driver. Please refer to drivers/leds/leds-cr0014114.c on how we do that now. >> + linux,default-trigger = "timer"; >> + default-state = "on"; >> + }; >> + }; >> + >> +or >> + >> + axp803: pmic@3a3 { >> + compatible = "x-powers,axp803"; >> + >> + ... >> + >> + led@0 { >> + compatible = "x-powers,axp20x-led"; >> + status = "okay"; >> + >> + label = "axp20x:yellow:chgled"; >> + x-powers,charger-mode = <1>; >> + }; >> + }; >> -- >> 2.17.1 >> > -- Best regards, Jacek Anaszewski