common.c 872 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright © 2014 NVIDIA Corporation
  3. * Copyright © 2015 Broadcom Corporation
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #include <linux/of.h>
  15. #include <soc/brcmstb/common.h>
  16. static const struct of_device_id brcmstb_machine_match[] = {
  17. { .compatible = "brcm,brcmstb", },
  18. { }
  19. };
  20. bool soc_is_brcmstb(void)
  21. {
  22. struct device_node *root;
  23. root = of_find_node_by_path("/");
  24. if (!root)
  25. return false;
  26. return of_match_node(brcmstb_machine_match, root) != NULL;
  27. }