1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Support for Intel Camera Imaging ISP subsystem.
4 * Copyright (c) 2015, Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16 #include "../../include/linux/atomisp.h"
17 #include "../../include/linux/atomisp_platform.h"
18 #include "ia_css_version.h"
19 #include "ia_css_version_data.h"
20 #include "ia_css_err.h"
21 #include "sh_css_firmware.h"
22
23 int
ia_css_get_version(char * version,int max_size)24 ia_css_get_version(char *version, int max_size) {
25 char *css_version;
26
27 if (!IS_ISP2401)
28 css_version = ISP2400_CSS_VERSION_STRING;
29 else
30 css_version = ISP2401_CSS_VERSION_STRING;
31
32 if (max_size <= (int)strlen(css_version) + (int)strlen(sh_css_get_fw_version()) + 5)
33 return -EINVAL;
34 strscpy(version, css_version, max_size);
35 strcat(version, "FW:");
36 strcat(version, sh_css_get_fw_version());
37 strcat(version, "; ");
38 return 0;
39 }
40