xref: /linux/include/uapi/linux/patchkey.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells  * <linux/patchkey.h> -- definition of _PATCHKEY macro
4607ca46eSDavid Howells  *
5607ca46eSDavid Howells  * Copyright (C) 2005 Stuart Brady
6607ca46eSDavid Howells  *
7607ca46eSDavid Howells  * This exists because awe_voice.h defined its own _PATCHKEY and it wasn't
8607ca46eSDavid Howells  * clear whether removing this would break anything in userspace.
9607ca46eSDavid Howells  *
10607ca46eSDavid Howells  * Do not include this file directly.  Please use <sys/soundcard.h> instead.
11607ca46eSDavid Howells  * For kernel code, use <linux/soundcard.h>
12607ca46eSDavid Howells  */
13607ca46eSDavid Howells 
14607ca46eSDavid Howells #ifndef _LINUX_PATCHKEY_H_INDIRECT
15607ca46eSDavid Howells #error "patchkey.h included directly"
16607ca46eSDavid Howells #endif
17607ca46eSDavid Howells 
18607ca46eSDavid Howells #ifndef _UAPI_LINUX_PATCHKEY_H
19607ca46eSDavid Howells #define _UAPI_LINUX_PATCHKEY_H
20607ca46eSDavid Howells 
21607ca46eSDavid Howells /* Endian macros. */
22607ca46eSDavid Howells #ifndef __KERNEL__
23607ca46eSDavid Howells #  include <endian.h>
24607ca46eSDavid Howells #endif
25607ca46eSDavid Howells 
26607ca46eSDavid Howells #if !defined(__KERNEL__)
27607ca46eSDavid Howells #if defined(__BYTE_ORDER)
28607ca46eSDavid Howells #  if __BYTE_ORDER == __BIG_ENDIAN
29607ca46eSDavid Howells #    define _PATCHKEY(id) (0xfd00|id)
30607ca46eSDavid Howells #  elif __BYTE_ORDER == __LITTLE_ENDIAN
31607ca46eSDavid Howells #    define _PATCHKEY(id) ((id<<8)|0x00fd)
32607ca46eSDavid Howells #  else
33607ca46eSDavid Howells #    error "could not determine byte order"
34607ca46eSDavid Howells #  endif
35607ca46eSDavid Howells #endif
36607ca46eSDavid Howells #endif
37607ca46eSDavid Howells 
38607ca46eSDavid Howells #endif /* _UAPI_LINUX_PATCHKEY_H */
39