Vadim Bendebury | e5d1579 | 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 | |
Tom Rini | abb9a04 | 2024-05-18 20:20:43 -0600 | [diff] [blame] | 11 | #include <common.h> |
Vadim Bendebury | e5d1579 | 2014-02-27 13:26:02 -0700 | [diff] [blame] | 12 | #include <cros_ec.h> |
Simon Glass | 44569b5 | 2014-10-13 23:42:14 -0600 | [diff] [blame] | 13 | #include <dm.h> |
| 14 | #include <errno.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 15 | #include <log.h> |
Simon Glass | 44569b5 | 2014-10-13 23:42:14 -0600 | [diff] [blame] | 16 | |
Simon Glass | b2ed222 | 2018-10-01 12:22:23 -0600 | [diff] [blame] | 17 | struct udevice *board_get_cros_ec_dev(void) |
Vadim Bendebury | e5d1579 | 2014-02-27 13:26:02 -0700 | [diff] [blame] | 18 | { |
Simon Glass | 44569b5 | 2014-10-13 23:42:14 -0600 | [diff] [blame] | 19 | struct udevice *dev; |
| 20 | int ret; |
| 21 | |
| 22 | ret = uclass_get_device(UCLASS_CROS_EC, 0, &dev); |
| 23 | if (ret) { |
| 24 | debug("%s: Error %d\n", __func__, ret); |
| 25 | return NULL; |
| 26 | } |
Simon Glass | b2ed222 | 2018-10-01 12:22:23 -0600 | [diff] [blame] | 27 | return dev; |
Vadim Bendebury | e5d1579 | 2014-02-27 13:26:02 -0700 | [diff] [blame] | 28 | } |