diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-07 18:33:29 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-20 12:32:20 +0200 |
commit | 8568fe630066a733456fb1ffc8e1402191d7e27c (patch) | |
tree | 12139f606bc6d592f26a84f029fd79762efccdd0 /drivers/staging/media/atomisp/pci/sh_css.c | |
parent | 1ab709827c08619c7b2401ea7e0769a9b70846fe (diff) | |
download | linux-8568fe630066a733456fb1ffc8e1402191d7e27c.tar.bz2 |
media: atomisp: print a better message when fw version is wrong
The printed message when a firmware version is wrong says nothing
usefull:
atomisp-isp2 0000:00:03.0: Fw version check failed.
atomisp-isp2: probe of 0000:00:03.0 failed with error -22
Print the expected and the received firmware version instead.
In order to do that, the firmware functions will need at least
a struct device pointer, so pass it.
While writing this patch, it was noticed that some of the
abstraction layers of this driver have functions that are never
called, but use this interface. Get rid of them.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/pci/sh_css.c')
-rw-r--r-- | drivers/staging/media/atomisp/pci/sh_css.c | 87 |
1 files changed, 4 insertions, 83 deletions
diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c index 27cbc57846bb..af77fb57282f 100644 --- a/drivers/staging/media/atomisp/pci/sh_css.c +++ b/drivers/staging/media/atomisp/pci/sh_css.c @@ -1619,19 +1619,8 @@ ia_css_reset_defaults(struct sh_css *css) *css = default_css; } -bool -ia_css_check_firmware_version(const struct ia_css_fw *fw) -{ - bool retval = false; - - if (fw) { - retval = sh_css_check_firmware_version(fw->data); - } - return retval; -} - enum ia_css_err -ia_css_load_firmware(const struct ia_css_env *env, +ia_css_load_firmware(struct device *dev, const struct ia_css_env *env, const struct ia_css_fw *fw) { enum ia_css_err err; @@ -1650,7 +1639,7 @@ ia_css_load_firmware(const struct ia_css_env *env, } ia_css_unload_firmware(); /* in case we are called twice */ - err = sh_css_load_firmware(fw->data, fw->bytes); + err = sh_css_load_firmware(dev, fw->data, fw->bytes); if (err == IA_CSS_SUCCESS) { err = ia_css_binary_init_infos(); @@ -1663,7 +1652,7 @@ ia_css_load_firmware(const struct ia_css_env *env, } enum ia_css_err -ia_css_init(const struct ia_css_env *env, +ia_css_init(struct device *dev, const struct ia_css_env *env, const struct ia_css_fw *fw, u32 mmu_l1_base, enum ia_css_irq_type irq_type) { @@ -1791,7 +1780,7 @@ ia_css_init(const struct ia_css_env *env, if (fw) { ia_css_unload_firmware(); /* in case we already had firmware loaded */ - err = sh_css_load_firmware(fw->data, fw->bytes); + err = sh_css_load_firmware(dev, fw->data, fw->bytes); if (err != IA_CSS_SUCCESS) { IA_CSS_LEAVE_ERR(err); return err; @@ -1859,74 +1848,6 @@ ia_css_init(const struct ia_css_env *env, return err; } -enum ia_css_err ia_css_suspend(void) -{ - int i; - - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_suspend() enter\n"); - my_css_save.mode = sh_css_mode_suspend; - for (i = 0; i < MAX_ACTIVE_STREAMS; i++) - if (my_css_save.stream_seeds[i].stream) { - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "==*> unloading seed %d (%p)\n", i, - my_css_save.stream_seeds[i].stream); - ia_css_stream_unload(my_css_save.stream_seeds[i].stream); - } - my_css_save.mode = sh_css_mode_working; - ia_css_stop_sp(); - ia_css_uninit(); - for (i = 0; i < MAX_ACTIVE_STREAMS; i++) - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "==*> after 1: seed %d (%p)\n", i, - my_css_save.stream_seeds[i].stream); - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_suspend() leave\n"); - return IA_CSS_SUCCESS; -} - -enum ia_css_err -ia_css_resume(void) { - int i, j; - enum ia_css_err err; - - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_resume() enter: void\n"); - - err = ia_css_init(&my_css_save.driver_env, my_css_save.loaded_fw, my_css_save.mmu_base, my_css_save.irq_type); - if (err != IA_CSS_SUCCESS) - return err; - err = ia_css_start_sp(); - if (err != IA_CSS_SUCCESS) - return err; - my_css_save.mode = sh_css_mode_resume; - for (i = 0; i < MAX_ACTIVE_STREAMS; i++) - { - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "==*> seed stream %p\n", - my_css_save.stream_seeds[i].stream); - if (my_css_save.stream_seeds[i].stream) { - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "==*> loading seed %d\n", i); - err = ia_css_stream_load(my_css_save.stream_seeds[i].stream); - if (err != IA_CSS_SUCCESS) { - if (i) - for (j = 0; j < i; j++) - ia_css_stream_unload(my_css_save.stream_seeds[j].stream); - return err; - } - err = ia_css_stream_start(my_css_save.stream_seeds[i].stream); - if (err != IA_CSS_SUCCESS) { - for (j = 0; j <= i; j++) { - ia_css_stream_stop(my_css_save.stream_seeds[j].stream); - ia_css_stream_unload(my_css_save.stream_seeds[j].stream); - } - return err; - } - *my_css_save.stream_seeds[i].orig_stream = my_css_save.stream_seeds[i].stream; - for (j = 0; j < my_css_save.stream_seeds[i].num_pipes; j++) - *my_css_save.stream_seeds[i].orig_pipes[j] = - my_css_save.stream_seeds[i].pipes[j]; - } - } - my_css_save.mode = sh_css_mode_working; - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "ia_css_resume() leave: return_void\n"); - return IA_CSS_SUCCESS; -} - enum ia_css_err ia_css_enable_isys_event_queue(bool enable) { if (sh_css_sp_is_running()) |