clk-mt8195-mfg.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. //
  3. // Copyright (c) 2021 MediaTek Inc.
  4. // Author: Chun-Jie Chen <[email protected]>
  5. #include "clk-gate.h"
  6. #include "clk-mtk.h"
  7. #include <dt-bindings/clock/mt8195-clk.h>
  8. #include <linux/clk-provider.h>
  9. #include <linux/platform_device.h>
  10. static const struct mtk_gate_regs mfg_cg_regs = {
  11. .set_ofs = 0x4,
  12. .clr_ofs = 0x8,
  13. .sta_ofs = 0x0,
  14. };
  15. #define GATE_MFG(_id, _name, _parent, _shift) \
  16. GATE_MTK_FLAGS(_id, _name, _parent, &mfg_cg_regs, \
  17. _shift, &mtk_clk_gate_ops_setclr, \
  18. CLK_SET_RATE_PARENT)
  19. static const struct mtk_gate mfg_clks[] = {
  20. GATE_MFG(CLK_MFG_BG3D, "mfg_bg3d", "mfg_ck_fast_ref", 0),
  21. };
  22. static const struct mtk_clk_desc mfg_desc = {
  23. .clks = mfg_clks,
  24. .num_clks = ARRAY_SIZE(mfg_clks),
  25. };
  26. static const struct of_device_id of_match_clk_mt8195_mfg[] = {
  27. {
  28. .compatible = "mediatek,mt8195-mfgcfg",
  29. .data = &mfg_desc,
  30. }, {
  31. /* sentinel */
  32. }
  33. };
  34. static struct platform_driver clk_mt8195_mfg_drv = {
  35. .probe = mtk_clk_simple_probe,
  36. .remove = mtk_clk_simple_remove,
  37. .driver = {
  38. .name = "clk-mt8195-mfg",
  39. .of_match_table = of_match_clk_mt8195_mfg,
  40. },
  41. };
  42. builtin_platform_driver(clk_mt8195_mfg_drv);