Files
linux-nv-oot/include/soc/tegra/camrtc-common.h
Frank Chen 304123a3bf video: camera: Port RTCPU drivers to OOT tree
Port RTCPU drivers from kernel/nvidia to kernel/nvidia-oot.
In addition to copying the files this patch:
1) Modifies make files to build rtcpu drivers as modules
2) Modifies licenses of all ported files to SPDX
3) Adds MODULE_LICENSE macro to all modules
4) Removes checks for old kernel versions and the dead code after those checks
5) Fixes style errors according to checkpatch.pl

Change-Id: If64296a22ce958e5326c7509cb69f8f7154f598e
Signed-off-by: Frank Chen <frankc@nvidia.com>
Signed-off-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2783040
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Pekka Pessi <ppessi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-01 11:00:35 -08:00

89 lines
1.6 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*/
/**
* @file camrtc-common.h
*
* @brief RCE common header file
*/
#ifndef INCLUDE_CAMRTC_COMMON_H
#define INCLUDE_CAMRTC_COMMON_H
#if defined(__KERNEL__)
#include <linux/types.h>
#include <linux/compiler.h>
#define CAMRTC_PACKED __packed
#define CAMRTC_ALIGN __aligned
#else
#include <stdint.h>
#include <stdbool.h>
#ifndef CAMRTC_PACKED
#define CAMRTC_PACKED __attribute__((packed))
#endif
#ifndef CAMRTC_ALIGN
#define CAMRTC_ALIGN(_n) __attribute__((aligned(_n)))
#endif
#ifndef U64_C
#define U64_C(_x_) ((uint64_t)(_x_##ULL))
#endif
#ifndef U32_C
#define U32_C(_x_) ((uint32_t)(_x_##UL))
#endif
#ifndef U16_C
#define U16_C(_x_) ((uint16_t)(_x_##U))
#endif
#ifndef U8_C
#define U8_C(_x_) ((uint8_t)(_x_##U))
#endif
#endif
/**
* @defgroup MK_xxx Macros for defining constants
*
* These macros are used to define constants in the camera/firmware-api
* headers.
*
* The user of the header files can predefine them and override the
* types of the constants.
*
* @{
*/
#ifndef MK_U64
#define MK_U64(_x_) U64_C(_x_)
#endif
#ifndef MK_U32
#define MK_U32(_x_) U32_C(_x_)
#endif
#ifndef MK_U16
#define MK_U16(_x_) U16_C(_x_)
#endif
#ifndef MK_U8
#define MK_U8(_x_) U8_C(_x_)
#endif
#ifndef MK_BIT32
#define MK_BIT32(_x_) (MK_U32(1) << MK_U32(_x_))
#endif
#ifndef MK_BIT64
#define MK_BIT64(_x_) (MK_U64(1) << MK_U64(_x_))
#endif
#ifndef MK_ALIGN
#define MK_ALIGN(_x_) _x_
#endif
#ifndef MK_SIZE
#define MK_SIZE(_x_) MK_U32(_x_)
#endif
/** @} */
#endif /* INCLUDE_CAMRTC_COMMON_H */