Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp339224pxf; Thu, 25 Mar 2021 05:30:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyetSpWYSFTfm0OlEu0nhq6ovb9pqj6Jero9hlLeM9PZRrRfJKdTjtY7O8LZnJ1m9NmeWXL X-Received: by 2002:a17:907:1b20:: with SMTP id mp32mr9144776ejc.495.1616675428662; Thu, 25 Mar 2021 05:30:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616675428; cv=none; d=google.com; s=arc-20160816; b=aenkqnjyXlIUD6G5JJr0ZdTYRgi2/NNCmL5J0y2MU9nETob6qD5Y4JWw5xAaVwn7dX 1vWqc7zyXvtJzl+SQMHdXfQYc2xS2t/yLVItYvmXxOy90tK1P5hlsleqnSkBTK5bxBvS BGG5lbYCt3ioZj4Z6VbvRhYZYrOs9xMc1zuUQLa3QCMvVKxLr+CxOQNvgGHCqaYAihJZ ZlmTCYbOCsAWN1+bNJqK6ZDPg51S5HugWlfAZ7S+f3LSQAZVan8cJuek2zNmd7Pjd5Ip zkW6uHgslu9jN+7Zbw/x/uzF5HdgcymhxlBYL0x91bMut+Bx2kArx6BwlqSttWNG9F6y 6eeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=dYDDYfowYCSpo0s4hP+xTGhD3oaYHzqhS3sE+saAaWg=; b=UBjsZU2Z0+w1KUQ0gCacY62NgP10dp1hmvwQQqKTq2N2j5+qf12eGRnKJrWqVB0OoY 20opk+iqrFAMVyJIYKLHdnL8Hyq9rLCCD0vngxpJ7D0VIfu9Yx3zW79fOhTg/jvdhjrm ubQTGQOmLYO1n5G8EAhptyzAo9yiHl6wCA38XU0SOFPh3IAQebnGIEunx34pZs6i0o9G 2qPyXNVK6wyPtY1+bJkIQMujNNyWVa1RdUexUdTTX5BxjY4Ubfoz/0cqlzIRfqSa2phD QpIVHtTaRVEB4yu/sgOMjslJPjmJh8mI3lhC5VxTmEURqAoxr6IKG8q9UhHvZX059VJj 9PlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g9si4173895ejh.247.2021.03.25.05.30.05; Thu, 25 Mar 2021 05:30:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231191AbhCYM1F (ORCPT + 99 others); Thu, 25 Mar 2021 08:27:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230154AbhCYM0x (ORCPT ); Thu, 25 Mar 2021 08:26:53 -0400 Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F02BC06174A; Thu, 25 Mar 2021 05:26:51 -0700 (PDT) Received: from thinkpad (unknown [IPv6:2a0e:b107:ae1:0:3e97:eff:fe61:c680]) by mail.nic.cz (Postfix) with ESMTPSA id 9CA3F140AB2; Thu, 25 Mar 2021 13:26:48 +0100 (CET) Date: Thu, 25 Mar 2021 13:26:47 +0100 From: Marek Behun To: Hermes Zhang Cc: "pavel@ucw.cz" , "dmurphy@ti.com" , "robh+dt@kernel.org" , "linux-leds@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "lkml@axis.com" , kernel Subject: Re: [PATCH 1/2] leds: leds-multi-gpio: Add multiple GPIOs LED driver Message-ID: <20210325132647.3004fd73@thinkpad> In-Reply-To: <7ea3f7e6ea7a464fa4bb59b94857a755@XBOX01.axis.com> References: <20210324075631.5004-1-chenhui.zhang@axis.com> <20210324075631.5004-2-chenhui.zhang@axis.com> <20210324103431.4b945915@thinkpad> <7ea3f7e6ea7a464fa4bb59b94857a755@XBOX01.axis.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-100.0 required=5.9 tests=SHORTCIRCUIT, USER_IN_WELCOMELIST,USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz X-Virus-Scanned: clamav-milter 0.102.2 at mail X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Mar 2021 06:04:43 +0000 Hermes Zhang wrote: > > LED_FULL / LED_OFF are deprecated, don't use them. > > Then could I use just 0 (instead LED_OFF) and led_cdev->max_brightness > > (instead of LED_FULL) here? The idea here is map the states defined in dts > > to the full brightness range. Yes, you can and should use 0 insted of LED_OFF. > > + priv->cdev.max_brightness = LED_FULL; > > ???? max_brightness is not 255 (= LED_FULL). max_brightness must be > > derived from the led-states property. > > Yeah, I will fix this. the max-brightness should for the whole LED, > right? So > > it will at same level with led-states. max_brightness should be (the number of states - 1). I.e. if you have 4 gpios and the LED supports full 2^4 = 16 states, max brightness should be 15. Marek