Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: ohci: allow platform driver to specify the number of ports

This patch modifies the ohci platform driver to accept the num_ports
parameter to be set via platform_data. Setting the number of ports must be
done after the call to ohci_hcd_init().

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Florian Fainelli and committed by
Greg Kroah-Hartman
2b16e39e f3a958d3

+6
+4
drivers/usb/host/ohci-platform.c
··· 31 31 ohci->flags |= OHCI_QUIRK_FRAME_NO; 32 32 33 33 ohci_hcd_init(ohci); 34 + 35 + if (pdata->num_ports) 36 + ohci->num_ports = pdata->num_ports; 37 + 34 38 err = ohci_init(ohci); 35 39 36 40 return err;
+2
include/linux/usb/ohci_pdriver.h
··· 25 25 * @big_endian_desc: BE descriptors 26 26 * @big_endian_mmio: BE registers 27 27 * @no_big_frame_no: no big endian frame_no shift 28 + * @num_ports: number of ports 28 29 * 29 30 * These are general configuration options for the OHCI controller. All of 30 31 * these options are activating more or less workarounds for some hardware. ··· 34 33 unsigned big_endian_desc:1; 35 34 unsigned big_endian_mmio:1; 36 35 unsigned no_big_frame_no:1; 36 + unsigned int num_ports; 37 37 38 38 /* Turn on all power and clocks */ 39 39 int (*power_on)(struct platform_device *pdev);