1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * TI OMAP4 ISS V4L2 Driver - CSI PHY module
4  *
5  * Copyright (C) 2012 Texas Instruments, Inc.
6  *
7  * Author: Sergio Aguirre <sergio.a.aguirre@gmail.com>
8  */
9 
10 #ifndef OMAP4_ISS_CSI_PHY_H
11 #define OMAP4_ISS_CSI_PHY_H
12 
13 #include <linux/platform_data/media/omap4iss.h>
14 
15 struct iss_csi2_device;
16 
17 struct iss_csiphy_dphy_cfg {
18 	u8 ths_term;
19 	u8 ths_settle;
20 	u8 tclk_term;
21 	unsigned tclk_miss:1;
22 	u8 tclk_settle;
23 };
24 
25 struct iss_csiphy {
26 	struct iss_device *iss;
27 	struct mutex mutex;	/* serialize csiphy configuration */
28 	u8 phy_in_use;
29 	struct iss_csi2_device *csi2;
30 
31 	/* memory resources, as defined in enum iss_mem_resources */
32 	unsigned int cfg_regs;
33 	unsigned int phy_regs;
34 
35 	u8 max_data_lanes;	/* number of CSI2 Data Lanes supported */
36 	u8 used_data_lanes;	/* number of CSI2 Data Lanes used */
37 	struct iss_csiphy_lanes_cfg lanes;
38 	struct iss_csiphy_dphy_cfg dphy;
39 };
40 
41 int omap4iss_csiphy_config(struct iss_device *iss,
42 			   struct v4l2_subdev *csi2_subdev);
43 int omap4iss_csiphy_acquire(struct iss_csiphy *phy);
44 void omap4iss_csiphy_release(struct iss_csiphy *phy);
45 int omap4iss_csiphy_init(struct iss_device *iss);
46 
47 #endif	/* OMAP4_ISS_CSI_PHY_H */
48