Writing a driver: how do I get resources?

Gavin Atkinson gavin at FreeBSD.org
Tue Sep 23 13:10:42 UTC 2008


Hi all,

Please forgive me if this email makes very little sense: I've never
really looked at how ACPI works from a driver's perspective, so don't
really know if what I'm trying to do is even correct.

I'm expanding the acpi_sony driver to cover the PNP ID SNY6001.  When I
simply claim it by returning 0 from the probe, I get the following I/O range:

acpi_sony0: <Sony programmable I/O> port 0-0x1f on acpi0

However, if I'm reading the AML[1] and Linux drivers[2] correctly, this
is not the correct range.  It appears that the _PRS method offers a
choice of four I/O ranges and four IRQs, one of which is then selected
by evaluating _SRS.  None of them are 0-0x1f.

Firstly, does that make sense?  Secondly, how do I do this from a
driver?  I can't see any other drivers that seem to get this involved in
ACPI, indeed the only mention of evaluating _PRS is within the ACPI code
itself.

Lastly, I only have intermittent access to this laptop, so I apologise
if I can't test things quickly.

Thanks,

Gavin


[1] http://www-users.york.ac.uk/~ga9/sony-vgn-tz31wn.asl
[2] http://lxr.linux.no/linux+v2.6.26.5/drivers/misc/sony-laptop.c


More information about the freebsd-acpi mailing list