Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp245835pxf; Wed, 10 Mar 2021 05:34:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHN1mYwDeBDKYLryrPZqoE1azCfbF8nGknsRW7odCDEl0FUfcRxkoOzzxIXWg46C/zvo+Y X-Received: by 2002:a17:906:32da:: with SMTP id k26mr3662554ejk.483.1615383260676; Wed, 10 Mar 2021 05:34:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615383260; cv=none; d=google.com; s=arc-20160816; b=BfYRAfCOf4hw/mrU6G4WNyk2/BEmtq/zsXvumu1DFX1nwc0Rdq2skO4cAd1ZNZCBvc cKeQzR/kUqMUGXXosc0DEK3T73J3gjAPBufRwilWqKkYM7ucsq+awr8dKdDvzOnHLtCp 98ustPDLl2P/ihuRmNIGhrjprDNEOAgNB3Gp/9DI/Srq3LZqDlBo5wBY17d0WzsL6D0x 63Pz1W761xx4QcJn7Cr4IZUGwx8MEdHf6TaIKK6c50K9EFQWkD+psFfao5ixVh8tuD4f 2U4keeXYjY8SEIz/uFNPLDACSY4yi/jB2X+Ig0ja/r0o74HdsZCMDOJOjoEhTxD+7Ti5 gcUg== 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=b0oBvAr78JlcFyUZKndJk43QRgfYKTGA0AUOpycQ0ck=; b=zPbjVo74gQ/Pjm6HoxKR+Go0cS7fKggxEZ91YNWVRlRJyDcCu0SgKYApdi6bJh2kAV Pbv4UVMx59x/lOTy6l5OnGN53sukv/twc8KGau/NK3mLMyMRSZGyL0h3uSdWsbMlqZdK UUGrjvjIXee74fRmEXn/lacbORC3+hsY+wJhMVQqCrv5i475P7ZmeSplt7jlI0d1wJnk BeW0kktzqMOatc1CO1UkzeGsEJeWX6KrxSV5aQO5SiV34cQJtdgZRgaLM6E4bZ/Rbain eqNnKn/alyLLD1K1T05mzcvvPlS3J+XKwPUG9FoRe4FF4/8CghwxjRygC6fjrcHiNn4g TQ2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T4E0kEoq; 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 o26si12102939edw.74.2021.03.10.05.33.58; Wed, 10 Mar 2021 05:34:20 -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=T4E0kEoq; 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 S234531AbhCJNa6 (ORCPT + 99 others); Wed, 10 Mar 2021 08:30:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:48684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232993AbhCJNZp (ORCPT ); Wed, 10 Mar 2021 08:25:45 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4042964FEE; Wed, 10 Mar 2021 13:25:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615382744; bh=8YDagtuGgfNLI4LgiAmlM32QPvFAwF2C7X9i86u/HXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T4E0kEoqgYrFEIpZpF7Zxnc+SQu5TXt3lPuJsUPVR1T9JNujeKYn8yKS1H9w/Mr4f 4h/YZoGoOEdUfL5ouYN8Gtzjh30MF3N44VnQNgjCNv+evSeb7qOATDoxzpEVGZ3AAQ DgwDxe4s2fjpDRWWQCgh8xhAZwhTcULGUdkR9AT8= 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.19 30/39] platform/x86: acer-wmi: Add ACER_CAP_SET_FUNCTION_MODE capability flag Date: Wed, 10 Mar 2021 14:24:38 +0100 Message-Id: <20210310132320.662946657@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210310132319.708237392@linuxfoundation.org> References: <20210310132319.708237392@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 2e77ac458bab..657fd8c49597 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -224,6 +224,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 @@ -2261,10 +2262,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