techpack: camera: csiphy: Guard overriding csiphy register values

Xiaomi guarded that in a few branches, unfortunately not consistently.
This is a combination of the following branches:
venus-r-oss, mona-r-oss, haydn-r-oss, star-r-oss, odin-r-oss, lisa-r-oss, vili-r-oss

K2 uses this in venus-r-oss
K8 uses this in odin-r-oss
K11 uses this in haydn-r-oss and star-r-oss
J18 uses this in star-r-oss
K3S uses this in vili-r-oss

Change-Id: If940a64897dbc70134c14c4be1b64b390f2d8879
This commit is contained in:
Arian 2022-01-12 15:12:01 +00:00 committed by Giovanni Ricca
parent b08f895848
commit 153e92063a
No known key found for this signature in database

View File

@ -5,6 +5,7 @@
*/
#include <linux/module.h>
#include <linux/hwid.h>
#include <dt-bindings/msm/msm-camera.h>
@ -934,12 +935,19 @@ int32_t cam_csiphy_config_dev(struct csiphy_device *csiphy_dev,
}
//csiphy_3phase only
if ((csiphy_dev->csiphy_info[index].data_rate/1000000) > csiphy_hack_rate_mb)
{
for (i = 0; i < csiphy_override_cnt; i += 2)
if (get_hw_version_platform() == HARDWARE_PROJECT_J18 ||
get_hw_version_platform() == HARDWARE_PROJECT_K2 ||
get_hw_version_platform() == HARDWARE_PROJECT_K3S ||
get_hw_version_platform() == HARDWARE_PROJECT_K8 ||
get_hw_version_platform() == HARDWARE_PROJECT_K11 ||
get_hw_version_platform() == HARDWARE_PROJECT_K3S) {
if ((csiphy_dev->csiphy_info[index].data_rate/1000000) > csiphy_hack_rate_mb)
{
cam_io_w_mb(csiphy_override[i+1], csiphybase + csiphy_override[i]);
CAM_DBG(CAM_CSIPHY, "csiphy_cfg_override [0x%x, 0x%x]", csiphy_override[i], csiphy_override[i+1]);
for (i = 0; i < csiphy_override_cnt; i += 2)
{
cam_io_w_mb(csiphy_override[i+1], csiphybase + csiphy_override[i]);
CAM_DBG(CAM_CSIPHY, "csiphy_cfg_override [0x%x, 0x%x]", csiphy_override[i], csiphy_override[i+1]);
}
}
}
}