From owner-svn-src-stable@freebsd.org Sat Nov 14 12:02:51 2020 Return-Path: Delivered-To: svn-src-stable@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 4B77E2E8A83; Sat, 14 Nov 2020 12:02:51 +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 4CYDVg1jtjz4rX6; Sat, 14 Nov 2020 12:02:51 +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 242D41476; Sat, 14 Nov 2020 12:02:51 +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 0AEC2pXo078581; Sat, 14 Nov 2020 12:02:51 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AEC2o1Q078576; Sat, 14 Nov 2020 12:02:50 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202011141202.0AEC2o1Q078576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sat, 14 Nov 2020 12:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367677 - in stable/12/sys/dev: acpi_support acpica iicbus X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in stable/12/sys/dev: acpi_support acpica iicbus X-SVN-Commit-Revision: 367677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2020 12:02:51 -0000 Author: wulf Date: Sat Nov 14 12:02:50 2020 New Revision: 367677 URL: https://svnweb.freebsd.org/changeset/base/367677 Log: MFC r367239-367241: r367239: Add plug and play information macroses for ACPI and I2C buses. Matching table format is compatible with ACPI_ID_PROBE bus method. Note that while ACPI_ID_PROBE matches against _HID and all _CIDs, current acpi_pnpinfo_str() exports only _HID and first _CID. That means second and further _CIDs should be added to both acpi_pnpinfo_str() and ACPICOMPAT_PNP_INFO if device matching against them is required. r367240: acpi_wmi(4): Add ACPI_PNP_INFO r367241: acpi_dock(4): Add ACPI_PNP_INFO Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D26824 Modified: stable/12/sys/dev/acpi_support/acpi_wmi.c stable/12/sys/dev/acpica/acpi_dock.c stable/12/sys/dev/acpica/acpivar.h stable/12/sys/dev/iicbus/iicbus.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/acpi_support/acpi_wmi.c ============================================================================== --- stable/12/sys/dev/acpi_support/acpi_wmi.c Sat Nov 14 11:51:37 2020 (r367676) +++ stable/12/sys/dev/acpi_support/acpi_wmi.c Sat Nov 14 12:02:50 2020 (r367677) @@ -201,6 +201,7 @@ DRIVER_MODULE(acpi_wmi, acpi, acpi_wmi_driver, acpi_wm MODULE_VERSION(acpi_wmi, 1); MODULE_DEPEND(acpi_wmi, acpi, 1, 1, 1); static char *wmi_ids[] = {"PNP0C14", NULL}; +ACPI_PNP_INFO(wmi_ids); /* * Probe for the PNP0C14 ACPI node Modified: stable/12/sys/dev/acpica/acpi_dock.c ============================================================================== --- stable/12/sys/dev/acpica/acpi_dock.c Sat Nov 14 11:51:37 2020 (r367676) +++ stable/12/sys/dev/acpica/acpi_dock.c Sat Nov 14 12:02:50 2020 (r367677) @@ -64,6 +64,8 @@ struct acpi_dock_softc { ACPI_SERIAL_DECL(dock, "ACPI Docking Station"); +static char *acpi_dock_pnp_ids[] = {"PNP0C15", NULL}; + /* * Utility functions */ @@ -545,3 +547,4 @@ 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); +ACPI_PNP_INFO(acpi_dock_pnp_ids); Modified: stable/12/sys/dev/acpica/acpivar.h ============================================================================== --- stable/12/sys/dev/acpica/acpivar.h Sat Nov 14 11:51:37 2020 (r367676) +++ stable/12/sys/dev/acpica/acpivar.h Sat Nov 14 12:02:50 2020 (r367677) @@ -232,6 +232,20 @@ extern int acpi_quirks; #define ACPI_Q_MADT_IRQ0 (1 << 2) /* + * Plug and play information for device matching. Matching table format + * is compatible with ids parameter of ACPI_ID_PROBE bus method. + * + * XXX: While ACPI_ID_PROBE matches against _HID and all _CIDs, current + * acpi_pnpinfo_str() exports only _HID and first _CID. That means second + * and further _CIDs should be added to both acpi_pnpinfo_str() and + * ACPICOMPAT_PNP_INFO if device matching against them is required. + */ +#define ACPICOMPAT_PNP_INFO(t, busname) \ + MODULE_PNP_INFO("Z:_HID", busname, t##hid, t, nitems(t)-1); \ + MODULE_PNP_INFO("Z:_CID", busname, t##cid, t, nitems(t)-1); +#define ACPI_PNP_INFO(t) ACPICOMPAT_PNP_INFO(t, acpi) + +/* * Note that the low ivar values are reserved to provide * interface compatibility with ISA drivers which can also * attach to ACPI. Modified: stable/12/sys/dev/iicbus/iicbus.h ============================================================================== --- stable/12/sys/dev/iicbus/iicbus.h Sat Nov 14 11:51:37 2020 (r367676) +++ stable/12/sys/dev/iicbus/iicbus.h Sat Nov 14 12:02:50 2020 (r367677) @@ -77,6 +77,12 @@ IICBUS_ACCESSOR(addr, ADDR, uint32_t) #define IICBUS_FDT_PNP_INFO(t) #endif +#ifdef DEV_ACPI +#define IICBUS_ACPI_PNP_INFO(t) ACPICOMPAT_PNP_INFO(t, iicbus) +#else +#define IICBUS_ACPI_PNP_INFO(t) +#endif + int iicbus_generic_intr(device_t dev, int event, char *buf); void iicbus_init_frequency(device_t dev, u_int bus_freq);