Merge tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / include / uapi / sound / sof / abi.h
blobfe2cfae94b45fda3c27a643dbc7431dc96dac98b
1 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2 /*
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
6 * Copyright(c) 2018 Intel Corporation. All rights reserved.
7 */
9 /**
10 * SOF ABI versioning is based on Semantic Versioning where we have a given
11 * MAJOR.MINOR.PATCH version number. See https://semver.org/
13 * Rules for incrementing or changing version :-
15 * 1) Increment MAJOR version if you make incompatible API changes. MINOR and
16 * PATCH should be reset to 0.
18 * 2) Increment MINOR version if you add backwards compatible features or
19 * changes. PATCH should be reset to 0.
21 * 3) Increment PATCH version if you add backwards compatible bug fixes.
24 #ifndef __INCLUDE_UAPI_SOUND_SOF_ABI_H__
25 #define __INCLUDE_UAPI_SOUND_SOF_ABI_H__
27 /* SOF ABI version major, minor and patch numbers */
28 #define SOF_ABI_MAJOR 3
29 #define SOF_ABI_MINOR 18
30 #define SOF_ABI_PATCH 0
32 /* SOF ABI version number. Format within 32bit word is MMmmmppp */
33 #define SOF_ABI_MAJOR_SHIFT 24
34 #define SOF_ABI_MAJOR_MASK 0xff
35 #define SOF_ABI_MINOR_SHIFT 12
36 #define SOF_ABI_MINOR_MASK 0xfff
37 #define SOF_ABI_PATCH_SHIFT 0
38 #define SOF_ABI_PATCH_MASK 0xfff
40 #define SOF_ABI_VER(major, minor, patch) \
41 (((major) << SOF_ABI_MAJOR_SHIFT) | \
42 ((minor) << SOF_ABI_MINOR_SHIFT) | \
43 ((patch) << SOF_ABI_PATCH_SHIFT))
45 #define SOF_ABI_VERSION_MAJOR(version) \
46 (((version) >> SOF_ABI_MAJOR_SHIFT) & SOF_ABI_MAJOR_MASK)
47 #define SOF_ABI_VERSION_MINOR(version) \
48 (((version) >> SOF_ABI_MINOR_SHIFT) & SOF_ABI_MINOR_MASK)
49 #define SOF_ABI_VERSION_PATCH(version) \
50 (((version) >> SOF_ABI_PATCH_SHIFT) & SOF_ABI_PATCH_MASK)
52 #define SOF_ABI_VERSION_INCOMPATIBLE(sof_ver, client_ver) \
53 (SOF_ABI_VERSION_MAJOR((sof_ver)) != \
54 SOF_ABI_VERSION_MAJOR((client_ver)) \
57 #define SOF_ABI_VERSION SOF_ABI_VER(SOF_ABI_MAJOR, SOF_ABI_MINOR, SOF_ABI_PATCH)
59 /* SOF ABI magic number "SOF\0". */
60 #define SOF_ABI_MAGIC 0x00464F53
62 #endif