Module Name:    src
Committed By:   jmcneill
Date:           Sun Feb  6 15:48:12 UTC 2022

Modified Files:
        src/sys/dev/acpi: dwcmmc_acpi.c

Log Message:
acpi: dwcmmc: Honour broken-cd and non-removable DSD properties


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/dwcmmc_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/dwcmmc_acpi.c
diff -u src/sys/dev/acpi/dwcmmc_acpi.c:1.1 src/sys/dev/acpi/dwcmmc_acpi.c:1.2
--- src/sys/dev/acpi/dwcmmc_acpi.c:1.1	Sun Jan  9 15:05:16 2022
+++ src/sys/dev/acpi/dwcmmc_acpi.c	Sun Feb  6 15:48:12 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: dwcmmc_acpi.c,v 1.1 2022/01/09 15:05:16 jmcneill Exp $ */
+/* $NetBSD: dwcmmc_acpi.c,v 1.2 2022/02/06 15:48:12 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2022 Jared McNeill <jmcne...@invisible.ca>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwcmmc_acpi.c,v 1.1 2022/01/09 15:05:16 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwcmmc_acpi.c,v 1.2 2022/02/06 15:48:12 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -149,6 +149,7 @@ static int
 dwcmmc_acpi_init_props(struct dwc_mmc_softc *sc, ACPI_HANDLE handle)
 {
 	ACPI_INTEGER ival;
+	bool bval;
 
 	/* Defaults */
 	sc->sc_fifo_depth = 0;
@@ -165,6 +166,16 @@ dwcmmc_acpi_init_props(struct dwc_mmc_so
 	if (ACPI_SUCCESS(acpi_dsd_integer(handle, "bus-width", &ival))) {
 		sc->sc_bus_width = ival;
 	}
+	bval = false;
+	acpi_dsd_bool(handle, "non-removable", &bval);
+	if (bval) {
+		sc->sc_flags |= DWC_MMC_F_NON_REMOVABLE;
+	}
+	bval = false;
+	acpi_dsd_bool(handle, "broken-cd", &bval);
+	if (bval) {
+		sc->sc_flags |= DWC_MMC_F_BROKEN_CD;
+	}
 
 	if (sc->sc_clock_freq == 0 || sc->sc_clock_freq == UINT_MAX) {
 		aprint_error_dev(sc->sc_dev, "clock frequency not specified\n");

Reply via email to