From owner-svn-src-all@freebsd.org Sat Oct 31 20:14:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7954F455514; Sat, 31 Oct 2020 20:14:29 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CNr4P2crcz3f2K; Sat, 31 Oct 2020 20:14:29 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F1D2CF48; Sat, 31 Oct 2020 20:14:29 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09VKESJr079065; Sat, 31 Oct 2020 20:14:28 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09VKESgs079062; Sat, 31 Oct 2020 20:14:28 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202010312014.09VKESgs079062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 31 Oct 2020 20:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367232 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 367232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Oct 2020 20:14:29 -0000 Author: wulf Date: Sat Oct 31 20:14:28 2020 New Revision: 367232 URL: https://svnweb.freebsd.org/changeset/base/367232 Log: acpi(9): Add EVENTHANDLERs for video and AC adapter events. They are required for coming ACPI support in LinuxKPI. Reviewed by: hselasky, manu (as part of D26603) Modified: head/sys/dev/acpica/acpi_acad.c head/sys/dev/acpica/acpi_video.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi_acad.c ============================================================================== --- head/sys/dev/acpica/acpi_acad.c Sat Oct 31 19:47:34 2020 (r367231) +++ head/sys/dev/acpica/acpi_acad.c Sat Oct 31 20:14:28 2020 (r367232) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -115,6 +116,7 @@ acpi_acad_get_status(void *context) ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev), "%s Line\n", newstatus ? "On" : "Off"); acpi_UserNotify("ACAD", h, newstatus); + EVENTHANDLER_INVOKE(acpi_acad_event, newstatus); } else ACPI_SERIAL_END(acad); } Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Sat Oct 31 19:47:34 2020 (r367231) +++ head/sys/dev/acpica/acpi_video.c Sat Oct 31 20:14:28 2020 (r367232) @@ -351,6 +351,12 @@ acpi_video_shutdown(device_t dev) } static void +acpi_video_invoke_event_handler(void *context) +{ + EVENTHANDLER_INVOKE(acpi_video_event, (int)(intptr_t)context); +} + +static void acpi_video_notify_handler(ACPI_HANDLE handle, UINT32 notify, void *context) { struct acpi_video_softc *sc; @@ -402,6 +408,8 @@ acpi_video_notify_handler(ACPI_HANDLE handle, UINT32 n device_printf(sc->device, "unknown notify event 0x%x\n", notify); } + AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_video_invoke_event_handler, + (void *)(uintptr_t)notify); } static void @@ -752,6 +760,9 @@ acpi_video_vo_notify_handler(ACPI_HANDLE handle, UINT3 out: ACPI_SERIAL_END(video_output); + + AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_video_invoke_event_handler, + (void *)(uintptr_t)notify); } /* ARGSUSED */ Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Sat Oct 31 19:47:34 2020 (r367231) +++ head/sys/dev/acpica/acpivar.h Sat Oct 31 20:14:28 2020 (r367232) @@ -433,6 +433,8 @@ typedef void (*acpi_event_handler_t)(void *, int); EVENTHANDLER_DECLARE(acpi_sleep_event, acpi_event_handler_t); EVENTHANDLER_DECLARE(acpi_wakeup_event, acpi_event_handler_t); +EVENTHANDLER_DECLARE(acpi_acad_event, acpi_event_handler_t); +EVENTHANDLER_DECLARE(acpi_video_event, acpi_event_handler_t); /* Device power control. */ ACPI_STATUS acpi_pwr_wake_enable(ACPI_HANDLE consumer, int enable);