Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi acpi: com: Honour the reg-shift property



details:   https://anonhg.NetBSD.org/src/rev/ac6c78f8a6c2
branches:  trunk
changeset: 989941:ac6c78f8a6c2
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Oct 21 00:56:52 2021 +0000

description:
acpi: com: Honour the reg-shift property

diffstat:

 sys/dev/acpi/com_acpi.c |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (42 lines):

diff -r 571047d2eadd -r ac6c78f8a6c2 sys/dev/acpi/com_acpi.c
--- a/sys/dev/acpi/com_acpi.c   Thu Oct 21 00:54:15 2021 +0000
+++ b/sys/dev/acpi/com_acpi.c   Thu Oct 21 00:56:52 2021 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
        bus_size_t size;
        ACPI_STATUS rv;
        ACPI_INTEGER clock_freq;
+       ACPI_INTEGER reg_shift;
 
        sc->sc_dev = self;
 
@@ -158,7 +159,14 @@
                        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",
+           &reg_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));
 



Home | Main Index | Thread Index | Old Index