From patchwork Fri Jul 14 08:52:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 703057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3864CC001DF for ; Fri, 14 Jul 2023 08:53:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235677AbjGNIxM (ORCPT ); Fri, 14 Jul 2023 04:53:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235753AbjGNIxB (ORCPT ); Fri, 14 Jul 2023 04:53:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DE072120 for ; Fri, 14 Jul 2023 01:53:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C6F6761C9C for ; Fri, 14 Jul 2023 08:52:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4457EC433CB; Fri, 14 Jul 2023 08:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689324779; bh=7/e4SBxn7hv2OmNuhqD/9ZmO4FGuiP/KNu8UxBKbWc4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UzjYx0r6PusLvZ4sX9zbW9vyJydVmyaAIRVTNzWAA7604UR+v3nihfp44YFZdUG6o cZDdK3+oS3yVGc5u6r79KhmIsACp1CRFR5ALEMz+NE+zgBqT0ZjsSgH5XjJDCwjhV1 p1fFFtpeJvBXoupqaZWdEy9aMn4nO8QUXksG7n7QMba9uEzi7FBWqieFBcNnHS7f4c CPjpJEjEraJecvz8ZAfLlO7mYwleoPee5cD0MkXip9fUFGt2ta6SvFsm3LqTEluv49 y63uFLaXH+MQlLIbz43U2yrLgbSJ4QGRaQzdhOwZawfrqXgiNJ8BVwYi99EI22ook7 efGn2x3Ws+Eog== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: linux-leds@vger.kernel.org, Pavel Machek , Lee Jones Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH v2 1/3] leds: turris-omnia: change max brightness from 255 to 1 Date: Fri, 14 Jul 2023 10:52:51 +0200 Message-ID: <20230714085253.13544-2-kabel@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230714085253.13544-1-kabel@kernel.org> References: <20230714085253.13544-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Using binary brightness makes more sense for this controller, because internally in the MCU it works that way: the LED has a color, and a state whether it is ON or OFF. The resulting brightness computation with led_mc_calc_color_components() will now always result in either (0, 0, 0) or the multi_intensity value. Signed-off-by: Marek BehĂșn --- drivers/leds/leds-turris-omnia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/leds-turris-omnia.c b/drivers/leds/leds-turris-omnia.c index 64b2d7b6d3f3..c063b6b710f9 100644 --- a/drivers/leds/leds-turris-omnia.c +++ b/drivers/leds/leds-turris-omnia.c @@ -110,7 +110,7 @@ static int omnia_led_register(struct i2c_client *client, struct omnia_led *led, init_data.fwnode = &np->fwnode; cdev = &led->mc_cdev.led_cdev; - cdev->max_brightness = 255; + cdev->max_brightness = 1; cdev->brightness_set_blocking = omnia_led_brightness_set_blocking; /* put the LED into software mode */