Merge "msm: camera: cpas: Add cpas support for camera v780 platform" into camera-kernel.lnx.5.0

Cette révision appartient à :
Savita Patted
2021-06-25 16:19:32 -07:00
révisé par Gerrit - the friendly Code Review server
révision 5a1e961891
5 fichiers modifiés avec 1155 ajouts et 26 suppressions

Voir le fichier

@@ -31,6 +31,7 @@
#include "cpastop_v570_200.h"
#include "cpastop_v680_100.h"
#include "cpastop_v165_100.h"
#include "cpastop_v780_100.h"
#include "cam_req_mgr_workq.h"
struct cam_camnoc_info *camnoc_info;
@@ -151,6 +152,15 @@ static const uint32_t cam_cpas_hw_version_map
0,
0,
},
/* for camera_780 */
{
CAM_CPAS_TITAN_780_V100,
0,
0,
0,
0,
0,
},
};
static int cam_cpas_translate_camera_cpas_version_id(
@@ -206,6 +216,10 @@ static int cam_cpas_translate_camera_cpas_version_id(
*cam_version_id = CAM_CPAS_CAMERA_VERSION_ID_165;
break;
case CAM_CPAS_CAMERA_VERSION_780:
*cam_version_id = CAM_CPAS_CAMERA_VERSION_ID_780;
break;
default:
CAM_ERR(CAM_CPAS, "Invalid cam version %u",
cam_version);
@@ -515,15 +529,6 @@ static int cam_cpastop_handle_ahb_timeout_err(struct cam_hw_info *cpas_hw,
return 0;
}
static int cam_cpastop_disable_test_irq(struct cam_hw_info *cpas_hw)
{
camnoc_info->irq_sbm->sbm_clear.value &= ~0x4;
camnoc_info->irq_sbm->sbm_enable.value &= ~0x100;
camnoc_info->irq_err[CAM_CAMNOC_HW_IRQ_CAMNOC_TEST].enable = false;
return 0;
}
static int cam_cpastop_reset_irq(struct cam_hw_info *cpas_hw)
{
int i;
@@ -694,9 +699,6 @@ static irqreturn_t cam_cpastop_handle_irq(int irq_num, void *data)
payload->hw = cpas_hw;
INIT_WORK((struct work_struct *)&payload->work, cam_cpastop_work);
if (TEST_IRQ_ENABLE)
cam_cpastop_disable_test_irq(cpas_hw);
cam_cpastop_reset_irq(cpas_hw);
payload->workq_scheduled_ts = ktime_get();
@@ -714,8 +716,9 @@ static int cam_cpastop_print_poweron_settings(struct cam_hw_info *cpas_hw)
for (i = 0; i < camnoc_info->specific_size; i++) {
if (camnoc_info->specific[i].enable) {
CAM_INFO(CAM_CPAS, "Reading QoS settings for %d",
camnoc_info->specific[i].port_type);
CAM_INFO(CAM_CPAS, "Reading QoS settings for %d %s",
camnoc_info->specific[i].port_type,
camnoc_info->specific[i].port_name);
cam_cpas_util_reg_read(cpas_hw, CAM_CPAS_REG_CAMNOC,
&camnoc_info->specific[i].priority_lut_low);
cam_cpas_util_reg_read(cpas_hw, CAM_CPAS_REG_CAMNOC,
@@ -752,8 +755,9 @@ static int cam_cpastop_poweron(struct cam_hw_info *cpas_hw)
cam_cpastop_reset_irq(cpas_hw);
for (i = 0; i < camnoc_info->specific_size; i++) {
if (camnoc_info->specific[i].enable) {
CAM_DBG(CAM_CPAS, "Updating QoS settings for %d",
camnoc_info->specific[i].port_type);
CAM_DBG(CAM_CPAS, "Updating QoS settings for %d %s",
camnoc_info->specific[i].port_type,
camnoc_info->specific[i].port_name);
cam_cpas_util_reg_update(cpas_hw, CAM_CPAS_REG_CAMNOC,
&camnoc_info->specific[i].priority_lut_low);
cam_cpas_util_reg_update(cpas_hw, CAM_CPAS_REG_CAMNOC,
@@ -946,6 +950,10 @@ static int cam_cpastop_init_hw_version(struct cam_hw_info *cpas_hw,
case CAM_CPAS_TITAN_165_V100:
camnoc_info = &cam165_cpas100_camnoc_info;
break;
case CAM_CPAS_TITAN_780_V100:
camnoc_info = &cam780_cpas100_camnoc_info;
qchannel_info = &cam780_cpas100_qchannel_info;
break;
default:
CAM_ERR(CAM_CPAS, "Camera Version not supported %d.%d.%d",
hw_caps->camera_version.major,
@@ -990,15 +998,6 @@ static int cam_cpastop_setup_qos_settings(struct cam_hw_info *cpas_hw,
"Invalid selection mask 0x%x for hw 0x%x",
selection_mask, soc_info->hw_version);
break;
case CAM_CPAS_TITAN_680_V100:
if ((selection_mask & CAM_CPAS_QOS_CUSTOM_SETTINGS_MASK) ||
(selection_mask & CAM_CPAS_QOS_DEFAULT_SETTINGS_MASK))
camnoc_info = &cam680_cpas100_camnoc_info;
else
CAM_ERR(CAM_CPAS,
"Invalid selection mask 0x%x for hw 0x%x",
selection_mask, soc_info->hw_version);
break;
default:
CAM_WARN(CAM_CPAS, "QoS selection not supported for 0x%x",
soc_info->hw_version);

Voir le fichier

@@ -154,6 +154,7 @@ enum cam_camnoc_hw_irq_type {
* @CAM_CAMNOC_TFE_2: Indicates TFE2 HW connection to camnoc
* @CAM_CAMNOC_OPE: Indicates OPE HW connection to camnoc
*/
/* Deprecated, do not use this anymore. port_name serves the purpose instead of this */
enum cam_camnoc_port_type {
CAM_CAMNOC_CDM,
CAM_CAMNOC_SFE_RD,

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Voir le fichier

@@ -72,6 +72,7 @@ enum cam_cpas_camera_version {
CAM_CPAS_CAMERA_VERSION_570 = 0x00050700,
CAM_CPAS_CAMERA_VERSION_680 = 0x00060800,
CAM_CPAS_CAMERA_VERSION_165 = 0x00010605,
CAM_CPAS_CAMERA_VERSION_780 = 0x00070800,
CAM_CPAS_CAMERA_VERSION_MAX
};
@@ -105,6 +106,7 @@ enum cam_cpas_camera_version_map_id {
CAM_CPAS_CAMERA_VERSION_ID_570 = 0x8,
CAM_CPAS_CAMERA_VERSION_ID_680 = 0x9,
CAM_CPAS_CAMERA_VERSION_ID_165 = 0xA,
CAM_CPAS_CAMERA_VERSION_ID_780 = 0xB,
CAM_CPAS_CAMERA_VERSION_ID_MAX
};
@@ -144,6 +146,7 @@ enum cam_cpas_hw_version {
CAM_CPAS_TITAN_545_V100 = 0x545100,
CAM_CPAS_TITAN_570_V200 = 0x570200,
CAM_CPAS_TITAN_680_V100 = 0x680100,
CAM_CPAS_TITAN_780_V100 = 0x780100,
CAM_CPAS_TITAN_MAX
};

Voir le fichier

@@ -6444,7 +6444,8 @@ int cam_icp_hw_mgr_init(struct device_node *of_node, uint64_t *hw_mgr_hdl,
if ((camera_hw_version == CAM_CPAS_TITAN_480_V100) ||
(camera_hw_version == CAM_CPAS_TITAN_580_V100) ||
(camera_hw_version == CAM_CPAS_TITAN_570_V200) ||
(camera_hw_version == CAM_CPAS_TITAN_680_V100)) {
(camera_hw_version == CAM_CPAS_TITAN_680_V100) ||
(camera_hw_version == CAM_CPAS_TITAN_780_V100)) {
if (cam_caps & CPAS_TITAN_IPE0_CAP_BIT)
icp_hw_mgr.ipe0_enable = true;
if (cam_caps & CPAS_BPS_BIT)