aboutsummaryrefslogtreecommitdiff
path: root/common/cros_ec.c
diff options
context:
space:
mode:
authorthead_admin <occ_thead@service.alibaba.com>2022-09-13 11:04:33 +0800
committerthead_admin <occ_thead@service.alibaba.com>2022-09-13 11:04:33 +0800
commit43db9e00d5837c100c0b2fbbee64a08ab807d1e0 (patch)
treeb40c0eed02935b6682e8c5c975e3016b6b2f55fe /common/cros_ec.c
Linux_SDK_V0.9.5Linux_SDK_V0.9.5
Diffstat (limited to 'common/cros_ec.c')
-rw-r--r--common/cros_ec.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/common/cros_ec.c b/common/cros_ec.c
new file mode 100644
index 00000000..e66471eb
--- /dev/null
+++ b/common/cros_ec.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ */
+
+#include <common.h>
+#include <cros_ec.h>
+#include <dm.h>
+#include <errno.h>
+
+struct udevice *board_get_cros_ec_dev(void)
+{
+ struct udevice *dev;
+ int ret;
+
+ ret = uclass_get_device(UCLASS_CROS_EC, 0, &dev);
+ if (ret) {
+ debug("%s: Error %d\n", __func__, ret);
+ return NULL;
+ }
+ return dev;
+}