summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMinda Chen <minda.chen@starfivetech.com>2023-03-09 09:19:58 +0300
committerAnup Patel <anup@brainfault.org>2023-03-09 18:30:57 +0300
commite9d08bd99cc702fcec1c5b59b593781da668e2bc (patch)
tree8b1b2cf40e976b79274f85860d8aced45836726e /include
parent4b28afc98bbe406e3ad6f4a97d0fe96a882e83a1 (diff)
downloadopensbi-e9d08bd99cc702fcec1c5b59b593781da668e2bc.tar.xz
lib: utils/i2c: Add minimal StarFive jh7110 I2C driver
Starfive JH7110 I2C IP is synopsys designware. Minimum StarFIve I2C driver to read/send bytes over I2C bus. This allows querying information and perform operation of onboard PMIC, as well as power-off and reset. Signed-off-by: Minda Chen <minda.chen@starfivetech.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include')
-rw-r--r--include/sbi_utils/i2c/dw_i2c.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/sbi_utils/i2c/dw_i2c.h b/include/sbi_utils/i2c/dw_i2c.h
new file mode 100644
index 0000000..88703e0
--- /dev/null
+++ b/include/sbi_utils/i2c/dw_i2c.h
@@ -0,0 +1,21 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2022 StarFive Technology Co., Ltd.
+ *
+ * Author: Minda Chen <minda.chen@starfivetech.com>
+ */
+
+#ifndef __DW_I2C_H__
+#define __DW_I2C_H__
+
+#include <sbi_utils/i2c/i2c.h>
+
+int dw_i2c_init(struct i2c_adapter *, int nodeoff);
+
+struct dw_i2c_adapter {
+ unsigned long addr;
+ struct i2c_adapter adapter;
+};
+
+#endif