From 9dc9500aaf0783c7e027f7b08c6bb1ce8e63a0aa Mon Sep 17 00:00:00 2001 From: lipengfei28 Date: Tue, 27 Aug 2024 12:08:33 +0800 Subject: [PATCH] pci add register drivers Signed-off-by: lipengfei28 --- drivers/drivers_initialize.c | 5 +++++ include/nuttx/pci/pci.h | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/drivers_initialize.c b/drivers/drivers_initialize.c index d87281c622..702fdd0069 100644 --- a/drivers/drivers_initialize.c +++ b/drivers/drivers_initialize.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -253,6 +254,10 @@ void drivers_initialize(void) mtd_loop_register(); #endif +#ifdef CONFIG_PCI + pci_register_drivers(); +#endif + #ifdef CONFIG_DRIVERS_VIRTIO virtio_register_drivers(); #endif diff --git a/include/nuttx/pci/pci.h b/include/nuttx/pci/pci.h index 1058e51cfc..6d995bc9a5 100644 --- a/include/nuttx/pci/pci.h +++ b/include/nuttx/pci/pci.h @@ -742,4 +742,14 @@ int pci_bus_write_config_word(FAR struct pci_bus_s *bus, unsigned int devfn, int pci_bus_write_config_dword(FAR struct pci_bus_s *bus, unsigned int devfn, int where, uint32_t val); +/**************************************************************************** + * Name: pci_register_drivers + * + * Description: + * Register all the pci drivers to pci bus + * + ****************************************************************************/ + +int pci_register_drivers(void); + #endif /* __INCLUDE_NUTTX_PCI_PCI_H */