lib: utils/i2c: Use fdt_driver for initialization

The i2c driver subsystem does not need any extra data, so it can use
`struct fdt_driver` directly. It always initializes the driver for a
specific DT node.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Samuel Holland
2024-11-11 14:02:50 -08:00
committed by Anup Patel
parent bef8f9b806
commit 333133edaa
5 changed files with 7 additions and 37 deletions

View File

@@ -10,15 +10,9 @@
#ifndef __FDT_I2C_H__
#define __FDT_I2C_H__
#include <sbi_utils/fdt/fdt_driver.h>
#include <sbi_utils/i2c/i2c.h>
/** FDT based I2C adapter driver */
struct fdt_i2c_adapter {
const struct fdt_match *match_table;
int (*init)(const void *fdt, int nodeoff,
const struct fdt_match *match);
};
/** Get I2C adapter identified by nodeoff */
int fdt_i2c_adapter_get(const void *fdt, int nodeoff,
struct i2c_adapter **out_adapter);