mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 13:43:28 +00:00
usb: host: xhci-omap: Remove redundant board_usb_init and board_usb_cleanup functions
board_usb_init()/_cleanup() should be in board files and don't have a place in the xhci-omap driver. Weak versions for board_usb_init()/_cleanup() already exist in common/usb.c (for host mode) and drivers/usb/gadget/g_dnl.c (for gadget mode). Therefore, remove init and cleanup functions from xhci-omap and implement them in the board files. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
163f8858ae
commit
b16c129c22
6 changed files with 33 additions and 28 deletions
|
@ -16,6 +16,7 @@
|
|||
#include <asm/arch/sys_proto.h>
|
||||
#include "../common/common.h"
|
||||
#include "../common/eeprom.h"
|
||||
#include <asm/omap_common.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
|
@ -64,3 +65,15 @@ u32 get_board_rev(void)
|
|||
{
|
||||
return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
|
||||
}
|
||||
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
enable_usb_clocks(index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_usb_cleanup(int index, enum usb_init_type init)
|
||||
{
|
||||
disable_usb_clocks(index);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include <power/pmic.h>
|
||||
#include <power/tps65218.h>
|
||||
#include "board.h"
|
||||
#include <usb.h>
|
||||
#include <asm/omap_common.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
|
@ -50,6 +52,18 @@ int board_init(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
enable_usb_clocks(index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_usb_cleanup(int index, enum usb_init_type init)
|
||||
{
|
||||
disable_usb_clocks(index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DRIVER_TI_CPSW
|
||||
|
||||
static void cpsw_control(int enabled)
|
||||
|
|
|
@ -687,7 +687,7 @@ int usb_gadget_handle_interrupts(int index)
|
|||
#endif /* CONFIG_USB_DWC3 */
|
||||
|
||||
#if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)
|
||||
int omap_xhci_board_usb_init(int index, enum usb_init_type init)
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
enable_usb_clocks(index);
|
||||
#ifdef CONFIG_USB_DWC3
|
||||
|
@ -718,7 +718,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type init)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
|
||||
int board_usb_cleanup(int index, enum usb_init_type init)
|
||||
{
|
||||
#ifdef CONFIG_USB_DWC3
|
||||
switch (index) {
|
||||
|
|
|
@ -867,7 +867,7 @@ int usb_gadget_handle_interrupts(int index)
|
|||
#endif /* CONFIG_USB_DWC3 */
|
||||
|
||||
#if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)
|
||||
int omap_xhci_board_usb_init(int index, enum usb_init_type init)
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
enable_usb_clocks(index);
|
||||
switch (index) {
|
||||
|
@ -901,7 +901,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type init)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
|
||||
int board_usb_cleanup(int index, enum usb_init_type init)
|
||||
{
|
||||
#ifdef CONFIG_USB_DWC3
|
||||
switch (index) {
|
||||
|
|
|
@ -907,7 +907,7 @@ static struct ti_usb_phy_device usb_phy2_device = {
|
|||
.index = 1,
|
||||
};
|
||||
|
||||
int omap_xhci_board_usb_init(int index, enum usb_init_type init)
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
enable_usb_clocks(index);
|
||||
switch (index) {
|
||||
|
@ -944,7 +944,7 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type init)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
|
||||
int board_usb_cleanup(int index, enum usb_init_type init)
|
||||
{
|
||||
switch (index) {
|
||||
case 0:
|
||||
|
|
|
@ -27,28 +27,6 @@ DECLARE_GLOBAL_DATA_PTR;
|
|||
|
||||
static struct omap_xhci omap;
|
||||
|
||||
__weak int omap_xhci_board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
enable_usb_clocks(index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
return omap_xhci_board_usb_init(index, init);
|
||||
}
|
||||
|
||||
__weak int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
|
||||
{
|
||||
disable_usb_clocks(index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_usb_cleanup(int index, enum usb_init_type init)
|
||||
{
|
||||
return omap_xhci_board_usb_cleanup(index, init);
|
||||
}
|
||||
|
||||
static int omap_xhci_core_init(struct omap_xhci *omap)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
Loading…
Reference in a new issue