common.c 794 B

123456789101112131415161718192021222324252627282930313233
  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. struct device_node *root;
  22. root = of_find_node_by_path("/");
  23. if (!root)
  24. return false;
  25. return of_match_node(tegra_machine_match, root) != NULL;
  26. }