| .. | .. |
|---|
| 9 | 9 | #define _PHY_ROCKCHIP_CSI2_DPHY_COMMON_H_ |
|---|
| 10 | 10 | |
|---|
| 11 | 11 | #include <linux/rk-camera-module.h> |
|---|
| 12 | +#include <linux/rkcif-config.h> |
|---|
| 12 | 13 | |
|---|
| 13 | 14 | #define PHY_MAX 16 |
|---|
| 14 | 15 | #define MAX_DEV_NAME_LEN 32 |
|---|
| 16 | + |
|---|
| 17 | +#define MAX_SAMSUNG_PHY_NUM 2 |
|---|
| 18 | + |
|---|
| 19 | +#define MAX_INNO_PHY_NUM 2 |
|---|
| 15 | 20 | |
|---|
| 16 | 21 | /* add new chip id in tail by time order */ |
|---|
| 17 | 22 | enum csi2_dphy_chip_id { |
|---|
| .. | .. |
|---|
| 59 | 64 | |
|---|
| 60 | 65 | struct dphy_drv_data { |
|---|
| 61 | 66 | 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; |
|---|
| 63 | 70 | }; |
|---|
| 64 | 71 | |
|---|
| 65 | 72 | struct csi2_dphy { |
|---|
| 66 | 73 | struct device *dev; |
|---|
| 67 | 74 | struct list_head list; |
|---|
| 68 | 75 | struct csi2_dphy_hw *dphy_hw; |
|---|
| 76 | + struct csi2_dphy_hw *dphy_hw_group[MAX_INNO_PHY_NUM]; |
|---|
| 69 | 77 | struct samsung_mipi_dcphy *samsung_phy; |
|---|
| 78 | + struct samsung_mipi_dcphy *samsung_phy_group[MAX_SAMSUNG_PHY_NUM]; |
|---|
| 70 | 79 | struct v4l2_async_notifier notifier; |
|---|
| 71 | 80 | struct v4l2_subdev sd; |
|---|
| 72 | 81 | struct mutex mutex; /* lock for updating protection */ |
|---|
| .. | .. |
|---|
| 75 | 84 | u64 data_rate_mbps; |
|---|
| 76 | 85 | int num_sensors; |
|---|
| 77 | 86 | int phy_index; |
|---|
| 87 | + struct rkcif_csi_info csi_info; |
|---|
| 88 | + void *phy_hw[RKMODULE_MULTI_DEV_NUM]; |
|---|
| 78 | 89 | bool is_streaming; |
|---|
| 79 | | - enum csi2_dphy_lane_mode lane_mode; |
|---|
| 90 | + int lane_mode; |
|---|
| 80 | 91 | const struct dphy_drv_data *drv_data; |
|---|
| 81 | 92 | struct rkmodule_csi_dphy_param dphy_param; |
|---|
| 82 | 93 | }; |
|---|
| .. | .. |
|---|
| 87 | 98 | const struct hsfreq_range *hsfreq_ranges_cphy; |
|---|
| 88 | 99 | int num_hsfreq_ranges_cphy; |
|---|
| 89 | 100 | const struct grf_reg *grf_regs; |
|---|
| 90 | | - const struct txrx_reg *txrx_regs; |
|---|
| 101 | + int num_grf_regs; |
|---|
| 91 | 102 | const struct csi2dphy_reg *csi2dphy_regs; |
|---|
| 103 | + int num_csi2dphy_regs; |
|---|
| 92 | 104 | void (*individual_init)(struct csi2_dphy_hw *hw); |
|---|
| 93 | 105 | int (*stream_on)(struct csi2_dphy *dphy, struct v4l2_subdev *sd); |
|---|
| 94 | 106 | int (*stream_off)(struct csi2_dphy *dphy, struct v4l2_subdev *sd); |
|---|
| .. | .. |
|---|
| 100 | 112 | struct regmap *regmap_grf; |
|---|
| 101 | 113 | struct regmap *regmap_sys_grf; |
|---|
| 102 | 114 | const struct grf_reg *grf_regs; |
|---|
| 103 | | - const struct txrx_reg *txrx_regs; |
|---|
| 104 | 115 | const struct csi2dphy_reg *csi2dphy_regs; |
|---|
| 105 | 116 | const struct dphy_hw_drv_data *drv_data; |
|---|
| 106 | 117 | void __iomem *hw_base_addr; |
|---|
| .. | .. |
|---|
| 119 | 130 | int (*stream_off)(struct csi2_dphy *dphy, struct v4l2_subdev *sd); |
|---|
| 120 | 131 | int (*ttl_mode_enable)(struct csi2_dphy_hw *hw); |
|---|
| 121 | 132 | 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); |
|---|
| 122 | 135 | }; |
|---|
| 123 | 136 | |
|---|
| 124 | 137 | int rockchip_csi2_dphy_hw_init(void); |
|---|