public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/4] board: ti: invoke clock API to enable and disable clocks
Date: Wed, 19 Aug 2015 16:16:27 +0530	[thread overview]
Message-ID: <1439981189-17571-4-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1439981189-17571-1-git-send-email-kishon@ti.com>

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>
---
 board/ti/am43xx/board.c     |    2 ++
 board/ti/beagle_x15/board.c |    4 ++++
 board/ti/dra7xx/evm.c       |    2 ++
 board/ti/omap5_uevm/evm.c   |    2 ++
 4 files changed, 10 insertions(+)

diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
index 1454976..770726c 100644
--- a/board/ti/am43xx/board.c
+++ b/board/ti/am43xx/board.c
@@ -713,6 +713,7 @@ static struct ti_usb_phy_device usb_phy2_device = {
 
 int board_usb_init(int index, enum usb_init_type init)
 {
+	enable_usb_clocks(index);
 	switch (index) {
 	case 0:
 		if (init == USB_INIT_DEVICE) {
@@ -759,6 +760,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
 	default:
 		printf("Invalid Controller Index\n");
 	}
+	disable_usb_clocks(index);
 
 	return 0;
 }
diff --git a/board/ti/beagle_x15/board.c b/board/ti/beagle_x15/board.c
index bcf8cf2..042f9ab 100644
--- a/board/ti/beagle_x15/board.c
+++ b/board/ti/beagle_x15/board.c
@@ -356,10 +356,12 @@ static struct ti_usb_phy_device usb_phy2_device = {
 
 int board_usb_init(int index, enum usb_init_type init)
 {
+	enable_usb_clocks(index);
 	switch (index) {
 	case 0:
 		if (init == USB_INIT_DEVICE) {
 			printf("port %d can't be used as device\n", index);
+			disable_usb_clocks(index);
 			return -EINVAL;
 		} else {
 			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;
 		} else {
 			printf("port %d can't be used as host\n", index);
+			disable_usb_clocks(index);
 			return -EINVAL;
 		}
 
@@ -405,6 +408,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
 	default:
 		printf("Invalid Controller Index\n");
 	}
+	disable_usb_clocks(index);
 	return 0;
 }
 
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index 4849694..04fc8ed 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -144,6 +144,7 @@ static struct ti_usb_phy_device usb_phy2_device = {
 
 int board_usb_init(int index, enum usb_init_type init)
 {
+	enable_usb_clocks(index);
 	switch (index) {
 	case 0:
 		if (init == USB_INIT_DEVICE) {
@@ -190,6 +191,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
 	default:
 		printf("Invalid Controller Index\n");
 	}
+	disable_usb_clocks(index);
 	return 0;
 }
 
diff --git a/board/ti/omap5_uevm/evm.c b/board/ti/omap5_uevm/evm.c
index d0d0e0e..659877c 100644
--- a/board/ti/omap5_uevm/evm.c
+++ b/board/ti/omap5_uevm/evm.c
@@ -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;
 	}
 
+	enable_usb_clocks(index);
 	ti_usb_phy_uboot_init(&usb_phy_device);
 	dwc3_omap_uboot_init(&usb_otg_ss_glue);
 	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);
 	dwc3_uboot_exit(index);
 	dwc3_omap_uboot_exit(index);
+	disable_usb_clocks(index);
 
 	return 0;
 }
-- 
1.7.9.5

  parent reply	other threads:[~2015-08-19 10:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 10:46 [U-Boot] [PATCH v2 0/4] ti: dwc3: Enable USB clocks on-demand Kishon Vijay Abraham I
2015-08-19 10:46 ` [U-Boot] [PATCH v2 1/4] ARM: OMAP5: Add functions to enable and disable USB clocks Kishon Vijay Abraham I
2015-08-20 17:50   ` Tom Rini
2015-08-28 21:04   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-08-19 10:46 ` [U-Boot] [PATCH v2 2/4] ARM: AM43xx: " Kishon Vijay Abraham I
2015-08-24 13:43   ` Tom Rini
2015-08-28 21:04   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-08-19 10:46 ` Kishon Vijay Abraham I [this message]
2015-08-28 21:04   ` [U-Boot] [U-Boot, v2, 3/4] board: ti: invoke clock API to enable and disable clocks Tom Rini
2015-08-19 10:46 ` [U-Boot] [PATCH v2 4/4] ARM: OMAP5/AM43xx: remove enabling USB clocks from enable_basic_clocks() Kishon Vijay Abraham I
2015-08-24 13:43   ` Tom Rini
2015-08-28 21:04   ` [U-Boot] [U-Boot, v2, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439981189-17571-4-git-send-email-kishon@ti.com \
    --to=kishon@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox