cros_ec.c 648 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
  3. * Use of this source code is governed by a BSD-style license that can be
  4. * found in the LICENSE file.
  5. *
  6. * Alternatively, this software may be distributed under the terms of the
  7. * GNU General Public License ("GPL") version 2 as published by the Free
  8. * Software Foundation.
  9. */
  10. #include <common.h>
  11. #include <cros_ec.h>
  12. #include <dm.h>
  13. #include <errno.h>
  14. struct udevice *board_get_cros_ec_dev(void)
  15. {
  16. struct udevice *dev;
  17. int ret;
  18. ret = uclass_get_device(UCLASS_CROS_EC, 0, &dev);
  19. if (ret) {
  20. debug("%s: Error %d\n", __func__, ret);
  21. return NULL;
  22. }
  23. return dev;
  24. }