180-clk-sunxi-add-clock-output-names-dt-prop-support.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 0bf618fda3ad24649add0bf943d16a9b4f5c3463 Mon Sep 17 00:00:00 2001
  2. From: Chen-Yu Tsai <wens@csie.org>
  3. Date: Mon, 3 Feb 2014 09:51:37 +0800
  4. Subject: [PATCH] clk: sunxi: add clock-output-names dt property support
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. sunxi clock drivers use dt node name as clock name, but clock
  9. nodes should be named clk@X, so the names would be the same.
  10. Let the drivers read clock names from dt clock-output-names
  11. property.
  12. Signed-off-by: Chen-Yu Tsai <wens@csie.org>
  13. Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
  14. Acked-by: Mike Turquette <mturquette@linaro.org>
  15. Signed-off-by: Emilio López <emilio@elopez.com.ar>
  16. ---
  17. drivers/clk/sunxi/clk-sunxi.c | 6 ++++++
  18. 1 file changed, 6 insertions(+)
  19. --- a/drivers/clk/sunxi/clk-sunxi.c
  20. +++ b/drivers/clk/sunxi/clk-sunxi.c
  21. @@ -51,6 +51,8 @@ static void __init sun4i_osc_clk_setup(s
  22. if (!gate)
  23. goto err_free_fixed;
  24. + of_property_read_string(node, "clock-output-names", &clk_name);
  25. +
  26. /* set up gate and fixed rate properties */
  27. gate->reg = of_iomap(node, 0);
  28. gate->bit_idx = SUNXI_OSC24M_GATE;
  29. @@ -601,6 +603,8 @@ static void __init sunxi_mux_clk_setup(s
  30. (parents[i] = of_clk_get_parent_name(node, i)) != NULL)
  31. i++;
  32. + of_property_read_string(node, "clock-output-names", &clk_name);
  33. +
  34. clk = clk_register_mux(NULL, clk_name, parents, i,
  35. CLK_SET_RATE_NO_REPARENT, reg,
  36. data->shift, SUNXI_MUX_GATE_WIDTH,
  37. @@ -660,6 +664,8 @@ static void __init sunxi_divider_clk_set
  38. clk_parent = of_clk_get_parent_name(node, 0);
  39. + of_property_read_string(node, "clock-output-names", &clk_name);
  40. +
  41. clk = clk_register_divider(NULL, clk_name, clk_parent, 0,
  42. reg, data->shift, data->width,
  43. data->pow ? CLK_DIVIDER_POWER_OF_TWO : 0,