msm: isp: Add support for VFE dual camera resolution limit
Read VFE resolution limitation from VFE fuse register and restrict support for dual camera resolution. Change-Id: I5f1c8878bd1039a40c7c8ecc5934757707e0123e Signed-off-by: Venu Yeshala <vyeshala@codeaurora.org>
This commit is contained in:
parent
51740526b9
commit
127c4c22e7
5 changed files with 41 additions and 7 deletions
|
@ -23,6 +23,7 @@ Required properties for child node:
|
|||
Only needed for child node.
|
||||
- "vfe" - Required.
|
||||
- "vfe_vbif" - Optional for "vfe32". Required for "vfe40".
|
||||
- "vfe_fuse" - Optional.
|
||||
- interrupts : should contain the vfe interrupt.
|
||||
- interrupt-names : should specify relevant names to each interrupts
|
||||
property defined.
|
||||
|
@ -52,9 +53,10 @@ Example:
|
|||
vfe0: qcom,vfe0@fda10000 {
|
||||
cell-index = <0>;
|
||||
compatible = "qcom,vfe44";
|
||||
reg = <0xfda10000 0x1000>;
|
||||
<0xfda40000 0x200>;
|
||||
reg-names = "vfe", "vfe_vbif";
|
||||
reg = <0xfda10000 0x1000>,
|
||||
<0xfda40000 0x200>,
|
||||
<0x7801a4 0x8>;
|
||||
reg-names = "vfe", "vfe_vbif", "vfe_fuse";
|
||||
interrupts = <0 57 0>;
|
||||
interrupt-names = "vfe";
|
||||
vdd-supply = <&gdsc_vfe>;
|
||||
|
@ -105,9 +107,10 @@ vfe0: qcom,vfe0@fda10000 {
|
|||
vfe1: qcom,vfe1@fda14000 {
|
||||
cell-index = <1>;
|
||||
compatible = "qcom,vfe44";
|
||||
reg = <0xfda14000 0x1000>;
|
||||
<0xfda40000 0x200>;
|
||||
reg-names = "vfe", "vfe_vbif";
|
||||
reg = <0xfda14000 0x1000>,
|
||||
<0xfda40000 0x200>,
|
||||
<0x7801a4 0x8>;
|
||||
reg-names = "vfe", "vfe_vbif", "vfe_fuse";
|
||||
interrupts = <0 58 0>;
|
||||
interrupt-names = "vfe";
|
||||
vdd-supply = <&gdsc_vfe>;
|
||||
|
|
|
@ -809,6 +809,7 @@ struct vfe_device {
|
|||
uint32_t is_split;
|
||||
uint32_t dual_vfe_enable;
|
||||
unsigned long page_fault_addr;
|
||||
uint32_t vfe_hw_limit;
|
||||
|
||||
/* Debug variables */
|
||||
int dump_reg;
|
||||
|
|
|
@ -2742,6 +2742,8 @@ int msm_vfe47_enable_regulators(struct vfe_device *vfe_dev, int enable)
|
|||
int msm_vfe47_get_platform_data(struct vfe_device *vfe_dev)
|
||||
{
|
||||
int rc = 0;
|
||||
void __iomem *vfe_fuse_base;
|
||||
uint32_t vfe_fuse_base_size;
|
||||
|
||||
vfe_dev->vfe_base = msm_camera_get_reg_base(vfe_dev->pdev, "vfe", 0);
|
||||
if (!vfe_dev->vfe_base)
|
||||
|
@ -2766,7 +2768,18 @@ int msm_vfe47_get_platform_data(struct vfe_device *vfe_dev)
|
|||
rc = -ENOMEM;
|
||||
goto get_res_fail;
|
||||
}
|
||||
|
||||
vfe_dev->vfe_hw_limit = 0;
|
||||
vfe_fuse_base = msm_camera_get_reg_base(vfe_dev->pdev,
|
||||
"vfe_fuse", 0);
|
||||
vfe_fuse_base_size = msm_camera_get_res_size(vfe_dev->pdev,
|
||||
"vfe_fuse");
|
||||
if (vfe_fuse_base) {
|
||||
if (vfe_fuse_base_size)
|
||||
vfe_dev->vfe_hw_limit =
|
||||
(msm_camera_io_r(vfe_fuse_base) >> 5) & 0x1;
|
||||
msm_camera_put_reg_base(vfe_dev->pdev, vfe_fuse_base,
|
||||
"vfe_fuse", 0);
|
||||
}
|
||||
rc = vfe_dev->hw_info->vfe_ops.platform_ops.get_regulators(vfe_dev);
|
||||
if (rc)
|
||||
goto get_regulator_fail;
|
||||
|
|
|
@ -1428,6 +1428,20 @@ static int msm_isp_send_hw_cmd(struct vfe_device *vfe_dev,
|
|||
vfe_dev->vfe_ub_policy = *cfg_data;
|
||||
break;
|
||||
}
|
||||
case GET_VFE_HW_LIMIT: {
|
||||
uint32_t *hw_limit = NULL;
|
||||
|
||||
if (cmd_len < sizeof(uint32_t)) {
|
||||
pr_err("%s:%d failed: invalid cmd len %u exp %zu\n",
|
||||
__func__, __LINE__, cmd_len,
|
||||
sizeof(uint32_t));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hw_limit = (uint32_t *)cfg_data;
|
||||
*hw_limit = vfe_dev->vfe_hw_limit;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
|
||||
#define ISP_STATS_STREAM_BIT 0x80000000
|
||||
|
||||
#define VFE_HW_LIMIT 1
|
||||
|
||||
struct msm_vfe_cfg_cmd_list;
|
||||
|
||||
enum ISP_START_PIXEL_PATTERN {
|
||||
|
@ -456,6 +458,7 @@ enum msm_vfe_reg_cfg_type {
|
|||
VFE_HW_UPDATE_UNLOCK,
|
||||
SET_WM_UB_SIZE,
|
||||
SET_UB_POLICY,
|
||||
GET_VFE_HW_LIMIT,
|
||||
};
|
||||
|
||||
struct msm_vfe_cfg_cmd2 {
|
||||
|
|
Loading…
Add table
Reference in a new issue