183-clk-sunxi-add-usb-clockreg-defs.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From c61dfeb17581d32360a817ba40636aaed85caade Mon Sep 17 00:00:00 2001
  2. From: Roman Byshko <rbyshko@gmail.com>
  3. Date: Fri, 7 Feb 2014 16:21:50 +0100
  4. Subject: [PATCH] clk: sunxi: Add USB clock register defintions
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Add register definitions for the usb-clk register found on sun4i, sun5i and
  9. sun7i SoCs.
  10. Signed-off-by: Roman Byshko <rbyshko@gmail.com>
  11. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  12. Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
  13. Signed-off-by: Emilio López <emilio@elopez.com.ar>
  14. ---
  15. Documentation/devicetree/bindings/clock/sunxi.txt | 5 +++++
  16. drivers/clk/sunxi/clk-sunxi.c | 12 ++++++++++++
  17. 2 files changed, 17 insertions(+)
  18. --- a/Documentation/devicetree/bindings/clock/sunxi.txt
  19. +++ b/Documentation/devicetree/bindings/clock/sunxi.txt
  20. @@ -37,6 +37,8 @@ Required properties:
  21. "allwinner,sun6i-a31-apb2-gates-clk" - for the APB2 gates on A31
  22. "allwinner,sun4i-mod0-clk" - for the module 0 family of clocks
  23. "allwinner,sun7i-a20-out-clk" - for the external output clocks
  24. + "allwinner,sun4i-a10-usb-clk" - for usb gates + resets on A10 / A20
  25. + "allwinner,sun5i-a13-usb-clk" - for usb gates + resets on A13
  26. Required properties for all clocks:
  27. - reg : shall be the control register address for the clock.
  28. @@ -49,6 +51,9 @@ Required properties for all clocks:
  29. Additionally, "allwinner,*-gates-clk" clocks require:
  30. - clock-output-names : the corresponding gate names that the clock controls
  31. +And "allwinner,*-usb-clk" clocks also require:
  32. +- reset-cells : shall be set to 1
  33. +
  34. Clock consumers should specify the desired clocks they use with a
  35. "clocks" phandle cell. Consumers that are using a gated clock should
  36. provide an additional ID in their clock property. This ID is the
  37. --- a/drivers/clk/sunxi/clk-sunxi.c
  38. +++ b/drivers/clk/sunxi/clk-sunxi.c
  39. @@ -816,6 +816,16 @@ static const struct gates_data sun7i_a20
  40. .mask = { 0xff80ff },
  41. };
  42. +static const struct gates_data sun4i_a10_usb_gates_data __initconst = {
  43. + .mask = {0x1C0},
  44. + .reset_mask = 0x07,
  45. +};
  46. +
  47. +static const struct gates_data sun5i_a13_usb_gates_data __initconst = {
  48. + .mask = {0x140},
  49. + .reset_mask = 0x03,
  50. +};
  51. +
  52. static void __init sunxi_gates_clk_setup(struct device_node *node,
  53. struct gates_data *data)
  54. {
  55. @@ -1107,6 +1117,8 @@ static const struct of_device_id clk_gat
  56. {.compatible = "allwinner,sun6i-a31-apb1-gates-clk", .data = &sun6i_a31_apb1_gates_data,},
  57. {.compatible = "allwinner,sun7i-a20-apb1-gates-clk", .data = &sun7i_a20_apb1_gates_data,},
  58. {.compatible = "allwinner,sun6i-a31-apb2-gates-clk", .data = &sun6i_a31_apb2_gates_data,},
  59. + {.compatible = "allwinner,sun4i-a10-usb-clk", .data = &sun4i_a10_usb_gates_data,},
  60. + {.compatible = "allwinner,sun5i-a13-usb-clk", .data = &sun5i_a13_usb_gates_data,},
  61. {}
  62. };