1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  */
6 
7 #include "../../include/linux/atomisp.h"
8 #include "../../include/linux/atomisp_platform.h"
9 #include "ia_css_version.h"
10 #include "ia_css_version_data.h"
11 #include "ia_css_err.h"
12 #include "sh_css_firmware.h"
13 
14 int
ia_css_get_version(char * version,int max_size)15 ia_css_get_version(char *version, int max_size)
16 {
17 	char *css_version;
18 
19 	if (!IS_ISP2401)
20 		css_version = ISP2400_CSS_VERSION_STRING;
21 	else
22 		css_version = ISP2401_CSS_VERSION_STRING;
23 
24 	if (max_size <= (int)strlen(css_version) + (int)strlen(sh_css_get_fw_version()) + 5)
25 		return -EINVAL;
26 	strscpy(version, css_version, max_size);
27 	strcat(version, "FW:");
28 	strcat(version, sh_css_get_fw_version());
29 	strcat(version, "; ");
30 	return 0;
31 }
32