xref: /haiku/headers/os/drivers/bus/FDT.h (revision 4c8e85b316c35a9161f5a1c50ad70bc91c83a76f)
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 typedef struct fdt_bus_module_info {
16 	driver_module_info info;
17 	device_node* (*node_by_phandle)(struct fdt_bus* bus, int phandle);
18 } fdt_bus_module_info;
19 
20 typedef struct fdt_device_module_info {
21 	driver_module_info info;
22 	device_node* (*get_bus)(struct fdt_device* dev);
23 	const char* (*get_name)(struct fdt_device* dev);
24 	const void* (*get_prop)(struct fdt_device* dev, const char* name, int* len);
25 	bool (*get_reg)(struct fdt_device* dev, uint32 ord, uint64* regs, uint64* len);
26 	bool (*get_interrupt)(struct fdt_device* dev, uint32 ord,
27 		device_node** interruptController, uint64* interrupt);
28 } fdt_device_module_info;
29 
30 
31 #endif // _DRIVERS_BUS_FDT_H
32