Skip to content

Commit

Permalink
usb: rename board_usb_init_type to usb_init_type
Browse files Browse the repository at this point in the history
This will be used by usb_lowlevel_init so it will
no longer be used by only board specific functions.

Move definition of enum usb_init_type higher in file
so that it will be available for usb_low_level_init.

Signed-off-by: Troy Kisky <[email protected]>
  • Loading branch information
tkisky authored and Marek Vasut committed Oct 20, 2013
1 parent ea02b65 commit bba6791
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions board/amcc/canyonlands/canyonlands.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ int board_early_init_f(void)
}

#if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_BOARD_INIT)
int board_usb_init(int index, enum board_usb_init_type init)
int board_usb_init(int index, enum usb_init_type init)
{
struct board_bcsr *bcsr_data =
(struct board_bcsr *)CONFIG_SYS_BCSR_BASE;
Expand Down Expand Up @@ -230,7 +230,7 @@ int usb_board_stop(void)
return 0;
}

int board_usb_cleanup(int index, enum board_usb_init_type init)
int board_usb_cleanup(int index, enum usb_init_type init)
{
return usb_board_stop();
}
Expand Down
4 changes: 2 additions & 2 deletions board/balloon3/balloon3.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void dram_init_banksize(void)
}

#ifdef CONFIG_CMD_USB
int board_usb_init(int index, enum board_usb_init_type init)
int board_usb_init(int index, enum usb_init_type init)
{
writel((readl(UHCHR) | UHCHR_PCPL | UHCHR_PSPL) &
~(UHCHR_SSEP0 | UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE),
Expand Down Expand Up @@ -91,7 +91,7 @@ int board_usb_init(int index, enum board_usb_init_type init)
return 0;
}

int board_usb_cleanup(int index, enum board_usb_init_type init)
int board_usb_cleanup(int index, enum usb_init_type init)
{
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions board/esd/apc405/apc405.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ void reset_phy(void)
}

#if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_BOARD_INIT)
int board_usb_init(int index, enum board_usb_init_type init)
int board_usb_init(int index, enum usb_init_type init)
{
return 0;
}
Expand All @@ -454,7 +454,7 @@ int usb_board_stop(void)
return 0;
}

int board_usb_cleanup(int index, enum board_usb_init_type init)
int board_usb_cleanup(int index, enum usb_init_type init)
{
return usb_board_stop();
}
Expand Down
4 changes: 2 additions & 2 deletions board/esd/pmc440/pmc440.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ int bootstrap_eeprom_read (unsigned dev_addr, unsigned offset,
}

#if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_BOARD_INIT)
int board_usb_init(int index, enum board_usb_init_type init)
int board_usb_init(int index, enum usb_init_type init)
{
char *act = getenv("usbact");
int i;
Expand All @@ -846,7 +846,7 @@ int usb_board_stop(void)
return 0;
}

int board_usb_cleanup(int index, enum board_usb_init_type init)
int board_usb_cleanup(int index, enum usb_init_type init)
{
return usb_board_stop();
}
Expand Down
4 changes: 2 additions & 2 deletions board/icpdas/lp8x4x/lp8x4x.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int board_mmc_init(bd_t *bis)
#endif

