common.c 866 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/of.h>
  9. #include <soc/tegra/common.h>
  10. static const struct of_device_id tegra_machine_match[] = {
  11. { .compatible = "nvidia,tegra20", },
  12. { .compatible = "nvidia,tegra30", },
  13. { .compatible = "nvidia,tegra114", },
  14. { .compatible = "nvidia,tegra124", },
  15. { .compatible = "nvidia,tegra132", },
  16. { .compatible = "nvidia,tegra210", },
  17. { }
  18. };
  19. bool soc_is_tegra(void)
  20. {
  21. const struct of_device_id *match;
  22. struct device_node *root;
  23. root = of_find_node_by_path("/");
  24. if (!root)
  25. return false;
  26. match = of_match_node(tegra_machine_match, root);
  27. of_node_put(root);
  28. return match != NULL;
  29. }