kernel-4.9/drivers/misc/mediatek/imgsensor/src/common/v1/imgsensor_i2c.c 添加i2c_DRV_NAME_3
{IMGSENSOR_I2C_DRV_NAME_3, 0},
static const struct of_device_id gof_device_id_3[] = {
{ .compatible = IMGSENSOR_I2C_OF_DRV_NAME_3, },
{}
};
static int
imgsensor_i2c_probe_3(struct i2c_client *client, const struct i2c_device_id *id)
{
gi2c.inst[IMGSENSOR_I2C_DEV_3].pi2c_client = client;
return 0;
}
{
.probe = imgsensor_i2c_probe_3,
.remove = imgsensor_i2c_remove,
.driver = {
.name = IMGSENSOR_I2C_DRV_NAME_3,
.owner = THIS_MODULE,
#ifdef CONFIG_OF
.of_match_table = gof_device_id_3,
#endif
},
.id_table = gi2c_dev_id,
}
添加上电 kernel-4.9/drivers/misc/mediatek/imgsensor/src/mt6761/camera_hw/imgsensor_cfg_table.c
IMGSENSOR_SENSOR_IDX_SUB2,
IMGSENSOR_I2C_DEV_3,
kernel-4.9/drivers/misc/mediatek/imgsensor/src/mt6761/camera_hw/imgsensor_cfg_table.h
#define IMGSENSOR_I2C_DRV_NAME_3 "kd_camera_hw_bus4"
#define IMGSENSOR_I2C_OF_DRV_NAME_3 "mediatek,camera_sub_two"
enum IMGSENSOR_I2C_DEV {
IMGSENSOR_I2C_DEV_0,
IMGSENSOR_I2C_DEV_1,
IMGSENSOR_I2C_DEV_2,
IMGSENSOR_I2C_DEV_3,
IMGSENSOR_I2C_DEV_MAX_NUM,
};
dws中添加上电
SUB_CAMERA_2_POWER_D
SUB_CAMERA_2_POWER_A
<device1>
<varName>CAMERA_SUB_TWO</varName>
<channel>I2C_CHANNEL_1</channel>
<address>0x2D</address>
</device1>
修改MCLK vendor/mediatek/proprietary/custom/mt6765/hal/imgsensor_src/cfg_setting_imgsensor.cpp
{
.sensorIdx = IMGSENSOR_SENSOR_IDX_SUB2,
.mclk = eMclk_4,
.port = EMipiPort_CSI0B,
.dir = CUSTOM_CFG_DIR_FRONT,
.bitOrder = CUSTOM_CFG_BITORDER_9_2,
.orientation = 270,
.horizontalFov = 75,
.verticalFov = 60,
.PadPclkInv = 0,
},
{
.sensorIdx = IMGSENSOR_SENSOR_IDX_MAIN3,
.mclk = eMclk_4,
.port = EMipiPort_CSI0B,
.dir = CUSTOM_CFG_DIR_REAR,
.bitOrder = CUSTOM_CFG_BITORDER_9_2,
.orientation = 90,
.horizontalFov = 75,
.verticalFov = 60,
.PadPclkInv = 0,
},
添加四摄切换 vendor\mediatek\proprietary\packages\apps\Camera2\feature\setting\cameraswitcher\src\com\mediatek\camera\feature\setting\CameraSwitcher.java
private static final String CAMERA_FACING_BACK2 = "back2";
private static final int CAMERA_FACING_BACK2_VALUE = 2;
private static final String CAMERA_FACING_BACK3 = "back3";
private static final int CAMERA_FACING_BACK3_VALUE = 3;
if (characteristics != null) {
int facing = characteristics.get(CameraCharacteristics.LENS_FACING);
if (facing == CameraMetadata.LENS_FACING_FRONT) {
facingString = CAMERA_FACING_FRONT;
}
else if (facing == CAMERA_FACING_BACK2_VALUE) {
facingString = CAMERA_FACING_BACK2;
}
else if (facing == CAMERA_FACING_BACK3_VALUE) {
facingString = CAMERA_FACING_BACK3;
} else {
facingString = CAMERA_FACING_BACK;
}
......
if (nextFacing.equals(CAMERA_FACING_BACK) && CameraUtil.getDualZoomId() != null) {
newCameraId = CameraUtil.getDualZoomId();
}
if(mFacing.equals(CAMERA_FACING_BACK))
nextFacing=CAMERA_FACING_FRONT;
else if(mFacing.equals(CAMERA_FACING_FRONT))
{
nextFacing=CAMERA_FACING_BACK2;
newCameraId=Integer.toString(2);
}
else if(mFacing.equals(CAMERA_FACING_BACK2))
{
nextFacing=CAMERA_FACING_BACK3;
newCameraId=Integer.toString(3);
}
else if(mFacing.equals(CAMERA_FACING_BACK3))
nextFacing=CAMERA_FACING_BACK;
Projectconfig
MTK_CAM_MAX_NUMBER_OF_CAMERA = 4
|