Vadim Bendebury | 41364f0 | 2014-02-27 13:26:02 -0700 | [diff] [blame] | 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 | |
Vadim Bendebury | 41364f0 | 2014-02-27 13:26:02 -0700 | [diff] [blame] | 11 | #include <cros_ec.h> |
Simon Glass | 84d6cbd | 2014-10-13 23:42:14 -0600 | [diff] [blame] | 12 | #include <dm.h> |
| 13 | #include <errno.h> |
Simon Glass | f7ae49f | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 14 | #include <log.h> |
Simon Glass | 84d6cbd | 2014-10-13 23:42:14 -0600 | [diff] [blame] | 15 | |
Simon Glass | 42116f6 | 2018-10-01 12:22:23 -0600 | [diff] [blame] | 16 | struct udevice *board_get_cros_ec_dev(void) |
Vadim Bendebury | 41364f0 | 2014-02-27 13:26:02 -0700 | [diff] [blame] | 17 | { |
Simon Glass | 84d6cbd | 2014-10-13 23:42:14 -0600 | [diff] [blame] | 18 | 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 Glass | 42116f6 | 2018-10-01 12:22:23 -0600 | [diff] [blame] | 26 | return dev; |
Vadim Bendebury | 41364f0 | 2014-02-27 13:26:02 -0700 | [diff] [blame] | 27 | } |