1 /*
2  * TI OMAP4 ISS V4L2 Driver - CSI PHY module
3  *
4  * Copyright (C) 2012 Texas Instruments, Inc.
5  *
6  * Author: Sergio Aguirre <sergio.a.aguirre@gmail.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  */
13 
14 #ifndef OMAP4_ISS_CSI_PHY_H
15 #define OMAP4_ISS_CSI_PHY_H
16 
17 #include <media/omap4iss.h>
18 
19 struct iss_csi2_device;
20 
21 struct iss_csiphy_dphy_cfg {
22 	u8 ths_term;
23 	u8 ths_settle;
24 	u8 tclk_term;
25 	unsigned tclk_miss:1;
26 	u8 tclk_settle;
27 };
28 
29 struct iss_csiphy {
30 	struct iss_device *iss;
31 	struct mutex mutex;	/* serialize csiphy configuration */
32 	u8 phy_in_use;
33 	struct iss_csi2_device *csi2;
34 
35 	/* Pointer to register remaps into kernel space */
36 	void __iomem *cfg_regs;
37 	void __iomem *phy_regs;
38 
39 	u8 max_data_lanes;	/* number of CSI2 Data Lanes supported */
40 	u8 used_data_lanes;	/* number of CSI2 Data Lanes used */
41 	struct iss_csiphy_lanes_cfg lanes;
42 	struct iss_csiphy_dphy_cfg dphy;
43 };
44 
45 int omap4iss_csiphy_config(struct iss_device *iss,
46 			   struct v4l2_subdev *csi2_subdev);
47 int omap4iss_csiphy_acquire(struct iss_csiphy *phy);
48 void omap4iss_csiphy_release(struct iss_csiphy *phy);
49 int omap4iss_csiphy_init(struct iss_device *iss);
50 
51 #endif	/* OMAP4_ISS_CSI_PHY_H */
52