ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
The OMAP1 OHCI driver needs to enable the OCPI IP block before it can work. Previously, the driver was simply calling a symbol defined in the OMAP platform code, but this is incorrect: drivers should be fully decoupled from platform and architecture code. So instead, modify the driver to call through a platform_data function pointer instead. We skip any DT aspect, since OMAP1 is not scheduled to be converted to DT in the near future. This resolves the following sparse warning: It also gets rid of a cpu_is_omap16xx() call in a driver. In the long term, it probably makes sense to move the OCPI bus code to somewhere under drivers/. This should avoid the whole platform_data/DT issue with this function. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Felipe Balbi <balbi@ti.com> Cc: Anand Gadiyar <gadiyar@ti.com> Acked-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
6f3c1af265
commit
d3645d39ad
|
@ -29,6 +29,8 @@
|
||||||
#include <plat/mux.h>
|
#include <plat/mux.h>
|
||||||
#include <plat/usb.h>
|
#include <plat/usb.h>
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
/* These routines should handle the standard chip-specific modes
|
/* These routines should handle the standard chip-specific modes
|
||||||
* for usb0/1/2 ports, covering basic mux and transceiver setup.
|
* for usb0/1/2 ports, covering basic mux and transceiver setup.
|
||||||
*
|
*
|
||||||
|
@ -138,6 +140,7 @@ static inline void ohci_device_init(struct omap_usb_config *pdata)
|
||||||
if (cpu_is_omap7xx())
|
if (cpu_is_omap7xx())
|
||||||
ohci_resources[1].start = INT_7XX_USB_HHC_1;
|
ohci_resources[1].start = INT_7XX_USB_HHC_1;
|
||||||
pdata->ohci_device = &ohci_device;
|
pdata->ohci_device = &ohci_device;
|
||||||
|
pdata->ocpi_enable = &ocpi_enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -91,6 +91,8 @@ struct omap_usb_config {
|
||||||
u32 (*usb0_init)(unsigned nwires, unsigned is_device);
|
u32 (*usb0_init)(unsigned nwires, unsigned is_device);
|
||||||
u32 (*usb1_init)(unsigned nwires);
|
u32 (*usb1_init)(unsigned nwires);
|
||||||
u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
|
u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
|
||||||
|
|
||||||
|
int (*ocpi_enable)(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct omap_lcd_config {
|
struct omap_lcd_config {
|
||||||
|
|
|
@ -205,8 +205,9 @@ static int ohci_omap_init(struct usb_hcd *hcd)
|
||||||
need_transceiver = need_transceiver
|
need_transceiver = need_transceiver
|
||||||
|| machine_is_omap_h2() || machine_is_omap_h3();
|
|| machine_is_omap_h2() || machine_is_omap_h3();
|
||||||
|
|
||||||
if (cpu_is_omap16xx())
|
/* XXX OMAP16xx only */
|
||||||
ocpi_enable();
|
if (config->ocpi_enable)
|
||||||
|
config->ocpi_enable();
|
||||||
|
|
||||||
#ifdef CONFIG_USB_OTG
|
#ifdef CONFIG_USB_OTG
|
||||||
if (need_transceiver) {
|
if (need_transceiver) {
|
||||||
|
|
Reference in New Issue