Commit ade6b4c2 authored by Kate Hsuan's avatar Kate Hsuan Committed by Mauro Carvalho Chehab

media: atomisp: sh_css: Removed #ifdef ISP2401 to make driver generic

Removed #ifdef ISP2401 to expose ia_css_stream_configure_rx() for ISP2400.

Link: https://lore.kernel.org/r/20230802095606.1298152-9-hpa@redhat.comSigned-off-by: default avatarKate Hsuan <hpa@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent d1f3bed6
...@@ -56,9 +56,7 @@ ...@@ -56,9 +56,7 @@
#include "assert_support.h" #include "assert_support.h"
#include "math_support.h" #include "math_support.h"
#include "sw_event_global.h" /* Event IDs.*/ #include "sw_event_global.h" /* Event IDs.*/
#if !defined(ISP2401)
#include "ia_css_ifmtr.h" #include "ia_css_ifmtr.h"
#endif
#include "input_system.h" #include "input_system.h"
#include "mmu_device.h" /* mmu_set_page_table_base_index(), ... */ #include "mmu_device.h" /* mmu_set_page_table_base_index(), ... */
#include "ia_css_mmu_private.h" /* sh_css_mmu_set_page_table_base_index() */ #include "ia_css_mmu_private.h" /* sh_css_mmu_set_page_table_base_index() */
...@@ -345,7 +343,6 @@ static struct sh_css_hmm_buffer_record ...@@ -345,7 +343,6 @@ static struct sh_css_hmm_buffer_record
*sh_css_hmm_buffer_record_validate(ia_css_ptr ddr_buffer_addr, *sh_css_hmm_buffer_record_validate(ia_css_ptr ddr_buffer_addr,
enum ia_css_buffer_type type); enum ia_css_buffer_type type);
#ifdef ISP2401
static unsigned int get_crop_lines_for_bayer_order(const struct static unsigned int get_crop_lines_for_bayer_order(const struct
ia_css_stream_config *config); ia_css_stream_config *config);
static unsigned int get_crop_columns_for_bayer_order(const struct static unsigned int get_crop_columns_for_bayer_order(const struct
...@@ -353,8 +350,6 @@ static unsigned int get_crop_columns_for_bayer_order(const struct ...@@ -353,8 +350,6 @@ static unsigned int get_crop_columns_for_bayer_order(const struct
static void get_pipe_extra_pixel(struct ia_css_pipe *pipe, static void get_pipe_extra_pixel(struct ia_css_pipe *pipe,
unsigned int *extra_row, unsigned int *extra_column); unsigned int *extra_row, unsigned int *extra_column);
#endif
static void static void
sh_css_pipe_free_shading_table(struct ia_css_pipe *pipe) sh_css_pipe_free_shading_table(struct ia_css_pipe *pipe)
{ {
...@@ -7971,7 +7966,6 @@ ia_css_pipe_override_frame_format(struct ia_css_pipe *pipe, ...@@ -7971,7 +7966,6 @@ ia_css_pipe_override_frame_format(struct ia_css_pipe *pipe,
return err; return err;
} }
#if !defined(ISP2401)
/* Configuration of INPUT_SYSTEM_VERSION_2401 is done on SP */ /* Configuration of INPUT_SYSTEM_VERSION_2401 is done on SP */
static int static int
ia_css_stream_configure_rx(struct ia_css_stream *stream) ia_css_stream_configure_rx(struct ia_css_stream *stream)
...@@ -8014,7 +8008,6 @@ ia_css_stream_configure_rx(struct ia_css_stream *stream) ...@@ -8014,7 +8008,6 @@ ia_css_stream_configure_rx(struct ia_css_stream *stream)
stream->reconfigure_css_rx = true; stream->reconfigure_css_rx = true;
return 0; return 0;
} }
#endif
static struct ia_css_pipe * static struct ia_css_pipe *
find_pipe(struct ia_css_pipe *pipes[], unsigned int num_pipes, find_pipe(struct ia_css_pipe *pipes[], unsigned int num_pipes,
...@@ -8100,9 +8093,7 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config, ...@@ -8100,9 +8093,7 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config,
/* check if mipi size specified */ /* check if mipi size specified */
if (stream_config->mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR) if (stream_config->mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR)
#ifdef ISP2401 if (!IS_ISP2401 || (IS_ISP2401 && !stream_config->online))
if (!stream_config->online)
#endif
{ {
unsigned int port = (unsigned int)stream_config->source.port.port; unsigned int port = (unsigned int)stream_config->source.port.port;
...@@ -8203,32 +8194,31 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config, ...@@ -8203,32 +8194,31 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config,
switch (curr_stream->config.mode) { switch (curr_stream->config.mode) {
case IA_CSS_INPUT_MODE_SENSOR: case IA_CSS_INPUT_MODE_SENSOR:
case IA_CSS_INPUT_MODE_BUFFERED_SENSOR: case IA_CSS_INPUT_MODE_BUFFERED_SENSOR:
#if !defined(ISP2401) if (!IS_ISP2401)
ia_css_stream_configure_rx(curr_stream); ia_css_stream_configure_rx(curr_stream);
#endif
break; break;
case IA_CSS_INPUT_MODE_TPG: case IA_CSS_INPUT_MODE_TPG:
#if !defined(ISP2401) if (!IS_ISP2401) {
IA_CSS_LOG("tpg_configuration: x_mask=%d, y_mask=%d, x_delta=%d, y_delta=%d, xy_mask=%d", IA_CSS_LOG("tpg_configuration: x_mask=%d, y_mask=%d, x_delta=%d, y_delta=%d, xy_mask=%d",
curr_stream->config.source.tpg.x_mask, curr_stream->config.source.tpg.x_mask,
curr_stream->config.source.tpg.y_mask, curr_stream->config.source.tpg.y_mask,
curr_stream->config.source.tpg.x_delta, curr_stream->config.source.tpg.x_delta,
curr_stream->config.source.tpg.y_delta, curr_stream->config.source.tpg.y_delta,
curr_stream->config.source.tpg.xy_mask); curr_stream->config.source.tpg.xy_mask);
sh_css_sp_configure_tpg( sh_css_sp_configure_tpg(
curr_stream->config.source.tpg.x_mask, curr_stream->config.source.tpg.x_mask,
curr_stream->config.source.tpg.y_mask, curr_stream->config.source.tpg.y_mask,
curr_stream->config.source.tpg.x_delta, curr_stream->config.source.tpg.x_delta,
curr_stream->config.source.tpg.y_delta, curr_stream->config.source.tpg.y_delta,
curr_stream->config.source.tpg.xy_mask); curr_stream->config.source.tpg.xy_mask);
#endif }
break; break;
case IA_CSS_INPUT_MODE_PRBS: case IA_CSS_INPUT_MODE_PRBS:
#if !defined(ISP2401) if (!IS_ISP2401) {
IA_CSS_LOG("mode prbs"); IA_CSS_LOG("mode prbs");
sh_css_sp_configure_prbs(curr_stream->config.source.prbs.seed); sh_css_sp_configure_prbs(curr_stream->config.source.prbs.seed);
#endif }
break; break;
case IA_CSS_INPUT_MODE_MEMORY: case IA_CSS_INPUT_MODE_MEMORY:
IA_CSS_LOG("mode memory"); IA_CSS_LOG("mode memory");
......
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