xref: /linux/drivers/gpu/drm/loongson/lsdc_i2c.h (revision be239684b18e1cdcafcf8c7face4a2f562c745ad)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2023 Loongson Technology Corporation Limited
4  */
5 
6 #ifndef __LSDC_I2C_H__
7 #define __LSDC_I2C_H__
8 
9 #include <linux/i2c.h>
10 #include <linux/i2c-algo-bit.h>
11 
12 struct lsdc_i2c {
13 	struct i2c_adapter adapter;
14 	struct i2c_algo_bit_data bit;
15 	struct drm_device *ddev;
16 	void __iomem *dir_reg;
17 	void __iomem *dat_reg;
18 	/* pin bit mask */
19 	u8 sda;
20 	u8 scl;
21 };
22 
23 struct lsdc_display_pipe;
24 
25 int lsdc_create_i2c_chan(struct drm_device *ddev,
26 			 struct lsdc_display_pipe *dispipe,
27 			 unsigned int index);
28 
29 #endif
30