drm/tests: hdmi: Fix memory leaks in drm_display_mode_from_cea_vic()
[drm/drm-misc.git] / drivers / fsi / fsi-master-i2cr.h
blob96636bf28cacebcd22a05d9b9afadc8a13e406c0
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
7 #include <linux/i2c.h>
8 #include <linux/mutex.h>
10 #include "fsi-master.h"
12 struct i2c_client;
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)
28 return true;
30 return false;
33 #endif /* DRIVERS_FSI_MASTER_I2CR_H */