Re: [RFC PATCH 1/2] usb: dwc2: add clock manage for hcd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Felipe,

    Thank for comment.

On 10/16/2014 06:23 AM, Felipe Balbi wrote:
Hi,

On Wed, Oct 15, 2014 at 10:46:17PM -0700, Kever Yang wrote:
This patch move clock init out of gadget into platform,
make both hcd and gadget can use the clock

Signed-off-by: Kever Yang <kever.yang@xxxxxxxxxxxxxx>
---

  drivers/usb/dwc2/gadget.c   | 16 ++--------------
  drivers/usb/dwc2/hcd.c      |  3 +++
  drivers/usb/dwc2/platform.c | 30 ++++++++++++++++++------------
  3 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index fa49c72..fddd923 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -46,6 +46,7 @@
  #include <linux/delay.h>
  #include <linux/io.h>
  #include <linux/slab.h>
+#include <linux/clk.h>
  #include <linux/usb.h>
#include <linux/usb/hcd.h>
@@ -2266,6 +2267,7 @@ static int _dwc2_hcd_start(struct usb_hcd *hcd)
  	spin_lock_irqsave(&hsotg->lock, flags);
hcd->state = HC_STATE_RUNNING;
+	clk_enable(hsotg->clk);
with this you're moving clk_enable() from gadget to HCD. You might want
to leave this completely to the glue; at least for now.
No, I moving devm_clk_get/clk_prerare_enable/clk_disable_unprepare
to platform, but not effect clk_enable/disable in the gadget.

I send this patch for comments if we can do it in this way.
If not, how should we manage clock in hcd and gadget?

- Kever
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux