Example #1
0
int
sdhc_acpi_parse_resources(union acpi_resource *crs, void *arg)
{
	struct sdhc_acpi_softc *sc = arg;
	int type = AML_CRSTYPE(crs);

	switch (type) {
	case LR_MEM32FIXED:
		sc->sc_addr = crs->lr_m32fixed._bas;
		sc->sc_size = crs->lr_m32fixed._len;
		break;
	case LR_EXTIRQ:
		sc->sc_irq = crs->lr_extirq.irq[0];
		sc->sc_irq_flags = crs->lr_extirq.flags;
		break;
	case 0x8c:
		/* XXX GPIO; use for card detect. */
		break;
	default:
		printf(" type 0x%x\n", type);
		break;
	}

	return 0;
}
Example #2
0
int
acpiprt_getirq(union acpi_resource *crs, void *arg)
{
	int *irq = (int *)arg;
	int typ;

	typ = AML_CRSTYPE(crs);
	switch (typ) {
	case SR_IRQ:
		*irq = ffs(aml_letohost16(crs->sr_irq.irq_mask)) - 1;
		break;
	case LR_EXTIRQ:
		*irq = aml_letohost32(crs->lr_extirq.irq[0]);
		break;
	default:
		printf("Unknown interrupt : %x\n", typ);
	}
	return (0);
}