clk-mt6765-mipi0a.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2018 MediaTek Inc.
  4. * Author: Owen Chen <[email protected]>
  5. */
  6. #include <linux/clk-provider.h>
  7. #include <linux/platform_device.h>
  8. #include "clk-mtk.h"
  9. #include "clk-gate.h"
  10. #include <dt-bindings/clock/mt6765-clk.h>
  11. static const struct mtk_gate_regs mipi0a_cg_regs = {
  12. .set_ofs = 0x80,
  13. .clr_ofs = 0x80,
  14. .sta_ofs = 0x80,
  15. };
  16. #define GATE_MIPI0A(_id, _name, _parent, _shift) \
  17. GATE_MTK(_id, _name, _parent, &mipi0a_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
  18. static const struct mtk_gate mipi0a_clks[] = {
  19. GATE_MIPI0A(CLK_MIPI0A_CSR_CSI_EN_0A,
  20. "mipi0a_csr_0a", "f_fseninf_ck", 1),
  21. };
  22. static const struct mtk_clk_desc mipi0a_desc = {
  23. .clks = mipi0a_clks,
  24. .num_clks = ARRAY_SIZE(mipi0a_clks),
  25. };
  26. static const struct of_device_id of_match_clk_mt6765_mipi0a[] = {
  27. {
  28. .compatible = "mediatek,mt6765-mipi0a",
  29. .data = &mipi0a_desc,
  30. }, {
  31. /* sentinel */
  32. }
  33. };
  34. static struct platform_driver clk_mt6765_mipi0a_drv = {
  35. .probe = mtk_clk_simple_probe,
  36. .remove = mtk_clk_simple_remove,
  37. .driver = {
  38. .name = "clk-mt6765-mipi0a",
  39. .of_match_table = of_match_clk_mt6765_mipi0a,
  40. },
  41. };
  42. builtin_platform_driver(clk_mt6765_mipi0a_drv);