GNU Linux-libre 4.14.313-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / sh_css_version.c
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14
15 #include "ia_css_version.h"
16 #include "ia_css_version_data.h"
17 #include "ia_css_err.h"
18 #include "sh_css_firmware.h"
19
20 enum ia_css_err
21 ia_css_get_version(char *version, int max_size)
22 {
23         if (max_size <= (int)strlen(CSS_VERSION_STRING) + (int)strlen(sh_css_get_fw_version()) + 5)
24                 return IA_CSS_ERR_INVALID_ARGUMENTS;
25         strcpy(version, CSS_VERSION_STRING);
26         strcat(version, "FW:");
27         strcat(version, sh_css_get_fw_version());
28         strcat(version, "; ");
29         return IA_CSS_SUCCESS;
30 }