Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Apr 2008 16:11:51 +1100
From:      "Alexey Tarasov" <glorgster@gmail.com>
To:        freebsd-acpi@freebsd.org
Subject:   Question about resource allocation
Message-ID:  <db2194de0804102211m5cb69480rc9d2a12684184bf@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

I'm trying to update spic and acpi_sony drivers, looking to Linux
sony_laptop driver.

Now I'm at allocating IO ports resource stage.
spic driver on FreeBSD uses bus_alloc_resources() with default for bus
values (0, ~0) for this purpose
----

	if (!(sc->port_res = bus_alloc_resource(sc->dev, SYS_RES_IOPORT,
		&sc->port_rid, 0, ~0, 5, RF_ACTIVE))) {
		device_printf(sc->dev,"Couldn't map I/O\n");
		return (ENXIO);
	}

----

sony_laptop  enumerates resources of device using acpi_walk_resources()
function and then calls request_region() for all found IO regions. First non
fail result will be used later in working with SPIC.

So question: is it better to use approach from sony_laptop. If yes, then how
to walk resources (I've not found analog of acpi_walk_resource function in
FreeBSD)

If there is link to any related documentation, it'll be great help.

Thanks.

---
Best regards,
Alexey



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?db2194de0804102211m5cb69480rc9d2a12684184bf>