Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp241025pxf; Wed, 10 Mar 2021 05:27:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVXEksAlzydH1IP/5JiK+KlaeiK3LmrCoXjs/rJt6dUxDrsfiV1a1H9aMOtOqY4vVJO/tS X-Received: by 2002:a05:6402:8d7:: with SMTP id d23mr3345689edz.256.1615382848534; Wed, 10 Mar 2021 05:27:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615382848; cv=none; d=google.com; s=arc-20160816; b=mW46GTnEj46fsgMsJk6i8YU4WXNeT2Q8SXL7tLwbRqU4DsgSZptsiUIpqW5rmiLliX iOf0fH2gbS6vSmOD5W5gwIyoXzA8dMu6deWBvT3Z42uYtWbVdvKA0U0KWzq240q9mujT JnMATJTbW6k1mD5T6O/3rtRVQrDesRfpXqos+YH0n/2IBwu0CaBakjRZAZ+XndXMu6Wa iJQJed/8e4hh2gfB6UvUnreVTUKdW8IG8+zaE+0HH3th2kmn5LuBQDuwfyDWTorByl4H VG7pQSNrCBeqSxBAsa8iq4GuLXG21a+zVyizfvgATOnxBQTfINKUtSWG24kTripWYwXi mkwQ== 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=yBQoNfDEiIRhL1fVok8idu9cLjrD5PrRbRD/H7iB8zQ=; b=QVce2NrZ9UlV/B/t80wSJxPzeBpOvdsxQpgRDBJaWAs3IF7QVKdr9BVAEBZpFX7DM2 96bVLkX5+VEOwHGpe9JP5/FXMAaxnCuMlMqlguH31TCAkPctGFhTL6k8AMeTrzfThrOq ONEe5RoSMsZozh7+kCRSodf3YwfpQ9EVVXQLHNTlu2zCN9FB5M6VrM3F3ubYYti6euHm JHIfuDeVCOmavEhBqftAQjrmlxyqlao2L0RVtjKZPVJZLAIGsRJPU+OkKGOkg3CYbAYh OiKCDEYFgVDIqEwcPYzHlw97nQIaRl9VZm3kWFKw00TAHzyPfdLNXE+dir3hWCrr7ar2 ZlKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q29kpf5u; 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 s5si6356877ejx.287.2021.03.10.05.27.05; Wed, 10 Mar 2021 05:27:28 -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=Q29kpf5u; 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 S233690AbhCJN0E (ORCPT + 99 others); Wed, 10 Mar 2021 08:26:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:45716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232587AbhCJNYm (ORCPT ); Wed, 10 Mar 2021 08:24:42 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 063A864FE8; Wed, 10 Mar 2021 13:24:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615382679; bh=OF6GQTRwQiT5OBr9hZ6oydzM6dYeuu2v1ssyGKBZaSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q29kpf5umvBAwf8gNDT7TYp4S1buhnl5PN58+3zQIkdBU3mIi2ybW1UT4/iKCU+2+ YCZAC8eo3p/R5FEOB035H59coYeA/K2NRFPhJnAxgbaV7y0r8ywd2b+wXZypeVCCXc 2VqcyORzlS78DUnlXrPdhQgS2OHZEd6l3oV67AgE= 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.10 18/49] platform/x86: acer-wmi: Add ACER_CAP_SET_FUNCTION_MODE capability flag Date: Wed, 10 Mar 2021 14:23:29 +0100 Message-Id: <20210310132322.538181658@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210310132321.948258062@linuxfoundation.org> References: <20210310132321.948258062@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 74021163ca23..8662468491a3 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