做项目的时候,经常会遇到新物料导入,我们一般叫二供,换了一家供应商,换不换供应商,我们这些做技术的小喽啰说了不算。当然大家都知道,这个和公司的采购强相关,当然和采购的老大更是密不可分.........................听说某大厂的采购老大,在深圳已经买了好几套房子了。当然,我们做好这颗料的兼容就行了,下面介绍一下高通8909平台(可以当古董拍卖的平台)如何兼容一颗新的camera。
\kernel\drivers\media\platform\msm\camera_v2\sensor\msm_sensor.c
int msm_sensor_match_id(struct msm_sensor_ctrl_t *s_ctrl)
{
int rc = 0;
uint16_t chipid = 0;
uint16_t module_id = -1;
struct msm_camera_i2c_client *sensor_i2c_client;
struct msm_camera_slave_info *slave_info;
const char *sensor_name;
if (!s_ctrl) {
pr_err("%s:%d failed: %pK\n",
__func__, __LINE__, s_ctrl);
return -EINVAL;
}
sensor_i2c_client = s_ctrl->sensor_i2c_client;
slave_info = s_ctrl->sensordata->slave_info;
sensor_name = s_ctrl->sensordata->sensor_name;
if (!sensor_i2c_client || !slave_info || !sensor_name) {
pr_err("%s:%d failed: %pK %pK %pK\n",
__func__, __LINE__, sensor_i2c_client, slave_info,
sensor_name);
return -EINVAL;
}
rc = sensor_i2c_client->i2c_func_tbl->i2c_read(
sensor_i2c_client, slave_info->sensor_id_reg_addr,
&chipid, MSM_CAMERA_I2C_WORD_DATA);
if (rc < 0) {
pr_err("LIWANCHAO %s: %s: read id failed\n", __func__, sensor_name);
return rc;
}
pr_err("LIWANCHAO,%s: line = %d,%s,read id: 0x%x expected id 0x%x:\n",
__func__, __LINE__,sensor_name, chipid, slave_info->sensor_id);
//add by liwanchao satrt
if(!strcmp(sensor_name, "ov5675_truly") || !strcmp(sensor_name, "ov5675_back"))
{
pr_err("LIWANCHAO,%s,%d,%s,\n",__func__,__LINE__,sensor_name);
rc = sensor_i2c_client->i2c_func_tbl->i2c_write(
sensor_i2c_client, 0x0100,
0x01, MSM_CAMERA_I2C_BYTE_DATA);
if (rc < 0) {
pr_err("%s: %s: otp_read id failed\n", __func__, sensor_name);
return rc;
}
rc = sensor_i2c_client->i2c_func_tbl->i2c_write(
sensor_i2c_client, 0x5001,
0x02, MSM_CAMERA_I2C_BYTE_DATA);
if (rc < 0) {
pr_err("%s: %s: otp_read id failed\n", __func__, sensor_name);
return rc;
}
rc = sensor_i2c_client->i2c_func_tbl->i2c_write(
sensor_i2c_client, 0x3d84,
0xc0, MSM_CAMERA_I2C_BYTE_DATA);
if (rc < 0) {
pr_err("%s: %s: otp_read id failed\n", __func__, sensor_name);
return rc;
}
rc = sensor_i2c_client->i2c_func_tbl->i2c_write(
sensor_i2c_client, 0x3d88,
0x70, MSM