mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-05 13:25:20 +02:00
usb: pci-quirks: handle HAS_IOPORT dependency for UHCI handoff
In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. With the AMD quirk handled USB PCI quirks still use inw() in uhci_check_and_reset_hc() and thus indirectly in quirk_usb_handoff_uhci(). Handle this by conditionally compiling uhci_check_and_reset_hc() and stubbing out quirk_usb_handoff_uhci() when HAS_IOPORT is not available. Co-developed-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Arnd Bergmann <arnd@kernel.org> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Link: https://lore.kernel.org/r/20230911125653.1393895-4-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
52e24f8c0a
commit
358ad297e3
|
@ -634,6 +634,16 @@ void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(usb_asmedia_modifyflowcontrol);
|
EXPORT_SYMBOL_GPL(usb_asmedia_modifyflowcontrol);
|
||||||
|
|
||||||
|
static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask)
|
||||||
|
{
|
||||||
|
u16 cmd;
|
||||||
|
|
||||||
|
return !pci_read_config_word(pdev, PCI_COMMAND, &cmd) && (cmd & mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define mmio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_MEMORY)
|
||||||
|
|
||||||
|
#if defined(CONFIG_HAS_IOPORT) && IS_ENABLED(CONFIG_USB_UHCI_HCD)
|
||||||
/*
|
/*
|
||||||
* Make sure the controller is completely inactive, unable to
|
* Make sure the controller is completely inactive, unable to
|
||||||
* generate interrupts or do DMA.
|
* generate interrupts or do DMA.
|
||||||
|
@ -715,14 +725,7 @@ reset_needed:
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(uhci_check_and_reset_hc);
|
EXPORT_SYMBOL_GPL(uhci_check_and_reset_hc);
|
||||||
|
|
||||||
static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask)
|
|
||||||
{
|
|
||||||
u16 cmd;
|
|
||||||
return !pci_read_config_word(pdev, PCI_COMMAND, &cmd) && (cmd & mask);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define pio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_IO)
|
#define pio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_IO)
|
||||||
#define mmio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_MEMORY)
|
|
||||||
|
|
||||||
static void quirk_usb_handoff_uhci(struct pci_dev *pdev)
|
static void quirk_usb_handoff_uhci(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
|
@ -742,6 +745,12 @@ static void quirk_usb_handoff_uhci(struct pci_dev *pdev)
|
||||||
uhci_check_and_reset_hc(pdev, base);
|
uhci_check_and_reset_hc(pdev, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* defined(CONFIG_HAS_IOPORT && IS_ENABLED(CONFIG_USB_UHCI_HCD) */
|
||||||
|
|
||||||
|
static void quirk_usb_handoff_uhci(struct pci_dev *pdev) {}
|
||||||
|
|
||||||
|
#endif /* defined(CONFIG_HAS_IOPORT && IS_ENABLED(CONFIG_USB_UHCI_HCD) */
|
||||||
|
|
||||||
static int mmio_resource_enabled(struct pci_dev *pdev, int idx)
|
static int mmio_resource_enabled(struct pci_dev *pdev, int idx)
|
||||||
{
|
{
|
||||||
return pci_resource_start(pdev, idx) && mmio_enabled(pdev);
|
return pci_resource_start(pdev, idx) && mmio_enabled(pdev);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user