clk-master.c 682 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (C) 2016 Atmel Corporation
  3. * Wenyou.Yang <wenyou.yang@atmel.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <clk-uclass.h>
  9. #include <dm/device.h>
  10. DECLARE_GLOBAL_DATA_PTR;
  11. static ulong at91_master_clk_get_rate(struct clk *clk)
  12. {
  13. return gd->arch.mck_rate_hz;
  14. }
  15. static struct clk_ops at91_master_clk_ops = {
  16. .get_rate = at91_master_clk_get_rate,
  17. };
  18. static const struct udevice_id at91_master_clk_match[] = {
  19. { .compatible = "atmel,at91sam9x5-clk-master" },
  20. {}
  21. };
  22. U_BOOT_DRIVER(at91_master_clk) = {
  23. .name = "at91-master-clk",
  24. .id = UCLASS_CLK,
  25. .of_match = at91_master_clk_match,
  26. .ops = &at91_master_clk_ops,
  27. };