forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/phy/rockchip/phy-rockchip-csi2-dphy-common.h
....@@ -9,9 +9,14 @@
99 #define _PHY_ROCKCHIP_CSI2_DPHY_COMMON_H_
1010
1111 #include <linux/rk-camera-module.h>
12
+#include <linux/rkcif-config.h>
1213
1314 #define PHY_MAX 16
1415 #define MAX_DEV_NAME_LEN 32
16
+
17
+#define MAX_SAMSUNG_PHY_NUM 2
18
+
19
+#define MAX_INNO_PHY_NUM 2
1520
1621 /* add new chip id in tail by time order */
1722 enum csi2_dphy_chip_id {
....@@ -59,14 +64,18 @@
5964
6065 struct dphy_drv_data {
6166 const char dev_name[MAX_DEV_NAME_LEN];
62
- enum csi2_dphy_vendor vendor;
67
+ enum csi2_dphy_chip_id chip_id;
68
+ char num_inno_phy;
69
+ char num_samsung_phy;
6370 };
6471
6572 struct csi2_dphy {
6673 struct device *dev;
6774 struct list_head list;
6875 struct csi2_dphy_hw *dphy_hw;
76
+ struct csi2_dphy_hw *dphy_hw_group[MAX_INNO_PHY_NUM];
6977 struct samsung_mipi_dcphy *samsung_phy;
78
+ struct samsung_mipi_dcphy *samsung_phy_group[MAX_SAMSUNG_PHY_NUM];
7079 struct v4l2_async_notifier notifier;
7180 struct v4l2_subdev sd;
7281 struct mutex mutex; /* lock for updating protection */
....@@ -75,8 +84,10 @@
7584 u64 data_rate_mbps;
7685 int num_sensors;
7786 int phy_index;
87
+ struct rkcif_csi_info csi_info;
88
+ void *phy_hw[RKMODULE_MULTI_DEV_NUM];
7889 bool is_streaming;
79
- enum csi2_dphy_lane_mode lane_mode;
90
+ int lane_mode;
8091 const struct dphy_drv_data *drv_data;
8192 struct rkmodule_csi_dphy_param dphy_param;
8293 };
....@@ -87,8 +98,9 @@
8798 const struct hsfreq_range *hsfreq_ranges_cphy;
8899 int num_hsfreq_ranges_cphy;
89100 const struct grf_reg *grf_regs;
90
- const struct txrx_reg *txrx_regs;
101
+ int num_grf_regs;
91102 const struct csi2dphy_reg *csi2dphy_regs;
103
+ int num_csi2dphy_regs;
92104 void (*individual_init)(struct csi2_dphy_hw *hw);
93105 int (*stream_on)(struct csi2_dphy *dphy, struct v4l2_subdev *sd);
94106 int (*stream_off)(struct csi2_dphy *dphy, struct v4l2_subdev *sd);
....@@ -100,7 +112,6 @@
100112 struct regmap *regmap_grf;
101113 struct regmap *regmap_sys_grf;
102114 const struct grf_reg *grf_regs;
103
- const struct txrx_reg *txrx_regs;
104115 const struct csi2dphy_reg *csi2dphy_regs;
105116 const struct dphy_hw_drv_data *drv_data;
106117 void __iomem *hw_base_addr;
....@@ -119,6 +130,8 @@
119130 int (*stream_off)(struct csi2_dphy *dphy, struct v4l2_subdev *sd);
120131 int (*ttl_mode_enable)(struct csi2_dphy_hw *hw);
121132 void (*ttl_mode_disable)(struct csi2_dphy_hw *hw);
133
+ int (*quick_stream_on)(struct csi2_dphy *dphy, struct v4l2_subdev *sd);
134
+ int (*quick_stream_off)(struct csi2_dphy *dphy, struct v4l2_subdev *sd);
122135 };
123136
124137 int rockchip_csi2_dphy_hw_init(void);