linux/drivers/usb/dwc3
Masahiro Yamada fe8abf332b usb: dwc3: support clocks and resets for DWC3 core
Historically, the clocks and resets are handled on the glue layer
side instead of the DWC3 core.  For simple cases, dwc3-of-simple.c
takes care of arbitrary number of clocks and resets.  The DT node
structure typically looks like as follows:

  dwc3-glue {
          compatible = "foo,dwc3";
          clocks = ...;
          resets = ...;
          ...

          dwc3 {
                  compatible = "snps,dwc3";
                  ...
          };
  }

By supporting the clocks and the reset in the dwc3/core.c, it will
be turned into a single node:

  dwc3 {
          compatible = "foo,dwc3", "snps,dwc3";
          clocks = ...;
          resets = ...;
          ...
  }

This commit adds the binding of clocks and resets specific to this IP.
The number of clocks should generally be the same across SoCs, it is
just some SoCs either tie clocks together or do not provide software
control of some of the clocks.

I took the clock names from the Synopsys datasheet: "ref" (ref_clk),
"bus_early" (bus_clk_early), and "suspend" (suspend_clk).

I found only one reset line in the datasheet, hence the reset-names
property is omitted.

Those clocks are required for new platforms.  Enforcing the new
binding breaks existing platforms since they specify clocks (and
resets) in their glue layer node, but nothing in the core node.
I listed such exceptional cases in the DT binding.  The driver
code has been relaxed to accept no clock.  This change is based
on the discussion [1].

I inserted reset_control_deassert() and clk_bulk_enable() before the
first register access, i.e. dwc3_cache_hwparams().

[1] https://patchwork.kernel.org/patch/10284265/

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2018-05-16 08:52:39 +03:00
..
Kconfig usb: dwc3: Add Qualcomm DWC3 glue driver 2018-05-15 10:20:13 +03:00
Makefile usb: dwc3: Add Qualcomm DWC3 glue driver 2018-05-15 10:20:13 +03:00
core.c usb: dwc3: support clocks and resets for DWC3 core 2018-05-16 08:52:39 +03:00
core.h usb: dwc3: support clocks and resets for DWC3 core 2018-05-16 08:52:39 +03:00
debug.h usb: dwc3: debug: decode a few more features 2017-12-11 12:36:48 +02:00
debugfs.c usb: dwc3: Dump LSP and BMU debug info 2018-03-22 10:49:02 +02:00
drd.c usb: dwc3: add dual role support using OTG block 2018-03-13 10:47:52 +02:00
dwc3-exynos.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
dwc3-keystone.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
dwc3-of-simple.c usb: dwc3: Add Qualcomm DWC3 glue driver 2018-05-15 10:20:13 +03:00
dwc3-omap.c usb: dwc3: omap: don't miss events during suspend/resume 2018-02-12 10:53:18 +02:00
dwc3-pci.c usb: dwc3: pci: Properly cleanup resource 2018-03-22 10:48:18 +02:00
dwc3-qcom.c usb: dwc3: Add Qualcomm DWC3 glue driver 2018-05-15 10:20:13 +03:00
dwc3-st.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
ep0.c usb: dwc3: ep0: remove redundant assignment 2018-03-19 10:52:12 +02:00
gadget.c usb: dwc3: gadget: never call ->complete() from ->ep_queue() 2018-03-26 13:22:09 +02:00
gadget.h USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
host.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
io.h USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
trace.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
trace.h usb: dwc3: Make sparse a bit happier 2017-12-11 12:36:49 +02:00
ulpi.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00