video: driver: Add support for diwali variant

Add support for diwali variants.

Change-Id: Idf322e674818642a9c886fe8707e5ff8f64c4db5
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
Bu işleme şunda yer alıyor:
Priyanka Gujjula
2021-09-09 12:12:47 +05:30
ebeveyn 7ac58c383b
işleme c3440c6ade
6 değiştirilmiş dosya ile 1771 ekleme ve 37 silme

Dosyayı Görüntüle

@@ -9,8 +9,15 @@
#include "msm_vidc_v4l2.h"
#include "msm_vidc_vb2.h"
#include "msm_vidc_control.h"
#if defined(CONFIG_MSM_VIDC_WAIPIO)
#include "msm_vidc_waipio.h"
#endif
#if defined(CONFIG_MSM_VIDC_DIWALI)
#include "msm_vidc_diwali.h"
#endif
#if defined(CONFIG_MSM_VIDC_IRIS2)
#include "msm_vidc_iris2.h"
#endif
static struct v4l2_file_operations msm_v4l2_file_operations = {
.owner = THIS_MODULE,
@@ -137,7 +144,7 @@ static int msm_vidc_init_ops(struct msm_vidc_core *core)
static int msm_vidc_deinit_platform_variant(struct msm_vidc_core *core, struct device *dev)
{
int rc = 0;
int rc = -EINVAL;
if (!core || !dev) {
d_vpr_e("%s: Invalid params\n", __func__);
@@ -146,22 +153,30 @@ static int msm_vidc_deinit_platform_variant(struct msm_vidc_core *core, struct d
d_vpr_h("%s()\n", __func__);
#if defined(CONFIG_MSM_VIDC_WAIPIO)
if (of_device_is_compatible(dev->of_node, "qcom,msm-vidc-waipio")) {
rc = msm_vidc_deinit_platform_waipio(core, dev);
} else {
d_vpr_e("%s(): unknown platform\n", __func__);
rc = -EINVAL;
if (rc)
d_vpr_e("%s: failed with %d\n", __func__, rc);
goto end_target_config;
}
#endif
#if defined(CONFIG_MSM_VIDC_DIWALI)
if (of_device_is_compatible(dev->of_node, "qcom,msm-vidc-diwali")) {
rc = msm_vidc_deinit_platform_diwali(core, dev);
if (rc)
d_vpr_e("%s: failed with %d\n", __func__, rc);
goto end_target_config;
}
#endif
if (rc)
d_vpr_e("%s: failed with %d\n", __func__, rc);
end_target_config:
return rc;
}
static int msm_vidc_init_platform_variant(struct msm_vidc_core *core, struct device *dev)
{
int rc = 0;
int rc = -EINVAL;
if (!core || !dev) {
d_vpr_e("%s: Invalid params\n", __func__);
@@ -170,22 +185,30 @@ static int msm_vidc_init_platform_variant(struct msm_vidc_core *core, struct dev
d_vpr_h("%s()\n", __func__);
#if defined(CONFIG_MSM_VIDC_WAIPIO)
if (of_device_is_compatible(dev->of_node, "qcom,msm-vidc-waipio")) {
rc = msm_vidc_init_platform_waipio(core, dev);
} else {
d_vpr_e("%s(): unknown platform\n", __func__);
rc = -EINVAL;
if (rc)
d_vpr_e("%s: failed with %d\n", __func__, rc);
goto end_target_config;
}
#endif
#if defined(CONFIG_MSM_VIDC_DIWALI)
if (of_device_is_compatible(dev->of_node, "qcom,msm-vidc-diwali")) {
rc = msm_vidc_init_platform_diwali(core, dev);
if (rc)
d_vpr_e("%s: failed with %d\n", __func__, rc);
goto end_target_config;
}
#endif
if (rc)
d_vpr_e("%s: failed with %d\n", __func__, rc);
end_target_config:
return rc;
}
static int msm_vidc_deinit_vpu(struct msm_vidc_core *core, struct device *dev)
{
int rc = 0;
int rc = -EINVAL;
if (!core || !dev) {
d_vpr_e("%s: Invalid params\n", __func__);
@@ -194,40 +217,32 @@ static int msm_vidc_deinit_vpu(struct msm_vidc_core *core, struct device *dev)
d_vpr_h("%s()\n", __func__);
#if defined(CONFIG_MSM_VIDC_IRIS2)
if (of_device_is_compatible(dev->of_node, "qcom,msm-vidc-iris2")) {
rc = msm_vidc_deinit_iris2(core);
} else {
d_vpr_e("%s(): unknown vpu\n", __func__);
rc = -EINVAL;
if (rc)
d_vpr_e("%s: failed with %d\n", __func__, rc);
}
if (rc)
d_vpr_e("%s: failed with %d\n", __func__, rc);
#endif
return rc;
}
static int msm_vidc_init_vpu(struct msm_vidc_core *core, struct device *dev)
{
int rc = 0;
int rc = -EINVAL;
if (!core || !dev) {
d_vpr_e("%s: Invalid params\n", __func__);
return -EINVAL;
}
d_vpr_h("%s()\n", __func__);
#if defined(CONFIG_MSM_VIDC_IRIS2)
if (of_device_is_compatible(dev->of_node, "qcom,msm-vidc-iris2")) {
rc = msm_vidc_init_iris2(core);
} else {
d_vpr_e("%s(): unknown vpu\n", __func__);
rc = -EINVAL;
if (rc)
d_vpr_e("%s: failed with %d\n", __func__, rc);
}
if (rc)
d_vpr_e("%s: failed with %d\n", __func__, rc);
#endif
return rc;
}