Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20796157rwd; Thu, 29 Jun 2023 07:10:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlHcMo3jJkzwyKAxENEK2yqXJZizUwc5uyn4aKBRS/xSS+ylWRh9S0Qu8R9rC+DXwvbL7fKS X-Received: by 2002:a05:6a00:1250:b0:668:74e9:8efb with SMTP id u16-20020a056a00125000b0066874e98efbmr118034pfi.8.1688047823508; Thu, 29 Jun 2023 07:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688047823; cv=none; d=google.com; s=arc-20160816; b=YO+5fOV1jEfbPsZ4FfgqOcSnu14CFZXAerGuO/H3x9VQ0werqBkwAZLw+0EbbY81ui INhMMvtDO6nmVLacocFfVi8Arml57pgN+UtZwqJHmocgQNBMSAjm2Fd4aikdujziEptd nSL2obxcUWdRiY0N1qlLGxpu5JXnPUe2ufb5jJunpGskCGhF5/0p9r9lrgdOKBfO90Nq E6En3Woc9deYMkHroWTifozj33wi7w4/mA2TZX3kgDxUUuRlKjIZcgRQbICmwMnmioNt u3ZaD0EiF7dZvDdYWmlJG7esrFlszIvgmjcS9HcZ69WGGh2J5faD8Lp3ZiIyMMlmnfQk L1UQ== 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:date:subject:cc:to:from :dkim-signature; bh=oivdCWpWhN5qlKpC0P4lDqtzGqA01OdlG871VKH1xqo=; fh=cFTs8V9nDk3fNTQG5Ljxl0tW+f6xsT+Agou7/RAAu4A=; b=GseGM6kmTPNloVW8aOql2dwZy7sM/b+Z6voqK85agLelEmC8wDvA/2PAPE22BsL6j9 cWy6ZuEp73VPDs9GB7/L1yrZP9reh6vndFpjhDgOWs6b/Ypn4epXFKj7AVcyRnt6NxVM qWFFGYKIyE2WOVg8E87aBeyr7krRem6SwfgD/WsWGshTu3Ky4rqTY5MKTZtDgxL7rY6I jeWM+w5Zgebi1ku7Xl5aMjLBcFqWL57K7vKgM2Soa6LHxlUFHvB6B0ZNQvd9YZLjwr/4 kqefB08uBdJaW5+8W6Lu/M7OZJaF/6yLMJ5VeP+JrCkdS62y4H/5YI94ZcyOspuBLUgk 9Qaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=dcB3N3vJ; 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=axis.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s13-20020a056a00194d00b0068225e629aesi1480235pfk.0.2023.06.29.07.10.07; Thu, 29 Jun 2023 07:10:23 -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 (test mode) header.i=@axis.com header.s=axis-central1 header.b=dcB3N3vJ; 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=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232082AbjF2Nra (ORCPT + 99 others); Thu, 29 Jun 2023 09:47:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230036AbjF2Nr3 (ORCPT ); Thu, 29 Jun 2023 09:47:29 -0400 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A8C63588; Thu, 29 Jun 2023 06:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1688046448; x=1719582448; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oivdCWpWhN5qlKpC0P4lDqtzGqA01OdlG871VKH1xqo=; b=dcB3N3vJOErNkhoE9GwVIDVeXO7huEOSnu+DuNlqFd4W756O7uDRQCXS 7bbT/lQt+YROd1O4R/nNR4EJMwBUSag/IefoBQEXmntjDRe52gu19+hTe IGnqN+flLM+mI1GYKfU6zwuWnVjrR8fGHoSc61zx6En99ZJ19yI92d058 CGQcGV50qgY515Z3bSxTt5fsRmbzQoO+NXqQHlLML0q8K1I7NYLdnTG95 qlSEBhmf10fDvGJuzR7PAnuGhaDFJPoJZ+888fmvgFIU02uJx+/OWjjNr 09EvE/HOLHD3OMQhnqZUweDswbXHUUudnf3iYK7F4CuSRbNR+yW2YLcPQ Q==; From: Astrid Rost To: Dan Murphy , Andrew Davis , Andy Shevchenko , Krzysztof Kozlowski , Pavel Machek , Lee Jones CC: , Astrid Rost , , Subject: [PATCH v1 1/2] led: leds-lp50xx: Add max-brightness as in leds-pwm Date: Thu, 29 Jun 2023 15:47:21 +0200 Message-ID: <20230629134722.3908637-2-astrid.rost@axis.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230629134722.3908637-1-astrid.rost@axis.com> References: <20230629134722.3908637-1-astrid.rost@axis.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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. Signed-off-by: Astrid Rost --- drivers/leds/leds-lp50xx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c index 28d6b39fa72d..1cb54c0524a1 100644 --- a/drivers/leds/leds-lp50xx.c +++ b/drivers/leds/leds-lp50xx.c @@ -502,6 +502,8 @@ static int lp50xx_probe_dt(struct lp50xx *priv) led->mc_cdev.num_colors = num_colors; led->mc_cdev.subled_info = mc_led_info; led_cdev = &led->mc_cdev.led_cdev; + fwnode_property_read_u32(child, "max-brightness", + &led_cdev->max_brightness); led_cdev->brightness_set_blocking = lp50xx_brightness_set; ret = devm_led_classdev_multicolor_register_ext(priv->dev, -- 2.30.2