Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
techpack: camera: Guard L3A specific camera driver modifications
Browse files Browse the repository at this point in the history
Change-Id: I073daf496cfff0d8589ff7089232820bd2f3a97e
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
  • Loading branch information
UtsavBalar1231 committed Apr 20, 2022
1 parent 36096da commit c852d3b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -694,11 +694,20 @@ static int cam_ife_csid_global_reset(struct cam_ife_csid_hw *csid_hw)
cam_io_w_mb(0x2, soc_info->reg_map[0].mem_base +
csid_reg->rdi_reg[i]->csid_rdi_cfg0_addr);

#ifdef CONFIG_BOARD_PSYCHE
/* reset SW regs first, then HW */
rc = cam_ife_csid_reset_regs(csid_hw, false);
#else
/* reset HW regs first, then SW */
rc = cam_ife_csid_reset_regs(csid_hw, true);
#endif
if (rc < 0)
goto end;
#ifdef CONFIG_BOARD_PSYCHE
rc = cam_ife_csid_reset_regs(csid_hw, true);
#else
rc = cam_ife_csid_reset_regs(csid_hw, false);
#endif
if (rc < 0)
goto end;

Expand Down
4 changes: 4 additions & 0 deletions techpack/camera/drivers/cam_req_mgr/cam_req_mgr_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@
#include "cam_debug_util.h"
#include "cam_common_util.h"

#ifdef CONFIG_BOARD_PSYCHE
/* Xiaomi: enlarge from 60 to 120 */
#define CAM_REQ_MGR_EVENT_MAX 120
#else
#define CAM_REQ_MGR_EVENT_MAX 60
#endif

static struct cam_req_mgr_device g_dev;
struct kmem_cache *g_cam_req_mgr_timer_cachep;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,7 @@ int cam_flash_pmic_gpio_pkt_parser(
"Apply setting failed: %d",
rc);

#ifdef CONFIG_BOARD_PSYCHE
//xiaomi add start
if(rc && CAM_FLASH_STATE_START == fctrl->flash_state)
{
Expand All @@ -1546,6 +1547,7 @@ int cam_flash_pmic_gpio_pkt_parser(
return rc;
}
//xiaomi add end
#endif

fctrl->flash_state = CAM_FLASH_STATE_CONFIG;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,7 @@ static int cam_ois_get_data(struct cam_ois_ctrl_t *o_ctrl,
t_now = get_cycles();
boottime64 = (uint64_t)((ts64.tv_sec * 1000000000) + ts64.tv_nsec);

#ifdef CONFIG_BOARD_PSYCHE
if (o_ctrl->opcode.ois_get_data != 0) {
uint32_t ois_addr = (o_ctrl->opcode.ois_get_data & 0xFFFF0000) >> 16;
uint32_t ois_addr_type = o_ctrl->opcode.ois_get_data & 0xFFFF;
Expand All @@ -1011,11 +1012,14 @@ static int cam_ois_get_data(struct cam_ois_ctrl_t *o_ctrl,
ois_addr_type, CAMERA_SENSOR_I2C_TYPE_BYTE,
num_data);
} else {
#endif
rc = camera_io_dev_read_seq(&(o_ctrl->io_master_info),
OIS_DATA_ADDR, o_ctrl->ois_data.data,
CAMERA_SENSOR_I2C_TYPE_BYTE, CAMERA_SENSOR_I2C_TYPE_BYTE,
num_data);
#ifdef CONFIG_BOARD_PSYCHE
}
#endif
o_ctrl->ois_data.data_timestamp = (uint64_t)(t_now*10000/192);//< QTimer Freq = 19.2 MHz

if (rc < 0) {
Expand Down
2 changes: 2 additions & 0 deletions techpack/camera/include/uapi/media/cam_sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ struct cam_ois_opcode {
uint32_t coeff;
uint32_t pheripheral;
uint32_t memory;
#ifdef CONFIG_BOARD_PSYCHE
uint32_t ois_get_data;
#endif
uint8_t fw_addr_type;
uint8_t is_addr_increase;
uint8_t is_addr_indata;
Expand Down

0 comments on commit c852d3b

Please sign in to comment.