Date: Sat, 31 Oct 2020 22:15:59 +0000 (UTC) From: Vladimir Kondratyev <wulf@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367239 - in head/sys/dev: acpica iicbus Message-ID: <202010312215.09VMFx86052418@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: wulf Date: Sat Oct 31 22:15:59 2020 New Revision: 367239 URL: https://svnweb.freebsd.org/changeset/base/367239 Log: 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. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26824 Modified: head/sys/dev/acpica/acpivar.h head/sys/dev/iicbus/iicbus.h Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Sat Oct 31 22:14:37 2020 (r367238) +++ head/sys/dev/acpica/acpivar.h Sat Oct 31 22:15:59 2020 (r367239) @@ -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: head/sys/dev/iicbus/iicbus.h ============================================================================== --- head/sys/dev/iicbus/iicbus.h Sat Oct 31 22:14:37 2020 (r367238) +++ head/sys/dev/iicbus/iicbus.h Sat Oct 31 22:15:59 2020 (r367239) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010312215.09VMFx86052418>