1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (C) IBM Corporation 2023 */
4 #ifndef DRIVERS_FSI_MASTER_I2CR_H
5 #define DRIVERS_FSI_MASTER_I2CR_H
8 #include <linux/mutex.h>
10 #include "fsi-master.h"
14 struct fsi_master_i2cr {
15 struct fsi_master master;
16 struct mutex lock; /* protect HW access */
17 struct i2c_client *client;
20 #define to_fsi_master_i2cr(m) container_of(m, struct fsi_master_i2cr, master)
22 int fsi_master_i2cr_read(struct fsi_master_i2cr *i2cr, u32 addr, u64 *data);
23 int fsi_master_i2cr_write(struct fsi_master_i2cr *i2cr, u32 addr, u64 data);
25 static inline bool is_fsi_master_i2cr(struct fsi_master *master)
27 if (master->dev.parent && master->dev.parent->type == &i2c_client_type)
33 #endif /* DRIVERS_FSI_MASTER_I2CR_H */