From patchwork Tue Feb 11 23:36:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Triplett X-Patchwork-Id: 11377147 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F3AED17F0 for ; Tue, 11 Feb 2020 23:36:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D357720842 for ; Tue, 11 Feb 2020 23:36:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727888AbgBKXgx (ORCPT ); Tue, 11 Feb 2020 18:36:53 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:48011 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727880AbgBKXgx (ORCPT ); Tue, 11 Feb 2020 18:36:53 -0500 X-Originating-IP: 172.58.46.204 Received: from localhost (unknown [172.58.46.204]) (Authenticated sender: josh@joshtriplett.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id ED55E60005; Tue, 11 Feb 2020 23:36:44 +0000 (UTC) Date: Tue, 11 Feb 2020 15:36:23 -0800 From: Josh Triplett To: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org Cc: Arjan van de Ven , linux-kernel@vger.kernel.org Subject: [PATCH 0/2] ACPI: Tiny power button driver Message-ID: MIME-Version: 1.0 Content-Disposition: inline Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Virtual machines often use an ACPI power button event to tell the machine to shut down gracefully. Provide an extremely lightweight "tiny power button" driver to handle this event by signaling init directly, rather than running a separate daemon (such as acpid or systemd-logind) that adds to startup time and VM image complexity. I originally proposed a change to the ACPI power button driver to introduce an optional path to signal init, but Rafael expressed a preference to have this as a separate, mutually exclusive driver instead. The result did come out much simpler, conceptually, with the added benefit of being able to disable CONFIG_INPUT entirely for a kernel that exclusively targets cloud/VM systems. The first patch in the series just moves HID definitions to acpi/button.h in preparation for sharing them with the tiny-power-button driver. The second patch provides the driver itself. Josh Triplett (2): acpi: button: move HIDs to acpi/button.h acpi: Add new tiny-power-button driver to directly signal init drivers/acpi/Kconfig | 24 +++++++++++++++++ drivers/acpi/Makefile | 1 + drivers/acpi/button.c | 3 --- drivers/acpi/tiny-power-button.c | 46 ++++++++++++++++++++++++++++++++ include/acpi/button.h | 4 +++ 5 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 drivers/acpi/tiny-power-button.c