From patchwork Thu Jul 2 11:07:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Ma X-Patchwork-Id: 11638493 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C2D5913B4 for ; Thu, 2 Jul 2020 11:07:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AAC6B20747 for ; Thu, 2 Jul 2020 11:07:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728071AbgGBLHx (ORCPT ); Thu, 2 Jul 2020 07:07:53 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:40131 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728009AbgGBLHx (ORCPT ); Thu, 2 Jul 2020 07:07:53 -0400 Received: from [222.129.43.254] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jqx4G-0002j6-Mm; Thu, 02 Jul 2020 11:07:49 +0000 From: Aaron Ma To: aaron.ma@canonical.com, mapengyu@gmail.com, ibm-acpi@hmh.eng.br, dvhart@infradead.org, andy@infradead.org, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [v2][PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid Date: Thu, 2 Jul 2020 19:07:40 +0800 Message-Id: <20200702110740.19880-1-aaron.ma@canonical.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200702085520.16901-1-aaron.ma@canonical.com> References: <20200702085520.16901-1-aaron.ma@canonical.com> MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org When _BCL invalid, disable thinkpad_acpi backlight brightness control. brightness_enable is already checked at the beginning. Most new thinkpads are using GPU driver to control brightness now, print notice when enabled brightness control even when brightness_enable = 1. Signed-off-by: Aaron Ma --- drivers/platform/x86/thinkpad_acpi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index ff7f0a4f2475..a52d6d457d6c 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -6955,10 +6955,13 @@ static int __init brightness_init(struct ibm_init_struct *iibm) pr_warn("Cannot enable backlight brightness support, ACPI is already handling it. Refer to the acpi_backlight kernel parameter.\n"); return 1; } - } else if (tp_features.bright_acpimode && brightness_enable > 1) { - pr_notice("Standard ACPI backlight interface not available, thinkpad_acpi native brightness control enabled\n"); + } else if (!tp_features.bright_acpimode) { + pr_notice("thinkpad_acpi backlight interface not available\n"); + return 1; } + pr_notice("thinkpad_acpi native brightness control enabled\n"); + /* * Check for module parameter bogosity, note that we * init brightness_mode to TPACPI_BRGHT_MODE_MAX in order to be