diff options
| author | jmcneill <jmcneill@NetBSD.org> | 2021-01-25 12:15:32 +0000 |
|---|---|---|
| committer | jmcneill <jmcneill@NetBSD.org> | 2021-01-25 12:15:32 +0000 |
| commit | 552d0b4439c79753e217619a04ee360c8a18e2df (patch) | |
| tree | 859635694a0196abbe4c5a5a2156061d3f0c7f41 /sys/dev/acpi | |
| parent | 2657c071e0a5d509e87cad18c9ff46917fe21c12 (diff) | |
Add "cookietype" to i2c attach args, so the consumer knows if ia_cookie
is either an OF phandle or an ACPI_HANDLE. Add NXP0002 compatible mapping
while here.
Diffstat (limited to 'sys/dev/acpi')
| -rw-r--r-- | sys/dev/acpi/acpi_i2c.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpi_i2c.c b/sys/dev/acpi/acpi_i2c.c index d986df90878..b10dbaf63f6 100644 --- a/sys/dev/acpi/acpi_i2c.c +++ b/sys/dev/acpi/acpi_i2c.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_i2c.c,v 1.8 2020/08/24 05:37:41 msaitoh Exp $ */ +/* $NetBSD: acpi_i2c.c,v 1.9 2021/01/25 12:15:32 jmcneill Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -30,11 +30,12 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_i2c.c,v 1.8 2020/08/24 05:37:41 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_i2c.c,v 1.9 2021/01/25 12:15:32 jmcneill Exp $"); #include <dev/acpi/acpireg.h> #include <dev/acpi/acpivar.h> #include <dev/acpi/acpi_i2c.h> +#include <dev/i2c/i2cvar.h> #define _COMPONENT ACPI_BUS_COMPONENT ACPI_MODULE_NAME ("acpi_i2c") @@ -112,6 +113,12 @@ static const struct acpi_i2c_id acpi_i2c_ids[] = { .parse = acpi_enter_i2c_hid }, { + .id = "NXP0002", + .compat = "nxp,pca9547", + .compatlen = 12, + .parse = NULL + }, + { .id = NULL, .compat = NULL, .compatlen = 0, @@ -192,6 +199,7 @@ acpi_enter_i2c_device(struct acpi_devnode *ad, prop_array_t array) prop_dictionary_set_string(dev, "name", name); prop_dictionary_set_uint32(dev, "addr", i2cc.i2c_addr); prop_dictionary_set_uint64(dev, "cookie", (uintptr_t)ad->ad_handle); + prop_dictionary_set_uint32(dev, "cookietype", I2C_COOKIE_ACPI); /* first search by name, then by CID */ i2c_id = acpi_i2c_search(name); idlist = &ad->ad_devinfo->CompatibleIdList; |
