xref: /haiku/headers/os/drivers/bus/FDT.h (revision b40866e65f8a6d0d8ba8ea62b1141291b812ae0d)
1 /*
2  * Copyright 2020-2021, Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _DRIVERS_BUS_FDT_H
6 #define _DRIVERS_BUS_FDT_H
7 
8 
9 #include <device_manager.h>
10 
11 
12 struct fdt_bus;
13 struct fdt_device;
14 
15 struct fdt_bus_module_info {
16 	driver_module_info info;
17 	device_node* (*node_by_phandle)(fdt_bus* bus, int phandle);
18 };
19 
20 struct fdt_device_module_info{
21 	driver_module_info info;
22 	device_node* (*get_bus)(fdt_device* dev);
23 	const char* (*get_name)(fdt_device* dev);
24 	const void* (*get_prop)(fdt_device* dev, const char* name, int* len);
25 	bool (*get_reg)(fdt_device* dev, uint32 ord, uint64* regs, uint64* len);
26 	bool (*get_interrupt)(fdt_device* dev, uint32 ord,
27 		device_node** interruptController, uint64* interrupt);
28 };
29 
30 
31 #endif // _DRIVERS_BUS_FDT_H
32