Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1253230imw; Tue, 5 Jul 2022 06:29:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sR/rUNkhzNHnQaypRXFJFG33oT6qED/aYNNuKhw2Q4OKgSpLuax2SFFuviUnUu2xyPYb4p X-Received: by 2002:a63:6a06:0:b0:3fd:5a1d:85c5 with SMTP id f6-20020a636a06000000b003fd5a1d85c5mr30552402pgc.130.1657027742625; Tue, 05 Jul 2022 06:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657027742; cv=none; d=google.com; s=arc-20160816; b=SZzAuqZ5yrJr5yHqm1/9zOz6GSijzS76SEyLAXnEYPAtekuRhTMmxynxjaLC/4NzxQ V77qEW9Ot5+HVUcXhr++YyK9YHhkSus1fLmx+Y9H0wLZlZ7dNDKtYZ4gCsTM1WY9VuE0 93YUwhJaQjHbi+96Mvr0own1Da7ruDUUnEEGlRAGMQ4h12ht9PXIIAX4i28UGS1S3Ngl CmwjzegyVy2FQzR+CILFORnB3ETIlrskZDfpT/1e9b6Sij7etmChbjaA4ZeLav+Z72ZL L+crAytOeRW9rGGQDx0a1MUGvv9JJUoxZGv4g/MYnjPAW0/aEeulG59uUk82sG0vifua w10g== 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=H4vybXFZGsEb4LW7H0tvIAeFwgAPXLo0ZezAF+f5GlM=; b=YxpqpkoR6m+y0Nb5eQFAwKftS0jCzp3co6m9wzXLGZEbEbmqqBj3snO0LTeMiuCetX YIVroJcWNZt2u4vc3OylHdvGjws4BlB/4Ue9w4fsM7cFTxY/QtT2dxDWEfhBpU/s7f41 /oDsNAyOV9WGmwQHUA3iSwuq5cPl9qoKPkAhwWMHg8PcR22QOoMavyVN7Ym5u4YOo+wo uJ6MFJi2Ujo8t8Fp0RcN7nP7BnyaiP69OKuhWpGZpQu6FAIEg+cT69hcX1cHi8rqTdrI cIOS+ZrSGGwgOC7SGvcJBqjAxMWizyvlqmdU5t4cqqbzuK17bcVJMXJaM5J1ue4oQwb6 GEYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1WlQpC99; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o20-20020a63e354000000b00412518cbe38si7373401pgj.426.2022.07.05.06.28.51; Tue, 05 Jul 2022 06:29:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1WlQpC99; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S238180AbiGEM22 (ORCPT + 99 others); Tue, 5 Jul 2022 08:28:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237269AbiGEMS6 (ORCPT ); Tue, 5 Jul 2022 08:18:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F6921A826; Tue, 5 Jul 2022 05:14:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 241F7B817AC; Tue, 5 Jul 2022 12:14:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84007C341C7; Tue, 5 Jul 2022 12:14:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657023252; bh=mXwYS3tDZj+FB8MJFc//EosuhjiE1AeB0xL3ixvneEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1WlQpC99RsFo/8cFcy38UmcQP+yhojFob9TCI7ZWjCzHrd5j6j8ZrRXNmpxFwqe9R XIL0ICWasSu0icxGLC2IVaA7woOZLTR9yGBDSULb9dPd/Wc5iiWKDufZChIhttI84C bd6ZKXrmCBsPOS+u518ZI9elCmx0F9YV23GgIok0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Andy Shevchenko , Sasha Levin , Stefan Seyfried , Kenneth Chan Subject: [PATCH 5.15 93/98] platform/x86: panasonic-laptop: dont report duplicate brightness key-presses Date: Tue, 5 Jul 2022 13:58:51 +0200 Message-Id: <20220705115620.207967081@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220705115617.568350164@linuxfoundation.org> References: <20220705115617.568350164@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit 1f2c9de83a50447a2d7166f6273ab0c0e97cd68e ] The brightness key-presses might also get reported by the ACPI video bus, check for this and in this case don't report the presses to avoid reporting 2 presses for a single key-press. Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug") Reported-and-tested-by: Stefan Seyfried Reported-and-tested-by: Kenneth Chan Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220624112340.10130-6-hdegoede@redhat.com Signed-off-by: Sasha Levin --- drivers/platform/x86/Kconfig | 1 + drivers/platform/x86/panasonic-laptop.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index e21ea3d23e6f..50a5c4f3cefd 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -871,6 +871,7 @@ config PANASONIC_LAPTOP tristate "Panasonic Laptop Extras" depends on INPUT && ACPI depends on BACKLIGHT_CLASS_DEVICE + depends on ACPI_VIDEO=n || ACPI_VIDEO select INPUT_SPARSEKMAP help This driver adds support for access to backlight control and hotkeys diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index cd3c23593eee..65ca863ffb9f 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -132,6 +132,7 @@ #include #include #include +#include MODULE_AUTHOR("Hiroshi Miura "); MODULE_AUTHOR("David Bronaugh "); @@ -783,6 +784,13 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc) key, 0x80, false); } + /* + * Don't report brightness key-presses if they are also reported + * by the ACPI video bus. + */ + if ((key == 1 || key == 2) && acpi_video_handles_brightness_key_presses()) + return; + if (!sparse_keymap_report_event(hotk_input_dev, key, updown, false)) pr_err("Unknown hotkey event: 0x%04llx\n", result); } -- 2.35.1