diff --git a/config/bengalcamera.conf b/config/bengalcamera.conf index 051268ee0f..38e163af7e 100644 --- a/config/bengalcamera.conf +++ b/config/bengalcamera.conf @@ -2,9 +2,7 @@ # Copyright (c) 2019, The Linux Foundation. All rights reserved. export CONFIG_SPECTRA_CAMERA=y +export CONFIG_SPECTRA_TFE=y export CONFIG_SPECTRA_ISP=y export CONFIG_SPECTRA_SENSOR=y -export CONFIG_SPECTRA_ICP=y -export CONFIG_SPECTRA_JPEG=y -export CONFIG_SPECTRA_LRME=y -export CONFIG_SPECTRA_FD=y +export CONFIG_SPECTRA_OPE=y diff --git a/config/bengalcameraconf.h b/config/bengalcameraconf.h index 6d3b107796..bb1f8be401 100644 --- a/config/bengalcameraconf.h +++ b/config/bengalcameraconf.h @@ -1,13 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. */ #define CONFIG_SPECTRA_CAMERA 1 +#define CONFIG_SPECTRA_TFE 1 #define CONFIG_SPECTRA_ISP 1 #define CONFIG_SPECTRA_SENSOR 1 -#define CONFIG_SPECTRA_ICP 1 -#define CONFIG_SPECTRA_JPEG 1 -#define CONFIG_SPECTRA_LRME 1 -#define CONFIG_SPECTRA_FD 1 +#define CONFIG_SPECTRA_OPE 1 diff --git a/drivers/cam_cdm/cam_cdm_intf.c b/drivers/cam_cdm/cam_cdm_intf.c index 8c7fcadc91..04b2a73935 100644 --- a/drivers/cam_cdm/cam_cdm_intf.c +++ b/drivers/cam_cdm/cam_cdm_intf.c @@ -702,10 +702,10 @@ struct platform_driver cam_cdm_intf_driver = { .probe = cam_cdm_intf_probe, .remove = cam_cdm_intf_remove, .driver = { - .name = "msm_cam_cdm_intf", - .owner = THIS_MODULE, - .of_match_table = msm_cam_cdm_intf_dt_match, - .suppress_bind_attrs = true, + .name = "msm_cam_cdm_intf", + .owner = THIS_MODULE, + .of_match_table = msm_cam_cdm_intf_dt_match, + .suppress_bind_attrs = true, }, }; diff --git a/drivers/cam_cpas/cam_cpas_hw.c b/drivers/cam_cpas/cam_cpas_hw.c index 5b509ad51c..edfc42a4f2 100644 --- a/drivers/cam_cpas/cam_cpas_hw.c +++ b/drivers/cam_cpas/cam_cpas_hw.c @@ -1565,7 +1565,7 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args, CAM_ERR(CAM_CPAS, "disable_resorce failed, rc=%d", rc); goto done; } - CAM_DBG(CAM_CPAS, "Disabled all the resources: irq_count=%d\n", + CAM_DBG(CAM_CPAS, "Disabled all the resources: irq_count=%d", atomic_read(&cpas_core->irq_count)); cpas_hw->hw_state = CAM_HW_STATE_POWER_DOWN; } diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/ppi_hw/cam_csid_ppi100.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/ppi_hw/cam_csid_ppi100.c index 3ad3bd9b6a..4d7fcb5372 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/ppi_hw/cam_csid_ppi100.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/ppi_hw/cam_csid_ppi100.c @@ -25,7 +25,7 @@ static const struct of_device_id cam_csid_ppi100_dt_match[] = { MODULE_DEVICE_TABLE(of, cam_csid_ppi100_dt_match); -static struct platform_driver cam_csid_ppi100_driver = { +struct platform_driver cam_csid_ppi100_driver = { .probe = cam_csid_ppi_probe, .remove = cam_csid_ppi_remove, .driver = { diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_csid_hw/cam_tfe_csid_core.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_csid_hw/cam_tfe_csid_core.c index a490088fb9..f9325204ba 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_csid_hw/cam_tfe_csid_core.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_csid_hw/cam_tfe_csid_core.c @@ -3018,7 +3018,8 @@ int cam_tfe_csid_hw_probe_init(struct cam_hw_intf *csid_hw_intf, for (i = 0; i < CAM_CSID_PPI_HW_MAX; i++) { rc = cam_csid_ppi_hw_init(&tfe_csid_hw->ppi_hw_intf[i], i); if (rc < 0) { - CAM_ERR(CAM_ISP, "PPI init failed for PPI %d", i); + CAM_INFO(CAM_ISP, "PPI init failed for PPI %d", i); + rc = 0; break; } } diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_csid_hw/cam_tfe_csid_dev.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_csid_hw/cam_tfe_csid_dev.c index cb4a3b9c49..790ddf1a5a 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_csid_hw/cam_tfe_csid_dev.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_csid_hw/cam_tfe_csid_dev.c @@ -10,13 +10,15 @@ #include "cam_tfe_csid_dev.h" #include "cam_tfe_csid_hw_intf.h" #include "cam_debug_util.h" +#include "camera_main.h" static struct cam_hw_intf *cam_tfe_csid_hw_list[CAM_TFE_CSID_HW_NUM_MAX] = { 0, 0, 0}; static char csid_dev_name[8]; -int cam_tfe_csid_probe(struct platform_device *pdev) +static int cam_tfe_csid_component_bind(struct device *dev, + struct device *master_dev, void *data) { struct cam_hw_intf *csid_hw_intf; @@ -26,6 +28,7 @@ int cam_tfe_csid_probe(struct platform_device *pdev) struct cam_tfe_csid_hw_info *csid_hw_data = NULL; uint32_t csid_dev_idx; int rc = 0; + struct platform_device *pdev = to_platform_device(dev); CAM_DBG(CAM_ISP, "probe called"); @@ -101,11 +104,13 @@ err: return rc; } -int cam_tfe_csid_remove(struct platform_device *pdev) +void cam_tfe_csid_component_unbind(struct device *dev, + struct device *master_dev, void *data) { struct cam_tfe_csid_hw *csid_dev = NULL; struct cam_hw_intf *csid_hw_intf; struct cam_hw_info *csid_hw_info; + struct platform_device *pdev = to_platform_device(dev); csid_dev = (struct cam_tfe_csid_hw *)platform_get_drvdata(pdev); csid_hw_intf = csid_dev->hw_intf; @@ -120,6 +125,27 @@ int cam_tfe_csid_remove(struct platform_device *pdev) kfree(csid_dev); kfree(csid_hw_info); kfree(csid_hw_intf); +} + +const static struct component_ops cam_tfe_csid_component_ops = { + .bind = cam_tfe_csid_component_bind, + .unbind = cam_tfe_csid_component_unbind, +}; + +int cam_tfe_csid_probe(struct platform_device *pdev) +{ + int rc = 0; + + rc = component_add(&pdev->dev, &cam_tfe_csid_component_ops); + if (rc) + CAM_ERR(CAM_ISP, "failed to add component rc: %d", rc); + + return rc; +} + +int cam_tfe_csid_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &cam_tfe_csid_component_ops); return 0; } diff --git a/drivers/cam_ope/ope_hw_mgr/ope_hw/ope_dev.c b/drivers/cam_ope/ope_hw_mgr/ope_hw/ope_dev.c index 0d3472d2bf..e3c7cedaff 100644 --- a/drivers/cam_ope/ope_hw_mgr/ope_hw/ope_dev.c +++ b/drivers/cam_ope/ope_hw_mgr/ope_hw/ope_dev.c @@ -67,6 +67,7 @@ static int cam_ope_init_hw_version(struct cam_hw_soc_info *soc_info, switch (core_info->hw_version) { case OPE_HW_VER_1_0_0: + case OPE_HW_VER_1_1_0: core_info->ope_hw_info->ope_hw = &ope_hw_100; break; default: diff --git a/drivers/cam_ope/ope_hw_mgr/ope_hw/ope_hw.h b/drivers/cam_ope/ope_hw_mgr/ope_hw/ope_hw.h index 2890f1579e..ecff57eeb9 100644 --- a/drivers/cam_ope/ope_hw_mgr/ope_hw/ope_hw.h +++ b/drivers/cam_ope/ope_hw_mgr/ope_hw/ope_hw.h @@ -7,6 +7,7 @@ #define CAM_OPE_HW_H #define OPE_HW_VER_1_0_0 0x10000000 +#define OPE_HW_VER_1_1_0 0x10010000 #define OPE_DEV_OPE 0 #define OPE_DEV_MAX 1 diff --git a/drivers/camera_main.c b/drivers/camera_main.c index ebc9559d51..db91401f13 100644 --- a/drivers/camera_main.c +++ b/drivers/camera_main.c @@ -79,7 +79,6 @@ static const struct camera_submodule_component camera_base[] = { static const struct camera_submodule_component camera_tfe[] = { #ifdef CONFIG_SPECTRA_TFE - {&cam_top_tpg_init_module, &cam_top_tpg_exit_module}, {&cam_csid_ppi100_init_module, &cam_csid_ppi100_exit_module}, {&cam_tfe_init_module, &cam_tfe_exit_module}, {&cam_tfe_csid530_init_module, &cam_tfe_csid530_exit_module}, diff --git a/drivers/camera_main.h b/drivers/camera_main.h index e802d64b75..255985fc8c 100644 --- a/drivers/camera_main.h +++ b/drivers/camera_main.h @@ -22,7 +22,7 @@ extern struct platform_driver cam_vfe_driver; extern struct platform_driver isp_driver; #endif #ifdef CONFIG_SPECTRA_TFE -extern struct platform_driver cam_top_tpg_driver; +extern struct platform_driver cam_csid_ppi100_driver; extern struct platform_driver cam_tfe_driver; extern struct platform_driver cam_tfe_csid530_driver; #endif @@ -79,6 +79,11 @@ static struct platform_driver *const cam_component_drivers[] = { &cam_cpas_driver, &cam_cdm_intf_driver, &cam_hw_cdm_driver, +#ifdef CONFIG_SPECTRA_TFE + &cam_csid_ppi100_driver, + &cam_tfe_driver, + &cam_tfe_csid530_driver, +#endif #ifdef CONFIG_SPECTRA_ISP &cam_top_tpg_driver, &cam_ife_csid17x_driver, @@ -86,11 +91,6 @@ static struct platform_driver *const cam_component_drivers[] = { &cam_vfe_driver, &isp_driver, #endif -#ifdef CONFIG_SPECTRA_TFE - &cam_top_tpg_driver, - &cam_tfe_driver, - &cam_tfe_csid530_driver, -#endif #ifdef CONFIG_SPECTRA_SENSOR &cam_res_mgr_driver, &cci_driver,