Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Read clock frequency from device properties



details:   https://anonhg.NetBSD.org/src/rev/b41a27dfc3c9
branches:  trunk
changeset: 967954:b41a27dfc3c9
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Dec 29 12:46:43 2019 +0000

description:
Read clock frequency from device properties

diffstat:

 sys/dev/acpi/sdhc_acpi.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r b1d89a090deb -r b41a27dfc3c9 sys/dev/acpi/sdhc_acpi.c
--- a/sys/dev/acpi/sdhc_acpi.c  Sun Dec 29 09:17:51 2019 +0000
+++ b/sys/dev/acpi/sdhc_acpi.c  Sun Dec 29 12:46:43 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdhc_acpi.c,v 1.8 2019/10/15 00:13:52 chs Exp $        */
+/*     $NetBSD: sdhc_acpi.c,v 1.9 2019/12/29 12:46:43 jmcneill Exp $   */
 
 /*
  * Copyright (c) 2016 Kimihiro Nonaka <nonaka%NetBSD.org@localhost>
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdhc_acpi.c,v 1.8 2019/10/15 00:13:52 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc_acpi.c,v 1.9 2019/12/29 12:46:43 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -135,6 +135,7 @@
        struct acpi_mem *mem;
        struct acpi_irq *irq;
        ACPI_STATUS rv;
+       ACPI_INTEGER clock_freq;
 
        sc->sc.sc_dev = self;
        sc->sc.sc_dmat = aa->aa_dmat;
@@ -193,6 +194,12 @@
        /* Enable DMA transfer */
        sc->sc.sc_flags |= SDHC_FLAG_USE_DMA;
 
+       /* Read clock frequency from device properties */
+       rv = acpi_dsd_integer(aa->aa_node->ad_handle, "clock-frequency",
+           &clock_freq);
+       if (ACPI_SUCCESS(rv))
+               sc->sc.sc_clkbase = clock_freq / 1000;
+
        if (sdhc_host_found(&sc->sc, sc->sc_memt, sc->sc_memh,
            sc->sc_memsize) != 0) {
                aprint_error_dev(self, "couldn't initialize host\n");



Home | Main Index | Thread Index | Old Index