Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp243217pxf; Wed, 10 Mar 2021 05:30:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhuaCUAXdNj4gScdg0eiOwmF8mRgNAFcc3cLmqC1Kv1HgTodkh3Q0Nce4Vu9zMSkx02gam X-Received: by 2002:aa7:d492:: with SMTP id b18mr3251088edr.381.1615383039575; Wed, 10 Mar 2021 05:30:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615383039; cv=none; d=google.com; s=arc-20160816; b=tH0t0iWnLwRqE3nKUHW6J8M3UgeG6XP3rZYQA/4V2J7tszIFCBNYbZLZKYjHmSwbnX uBg50UWspZVZr39U+VxJKFjKWSZalQ7J+USUsL4oci8MDS+vpFeHSHOzXrpFfBtdfFj1 tkgCrsOEga0S60gjINGaWGDNTO5PmpHQUmAi40AomlgvaayjQ9UhNXjSVwbR0TSIM7BJ JWmULaFUF0lcnyIli/isJGI7R1ZEhSIk7q5xwYmpqtFCUEIrzZQRmRV+9qzN/RgfIG70 t03d/lRrnj9gBscQxjF63HznjCD7EKzJuAL6svOCBvRG1ph2KzytasfG/OjGbsqaHq5f LGOg== 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=YBPb+1On78aTiFC3tLvOOec+G/yNryP5TsAdmljE8eA=; b=Ck7kz1FX0MH7+c7O2LeJZkzH5DGQlLq+9YRQkSwCklqEPmhvWI50eGiFbln8hv8Rtu jqpzdeLbQzy/UmYOKAfUHk75i9i7F09mhCw/d8rNULTvIWCog9NBH+2UWZ8X6uvkxb0z RVWNY6BNTOOXlXO3OvzXEW6orEO19vGPRpsq0dYJZOpskadaEhDbBoNVJCCRswt+RhuX LFs2cOTFZMCVsJ70LmR1+oJnR/Gain8yuT8a70guYPQupowcqCGyNrppowgKCHQRvJAH wxwSuAC98n1NlswatXI5kUBAfOqbEYlwb8ydNheCKUC8FsGU/06OxQdFDeC0+Mme174t 36kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sgFPIkov; 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 s1si6506932ejf.199.2021.03.10.05.30.15; Wed, 10 Mar 2021 05:30:39 -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=sgFPIkov; 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 S233911AbhCJN1a (ORCPT + 99 others); Wed, 10 Mar 2021 08:27:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:46512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233160AbhCJNZA (ORCPT ); Wed, 10 Mar 2021 08:25:00 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AE22664FF7; Wed, 10 Mar 2021 13:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615382699; bh=C2aoCvJPiZt8FLiybWpi86wNigkAD7g/GgtMVPpnR28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sgFPIkovgiSN/pTUXcQY7J41ye3J97HjEm7wIPyGuHy6Q8WHfFSQcSNkFjjHXeNYo tMKtddyk+iTR4yLFcqlYl2KIkBlrWeNEvtivK0evD9fGiiPi3cHHKVw8wGnRm/w8sP VgNkBUNE+OIoj7GX2ctMOHk2J8n+y1K0cZPQQSv0= 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 5.4 11/24] platform/x86: acer-wmi: Add ACER_CAP_SET_FUNCTION_MODE capability flag Date: Wed, 10 Mar 2021 14:24:23 +0100 Message-Id: <20210310132320.891310893@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210310132320.550932445@linuxfoundation.org> References: <20210310132320.550932445@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 e26ae1d917ea..bde37be6973e 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -211,6 +211,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 @@ -2202,10 +2203,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