From 8280d4bbbfceb9612615d0a6dd9ea7874ca4b390 Mon Sep 17 00:00:00 2001 From: Anuj Gangwar Date: Fri, 15 Mar 2019 17:13:26 +0530 Subject: include: uapi: move media imx headers with IOCTL Create new header files imx219, imx274, imx318 in include/uapi/media/. The files have IOCTL definitions which is moved from include/media/. Bug 2062672 Change-Id: Idd6633d5b9222e13ac27ec3d429184166e0fd4b4 Signed-off-by: Anuj Gangwar Reviewed-on: https://git-master.nvidia.com/r/2110009 (cherry picked from commit 21d478e9a75c3cf7008b291b291517f8fb976efe) Reviewed-on: https://git-master.nvidia.com/r/2113721 GVS: Gerrit_Virtual_Submit Reviewed-by: Bibek Basu Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/uapi/media/imx219.h | 62 +++++++++++++++++++++++++++++++ include/uapi/media/imx274.h | 60 ++++++++++++++++++++++++++++++ include/uapi/media/imx318.h | 90 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 212 insertions(+) create mode 100644 include/uapi/media/imx219.h create mode 100644 include/uapi/media/imx274.h create mode 100644 include/uapi/media/imx318.h (limited to 'include/uapi') diff --git a/include/uapi/media/imx219.h b/include/uapi/media/imx219.h new file mode 100644 index 000000000..73f4abb7e --- /dev/null +++ b/include/uapi/media/imx219.h @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2014-2019, NVIDIA Corporation. All rights reserved. + * + * NVIDIA Corporation and its licensors retain all intellectual property + * and proprietary rights in and to this software and related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA Corporation is strictly prohibited. + */ + +#ifndef __UAPI_IMX219_H__ +#define __UAPI_IMX219_H__ + +#include +#include + +#define IMX219_IOCTL_SET_MODE _IOW('o', 1, struct imx219_mode) +#define IMX219_IOCTL_GET_STATUS _IOR('o', 2, __u8) +#define IMX219_IOCTL_SET_FRAME_LENGTH _IOW('o', 3, __u32) +#define IMX219_IOCTL_SET_COARSE_TIME _IOW('o', 4, __u32) +#define IMX219_IOCTL_SET_GAIN _IOW('o', 5, struct imx219_gain) +#define IMX219_IOCTL_GET_FUSEID _IOR('o', 6, struct nvc_fuseid) +#define IMX219_IOCTL_SET_GROUP_HOLD _IOW('o', 7, struct imx219_ae) +#define IMX219_IOCTL_GET_AFDAT _IOR('o', 8, __u32) +#define IMX219_IOCTL_SET_POWER _IOW('o', 20, __u32) +#define IMX219_IOCTL_GET_FLASH_CAP _IOR('o', 30, __u32) +#define IMX219_IOCTL_SET_FLASH_MODE _IOW('o', 31, \ + struct imx219_flash_control) + +/* TODO: revisit these values for IMX219 */ +#define IMX219_FRAME_LENGTH_ADDR_MSB 0x0160 +#define IMX219_FRAME_LENGTH_ADDR_LSB 0x0161 +#define IMX219_COARSE_TIME_ADDR_MSB 0x015a +#define IMX219_COARSE_TIME_ADDR_LSB 0x015b +#define IMX219_GAIN_ADDR 0x0157 + +struct imx219_flash_control { + u8 enable; + u8 edge_trig_en; + u8 start_edge; + u8 repeat; + u16 delay_frm; +}; + +struct imx219_mode { + int xres; + int yres; + __u32 frame_length; + __u32 coarse_time; + __u32 gain; +}; + +struct imx219_ae { + __u32 frame_length; + __u8 frame_length_enable; + __u32 coarse_time; + __u8 coarse_time_enable; + __u32 gain; + __u8 gain_enable; +}; + +#endif /* __UAPI_IMX219_H__ */ diff --git a/include/uapi/media/imx274.h b/include/uapi/media/imx274.h new file mode 100644 index 000000000..3bacb07b7 --- /dev/null +++ b/include/uapi/media/imx274.h @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2016-2019, NVIDIA Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __UAPI_IMX274_H__ +#define __UAPI_IMX274_H__ + +#include +#include + +#define IMX274_IOCTL_SET_MODE _IOW('o', 1, struct imx274_mode) +#define IMX274_IOCTL_GET_STATUS _IOR('o', 2, __u8) +#define IMX274_IOCTL_SET_FRAME_LENGTH _IOW('o', 3, __u32) +#define IMX274_IOCTL_SET_COARSE_TIME _IOW('o', 4, __u32) +#define IMX274_IOCTL_SET_GAIN _IOW('o', 5, __u16) +#define IMX274_IOCTL_GET_SENSORDATA _IOR('o', 6, \ + struct imx274_sensordata) +#define IMX274_IOCTL_SET_GROUP_HOLD _IOW('o', 7, struct imx274_ae) +#define IMX274_IOCTL_SET_HDR_COARSE_TIME _IOW('o', 8, \ + struct imx274_hdr) +#define IMX274_IOCTL_SET_POWER _IOW('o', 20, __u32) + +struct imx274_mode { + __u32 xres; + __u32 yres; + __u32 frame_length; + __u32 coarse_time; + __u32 coarse_time_short; + __u16 gain; + __u8 hdr_en; +}; + +struct imx274_hdr { + __u32 coarse_time_long; + __u32 coarse_time_short; +}; + +struct imx274_ae { + __u32 frame_length; + __u8 frame_length_enable; + __u32 coarse_time; + __u32 coarse_time_short; + __u8 coarse_time_enable; + __s32 gain; + __u8 gain_enable; +}; + +#endif /* __UAPI_IMX274_H__ */ diff --git a/include/uapi/media/imx318.h b/include/uapi/media/imx318.h new file mode 100644 index 000000000..cf55b0568 --- /dev/null +++ b/include/uapi/media/imx318.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* TODO set all define values correctly, copied from ov5693*/ +#ifndef __UAPI_IMX318_H__ +#define __UAPI_IMX318_H__ + +#include +#include + +#define IMX318_IOCTL_SET_MODE _IOW('o', 1, struct imx318_mode) +#define IMX318_IOCTL_SET_FRAME_LENGTH _IOW('o', 2, __u32) +#define IMX318_IOCTL_SET_COARSE_TIME _IOW('o', 3, __u32) +#define IMX318_IOCTL_SET_GAIN _IOW('o', 4, __u16) +#define IMX318_IOCTL_GET_STATUS _IOR('o', 5, __u8) +#define IMX318_IOCTL_SET_BINNING _IOW('o', 6, __u8) +#define IMX318_IOCTL_TEST_PATTERN _IOW('o', 7, \ + enum imx318_test_pattern) +#define IMX318_IOCTL_SET_GROUP_HOLD _IOW('o', 8, struct imx318_ae) +/* operating mode can be either stereo , leftOnly or rightOnly */ +#define IMX318_IOCTL_SET_CAMERA_MODE _IOW('o', 10, __u32) +#define IMX318_IOCTL_SYNC_SENSORS _IOW('o', 11, __u32) +#define IMX318_IOCTL_GET_FUSEID _IOR('o', 12, struct nvc_fuseid) +#define IMX318_IOCTL_SET_CAL_DATA _IOW('o', 15, \ + struct imx318_cal_data) +#define IMX318_IOCTL_GET_EEPROM_DATA _IOR('o', 20, __u8 *) +#define IMX318_IOCTL_SET_EEPROM_DATA _IOW('o', 21, __u8 *) +#define IMX318_IOCTL_GET_CAPS _IOR('o', 22, \ + struct nvc_imager_cap) +#define IMX318_IOCTL_SET_POWER _IOW('o', 23, __u32) + +struct imx318_mode { + int res_x; + int res_y; + int fps; + __u32 frame_length; + __u32 coarse_time; + __u32 coarse_time_short; + __u16 gain; + __u8 hdr_en; +}; + +struct imx318_ae { + __u32 frame_length; + __u8 frame_length_enable; + __u32 coarse_time; + __u32 coarse_time_short; + __u8 coarse_time_enable; + __s32 gain; + __u8 gain_enable; +}; + +struct imx318_fuseid { + __u32 size; + __u8 id[16]; +}; + +struct imx318_hdr { + __u32 coarse_time_long; + __u32 coarse_time_short; +}; + +struct imx318_otp_bank { + __u32 id; + __u8 buf[16]; +}; + +struct imx318_cal_data { + int loaded; + int rg_ratio; + int bg_ratio; + int rg_ratio_typical; + int bg_ratio_typical; + __u8 lenc[62]; +}; + +#endif /* __UAPI_IMX318_H__ */ -- cgit v1.2.2