Merge tag 'regmap-fix-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux/fpc-iii.git] / drivers / media / usb / pvrusb2 / pvrusb2-util.h
blob7059772a49064effe5f0afc313f58b004378520c
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
4 * Copyright (C) 2005 Mike Isely <isely@pobox.com>
5 */
6 #ifndef __PVRUSB2_UTIL_H
7 #define __PVRUSB2_UTIL_H
9 #define PVR2_DECOMPOSE_LE(t,i,d) \
10 do { \
11 (t)[i] = (d) & 0xff;\
12 (t)[i+1] = ((d) >> 8) & 0xff;\
13 (t)[i+2] = ((d) >> 16) & 0xff;\
14 (t)[i+3] = ((d) >> 24) & 0xff;\
15 } while(0)
17 #define PVR2_DECOMPOSE_BE(t,i,d) \
18 do { \
19 (t)[i+3] = (d) & 0xff;\
20 (t)[i+2] = ((d) >> 8) & 0xff;\
21 (t)[i+1] = ((d) >> 16) & 0xff;\
22 (t)[i] = ((d) >> 24) & 0xff;\
23 } while(0)
25 #define PVR2_COMPOSE_LE(t,i) \
26 ((((u32)((t)[i+3])) << 24) | \
27 (((u32)((t)[i+2])) << 16) | \
28 (((u32)((t)[i+1])) << 8) | \
29 ((u32)((t)[i])))
31 #define PVR2_COMPOSE_BE(t,i) \
32 ((((u32)((t)[i])) << 24) | \
33 (((u32)((t)[i+1])) << 16) | \
34 (((u32)((t)[i+2])) << 8) | \
35 ((u32)((t)[i+3])))
38 #endif /* __PVRUSB2_UTIL_H */