0193-clk-mediatek-adjust-dependency-of-reset.c-to-avoid-u.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. From 0f9391b4ee12cad5c93e109b9eb6c0c6298da0d3 Mon Sep 17 00:00:00 2001
  2. From: Sean Wang <[email protected]>
  3. Date: Fri, 5 Jan 2018 16:14:06 +0800
  4. Subject: [PATCH 193/224] clk: mediatek: adjust dependency of reset.c to avoid
  5. unexpectedly being built
  6. Changes from v1->v2:
  7. Add 'select RESET_CONTROLLER' under COMMON_CLK_MEDIATEK and enable
  8. reset.c to be built when COMMON_CLK_MEDIATEK is selected. That should
  9. be quite reasonable because the reset controller is tightly embedded
  10. inside and exported from these clock subsystems. At least it can be found
  11. on infracfg and pericfg subsystem that both are really fundamental block
  12. lots of devices must depend on.
  13. commit 74cb0d6dde8 ("clk: mediatek: fixup test-building of MediaTek clock
  14. drivers") can let the build system looking into the directory where the
  15. clock drivers resides and then allow test-building the drivers.
  16. But the change also gives rise to certain incorrect behavior which is
  17. reset.c being built even not depending on either COMPILE_TEST or
  18. ARCH_MEDIATEK alternative dependency. To get rid of reset.c being built
  19. unexpectedly on the other platforms, it would be a good change that the
  20. file should be built depending on its own specific configuration rather
  21. than just on generic RESET_CONTROLLER one.
  22. Signed-off-by: Sean Wang <[email protected]>
  23. Cc: Jean Delvare <[email protected]>
  24. Signed-off-by: Stephen Boyd <[email protected]>
  25. ---
  26. drivers/clk/mediatek/Kconfig | 1 +
  27. drivers/clk/mediatek/Makefile | 4 ++--
  28. drivers/clk/mediatek/clk-mtk.h | 7 -------
  29. 3 files changed, 3 insertions(+), 9 deletions(-)
  30. --- a/drivers/clk/mediatek/Kconfig
  31. +++ b/drivers/clk/mediatek/Kconfig
  32. @@ -6,6 +6,7 @@ menu "Clock driver for MediaTek SoC"
  33. config COMMON_CLK_MEDIATEK
  34. bool
  35. + select RESET_CONTROLLER
  36. ---help---
  37. MediaTek SoCs' clock support.
  38. --- a/drivers/clk/mediatek/Makefile
  39. +++ b/drivers/clk/mediatek/Makefile
  40. @@ -1,6 +1,5 @@
  41. # SPDX-License-Identifier: GPL-2.0
  42. -obj-$(CONFIG_COMMON_CLK_MEDIATEK) += clk-mtk.o clk-pll.o clk-gate.o clk-apmixed.o clk-cpumux.o
  43. -obj-$(CONFIG_RESET_CONTROLLER) += reset.o
  44. +obj-$(CONFIG_COMMON_CLK_MEDIATEK) += clk-mtk.o clk-pll.o clk-gate.o clk-apmixed.o clk-cpumux.o reset.o
  45. obj-$(CONFIG_COMMON_CLK_MT6797) += clk-mt6797.o
  46. obj-$(CONFIG_COMMON_CLK_MT6797_IMGSYS) += clk-mt6797-img.o
  47. obj-$(CONFIG_COMMON_CLK_MT6797_MMSYS) += clk-mt6797-mm.o
  48. --- a/drivers/clk/mediatek/clk-mtk.h
  49. +++ b/drivers/clk/mediatek/clk-mtk.h
  50. @@ -229,14 +229,7 @@ void mtk_clk_register_plls(struct device
  51. struct clk *mtk_clk_register_ref2usb_tx(const char *name,
  52. const char *parent_name, void __iomem *reg);
  53. -#ifdef CONFIG_RESET_CONTROLLER
  54. void mtk_register_reset_controller(struct device_node *np,
  55. unsigned int num_regs, int regofs);
  56. -#else
  57. -static inline void mtk_register_reset_controller(struct device_node *np,
  58. - unsigned int num_regs, int regofs)
  59. -{
  60. -}
  61. -#endif
  62. #endif /* __DRV_CLK_MTK_H */