Commit 3530ef0a authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] exynos4-is: Rename the ISP chain configuration data structure

More appropriate names for the ISP chain data structure.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a6f5635e
......@@ -79,18 +79,18 @@ int fimc_is_hw_wait_intmsr0_intmsd0(struct fimc_is *is)
int fimc_is_hw_set_param(struct fimc_is *is)
{
struct is_config_param *cfg = &is->cfg_param[is->scenario_id];
struct chain_config *config = &is->config[is->config_index];
unsigned int param_count = __get_pending_param_count(is);
fimc_is_hw_wait_intmsr0_intmsd0(is);
mcuctl_write(HIC_SET_PARAMETER, is, MCUCTL_REG_ISSR(0));
mcuctl_write(is->sensor_index, is, MCUCTL_REG_ISSR(1));
mcuctl_write(is->scenario_id, is, MCUCTL_REG_ISSR(2));
mcuctl_write(is->config_index, is, MCUCTL_REG_ISSR(2));
mcuctl_write(param_count, is, MCUCTL_REG_ISSR(3));
mcuctl_write(cfg->p_region_index1, is, MCUCTL_REG_ISSR(4));
mcuctl_write(cfg->p_region_index2, is, MCUCTL_REG_ISSR(5));
mcuctl_write(config->p_region_index1, is, MCUCTL_REG_ISSR(4));
mcuctl_write(config->p_region_index2, is, MCUCTL_REG_ISSR(5));
fimc_is_hw_set_intgr0_gd0(is);
return 0;
......@@ -174,10 +174,10 @@ int fimc_is_hw_change_mode(struct fimc_is *is)
HIC_CAPTURE_STILL, HIC_CAPTURE_VIDEO,
};
if (WARN_ON(is->scenario_id > ARRAY_SIZE(cmd)))
if (WARN_ON(is->config_index > ARRAY_SIZE(cmd)))
return -EINVAL;
mcuctl_write(cmd[is->scenario_id], is, MCUCTL_REG_ISSR(0));
mcuctl_write(cmd[is->config_index], is, MCUCTL_REG_ISSR(0));
mcuctl_write(is->sensor_index, is, MCUCTL_REG_ISSR(1));
mcuctl_write(is->setfile.sub_index, is, MCUCTL_REG_ISSR(2));
fimc_is_hw_set_intgr0_gd0(is);
......@@ -238,6 +238,6 @@ int fimc_is_itf_mode_change(struct fimc_is *is)
FIMC_IS_CONFIG_TIMEOUT);
if (!ret < 0)
dev_err(&is->pdev->dev, "%s(): mode change (%d) timeout\n",
__func__, is->scenario_id);
__func__, is->config_index);
return ret;
}
......@@ -530,8 +530,8 @@ static void fimc_is_general_irq_handler(struct fimc_is *is)
break;
case HIC_SET_PARAMETER:
is->cfg_param[is->scenario_id].p_region_index1 = 0;
is->cfg_param[is->scenario_id].p_region_index2 = 0;
is->config[is->config_index].p_region_index1 = 0;
is->config[is->config_index].p_region_index2 = 0;
set_bit(IS_ST_BLOCK_CMD_CLEARED, &is->state);
pr_debug("HIC_SET_PARAMETER\n");
break;
......@@ -590,8 +590,8 @@ static void fimc_is_general_irq_handler(struct fimc_is *is)
switch (is->i2h_cmd.args[0]) {
case HIC_SET_PARAMETER:
is->cfg_param[is->scenario_id].p_region_index1 = 0;
is->cfg_param[is->scenario_id].p_region_index2 = 0;
is->config[is->config_index].p_region_index1 = 0;
is->config[is->config_index].p_region_index2 = 0;
set_bit(IS_ST_BLOCK_CMD_CLEARED, &is->state);
break;
}
......@@ -656,7 +656,7 @@ static int fimc_is_hw_open_sensor(struct fimc_is *is,
int fimc_is_hw_initialize(struct fimc_is *is)
{
const int scenario_ids[] = {
const int config_ids[] = {
IS_SC_PREVIEW_STILL, IS_SC_PREVIEW_VIDEO,
IS_SC_CAPTURE_STILL, IS_SC_CAPTURE_VIDEO
};
......@@ -718,23 +718,23 @@ int fimc_is_hw_initialize(struct fimc_is *is)
}
/* Preserve previous mode. */
prev_id = is->scenario_id;
prev_id = is->config_index;
/* Set initial parameter values. */
for (i = 0; i < ARRAY_SIZE(scenario_ids); i++) {
is->scenario_id = scenario_ids[i];
for (i = 0; i < ARRAY_SIZE(config_ids); i++) {
is->config_index = config_ids[i];
fimc_is_set_initial_params(is);
ret = fimc_is_itf_s_param(is, true);
if (ret < 0) {
is->scenario_id = prev_id;
is->config_index = prev_id;
return ret;
}
}
is->scenario_id = prev_id;
is->config_index = prev_id;
set_bit(IS_ST_INIT_DONE, &is->state);
dev_info(dev, "initialization sequence completed (%d)\n",
is->scenario_id);
is->config_index);
return 0;
}
......
......@@ -219,7 +219,7 @@ struct fimc_is_setfile {
u32 base;
};
struct is_config_param {
struct chain_config {
struct global_param global;
struct sensor_param sensor;
struct isp_param isp;
......@@ -279,12 +279,13 @@ struct fimc_is {
struct h2i_cmd h2i_cmd;
struct is_fd_result_header fd_header;
struct is_config_param cfg_param[IS_SC_MAX];
struct chain_config config[IS_SC_MAX];
unsigned config_index;
struct is_region *is_p_region;
dma_addr_t is_dma_p_region;
struct is_share_region *is_shared_region;
struct is_af_info af;
u32 scenario_id;
struct dentry *debugfs_entry;
};
......@@ -301,7 +302,7 @@ static inline void fimc_is_mem_barrier(void)
static inline void fimc_is_set_param_bit(struct fimc_is *is, int num)
{
struct is_config_param *cfg = &is->cfg_param[is->scenario_id];
struct chain_config *cfg = &is->config[is->config_index];
if (num >= 32)
set_bit(num - 32, &cfg->p_region_index2);
......
......@@ -236,7 +236,7 @@ static int fimc_isp_subdev_s_stream(struct v4l2_subdev *sd, int on)
}
v4l2_dbg(1, debug, sd, "changing mode to %d\n",
is->scenario_id);
is->config_index);
ret = fimc_is_itf_mode_change(is);
if (ret)
return -EINVAL;
......@@ -317,8 +317,8 @@ static int fimc_isp_subdev_s_power(struct v4l2_subdev *sd, int on)
clear_bit(IS_ST_PWR_ON, &is->state);
clear_bit(IS_ST_INIT_DONE, &is->state);
is->state = 0;
is->cfg_param[is->scenario_id].p_region_index1 = 0;
is->cfg_param[is->scenario_id].p_region_index2 = 0;
is->config[is->config_index].p_region_index1 = 0;
is->config[is->config_index].p_region_index2 = 0;
set_bit(IS_ST_IDLE, &is->state);
wmb();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment