2 * imx274.c - imx274 sensor driver
4 * Copyright (c) 2016, NVIDIA CORPORATION, All Rights Reserved.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef __IMX274_I2C_TABLES__
20 #define __IMX274_I2C_TABLES__
22 #include <media/camera_common.h>
25 #define IMX274_TABLE_WAIT_MS 0
26 #define IMX274_TABLE_END 1
27 #define IMX274_WAIT_MS 1
29 #define imx274_reg struct reg_8
31 static const imx274_reg imx274_start[] = {
32 {0x3000, 0x00}, /* mode select streaming on */
34 {IMX274_TABLE_WAIT_MS, IMX274_WAIT_MS},
37 {IMX274_TABLE_WAIT_MS, IMX274_WAIT_MS},
38 {IMX274_TABLE_END, 0x00}
41 static const imx274_reg imx274_stop[] = {
42 {IMX274_TABLE_WAIT_MS, IMX274_WAIT_MS},
43 {0x3000, 0x12}, /* mode select streaming off */
44 {IMX274_TABLE_END, 0x00}
47 static const imx274_reg tp_colorbars[] = {
55 {IMX274_TABLE_END, 0x00}
59 /* Mode 1 : 3840X2160 10 bits 30fps*/
60 static const imx274_reg mode_3840X2160[] = {
61 {IMX274_TABLE_WAIT_MS, IMX274_WAIT_MS},
137 {IMX274_TABLE_WAIT_MS, IMX274_WAIT_MS},
138 {IMX274_TABLE_END, 0x0000}
141 /* Mode 1 : 3840X2160 10 bits 60fps*/
142 static const imx274_reg mode_3840X2160_60fps[] = {
143 {IMX274_TABLE_WAIT_MS, IMX274_WAIT_MS},
144 /* input freq. 24M */
219 {IMX274_TABLE_WAIT_MS, IMX274_WAIT_MS},
220 {IMX274_TABLE_END, 0x0000}
223 /* Mode 3 : 1920X1080 10 bits 60fps*/
224 static imx274_reg mode_1920X1080[] = {
225 {IMX274_TABLE_WAIT_MS, IMX274_WAIT_MS},
226 /* input freq. 24M */
301 {IMX274_TABLE_WAIT_MS, IMX274_WAIT_MS},
302 {IMX274_TABLE_END, 0x0000}
305 /* Mode 5 : 1280X720 10 bits */
306 static imx274_reg mode_1280X720[] = {
307 {IMX274_TABLE_WAIT_MS, IMX274_WAIT_MS},
308 /* input freq. 24M */
381 {IMX274_TABLE_WAIT_MS, IMX274_WAIT_MS},
382 {IMX274_TABLE_END, 0x0000}
386 IMX274_MODE_3840X2160,
387 IMX274_MODE_1920X1080,
388 IMX274_MODE_1280X720,
389 IMX274_MODE_START_STREAM,
390 IMX274_MODE_STOP_STREAM,
391 IMX274_MODE_TEST_PATTERN,
394 static const imx274_reg *mode_table[] = {
395 [IMX274_MODE_3840X2160] = mode_3840X2160_60fps,
396 [IMX274_MODE_1920X1080] = mode_1920X1080,
397 [IMX274_MODE_1280X720] = mode_1280X720,
399 [IMX274_MODE_START_STREAM] = imx274_start,
400 [IMX274_MODE_STOP_STREAM] = imx274_stop,
401 [IMX274_MODE_TEST_PATTERN] = tp_colorbars,
404 static const int imx274_framerates[] = {
409 static const struct camera_common_frmfmt imx274_frmfmt[] = {
410 {{3840, 2160}, imx274_framerates, 2, 0, IMX274_MODE_3840X2160},
411 {{1920, 1080}, imx274_framerates, 2, 0, IMX274_MODE_1920X1080},
412 {{1280, 720}, imx274_framerates, 2, 0, IMX274_MODE_1280X720},
414 #endif /* __IMX274_I2C_TABLES__ */