#ifdef CONFIG_CMD_USB
int board_usb_init(int index, enum board_usb_init_type init)
int board_usb_init(int index, enum usb_init_type init)
{
writel((UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
~(UHCHR_SSEP0 | UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE),
Expand Down Expand Up @@ -90,7 +90,7 @@ int board_usb_init(int index, enum board_usb_init_type init)
return 0;
}

int board_usb_cleanup(int index, enum board_usb_init_type init)
int board_usb_cleanup(int index, enum usb_init_type init)
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion board/samsung/trats/trats.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ struct s3c_plat_otg_data s5pc210_otg_data = {
.usb_flags = PHY0_SLEEP,
};

int board_usb_init(int index, enum board_usb_init_type init)
int board_usb_init(int index, enum usb_init_type init)
{
debug("USB_udc_probe\n");
return s3c_udc_probe(&s5pc210_otg_data);
Expand Down
4 changes: 2 additions & 2 deletions board/toradex/colibri_pxa270/colibri_pxa270.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int dram_init(void)
}

#ifdef CONFIG_CMD_USB
int board_usb_init(int index, enum board_usb_init_type init)
int board_usb_init(int index, enum usb_init_type init)
{
writel((readl(UHCHR) | UHCHR_PCPL | UHCHR_PSPL) &
~(UHCHR_SSEP0 | UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE),
Expand Down Expand Up @@ -71,7 +71,7 @@ int board_usb_init(int index, enum board_usb_init_type init)
return 0;
}

int board_usb_cleanup(int index, enum board_usb_init_type init)
int board_usb_cleanup(int index, enum usb_init_type init)
{
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions board/trizepsiv/conxs.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern struct serial_device serial_stuart_device;
* Miscelaneous platform dependent initialisations
*/

int board_usb_init(int index, enum board_usb_init_type init)
int board_usb_init(int index, enum usb_init_type init)
{
writel((readl(UHCHR) | UHCHR_PCPL | UHCHR_PSPL) &
~(UHCHR_SSEP0 | UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE),
Expand All @@ -70,7 +70,7 @@ int board_usb_init(int index, enum board_usb_init_type init)
return 0;
}

int board_usb_cleanup(int index, enum board_usb_init_type init)
int board_usb_cleanup(int index, enum usb_init_type init)
{
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions board/vpac270/vpac270.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int board_mmc_init(bd_t *bis)
#endif

#ifdef CONFIG_CMD_USB
int board_usb_init(int index, enum board_usb_init_type init)
int board_usb_init(int index, enum usb_init_type init)
{
writel((UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
~(UHCHR_SSEP0 | UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE),
Expand Down Expand Up @@ -98,7 +98,7 @@ int board_usb_init(int index, enum board_usb_init_type init)
return 0;
}

int board_usb_cleanup(int index, enum board_usb_init_type init)
int board_usb_cleanup(int index, enum usb_init_type init)
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion common/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ int usb_new_device(struct usb_device *dev)
}

__weak
int board_usb_init(int index, enum board_usb_init_type init)
int board_usb_init(int index, enum usb_init_type init)
{
return 0;
}
Expand Down
26 changes: 13 additions & 13 deletions include/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ struct usb_device {
unsigned int slot_id;
};

/*
* You can initialize platform's USB host or device
* ports by passing this enum as an argument to
* board_usb_init().
*/
enum usb_init_type {
USB_INIT_HOST,
USB_INIT_DEVICE
};

/**********************************************************************
* this is how the lowlevel part communicate with the outer world
*/
Expand Down Expand Up @@ -169,33 +179,23 @@ extern void udc_disconnect(void);

#endif

/*
* You can initialize platform's USB host or device
* ports by passing this enum as an argument to
* board_usb_init().
*/
enum board_usb_init_type {
USB_INIT_HOST,
USB_INIT_DEVICE
};

/*
* board-specific hardware initialization, called by
* usb drivers and u-boot commands
*
* @param index USB controller number
* @param init initializes controller as USB host or device
*/
int board_usb_init(int index, enum board_usb_init_type init);
int board_usb_init(int index, enum usb_init_type init);

/*
* can be used to clean up after failed USB initialization attempt
* vide: board_usb_init()
*
* @param index USB controller number for selective cleanup
* @param init board_usb_init_type passed to board_usb_init()
* @param init usb_init_type passed to board_usb_init()
*/
int board_usb_cleanup(int index, enum board_usb_init_type init);
int board_usb_cleanup(int index, enum usb_init_type init);

#ifdef CONFIG_USB_STORAGE

Expand Down

0 comments on commit bba6791

Please sign in to comment.