How to write a driver for a device in ACPI BUS



Reaction score: 4
Messages: 61


I am trying to write a driver for a UART device in ACPI BUS. As part of this, I added a new table "uart_acpi_ids" in uart_bus_acpi.c with the devices ACPI ID. Then in the "uart_acpi_probe", in addition to existing ISA_PNP_PROBE, I added the part to do ACPI_ID_PROBE with the newly added uart_acpi_ids list. With these changes compilation fails saying "ACPI_ID_PROBE" not defined. I couldn't see the ACPI_ID_PROBE definition in the source. I tried including the following header files, but compilation fails saying opt_acpi.h not found.

#include "opt_acpi.h"
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <dev/acpica/acpivar.h>

Questions :
1) Why "uart_bus_acpi.c" has ISA ID table and lookup things? and where does that ISA ID's come from?
2) Where is ACPI_ID_PROBE defined? (Likewise, I don't see ISA_PNP_PROBE defined, so where are these macros/functions defined)
3) I see the opt_acpi.h in multiple directories of /usr/obj/<src_path>/sys/<CUSTOM KERNEL>/modules path. So, how are these option file headers generated and what I could be missing for the compilation to fail?