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 {
26 char *css_version;
27
28 if (!IS_ISP2401)
29 css_version = ISP2400_CSS_VERSION_STRING;
30 else
31 css_version = ISP2401_CSS_VERSION_STRING;
32
33 if (max_size <= (int)strlen(css_version) + (int)strlen(sh_css_get_fw_version()) + 5)
34 return -EINVAL;
35 strscpy(version, css_version, max_size);
36 strcat(version, "FW:");
37 strcat(version, sh_css_get_fw_version());
38 strcat(version, "; ");
39 return 0;
40 }
41