From patchwork Mon Oct 24 11:35:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13017603 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BD949C38A2D for ; Mon, 24 Oct 2022 13:23:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7701410E6CD; Mon, 24 Oct 2022 13:23:33 +0000 (UTC) Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 679FC10E3DD for ; Mon, 24 Oct 2022 11:38:46 +0000 (UTC) Received: by mail-pg1-x52a.google.com with SMTP id 78so8422183pgb.13 for ; Mon, 24 Oct 2022 04:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wpAa0dkS8XhA2GQ66lc5m8kkJugJVYjadMORUlQ0wPQ=; b=t0cdU8Gq6mNNYiksD6eEYKO8Asn+CT0EzR/trw2LnPyXm+rD6nqXsCYeQqjtM7gPYM czLtjzn9STZMwbg25oKJ+rchJIE1C3EbruYtUtL1fo+a90zdV4qc0tsyovLT5dJAiUGE qsy+4fAYnPcQVS0njH5jJLQI9FZmFytWkVQGNsnYWmnWaeNhpSPFlsctwJOWhSbiXeZ9 h7w4BZ8ZVIJgYAYNUV3nlz9q7wdjdRwS9ZZ0zjcSCMcue0JOz1szUQizwPn6jyvjKFGF cxNAlwAh76EuqilV01f5017ZpYLpbgRwKmZuX/eFx2jyV1b0J3gkxlk7wW3OSfaxul6v yo0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wpAa0dkS8XhA2GQ66lc5m8kkJugJVYjadMORUlQ0wPQ=; b=BirH8+IASLPUgCkKNrjItPHfPw0kEqPWX6DoZT4Beow/cgZoTQAb5cASg5wGMOjn+y g4dzNM4Kn5lY4d2HvjXwdVCoXh+YeQR4KMqlNQZXPPUfTfKVNX/gsxhIV0mZrL8PmomO /tiEqf6Bpjzz6FsjT+zrYQC3DqxMQT9JQKsYgUFdnFxLoIrzzhXJtGNIr8XdrAPWRDK8 UJyYiIDhHIo0wRh1misxrYL+YC5nci8PWKAK/Jurg0l1PfEscR2Gr3bcnmJtE4fytBob NQG8R0eu/dGGk8/2xb2KsrW2mbE45EeqeYDxkMGT9HkFPxplqZ9dH5wVIAW8Kmflkd3/ S1yg== X-Gm-Message-State: ACrzQf362m+gyRuir6T1rHUNBHh18GdZFlkF8t4UAolBdkoN+5imtF6u 4vIe2pJhY/iOuXy9w1pdq+AG3g== X-Google-Smtp-Source: AMsMyM6nms4lu3tkLOdZ9JNSQbhLjcWcRc9H/ekaTG+Ayy8xJMo8kAow4Lj5Qd758THxno/pN3RsVg== X-Received: by 2002:a65:68cb:0:b0:460:b552:fbf4 with SMTP id k11-20020a6568cb000000b00460b552fbf4mr28051732pgt.457.1666611526061; Mon, 24 Oct 2022 04:38:46 -0700 (PDT) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id b8-20020a170903228800b001830ed575c3sm19475075plh.117.2022.10.24.04.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 04:38:45 -0700 (PDT) From: Akihiko Odaki To: Date: Mon, 24 Oct 2022 20:35:13 +0900 Message-Id: <20221024113513.5205-23-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221024113513.5205-1-akihiko.odaki@daynix.com> References: <20221024113513.5205-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 24 Oct 2022 13:23:26 +0000 Subject: [Intel-gfx] [PATCH 22/22] ACPI: video: Fallback to native backlight X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Ike Panhc , "Rafael J. Wysocki" , dri-devel@lists.freedesktop.org, Azael Avalos , Mattia Dongili , Daniel Dadap , Henrique de Moraes Holschuh , Akihiko Odaki , David Airlie , Daniel Thompson , Jonathan Woithe , Jonathan Corbet , "Lee, Chun-Yi" , Helge Deller , Lee Jones , Robert Moore , linux-acpi@vger.kernel.org, Cezary Jackiewicz , Len Brown , Kenneth Chan , Corentin Chary , intel-gfx@lists.freedesktop.org, acpi4asus-user@lists.sourceforge.net, Maxime Ripard , Mark Gross , Hans de Goede , Rodrigo Vivi , Daniel Vetter , platform-driver-x86@vger.kernel.org, devel@acpica.org, ibm-acpi-devel@lists.sourceforge.net, Jingoo Han , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Zimmermann , =?utf-8?q?Pali_Roh=C3=A1r?= Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Commit 2600bfa3df99 ("ACPI: video: Add acpi_video_backlight_use_native() helper") and following commits made native backlight unavailable if CONFIG_ACPI_VIDEO is set and the backlight feature of ACPI video is unavailable, which broke the backlight functionality on Lenovo ThinkPad C13 Yoga Chromebook. Allow to fall back to native backlight in such cases. Signed-off-by: Akihiko Odaki --- drivers/acpi/video_detect.c | 4 ++-- include/acpi/video.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 88462f2fb8cc..36354241c740 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -732,8 +732,8 @@ static int __acpi_video_get_backlight_types(bool native) return ACPI_BACKLIGHT_VIDEO; } - /* No ACPI video (old hw), use vendor specific fw methods. */ - return ACPI_BACKLIGHT_VENDOR; + /* No ACPI video, use native or vendor specific fw methods. */ + return ACPI_BACKLIGHT_VENDOR | ACPI_BACKLIGHT_NATIVE; } int acpi_video_get_backlight_types(void) diff --git a/include/acpi/video.h b/include/acpi/video.h index 5b748fdb606e..656b59acfd1f 100644 --- a/include/acpi/video.h +++ b/include/acpi/video.h @@ -76,7 +76,7 @@ static inline int acpi_video_get_edid(struct acpi_device *device, int type, } static inline int acpi_video_get_backlight_types(void) { - return ACPI_BACKLIGHT_VENDOR; + return ACPI_BACKLIGHT_VENDOR | ACPI_BACKLIGHT_NATIVE; } static inline bool acpi_video_backlight_use_native(void) {