Module Name: src Committed By: jmcneill Date: Thu Oct 21 00:56:52 UTC 2021
Modified Files: src/sys/dev/acpi: com_acpi.c Log Message: acpi: com: Honour the reg-shift property To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/dev/acpi/com_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/acpi/com_acpi.c diff -u src/sys/dev/acpi/com_acpi.c:1.42 src/sys/dev/acpi/com_acpi.c:1.43 --- src/sys/dev/acpi/com_acpi.c:1.42 Thu Mar 25 05:33:59 2021 +++ src/sys/dev/acpi/com_acpi.c Thu Oct 21 00:56:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: com_acpi.c,v 1.42 2021/03/25 05:33:59 rin Exp $ */ +/* $NetBSD: com_acpi.c,v 1.43 2021/10/21 00:56:52 jmcneill Exp $ */ /* * Copyright (c) 2002 Jared D. McNeill <jmcne...@invisible.ca> @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.42 2021/03/25 05:33:59 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.43 2021/10/21 00:56:52 jmcneill Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -118,6 +118,7 @@ com_acpi_attach(device_t parent, device_ bus_size_t size; ACPI_STATUS rv; ACPI_INTEGER clock_freq; + ACPI_INTEGER reg_shift; sc->sc_dev = self; @@ -158,7 +159,14 @@ com_acpi_attach(device_t parent, device_ aprint_error_dev(self, "can't map i/o space\n"); goto out; } - com_init_regs(&sc->sc_regs, iot, ioh, base); + + rv = acpi_dsd_integer(aa->aa_node->ad_handle, "reg-shift", + ®_shift); + if (ACPI_FAILURE(rv)) { + reg_shift = 0; + } + + com_init_regs_stride(&sc->sc_regs, iot, ioh, base, reg_shift); aprint_normal("%s", device_xname(self));