xref: /openbmc/qemu/hw/usb/meson.build (revision c51a3f5d)
1hw_usb_modules = {}
2
3# usb subsystem core
4softmmu_ss.add(files(
5  'bus.c',
6  'combined-packet.c',
7  'core.c',
8  'libhw.c'
9))
10
11softmmu_ss.add(when: 'CONFIG_USB', if_true: files(
12  'desc.c',
13  'desc-msos.c',
14))
15
16# usb host adapters
17softmmu_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c'))
18softmmu_ss.add(when: 'CONFIG_USB_OHCI', if_true: files('hcd-ohci.c'))
19softmmu_ss.add(when: 'CONFIG_USB_OHCI_PCI', if_true: files('hcd-ohci-pci.c'))
20softmmu_ss.add(when: 'CONFIG_USB_EHCI', if_true: files('hcd-ehci.c'))
21softmmu_ss.add(when: 'CONFIG_USB_EHCI_PCI', if_true: files('hcd-ehci-pci.c'))
22softmmu_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci.c', 'hcd-ehci-sysbus.c'))
23softmmu_ss.add(when: 'CONFIG_USB_XHCI', if_true: files('hcd-xhci.c'))
24softmmu_ss.add(when: 'CONFIG_USB_XHCI_NEC', if_true: files('hcd-xhci-nec.c'))
25softmmu_ss.add(when: 'CONFIG_USB_MUSB', if_true: files('hcd-musb.c'))
26softmmu_ss.add(when: 'CONFIG_USB_DWC2', if_true: files('hcd-dwc2.c'))
27
28softmmu_ss.add(when: 'CONFIG_TUSB6010', if_true: files('tusb6010.c'))
29softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('chipidea.c'))
30softmmu_ss.add(when: 'CONFIG_IMX_USBPHY', if_true: files('imx-usb-phy.c'))
31
32# emulated usb devices
33softmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hub.c'))
34softmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hid.c'))
35softmmu_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.c'))
36softmmu_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage.c'))
37softmmu_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c'))
38softmmu_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c'))
39softmmu_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c'))
40softmmu_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c'))
41softmmu_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: files('dev-mtp.c'))
42
43# smartcard
44softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
45
46if config_host.has_key('CONFIG_SMARTCARD')
47  usbsmartcard_ss = ss.source_set()
48  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
49                      if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')])
50  hw_usb_modules += {'smartcard': usbsmartcard_ss}
51endif
52
53# U2F
54softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
55softmmu_ss.add(when: ['CONFIG_LINUX', 'CONFIG_USB_U2F'], if_true: [libudev, files('u2f-passthru.c')])
56if u2f.found()
57  softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: [u2f, files('u2f-emulated.c')])
58endif
59
60# usb redirect
61if config_host.has_key('CONFIG_USB_REDIR')
62  usbredir_ss = ss.source_set()
63  usbredir_ss.add(when: 'CONFIG_USB',
64                  if_true: [usbredir, files('redirect.c', 'quirks.c')])
65  hw_usb_modules += {'redirect': usbredir_ss}
66endif
67
68# usb pass-through
69softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_USB_LIBUSB', libusb],
70               if_true: files('host-libusb.c'),
71               if_false: files('host-stub.c'))
72softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('host-stub.c'))
73
74softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN', libusb], if_true: files('xen-usb.c'))
75
76modules += { 'hw-usb': hw_usb_modules }
77