blob: 9ccc8fa16cdb616c49e673fab812b6fdc7711964 [file] [log] [blame]
Vadim Bendeburye5d15792014-02-27 13:26:02 -07001/*
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
Vadim Bendeburye5d15792014-02-27 13:26:02 -070011#include <cros_ec.h>
Simon Glass44569b52014-10-13 23:42:14 -060012#include <dm.h>
13#include <errno.h>
Simon Glass0f2af882020-05-10 11:40:05 -060014#include <log.h>
Simon Glass44569b52014-10-13 23:42:14 -060015
Simon Glassb2ed2222018-10-01 12:22:23 -060016struct udevice *board_get_cros_ec_dev(void)
Vadim Bendeburye5d15792014-02-27 13:26:02 -070017{
Simon Glass44569b52014-10-13 23:42:14 -060018 struct udevice *dev;
19 int ret;
20
21 ret = uclass_get_device(UCLASS_CROS_EC, 0, &dev);
22 if (ret) {
23 debug("%s: Error %d\n", __func__, ret);
24 return NULL;
25 }
Simon Glassb2ed2222018-10-01 12:22:23 -060026 return dev;
Vadim Bendeburye5d15792014-02-27 13:26:02 -070027}