mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 07:41:42 +01:00
lib: utils/i2c: Add simple FDT based I2C framework
FDT based I2C framework on the top of I2C library. The drivers are probed on demand by fdt_i2c_adapter_get function. Tested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Alexandre Ghiti <alexandre.ghiti@canonical.com> Tested-by: Alexandre Ghiti <alexandre.ghiti@canonical.com> Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
This commit is contained in:

committed by
Anup Patel

parent
2c964a2e15
commit
6ca6bcafb7
26
include/sbi_utils/i2c/fdt_i2c.h
Normal file
26
include/sbi_utils/i2c/fdt_i2c.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2021 YADRO
|
||||
*
|
||||
* Authors:
|
||||
* Nikita Shubin <n.shubin@yadro.com>
|
||||
*/
|
||||
|
||||
#ifndef __FDT_I2C_H__
|
||||
#define __FDT_I2C_H__
|
||||
|
||||
#include <sbi_utils/i2c/i2c.h>
|
||||
|
||||
/** FDT based I2C adapter driver */
|
||||
struct fdt_i2c_adapter {
|
||||
const struct fdt_match *match_table;
|
||||
int (*init)(void *fdt, int nodeoff,
|
||||
const struct fdt_match *match);
|
||||
};
|
||||
|
||||
/** Get I2C adapter identified by nodeoff */
|
||||
int fdt_i2c_adapter_get(void *fdt, int nodeoff,
|
||||
struct i2c_adapter **out_adapter);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user