Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp22708754rwd; Fri, 30 Jun 2023 11:26:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlH3CG2nnapODiG3Rs4Y0aiwOGnt7Xi+Nb4x3zgqoN6Gg857YOVciFt1Rkmyim9IIVFr/aOk X-Received: by 2002:a17:90b:4d83:b0:259:24c4:4dd4 with SMTP id oj3-20020a17090b4d8300b0025924c44dd4mr2620622pjb.10.1688149603860; Fri, 30 Jun 2023 11:26:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688149603; cv=none; d=google.com; s=arc-20160816; b=XBOrvVmSQ2qEnNgl1IaWkOKMvNHrRqTT8r6oZbhy9/OKc9DDDf/rIwtj5GrkLxnfMV 7JX9FWCmWzxmoAgRYeuLVW69ZO7GBI9ODa3/WrZk4b6Ch/TFfcoMHH3009glsGqw4uxl kxAxuRcy6FPsTUwhDtV6aieNNAS7JccP4zAnZkDpgoP3FrpGKgqkexoFaHNMDqr7VmQg 3UNf1tYxqxLHJHfcdOmzHnSjxD9dTsSLgdcMEaEmjq/q19KOjxFCmvts8Xaw7tYSBrCH jw7STHzTJZcVUClhEqEmMIGa0ttvu/Sa4784uhnXBU96E/0DRKcp27NhkqoZZD+bmoKV p+eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=l3dV0SjeRpnsecwu3/eGyon4J9SGw2KxPo9DUYrt6iQ=; fh=TkFLpl6b1DqSKfLfD1mDVd9GIG2Gi+Ru0B4/yBrbvhI=; b=xAjGj4D7qQYyb3WSLheIIEv2IRdBcAMXg+HwroL/dJQa+9zpR4clCF2181wzJkafwl urKY7hFolkyzXOPeRaUfCuXbmIohiuuzWRUFddA51FKfyQjd5KiLAwjZY4S3lz1YBKQQ 42bTJFuSatiWqJvOoD5XlFUTDlFmRVhn36NzbopABXT1V21dr9PEGKh6J+S69Ds7YfUF 6AiIcWldiIg9BtV1hQIjLPI4wra8wklkoe1u8DdldpgNM17nwlsvCVHlhk7uqtwxmMZM DHrL6ZWbMFeQGylRaIbEBqJQ8WrLej2iGysKa31gp0u3yYkTchn9LUBPaqROjTDchLvx yi1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MsJIGi3x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k11-20020a17090a9d8b00b0025eae2cef4bsi6957039pjp.1.2023.06.30.11.26.29; Fri, 30 Jun 2023 11:26:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MsJIGi3x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232830AbjF3SAA (ORCPT + 99 others); Fri, 30 Jun 2023 14:00:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbjF3R76 (ORCPT ); Fri, 30 Jun 2023 13:59:58 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F8F835AB; Fri, 30 Jun 2023 10:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688147997; x=1719683997; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=SsGHuD60K6V+2Csu940O7qwcjIx9HfXaFouXONb7hXY=; b=MsJIGi3x5Fh7DSsaFiAWg8fZuB7zFPBZ20RuKGxQbzVJNLKuBNpoclbY VsILDQntt7zhU4uDKk1Zdn1dlAFyxuILxGvBoDty3WQPt+es8bHZL+aTa Wx4XriaA8YnV3qFCYjLi+A8QmyPt0n9aMaivUcCyZWsv3Hm/pAyO1AGNV e6g1NPk7wZLtWxPpGmIBTEBFE03M2OJkEHvFp1Vk8fMg9sCUSt9Zdu8Gs eC61gfyCCuJRxNOmpBiNsdMy2S1E7qSjt7TCUspv2L25fPD3YunQzdACf OJV3jcvfgKTf/MZ8mzy31c0mKMD31GXW65rD1PLSpPBWhv3R5vVOWyT5n Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10757"; a="361307514" X-IronPort-AV: E=Sophos;i="6.01,171,1684825200"; d="scan'208";a="361307514" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2023 10:59:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10757"; a="831030189" X-IronPort-AV: E=Sophos;i="6.01,171,1684825200"; d="scan'208";a="831030189" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP; 30 Jun 2023 10:59:54 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qFIPQ-001AjG-2G; Fri, 30 Jun 2023 20:59:52 +0300 Date: Fri, 30 Jun 2023 20:59:52 +0300 From: Andy Shevchenko To: Astrid Rost Cc: Krzysztof Kozlowski , Rob Herring , Jacek Anaszewski , Pavel Machek , Lee Jones , kernel@axis.com, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] led: led-class: Read max-brightness from devicetree Message-ID: References: <20230630092248.4146169-1-astrid.rost@axis.com> <20230630092248.4146169-2-astrid.rost@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230630092248.4146169-2-astrid.rost@axis.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 30, 2023 at 11:22:46AM +0200, Astrid Rost wrote: > Add max-brightness in order to reduce the current on the connected LEDs. > Normally, the maximum brightness is determined by the hardware, and this > property is not required. This property is used to set a software limit. > It could happen that an LED is made so bright that it gets damaged or > causes damage due to restrictions in a specific system, such as mounting > conditions. Note that led-max-microamp should be preferably used, if it > is supported by the controller. LGTM, Reviewed-by: Andy Shevchenko Maybe you can also add to the cover letter that there are already users in the kernel that may be simplified after this change lands the upstream. > Signed-off-by: Astrid Rost > --- > drivers/leds/led-class.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c > index 9255bc11f99d..ce652abf9336 100644 > --- a/drivers/leds/led-class.c > +++ b/drivers/leds/led-class.c > @@ -457,6 +457,10 @@ int led_classdev_register_ext(struct device *parent, > if (fwnode_property_present(init_data->fwnode, > "retain-state-shutdown")) > led_cdev->flags |= LED_RETAIN_AT_SHUTDOWN; > + > + fwnode_property_read_u32(init_data->fwnode, > + "max-brightness", > + &led_cdev->max_brightness); > } > } else { > proposed_name = led_cdev->name; > -- > 2.30.2 > -- With Best Regards, Andy Shevchenko