From patchwork Tue Sep 21 17:35:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12508433 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65E5AC433FE for ; Tue, 21 Sep 2021 17:35:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0AF5161166 for ; Tue, 21 Sep 2021 17:35:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0AF5161166 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B79BA6E9AD; Tue, 21 Sep 2021 17:35:31 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gabe.freedesktop.org (Postfix) with ESMTPS id 83F966E9AD for ; Tue, 21 Sep 2021 17:35:29 +0000 (UTC) Received: from tr.lan (ip-89-176-112-137.net.upcbroadband.cz [89.176.112.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id E06A882DB2; Tue, 21 Sep 2021 19:35:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1632245728; bh=fQ8JZO4D4mNVyYLfcl8scGzQjWbJK5VrU1vg9jCg9ug=; h=From:To:Cc:Subject:Date:From; b=zNcgC9Ba/Vsmr5Z7ZG/ODU5/lWrnnW/V+C49YzfAYa15ZFx7b372eq1HsYN9C0tUy 6BC5ZDMPPujlH9PhedPlEVZv8CMmz4s/VWuXFgyETxGQDHhW9+utNVvSRWcHZE6oLT r6fIsiCV586kfBjco3RcbLNXDyDFZ55eLWnXnG+qLfEdvd62tecrU2C6vajvd3tmNY Kd/XsoYVLOvSJ1q2LIz+2ULEcbZb6o1ObXPJ8AUAHlrybDmzOS7Nkq8hDR+zZkdsX0 ANqnHdisI+yd2wO4vpvqD9/8TGU6ePH8T4+1boYrH7Yl5IlKe0HCAQMEbW73IgbzOZ HxoCT8Cy55SEw== From: Marek Vasut To: dri-devel@lists.freedesktop.org Cc: lee.jones@linaro.org, Marek Vasut , =?utf-8?q?Noralf_Tr?= =?utf-8?q?=C3=B8nnes?= , Daniel Thompson , stable@vger.kernel.org, Meghana Madhyastha , Sean Paul , Thierry Reding Subject: [RESEND][PATCH v2] video: backlight: Drop maximum brightness override for brightness zero Date: Tue, 21 Sep 2021 19:35:06 +0200 Message-Id: <20210921173506.19675-1-marex@denx.de> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The note in c2adda27d202f ("video: backlight: Add of_find_backlight helper in backlight.c") says that gpio-backlight uses brightness as power state. This has been fixed since in ec665b756e6f7 ("backlight: gpio-backlight: Correct initial power state handling") and other backlight drivers do not require this workaround. Drop the workaround. This fixes the case where e.g. pwm-backlight can perfectly well be set to brightness 0 on boot in DT, which without this patch leads to the display brightness to be max instead of off. Fixes: c2adda27d202f ("video: backlight: Add of_find_backlight helper in backlight.c") Acked-by: Noralf Trønnes Reviewed-by: Daniel Thompson Cc: # 5.4+ Cc: # 4.19.x: ec665b756e6f7: backlight: gpio-backlight: Correct initial power state handling Signed-off-by: Marek Vasut Cc: Daniel Thompson Cc: Lee Jones Cc: Meghana Madhyastha Cc: Noralf Trønnes Cc: Sean Paul Cc: Thierry Reding --- V2: Add AB/RB, CC stable --- drivers/video/backlight/backlight.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 537fe1b376ad7..fc990e576340b 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -688,12 +688,6 @@ static struct backlight_device *of_find_backlight(struct device *dev) of_node_put(np); if (!bd) return ERR_PTR(-EPROBE_DEFER); - /* - * Note: gpio_backlight uses brightness as - * power state during probe - */ - if (!bd->props.brightness) - bd->props.brightness = bd->props.max_brightness; } }