From owner-svn-src-all@freebsd.org Fri May 31 15:44:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1704D15C0226; Fri, 31 May 2019 15:44:35 +0000 (UTC) (envelope-from markj@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) server-signature RSA-PSS (4096 bits) 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 AED07716BC; Fri, 31 May 2019 15:44:34 +0000 (UTC) (envelope-from markj@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 7FA6A25D1; Fri, 31 May 2019 15:44:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4VFiYWG002489; Fri, 31 May 2019 15:44:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4VFiYNM002487; Fri, 31 May 2019 15:44:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905311544.x4VFiYNM002487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 31 May 2019 15:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348459 - in head: sbin/devd sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: sbin/devd sys/dev/acpica X-SVN-Commit-Revision: 348459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AED07716BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 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: Fri, 31 May 2019 15:44:35 -0000 Author: markj Date: Fri May 31 15:44:33 2019 New Revision: 348459 URL: https://svnweb.freebsd.org/changeset/base/348459 Log: acpi_dock(4): Notify devd(8) on dock status change. PR: 238138 Submitted by: Muhammad Kaisar Arkhan MFC after: 2 weeks Modified: head/sbin/devd/devd.conf.5 head/sys/dev/acpica/acpi_dock.c Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Fri May 31 15:05:54 2019 (r348458) +++ head/sbin/devd/devd.conf.5 Fri May 31 15:44:33 2019 (r348459) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd March 29, 2019 +.Dd May 31, 2019 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -341,6 +341,8 @@ AC line state ($notify=0x00 is offline, 0x01 is online Button state ($notify=0x00 is power, 0x01 is sleep). .It Li CMBAT Battery events. +.It Li Dock +Dock state ($notify=0x00 is undocked, 0x01 is docked). .It Li Lid Lid state ($notify=0x00 is closed, 0x01 is open). .It Li PROCESSOR Modified: head/sys/dev/acpica/acpi_dock.c ============================================================================== --- head/sys/dev/acpica/acpi_dock.c Fri May 31 15:05:54 2019 (r348458) +++ head/sys/dev/acpica/acpi_dock.c Fri May 31 15:44:33 2019 (r348459) @@ -256,11 +256,13 @@ acpi_dock_insert_children(device_t dev) static void acpi_dock_insert(device_t dev) { - struct acpi_dock_softc *sc; + struct acpi_dock_softc *sc; + ACPI_HANDLE h; ACPI_SERIAL_ASSERT(dock); sc = device_get_softc(dev); + h = acpi_get_handle(dev); if (sc->status == ACPI_DOCK_STATUS_UNDOCKED || sc->status == ACPI_DOCK_STATUS_UNKNOWN) { @@ -270,8 +272,12 @@ acpi_dock_insert(device_t dev) return; } - if (!cold) + if (!cold) { acpi_dock_insert_children(dev); + + acpi_UserNotify("Dock", h, 1); + } + sc->status = ACPI_DOCK_STATUS_DOCKED; } } @@ -325,10 +331,13 @@ static void acpi_dock_removal(device_t dev) { struct acpi_dock_softc *sc; + ACPI_HANDLE h; ACPI_SERIAL_ASSERT(dock); sc = device_get_softc(dev); + h = acpi_get_handle(dev); + if (sc->status == ACPI_DOCK_STATUS_DOCKED || sc->status == ACPI_DOCK_STATUS_UNKNOWN) { acpi_dock_eject_children(dev); @@ -342,6 +351,8 @@ acpi_dock_removal(device_t dev) return; } + acpi_UserNotify("Dock", h, 0); + sc->status = ACPI_DOCK_STATUS_UNDOCKED; } @@ -534,4 +545,3 @@ static devclass_t acpi_dock_devclass; DRIVER_MODULE(acpi_dock, acpi, acpi_dock_driver, acpi_dock_devclass, 0, 0); MODULE_DEPEND(acpi_dock, acpi, 1, 1, 1); -