media: atomisp: allow passing firmware name at modprobe time

It can be useful to be able to test different firmware files
at modprobe time, in order to be able to test different
variants without much efforts.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Mauro Carvalho Chehab 2020-05-29 09:56:05 +02:00
parent 6a9c6ba7b7
commit 607e954ac5
1 changed files with 19 additions and 11 deletions

View File

@ -95,6 +95,10 @@ int mipicsi_flag;
module_param(mipicsi_flag, int, 0644);
MODULE_PARM_DESC(mipicsi_flag, "mipi csi compression predictor algorithm");
static char firmware_name[256];
module_param_string(firmware_name, firmware_name, sizeof(firmware_name), 0);
MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the default firmware name.");
/*set to 16x16 since this is the amount of lines and pixels the sensor
exports extra. If these are kept at the 10x8 that they were on, in yuv
downscaling modes incorrect resolutions where requested to the sensor
@ -1449,6 +1453,9 @@ atomisp_load_firmware(struct atomisp_device *isp)
if (skip_fwload)
return NULL;
if (firmware_name[0] != '\0') {
fw_path = firmware_name;
} else {
if ((isp->media_dev.hw_revision >> ATOMISP_HW_REVISION_SHIFT)
== ATOMISP_HW_REVISION_ISP2401)
fw_path = "shisp_2401a0_v21.bin";
@ -1462,6 +1469,7 @@ atomisp_load_firmware(struct atomisp_device *isp)
((ATOMISP_HW_REVISION_ISP2400 << ATOMISP_HW_REVISION_SHIFT)
| ATOMISP_HW_STEPPING_B0))
fw_path = "shisp_2400b0_v21.bin";
}
if (!fw_path) {
dev_err(isp->dev, "Unsupported hw_revision 0x%x\n",