Răsfoiți Sursa

Merge "video: driver: add support for pineapple V2 devices"

qctecmdr 2 ani în urmă
părinte
comite
954b0ff6f5

+ 8 - 4
driver/platform/common/src/msm_vidc_platform.c

@@ -247,7 +247,8 @@ static int msm_vidc_deinit_platform_variant(struct msm_vidc_core *core, struct d
 	}
 #endif
 #if defined(CONFIG_MSM_VIDC_PINEAPPLE)
-	if (of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc")) {
+	if (of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc") ||
+		of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc-v2")) {
 		rc = msm_vidc_deinit_platform_pineapple(core, dev);
 		if (rc)
 			d_vpr_e("%s: failed with %d\n", __func__, rc);
@@ -295,7 +296,8 @@ static int msm_vidc_init_platform_variant(struct msm_vidc_core *core, struct dev
 	}
 #endif
 #if defined(CONFIG_MSM_VIDC_PINEAPPLE)
-	if (of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc")) {
+	if (of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc") ||
+		of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc-v2")) {
 		rc = msm_vidc_init_platform_pineapple(core, dev);
 		if (rc)
 			d_vpr_e("%s: failed with %d\n", __func__, rc);
@@ -343,7 +345,8 @@ static int msm_vidc_deinit_vpu(struct msm_vidc_core *core, struct device *dev)
 	}
 #endif
 #if defined(CONFIG_MSM_VIDC_IRIS33)
-	if (of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc")) {
+	if (of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc") ||
+		of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc-v2")) {
 		rc = msm_vidc_deinit_iris33(core);
 		if (rc)
 			d_vpr_e("%s: failed with %d\n", __func__, rc);
@@ -380,7 +383,8 @@ static int msm_vidc_init_vpu(struct msm_vidc_core *core, struct device *dev)
 	}
 #endif
 #if defined(CONFIG_MSM_VIDC_IRIS33)
-	if (of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc")) {
+	if (of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc") ||
+		of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc-v2")) {
 		rc = msm_vidc_init_iris33(core);
 		if (rc)
 			d_vpr_e("%s: failed with %d\n", __func__, rc);

+ 13 - 3
driver/platform/pineapple/src/msm_vidc_pineapple.c

@@ -2574,6 +2574,10 @@ static struct freq_table pineapple_freq_table[] = {
 	{533333333}, {480000000}, {435000000}, {380000000}, {280000000}, {196000000}
 };
 
+static struct freq_table pineapple_freq_table_v2[] = {
+	{533333333}, {480000000}, {435000000}, {380000000}, {300000000}, {196000000}
+};
+
 /* register, value, mask */
 static const struct reg_preset_table pineapple_reg_preset_table[] = {
 	{ 0xB0088, 0x0, 0x11 },
@@ -2634,17 +2638,23 @@ int msm_vidc_pineapple_check_ddr_type(void)
 	return 0;
 }
 
-static int msm_vidc_init_data(struct msm_vidc_core *core)
+static int msm_vidc_init_data(struct msm_vidc_core *core, struct device *dev)
 {
 	int rc = 0;
 
-	if (!core || !core->platform) {
+	if (!core || !core->platform || !dev) {
 		d_vpr_e("%s: invalid params\n", __func__);
 		return -EINVAL;
 	}
 	d_vpr_h("%s: initialize pineapple data\n", __func__);
 
 	core->platform->data = pineapple_data;
+	if (of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc-v2")) {
+		d_vpr_h("%s: update frequency table for pineapple v2\n", __func__);
+		core->platform->data.freq_tbl = pineapple_freq_table_v2;
+		core->platform->data.freq_tbl_size = ARRAY_SIZE(pineapple_freq_table_v2);
+	}
+
 	core->mem_ops = get_mem_ops_ext();
 	rc = msm_vidc_pineapple_check_ddr_type();
 	if (rc)
@@ -2657,7 +2667,7 @@ int msm_vidc_init_platform_pineapple(struct msm_vidc_core *core, struct device *
 {
 	int rc = 0;
 
-	rc = msm_vidc_init_data(core);
+	rc = msm_vidc_init_data(core, dev);
 	if (rc)
 		return rc;
 

+ 3 - 1
driver/vidc/src/msm_vidc_probe.c

@@ -42,7 +42,8 @@ static inline bool is_video_device(struct device *dev)
 	return !!(of_device_is_compatible(dev->of_node, "qcom,sm8450-vidc") ||
 		of_device_is_compatible(dev->of_node, "qcom,sm8550-vidc") ||
 		of_device_is_compatible(dev->of_node, "qcom,sm8550-vidc-v2") ||
-		of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc"));
+		of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc")) ||
+		of_device_is_compatible(dev->of_node, "qcom,sm8650-vidc-v2");
 }
 
 static inline bool is_video_context_bank_device(struct device *dev)
@@ -119,6 +120,7 @@ static const struct of_device_id msm_vidc_dt_match[] = {
 	{.compatible = "qcom,sm8550-vidc"},
 	{.compatible = "qcom,sm8550-vidc-v2"},
 	{.compatible = "qcom,sm8650-vidc"},
+	{.compatible = "qcom,sm8650-vidc-v2"},
 	{.compatible = "qcom,vidc,cb-ns-pxl"},
 	{.compatible = "qcom,vidc,cb-ns"},
 	{.compatible = "qcom,vidc,cb-sec-non-pxl"},