fix potens not being set in ttyFB* device
[lunaix-os.git] / lunaix-os / hal / char / uart / 16x50_dev.c
1 #include <lunaix/device.h>
2
3 #include <hal/pci.h>
4
5 #include "16x50.h"
6
7 extern_hook_load(isa16x50_create_once);
8 extern_hook_create(pci16650_pci_create);
9 extern_hook_register(pci16x50_pci_register);
10
11 static int
12 uart_16x50_load(struct device_def* def)
13 {
14     isa16x50_create_once(def);
15     return 0;
16 }
17
18 static int
19 uart_16x50_create(struct device_def* def, morph_t* morphed)
20 {
21     if (morph_type_of(morphed, pci_probe_morpher)) {
22         pci16650_pci_create(def, morphed);
23     }
24
25     return 0;
26 }
27
28 static int
29 uart_16x50_register(struct device_def* def)
30 {
31     pci16x50_pci_register(def);
32     
33     return 0;
34 }
35
36 static struct device_def uart_dev = {
37     def_device_class(GENERIC, CHAR, UART16550),
38     def_device_name("16550 UART"),
39
40     def_on_register(uart_16x50_register),
41     def_on_load(uart_16x50_load),
42     def_on_create(uart_16x50_create)
43 };
44 EXPORT_DEVICE(uart16550_pmio, &uart_dev, load_onboot);