Commit 79adb947 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

media: atomisp: Remove never set file_input flag

After the file-injection support removal the file_input flag is
always false.

Remove the flag and replace any code checking it with the code-path
for when it is false.
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 5e61114e
...@@ -1308,9 +1308,7 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout) ...@@ -1308,9 +1308,7 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout)
bool depth_mode = false; bool depth_mode = false;
int i, ret, depth_cnt = 0; int i, ret, depth_cnt = 0;
if (!isp->sw_contex.file_input) atomisp_css_irq_enable(isp, IA_CSS_IRQ_INFO_CSS_RECEIVER_SOF, false);
atomisp_css_irq_enable(isp,
IA_CSS_IRQ_INFO_CSS_RECEIVER_SOF, false);
BUG_ON(isp->num_of_streams > MAX_STREAM_NUM); BUG_ON(isp->num_of_streams > MAX_STREAM_NUM);
...@@ -1396,16 +1394,11 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout) ...@@ -1396,16 +1394,11 @@ static void __atomisp_css_recover(struct atomisp_device *isp, bool isp_timeout)
atomisp_csi2_configure(asd); atomisp_csi2_configure(asd);
} }
if (!isp->sw_contex.file_input) { atomisp_css_irq_enable(isp, IA_CSS_IRQ_INFO_CSS_RECEIVER_SOF,
atomisp_css_irq_enable(isp, IA_CSS_IRQ_INFO_CSS_RECEIVER_SOF, atomisp_css_valid_sof(isp));
atomisp_css_valid_sof(isp));
if (atomisp_freq_scaling(isp, ATOMISP_DFS_MODE_AUTO, true) < 0) if (atomisp_freq_scaling(isp, ATOMISP_DFS_MODE_AUTO, true) < 0)
dev_dbg(isp->dev, "DFS auto failed while recovering!\n"); dev_dbg(isp->dev, "DFS auto failed while recovering!\n");
} else {
if (atomisp_freq_scaling(isp, ATOMISP_DFS_MODE_MAX, true) < 0)
dev_dbg(isp->dev, "DFS max failed while recovering!\n");
}
for (i = 0; i < isp->num_of_streams; i++) { for (i = 0; i < isp->num_of_streams; i++) {
struct atomisp_sub_device *asd; struct atomisp_sub_device *asd;
...@@ -1610,10 +1603,7 @@ void atomisp_wdt_work(struct work_struct *work) ...@@ -1610,10 +1603,7 @@ void atomisp_wdt_work(struct work_struct *work)
if (asd->streaming != ATOMISP_DEVICE_STREAMING_ENABLED) if (asd->streaming != ATOMISP_DEVICE_STREAMING_ENABLED)
continue; continue;
atomisp_wdt_refresh(asd, atomisp_wdt_refresh(asd, ATOMISP_ISP_TIMEOUT_DURATION);
isp->sw_contex.file_input ?
ATOMISP_ISP_FILE_TIMEOUT_DURATION :
ATOMISP_ISP_TIMEOUT_DURATION);
} }
} }
...@@ -1643,14 +1633,10 @@ void atomisp_css_flush(struct atomisp_device *isp) ...@@ -1643,14 +1633,10 @@ void atomisp_css_flush(struct atomisp_device *isp)
for (i = 0; i < isp->num_of_streams; i++) { for (i = 0; i < isp->num_of_streams; i++) {
struct atomisp_sub_device *asd = &isp->asd[i]; struct atomisp_sub_device *asd = &isp->asd[i];
if (asd->streaming != if (asd->streaming != ATOMISP_DEVICE_STREAMING_ENABLED)
ATOMISP_DEVICE_STREAMING_ENABLED)
continue; continue;
atomisp_wdt_refresh(asd, atomisp_wdt_refresh(asd, ATOMISP_ISP_TIMEOUT_DURATION);
isp->sw_contex.file_input ?
ATOMISP_ISP_FILE_TIMEOUT_DURATION :
ATOMISP_ISP_TIMEOUT_DURATION);
} }
dev_dbg(isp->dev, "atomisp css flush done\n"); dev_dbg(isp->dev, "atomisp css flush done\n");
} }
...@@ -1896,14 +1882,6 @@ irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr) ...@@ -1896,14 +1882,6 @@ irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr)
} }
out: out:
rt_mutex_unlock(&isp->mutex); rt_mutex_unlock(&isp->mutex);
for (i = 0; i < isp->num_of_streams; i++) {
asd = &isp->asd[i];
if (asd->streaming == ATOMISP_DEVICE_STREAMING_ENABLED
&& css_pipe_done[asd->index]
&& isp->sw_contex.file_input)
v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
video, s_stream, 1);
}
dev_dbg(isp->dev, "<%s\n", __func__); dev_dbg(isp->dev, "<%s\n", __func__);
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -5377,8 +5355,7 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev, ...@@ -5377,8 +5355,7 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev,
ia_css_frame_free(asd->raw_output_frame); ia_css_frame_free(asd->raw_output_frame);
asd->raw_output_frame = NULL; asd->raw_output_frame = NULL;
if (!asd->continuous_mode->val && if (!asd->continuous_mode->val && !asd->params.online_process &&
!asd->params.online_process && !isp->sw_contex.file_input &&
ia_css_frame_allocate_from_info(&asd->raw_output_frame, ia_css_frame_allocate_from_info(&asd->raw_output_frame,
raw_output_info)) raw_output_info))
return -ENOMEM; return -ENOMEM;
......
...@@ -628,7 +628,6 @@ static void atomisp_dev_init_struct(struct atomisp_device *isp) ...@@ -628,7 +628,6 @@ static void atomisp_dev_init_struct(struct atomisp_device *isp)
{ {
unsigned int i; unsigned int i;
isp->sw_contex.file_input = false;
isp->need_gfx_throttle = true; isp->need_gfx_throttle = true;
isp->isp_fatal_error = false; isp->isp_fatal_error = false;
isp->mipi_frame_size = 0; isp->mipi_frame_size = 0;
...@@ -915,7 +914,7 @@ static int atomisp_release(struct file *file) ...@@ -915,7 +914,7 @@ static int atomisp_release(struct file *file)
* The sink pad setting can only be cleared when all device nodes * The sink pad setting can only be cleared when all device nodes
* get released. * get released.
*/ */
if (!isp->sw_contex.file_input && asd->fmt_auto->val) { if (asd->fmt_auto->val) {
struct v4l2_mbus_framefmt isp_sink_fmt = { 0 }; struct v4l2_mbus_framefmt isp_sink_fmt = { 0 };
atomisp_subdev_set_ffmt(&asd->subdev, fh.state, atomisp_subdev_set_ffmt(&asd->subdev, fh.state,
...@@ -926,15 +925,6 @@ static int atomisp_release(struct file *file) ...@@ -926,15 +925,6 @@ static int atomisp_release(struct file *file)
if (atomisp_subdev_users(asd)) if (atomisp_subdev_users(asd))
goto done; goto done;
/* clear the sink pad for file input */
if (isp->sw_contex.file_input && asd->fmt_auto->val) {
struct v4l2_mbus_framefmt isp_sink_fmt = { 0 };
atomisp_subdev_set_ffmt(&asd->subdev, fh.state,
V4L2_SUBDEV_FORMAT_ACTIVE,
ATOMISP_SUBDEV_PAD_SINK, &isp_sink_fmt);
}
atomisp_css_free_stat_buffers(asd); atomisp_css_free_stat_buffers(asd);
atomisp_free_internal_buffers(asd); atomisp_free_internal_buffers(asd);
ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera, ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
......
...@@ -91,7 +91,6 @@ ...@@ -91,7 +91,6 @@
#define ATOMISP_ISP_TIMEOUT_DURATION (2 * HZ) #define ATOMISP_ISP_TIMEOUT_DURATION (2 * HZ)
#define ATOMISP_EXT_ISP_TIMEOUT_DURATION (6 * HZ) #define ATOMISP_EXT_ISP_TIMEOUT_DURATION (6 * HZ)
#define ATOMISP_ISP_FILE_TIMEOUT_DURATION (60 * HZ)
#define ATOMISP_WDT_KEEP_CURRENT_DELAY 0 #define ATOMISP_WDT_KEEP_CURRENT_DELAY 0
#define ATOMISP_ISP_MAX_TIMEOUT_COUNT 2 #define ATOMISP_ISP_MAX_TIMEOUT_COUNT 2
#define ATOMISP_CSS_STOP_TIMEOUT_US 200000 #define ATOMISP_CSS_STOP_TIMEOUT_US 200000
...@@ -202,7 +201,6 @@ struct atomisp_regs { ...@@ -202,7 +201,6 @@ struct atomisp_regs {
}; };
struct atomisp_sw_contex { struct atomisp_sw_contex {
bool file_input;
int power_state; int power_state;
int running_freq; int running_freq;
}; };
......
...@@ -737,7 +737,7 @@ static int atomisp_s_input(struct file *file, void *fh, unsigned int input) ...@@ -737,7 +737,7 @@ static int atomisp_s_input(struct file *file, void *fh, unsigned int input)
ret = v4l2_subdev_call(motor, core, s_power, 1); ret = v4l2_subdev_call(motor, core, s_power, 1);
} }
if (!isp->sw_contex.file_input && motor) if (motor)
ret = v4l2_subdev_call(motor, core, init, 1); ret = v4l2_subdev_call(motor, core, init, 1);
asd->input_curr = input; asd->input_curr = input;
...@@ -1841,8 +1841,6 @@ static int atomisp_streamon(struct file *file, void *fh, ...@@ -1841,8 +1841,6 @@ static int atomisp_streamon(struct file *file, void *fh,
atomic_set(&asd->sof_count, -1); atomic_set(&asd->sof_count, -1);
atomic_set(&asd->sequence, -1); atomic_set(&asd->sequence, -1);
atomic_set(&asd->sequence_temp, -1); atomic_set(&asd->sequence_temp, -1);
if (isp->sw_contex.file_input)
wdt_duration = ATOMISP_ISP_FILE_TIMEOUT_DURATION;
asd->params.dis_proj_data_valid = false; asd->params.dis_proj_data_valid = false;
asd->latest_preview_exp_id = 0; asd->latest_preview_exp_id = 0;
...@@ -1865,26 +1863,21 @@ static int atomisp_streamon(struct file *file, void *fh, ...@@ -1865,26 +1863,21 @@ static int atomisp_streamon(struct file *file, void *fh,
atomisp_setup_flash(asd); atomisp_setup_flash(asd);
} }
if (!isp->sw_contex.file_input) { atomisp_css_irq_enable(isp, IA_CSS_IRQ_INFO_CSS_RECEIVER_SOF,
atomisp_css_irq_enable(isp, IA_CSS_IRQ_INFO_CSS_RECEIVER_SOF, atomisp_css_valid_sof(isp));
atomisp_css_valid_sof(isp)); atomisp_csi2_configure(asd);
atomisp_csi2_configure(asd); /*
/* * set freq to max when streaming count > 1 which indicate
* set freq to max when streaming count > 1 which indicate * dual camera would run
* dual camera would run */
*/ if (atomisp_streaming_count(isp) > 1) {
if (atomisp_streaming_count(isp) > 1) { if (atomisp_freq_scaling(isp,
if (atomisp_freq_scaling(isp, ATOMISP_DFS_MODE_MAX, false) < 0)
ATOMISP_DFS_MODE_MAX, false) < 0)
dev_dbg(isp->dev, "DFS max mode failed!\n");
} else {
if (atomisp_freq_scaling(isp,
ATOMISP_DFS_MODE_AUTO, false) < 0)
dev_dbg(isp->dev, "DFS auto mode failed!\n");
}
} else {
if (atomisp_freq_scaling(isp, ATOMISP_DFS_MODE_MAX, false) < 0)
dev_dbg(isp->dev, "DFS max mode failed!\n"); dev_dbg(isp->dev, "DFS max mode failed!\n");
} else {
if (atomisp_freq_scaling(isp,
ATOMISP_DFS_MODE_AUTO, false) < 0)
dev_dbg(isp->dev, "DFS auto mode failed!\n");
} }
if (asd->depth_mode->val && atomisp_streaming_count(isp) == if (asd->depth_mode->val && atomisp_streaming_count(isp) ==
...@@ -2047,15 +2040,6 @@ int __atomisp_streamoff(struct file *file, void *fh, enum v4l2_buf_type type) ...@@ -2047,15 +2040,6 @@ int __atomisp_streamoff(struct file *file, void *fh, enum v4l2_buf_type type)
/* if other streams are running, should not disable watch dog */ /* if other streams are running, should not disable watch dog */
rt_mutex_unlock(&isp->mutex); rt_mutex_unlock(&isp->mutex);
atomisp_wdt_stop(asd, true); atomisp_wdt_stop(asd, true);
/*
* must stop sending pixels into GP_FIFO before stop
* the pipeline.
*/
if (isp->sw_contex.file_input)
v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
video, s_stream, 0);
rt_mutex_lock(&isp->mutex); rt_mutex_lock(&isp->mutex);
} }
...@@ -2072,10 +2056,7 @@ int __atomisp_streamoff(struct file *file, void *fh, enum v4l2_buf_type type) ...@@ -2072,10 +2056,7 @@ int __atomisp_streamoff(struct file *file, void *fh, enum v4l2_buf_type type)
} }
atomisp_clear_css_buffer_counters(asd); atomisp_clear_css_buffer_counters(asd);
atomisp_css_irq_enable(isp, IA_CSS_IRQ_INFO_CSS_RECEIVER_SOF, false);
if (!isp->sw_contex.file_input)
atomisp_css_irq_enable(isp, IA_CSS_IRQ_INFO_CSS_RECEIVER_SOF,
false);
if (asd->delayed_init == ATOMISP_DELAYED_INIT_QUEUED) { if (asd->delayed_init == ATOMISP_DELAYED_INIT_QUEUED) {
cancel_work_sync(&asd->delayed_init_work); cancel_work_sync(&asd->delayed_init_work);
...@@ -2128,9 +2109,8 @@ int __atomisp_streamoff(struct file *file, void *fh, enum v4l2_buf_type type) ...@@ -2128,9 +2109,8 @@ int __atomisp_streamoff(struct file *file, void *fh, enum v4l2_buf_type type)
!= atomisp_sensor_start_stream(asd)) != atomisp_sensor_start_stream(asd))
return 0; return 0;
if (!isp->sw_contex.file_input) ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera, video, s_stream, 0);
video, s_stream, 0);
if (isp->flash) { if (isp->flash) {
asd->params.num_flash_frames = 0; asd->params.num_flash_frames = 0;
......
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