/*
* tp2854_mode_tbls.h - tp2854 mode tables
*
* Copyright (c) 2016-2017, 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 __TP2854_I2C_TABLES__
#define __TP2854_I2C_TABLES__
#include
#include
#define TP2854_TABLE_WAIT_MS 0
#define TP2854_TABLE_END 255
#define TP2854_MAX_RETRIES 3
#define TP2854_WAIT_MS_STOP 1
#define TP2854_WAIT_MS_START 30
#define TP2854_WAIT_MS_STREAM 210
#define TP2854_GAIN_TABLE_SIZE 255
/* #define INIT_ET_INSETTING 1 */
#define tp2854_reg struct reg_8
static tp2854_reg tp2854_start[] = {
{0x0040, 0x08 },
{0x0023, 0x00},
{0x0040, 0x00},
{ TP2854_TABLE_END, 0x00 }
};
static tp2854_reg tp2854_stop[] = {
{0x0040, 0x08 },
{0x0023, 0x02},
{0x0040, 0x00},
{TP2854_TABLE_END, 0x00 }
};
static tp2854_reg tp2854_1920x1080_crop_30fps[] = {
{0x0040, 0x04 },
{0x004e, 0x50},
{0x00f5, 0xf0},
{0x0002, 0xc0},
{0x0007, 0xc0},
{0x000b, 0xc0},
{0x000c, 0x03},
{0x000d, 0x50},
{0x0015, 0x03},
{0x0016, 0xd2},
{0x0017, 0x80},
{0x0018, 0x29},
{0x0019, 0x38},
{0x001a, 0x47},
{0x001c, 0x08},
{0x001d, 0x98},
{0x0035, 0x05},
{0x0038, 0x00},
{0x0039, 0x1c},
{0x0040, 0x08},
{0x0001, 0xf8},
{0x0002, 0x01},
{0x0008, 0x0f},
{0x0013, 0x04},
{0x0014, 0x56},
{0x0015, 0x0a},
{0x0020, 0x14},
{0x0034, 0x1b},
{0x0040, 0x04},
{TP2854_TABLE_END, 0x00}
};
enum {
TP2854_MODE_1920X1080_CROP_30FPS,
TP2854_MODE_START_STREAM,
TP2854_MODE_STOP_STREAM,
};
static tp2854_reg *mode_table[] = {
[TP2854_MODE_1920X1080_CROP_30FPS] = tp2854_1920x1080_crop_30fps,
[TP2854_MODE_START_STREAM] = tp2854_start,
[TP2854_MODE_STOP_STREAM] = tp2854_stop,
};
static const int tp2854_30fps[] = {
30,
};
static const int tp2854_60fps[] = {
60,
};
/*
* WARNING: frmfmt ordering need to match mode definition in
* device tree!
*/
static const struct camera_common_frmfmt tp2854_frmfmt[] = {
{{1920, 1080}, tp2854_30fps, 1, 0,
TP2854_MODE_1920X1080_CROP_30FPS},
/* Add modes with no device tree support after below */
};
#endif /* __TP2854_I2C_TABLES__ */