Loading Documentation/devicetree/bindings/media/video/msm-vfe.txt +6 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ Required properties: different SoC can have same hardware version and still different QOS, VBIF, and DS parameters. In this case they are exported if separate SoC version specific dts files. - max-nominal-clk: nominal rate of the VFE clock in Hertz. - max-turbo-clk: turbo/high rate of the VFE clock in Hertz. Example: Loading Loading @@ -82,6 +84,8 @@ Example: 0x44441111 0x44441111 0x44441111 0x44441111 0x44441111 0x44441111 0x44441111 0x00000103>; max-clk-nominal = <465000000>; max-clk-turbo = <600000000>; }; In version specific file one needs to move only entries that differ between Loading Loading @@ -123,4 +127,6 @@ SoC versions with same VFE HW version: 0x44441111 0x44441111 0x00000103>; max-clk-nominal = <465000000>; max-clk-turbo = <600000000>; }; arch/arm/boot/dts/qcom/msm8994-camera-v1.dtsi +4 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ 0x44441111 0x44441111 0x00000103>; max-clk-nominal = <400000000>; max-clk-turbo = <533330000>; }; &vfe1 { Loading Loading @@ -85,4 +87,6 @@ 0x44441111 0x44441111 0x00000103>; max-clk-nominal = <400000000>; max-clk-turbo = <533330000>; }; arch/arm/boot/dts/qcom/msm8994-camera-v2.dtsi +4 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ 0xCCCC1111 0xCCCC1111 0x00000103>; max-clk-nominal = <465000000>; max-clk-turbo = <600000000>; }; &vfe1 { Loading Loading @@ -85,4 +87,6 @@ 0xCCCC1111 0xCCCC1111 0x00000103>; max-clk-nominal = <465000000>; max-clk-turbo = <600000000>; }; drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c +63 −0 Original line number Diff line number Diff line Loading @@ -415,6 +415,49 @@ static int msm_isp_get_max_clk_rate(struct vfe_device *vfe_dev, long *rate) return 0; } static int msm_isp_get_clk_rates(struct vfe_device *vfe_dev, struct msm_isp_clk_rates *rates) { struct device_node *of_node; int32_t rc = 0; uint32_t nominal = 0, turbo = 0; if (!vfe_dev || !rates) { pr_err("%s:%d failed: vfe_dev %p rates %p\n", __func__, __LINE__, vfe_dev, rates); return -EINVAL; } if (!vfe_dev->pdev) { pr_err("%s:%d failed: vfe_dev->pdev %p\n", __func__, __LINE__, vfe_dev->pdev); return -EINVAL; } of_node = vfe_dev->pdev->dev.of_node; if (!of_node) { pr_err("%s %d failed: of_node = %p\n", __func__, __LINE__, of_node); return -EINVAL; } rc = of_property_read_u32(of_node, "max-clk-nominal", &nominal); if (rc < 0 || !nominal) { pr_err("%s: nominal rate error\n", __func__); return -EINVAL; } rc = of_property_read_u32(of_node, "max-clk-turbo", &turbo); if (rc < 0 || !turbo) { pr_err("%s: turbo rate error\n", __func__); return -EINVAL; } rates->nominal_rate = nominal; rates->high_rate = turbo; return 0; } static int msm_isp_set_clk_rate(struct vfe_device *vfe_dev, long *rate) { int rc = 0; Loading Loading @@ -1068,6 +1111,26 @@ static int msm_isp_send_hw_cmd(struct vfe_device *vfe_dev, break; } case GET_CLK_RATES: { int rc = 0; struct msm_isp_clk_rates rates; struct msm_isp_clk_rates *user_data = (struct msm_isp_clk_rates *)cfg_data; if (cmd_len != sizeof(struct msm_isp_clk_rates)) { pr_err("%s:%d failed: invalid cmd len %u exp %zu\n", __func__, __LINE__, cmd_len, sizeof(struct msm_isp_clk_rates)); return -EINVAL; } rc = msm_isp_get_clk_rates(vfe_dev, &rates); if (rc < 0) { pr_err("%s:%d failed: rc %d\n", __func__, __LINE__, rc); return -EINVAL; } user_data->nominal_rate = rates.nominal_rate; user_data->high_rate = rates.high_rate; break; } case GET_ISP_ID: { uint32_t *isp_id = NULL; Loading include/media/msmb_isp.h +6 −0 Original line number Diff line number Diff line Loading @@ -321,6 +321,7 @@ enum msm_vfe_reg_cfg_type { VFE_READ_DMI_32BIT, VFE_READ_DMI_64BIT, GET_MAX_CLK_RATE, GET_CLK_RATES, GET_ISP_ID, VFE_HW_UPDATE_LOCK, VFE_HW_UPDATE_UNLOCK, Loading Loading @@ -402,6 +403,11 @@ struct msm_isp_qbuf_info { uint32_t dirty_buf; }; struct msm_isp_clk_rates { uint32_t nominal_rate; uint32_t high_rate; }; struct msm_vfe_axi_src_state { enum msm_vfe_input_src input_src; uint32_t src_active; Loading Loading
Documentation/devicetree/bindings/media/video/msm-vfe.txt +6 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ Required properties: different SoC can have same hardware version and still different QOS, VBIF, and DS parameters. In this case they are exported if separate SoC version specific dts files. - max-nominal-clk: nominal rate of the VFE clock in Hertz. - max-turbo-clk: turbo/high rate of the VFE clock in Hertz. Example: Loading Loading @@ -82,6 +84,8 @@ Example: 0x44441111 0x44441111 0x44441111 0x44441111 0x44441111 0x44441111 0x44441111 0x00000103>; max-clk-nominal = <465000000>; max-clk-turbo = <600000000>; }; In version specific file one needs to move only entries that differ between Loading Loading @@ -123,4 +127,6 @@ SoC versions with same VFE HW version: 0x44441111 0x44441111 0x00000103>; max-clk-nominal = <465000000>; max-clk-turbo = <600000000>; };
arch/arm/boot/dts/qcom/msm8994-camera-v1.dtsi +4 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ 0x44441111 0x44441111 0x00000103>; max-clk-nominal = <400000000>; max-clk-turbo = <533330000>; }; &vfe1 { Loading Loading @@ -85,4 +87,6 @@ 0x44441111 0x44441111 0x00000103>; max-clk-nominal = <400000000>; max-clk-turbo = <533330000>; };
arch/arm/boot/dts/qcom/msm8994-camera-v2.dtsi +4 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ 0xCCCC1111 0xCCCC1111 0x00000103>; max-clk-nominal = <465000000>; max-clk-turbo = <600000000>; }; &vfe1 { Loading Loading @@ -85,4 +87,6 @@ 0xCCCC1111 0xCCCC1111 0x00000103>; max-clk-nominal = <465000000>; max-clk-turbo = <600000000>; };
drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c +63 −0 Original line number Diff line number Diff line Loading @@ -415,6 +415,49 @@ static int msm_isp_get_max_clk_rate(struct vfe_device *vfe_dev, long *rate) return 0; } static int msm_isp_get_clk_rates(struct vfe_device *vfe_dev, struct msm_isp_clk_rates *rates) { struct device_node *of_node; int32_t rc = 0; uint32_t nominal = 0, turbo = 0; if (!vfe_dev || !rates) { pr_err("%s:%d failed: vfe_dev %p rates %p\n", __func__, __LINE__, vfe_dev, rates); return -EINVAL; } if (!vfe_dev->pdev) { pr_err("%s:%d failed: vfe_dev->pdev %p\n", __func__, __LINE__, vfe_dev->pdev); return -EINVAL; } of_node = vfe_dev->pdev->dev.of_node; if (!of_node) { pr_err("%s %d failed: of_node = %p\n", __func__, __LINE__, of_node); return -EINVAL; } rc = of_property_read_u32(of_node, "max-clk-nominal", &nominal); if (rc < 0 || !nominal) { pr_err("%s: nominal rate error\n", __func__); return -EINVAL; } rc = of_property_read_u32(of_node, "max-clk-turbo", &turbo); if (rc < 0 || !turbo) { pr_err("%s: turbo rate error\n", __func__); return -EINVAL; } rates->nominal_rate = nominal; rates->high_rate = turbo; return 0; } static int msm_isp_set_clk_rate(struct vfe_device *vfe_dev, long *rate) { int rc = 0; Loading Loading @@ -1068,6 +1111,26 @@ static int msm_isp_send_hw_cmd(struct vfe_device *vfe_dev, break; } case GET_CLK_RATES: { int rc = 0; struct msm_isp_clk_rates rates; struct msm_isp_clk_rates *user_data = (struct msm_isp_clk_rates *)cfg_data; if (cmd_len != sizeof(struct msm_isp_clk_rates)) { pr_err("%s:%d failed: invalid cmd len %u exp %zu\n", __func__, __LINE__, cmd_len, sizeof(struct msm_isp_clk_rates)); return -EINVAL; } rc = msm_isp_get_clk_rates(vfe_dev, &rates); if (rc < 0) { pr_err("%s:%d failed: rc %d\n", __func__, __LINE__, rc); return -EINVAL; } user_data->nominal_rate = rates.nominal_rate; user_data->high_rate = rates.high_rate; break; } case GET_ISP_ID: { uint32_t *isp_id = NULL; Loading
include/media/msmb_isp.h +6 −0 Original line number Diff line number Diff line Loading @@ -321,6 +321,7 @@ enum msm_vfe_reg_cfg_type { VFE_READ_DMI_32BIT, VFE_READ_DMI_64BIT, GET_MAX_CLK_RATE, GET_CLK_RATES, GET_ISP_ID, VFE_HW_UPDATE_LOCK, VFE_HW_UPDATE_UNLOCK, Loading Loading @@ -402,6 +403,11 @@ struct msm_isp_qbuf_info { uint32_t dirty_buf; }; struct msm_isp_clk_rates { uint32_t nominal_rate; uint32_t high_rate; }; struct msm_vfe_axi_src_state { enum msm_vfe_input_src input_src; uint32_t src_active; Loading