mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-26 12:27:12 +00:00
board: ti: invoke clock API to enable and disable clocks
invoke enable_usb_clocks during board_usb_init and disable_usb_clocks during board_usb_exit to enable and disable clocks respectively. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
09cc14f4bc
commit
6f1af1e358
4 changed files with 10 additions and 0 deletions
|
@ -713,6 +713,7 @@ static struct ti_usb_phy_device usb_phy2_device = {
|
||||||
|
|
||||||
int 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) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
if (init == USB_INIT_DEVICE) {
|
if (init == USB_INIT_DEVICE) {
|
||||||
|
@ -759,6 +760,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
|
||||||
default:
|
default:
|
||||||
printf("Invalid Controller Index\n");
|
printf("Invalid Controller Index\n");
|
||||||
}
|
}
|
||||||
|
disable_usb_clocks(index);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -356,10 +356,12 @@ static struct ti_usb_phy_device usb_phy2_device = {
|
||||||
|
|
||||||
int 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) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
if (init == USB_INIT_DEVICE) {
|
if (init == USB_INIT_DEVICE) {
|
||||||
printf("port %d can't be used as device\n", index);
|
printf("port %d can't be used as device\n", index);
|
||||||
|
disable_usb_clocks(index);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
} else {
|
} else {
|
||||||
usb_otg_ss1.dr_mode = USB_DR_MODE_HOST;
|
usb_otg_ss1.dr_mode = USB_DR_MODE_HOST;
|
||||||
|
@ -379,6 +381,7 @@ int board_usb_init(int index, enum usb_init_type init)
|
||||||
usb_otg_ss2_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID;
|
usb_otg_ss2_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID;
|
||||||
} else {
|
} else {
|
||||||
printf("port %d can't be used as host\n", index);
|
printf("port %d can't be used as host\n", index);
|
||||||
|
disable_usb_clocks(index);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,6 +408,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
|
||||||
default:
|
default:
|
||||||
printf("Invalid Controller Index\n");
|
printf("Invalid Controller Index\n");
|
||||||
}
|
}
|
||||||
|
disable_usb_clocks(index);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,6 +163,7 @@ static struct ti_usb_phy_device usb_phy2_device = {
|
||||||
|
|
||||||
int 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) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
if (init == USB_INIT_DEVICE) {
|
if (init == USB_INIT_DEVICE) {
|
||||||
|
@ -209,6 +210,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
|
||||||
default:
|
default:
|
||||||
printf("Invalid Controller Index\n");
|
printf("Invalid Controller Index\n");
|
||||||
}
|
}
|
||||||
|
disable_usb_clocks(index);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,7 @@ int board_usb_init(int index, enum usb_init_type init)
|
||||||
usb_otg_ss_glue.vbus_id_status = OMAP_DWC3_ID_GROUND;
|
usb_otg_ss_glue.vbus_id_status = OMAP_DWC3_ID_GROUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enable_usb_clocks(index);
|
||||||
ti_usb_phy_uboot_init(&usb_phy_device);
|
ti_usb_phy_uboot_init(&usb_phy_device);
|
||||||
dwc3_omap_uboot_init(&usb_otg_ss_glue);
|
dwc3_omap_uboot_init(&usb_otg_ss_glue);
|
||||||
dwc3_uboot_init(&usb_otg_ss);
|
dwc3_uboot_init(&usb_otg_ss);
|
||||||
|
@ -112,6 +113,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
|
||||||
ti_usb_phy_uboot_exit(index);
|
ti_usb_phy_uboot_exit(index);
|
||||||
dwc3_uboot_exit(index);
|
dwc3_uboot_exit(index);
|
||||||
dwc3_omap_uboot_exit(index);
|
dwc3_omap_uboot_exit(index);
|
||||||
|
disable_usb_clocks(index);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue