Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp245130pxf; Wed, 10 Mar 2021 05:33:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwctrgus533On1Nz1jeG2lW2podq+0q0YNHayRwB6AS6+3oKuw/OUs7gSnQoaCrvWkO6IQr X-Received: by 2002:a17:907:216a:: with SMTP id rl10mr3642498ejb.365.1615383199399; Wed, 10 Mar 2021 05:33:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615383199; cv=none; d=google.com; s=arc-20160816; b=ii8Z7gPIANyC/rNqe0j3kT7RazCp34yIF/ktncJpj9r1burpmK6GLsqUcwJF/anFTa HdnwHUqP/Z7v7FPtVbiRi/ZAmhaDxqq7y02omrI/eKDEIITfy5JXGSMLI+0c6xPfZj/q SHYrfcuKYdDjHcTzaMykkZ3vhEawELscDjXrhdmoeB07Ecs59tuTwgfGQtG1wqRt3OlH GMLgRL87NZf6ez27z1lzWGM0faNQiFQ2ZHEBP2reHJ4q5LZg+KqbLTl7CdbAywRyUkL2 jiUeyHKtW2jpGGbicCsP6I8zBBR2TsZGv6sEXk40j6vxC4or/HfIz825EeOzkhOlr2TU jadg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=w0pIZhEamS0QBtqhIorgX9N1PunB/2iaNvrD/sjN70s=; b=fOKVoERe7B8/jwsmeK14FYP+okv1QTAnWIHJj1Dnq5SivhpsP7HbQWBQda3GQiK9A7 ravBhHR8jOcWRP0deo0LbrAcOQKEs9kvN7kpwPLXXiv23coT8TaK7VJhvXjHyxRBuqLV gY20UYKdY2zOja+Dk7nKDBXd4XFtVyNmDk/JmSju/qs3mWgtpXMLhXeEfjGGjAP7U4Iu gTnSuA7WVDiLweqARHfgDfBEKrxyh1hqzpf+axa86LGKf/sVA6Xxy7/5dLIsT07hKt+p yC2vbrvNaKJjcJWh8TzlE3tPqJo5vlGXss1xlty/5/upWZo4hM18wI2rgbubzOMNXSJO 9wDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kekL5jf6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gj9si12473136ejb.552.2021.03.10.05.32.57; Wed, 10 Mar 2021 05:33:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kekL5jf6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233913AbhCJN3v (ORCPT + 99 others); Wed, 10 Mar 2021 08:29:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:46746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233366AbhCJNZ2 (ORCPT ); Wed, 10 Mar 2021 08:25:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C20D765015; Wed, 10 Mar 2021 13:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615382726; bh=FmHN8MCoMBNyPQv8vIXrMudtKn2O6qqBGE43AJrfrT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kekL5jf6MdGPtbCKWWymcv77PPf1mdNPUdRjBJZTDg9SN+ga9fN6NtytH1EII2b7E q/pZMRLPmaG2+gfC8RO5q+z01j1ETJktCyPceIYPp3YP5E01Dlp3jH2pxTE4Y8/6py 8N09SD3bZZ4wrNm1lpsv6uJEzpi+Te1UDQhuP+4Q= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Hans de Goede , Sasha Levin Subject: [PATCH 4.14 15/20] platform/x86: acer-wmi: Add ACER_CAP_SET_FUNCTION_MODE capability flag Date: Wed, 10 Mar 2021 14:24:52 +0100 Message-Id: <20210310132321.011047943@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210310132320.512307035@linuxfoundation.org> References: <20210310132320.512307035@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Hans de Goede [ Upstream commit 82cb8a5c395ea5be20e0fe31a8fe84380a502ca5 ] Not all devices supporting WMID_GUID3 support the wmid3_set_function_mode() call, leading to errors like these: [ 60.138358] acer_wmi: Enabling RF Button failed: 0x1 - 0xff [ 60.140036] acer_wmi: Enabling Launch Manager failed: 0x1 - 0xff Add an ACER_CAP_SET_FUNCTION_MODE capability flag, so that these calls can be disabled through the new force_caps mechanism. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20201019185628.264473-5-hdegoede@redhat.com Signed-off-by: Sasha Levin --- drivers/platform/x86/acer-wmi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 12aa174a865f..729d0277e100 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -223,6 +223,7 @@ struct hotkey_function_type_aa { #define ACER_CAP_BLUETOOTH BIT(2) #define ACER_CAP_BRIGHTNESS BIT(3) #define ACER_CAP_THREEG BIT(4) +#define ACER_CAP_SET_FUNCTION_MODE BIT(5) /* * Interface type flags @@ -2263,10 +2264,14 @@ static int __init acer_wmi_init(void) if (acpi_video_get_backlight_type() != acpi_backlight_vendor) interface->capability &= ~ACER_CAP_BRIGHTNESS; + if (wmi_has_guid(WMID_GUID3)) + interface->capability |= ACER_CAP_SET_FUNCTION_MODE; + if (force_caps != -1) interface->capability = force_caps; - if (wmi_has_guid(WMID_GUID3)) { + if (wmi_has_guid(WMID_GUID3) && + (interface->capability & ACER_CAP_SET_FUNCTION_MODE)) { if (ACPI_FAILURE(acer_wmi_enable_rf_button())) pr_warn("Cannot enable RF Button Driver\n"); -- 2.30.1