/* * imx219_tables.h - sensor mode tables for imx219 HDR sensor. * * Copyright (c) 2015-2020, 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 __IMX219_I2C_TABLES__ #define __IMX219_I2C_TABLES__ #define IMX219_TABLE_WAIT_MS 0 #define IMX219_TABLE_END 1 #define imx219_reg struct reg_8 static imx219_reg imx219_start_stream[] = { {0x0100, 0x01}, /* mode select streaming on */ {IMX219_TABLE_END, 0x00} }; static imx219_reg imx219_stop_stream[] = { {0x0100, 0x00}, {IMX219_TABLE_END, 0x00} }; static imx219_reg imx219_mode_common[] = { // { 0x100 , 0x00}, // {0x0103,0x01}, { 0x302, 0x1e}, { 0x303, 0x00}, { 0x30d, 0x1e}, { 0x30e, 0x02}, { 0x312, 0x01}, { 0x3000, 0x00}, { 0x3018, 0x32}, { 0x3031, 0x0a}, { 0x3080, 0x08}, { 0x3083, 0xB4}, { 0x3103, 0x00}, { 0x3104, 0x01}, { 0x3106, 0x01}, { 0x3500, 0x00}, { 0x3501, 0x44}, { 0x3502, 0x40}, { 0x3503, 0x88}, { 0x3507, 0x00}, { 0x3508, 0x00}, { 0x3509, 0x80}, { 0x350c, 0x00}, { 0x350d ,0x80}, { 0x3510, 0x00}, { 0x3511 ,0x00}, { 0x3512, 0x20}, { 0x3632 ,0x00}, { 0x3633, 0x10}, { 0x3634 ,0x10}, { 0x3635 ,0x10}, { 0x3645, 0x13}, { 0x3646 ,0x81}, { 0x3636 ,0x10}, { 0x3651, 0x0a}, { 0x3656 ,0x02}, { 0x3659 ,0x04}, { 0x365a ,0xda}, { 0x365b ,0xa2}, { 0x365c, 0x04}, { 0x365d, 0x1d}, { 0x365e ,0x1a}, { 0x3662 ,0xd7}, { 0x3667, 0x78}, { 0x3669 ,0x0a}, { 0x366a, 0x92}, { 0x3700, 0x54}, { 0x3702 ,0x10}, { 0x3706, 0x42}, { 0x3709, 0x30}, { 0x370b ,0xc2}, { 0x3714, 0x63}, { 0x3715, 0x01}, { 0x3716 ,0x00}, { 0x371a, 0x3e}, { 0x3732 ,0x0e}, { 0x3733 ,0x10}, { 0x375f ,0x0e}, { 0x3768, 0x30}, { 0x3769, 0x44}, { 0x376a ,0x22}, { 0x377b ,0x20}, { 0x377c ,0x00}, { 0x377d ,0x0c}, { 0x3798 ,0x00}, { 0x37a1, 0x55}, { 0x37a8 ,0x6d}, { 0x37c2 ,0x04}, { 0x37c5 ,0x00}, { 0x37c8 ,0x00}, { 0x3800 ,0x00}, { 0x3801, 0x00}, { 0x3802, 0x00}, { 0x3803, 0x00}, { 0x3804 ,0x07}, { 0x3805 ,0x8f}, { 0x3806, 0x04}, { 0x3807, 0x47}, { 0x3808, 0x07}, { 0x3809 ,0x88},//80 { 0x380a ,0x04}, { 0x380b ,0x40},//3 { 0x380c ,0x04}, { 0x380d ,0x38}, { 0x380e ,0x04}, { 0x380f ,0x60}, { 0x3810 ,0x00}, { 0x3811 ,0x04}, { 0x3812 ,0x00}, { 0x3813 ,0x04}, { 0x3814 ,0x01}, { 0x3815 ,0x01}, { 0x3820 ,0x80}, { 0x3821 ,0x46}, { 0x3822 ,0x84}, { 0x3829 ,0x00}, { 0x382a ,0x01}, { 0x382b ,0x01}, { 0x3830 ,0x04}, { 0x3836 ,0x01}, { 0x3837 ,0x08}, { 0x3839 ,0x01}, { 0x383a ,0x00}, { 0x383b ,0x08}, { 0x383c ,0x00}, { 0x3f0b ,0x00}, { 0x4001 ,0x20}, { 0x4009 ,0x07}, { 0x4003, 0x10}, { 0x4010 ,0xe0}, { 0x4016 ,0x00}, { 0x4017 ,0x10}, { 0x4044 ,0x02}, { 0x4304 ,0x08}, { 0x4307 ,0x30}, { 0x4320, 0x80}, { 0x4322 ,0x00}, { 0x4323 ,0x00}, { 0x4324 ,0x00}, { 0x4325, 0x00}, { 0x4326, 0x00}, { 0x4327, 0x00}, { 0x4328, 0x00}, { 0x4329, 0x00}, { 0x432c, 0x03}, { 0x432d ,0x81}, { 0x4501 ,0x84}, { 0x4502, 0x40}, { 0x4503, 0x18}, { 0x4504 ,0x04}, { 0x4508, 0x02}, { 0x4601, 0x10}, { 0x3760, 0x00}, { 0x4816, 0x52}, { 0x4837, 0x16}, { 0x5000 ,0x7f}, { 0x5001 ,0x00}, { 0x5005, 0x38}, { 0x501e, 0x0d}, { 0x5040, 0x00}, { 0x5901, 0x00}, // {0x0100, 0x01}, {IMX219_TABLE_END, 0x00} }; static imx219_reg imx219_mode_376x376_30fps[] = { /* capture settings */ { 0x302, 0x1e}, { 0x303, 0x00}, { 0x30d, 0x1e}, { 0x30e, 0x02}, { 0x312, 0x01}, { 0x3000, 0x00}, { 0x3018, 0x32}, { 0x3031, 0x0a}, { 0x3080, 0x08}, { 0x3083, 0xB4}, { 0x3103, 0x00}, { 0x3104, 0x01}, { 0x3106, 0x01}, { 0x3500, 0x00}, { 0x3501, 0x44}, { 0x3502, 0x40}, { 0x3503, 0x88}, { 0x3507, 0x00}, { 0x3508, 0x00}, { 0x3509, 0x80}, { 0x350c, 0x00}, { 0x350d ,0x80}, { 0x3510, 0x00}, { 0x3511 ,0x00}, { 0x3512, 0x20}, { 0x3632 ,0x00}, { 0x3633, 0x10}, { 0x3634 ,0x10}, { 0x3635 ,0x10}, { 0x3645, 0x13}, { 0x3646 ,0x81}, { 0x3636 ,0x10}, { 0x3651, 0x0a}, { 0x3656 ,0x02}, { 0x3659 ,0x04}, { 0x365a ,0xda}, { 0x365b ,0xa2}, { 0x365c, 0x04}, { 0x365d, 0x1d}, { 0x365e ,0x1a}, { 0x3662 ,0xd7}, { 0x3667, 0x78}, { 0x3669 ,0x0a}, { 0x366a, 0x92}, { 0x3700, 0x54}, { 0x3702 ,0x10}, { 0x3706, 0x42}, { 0x3709, 0x30}, { 0x370b ,0xc2}, { 0x3714, 0x63}, { 0x3715, 0x01}, { 0x3716 ,0x00}, { 0x371a, 0x3e}, { 0x3732 ,0x0e}, { 0x3733 ,0x10}, { 0x375f ,0x0e}, { 0x3768, 0x30}, { 0x3769, 0x44}, { 0x376a ,0x22}, { 0x377b ,0x20}, { 0x377c ,0x00}, { 0x377d ,0x0c}, { 0x3798 ,0x00}, { 0x37a1, 0x55}, { 0x37a8 ,0x6d}, { 0x37c2 ,0x04}, { 0x37c5 ,0x00}, { 0x37c8 ,0x00}, { 0x3800 ,0x00}, { 0x3801, 0x00}, { 0x3802, 0x00}, { 0x3803, 0x00}, { 0x3804 ,0x07}, { 0x3805 ,0x8f}, { 0x3806, 0x04}, { 0x3807, 0x47}, { 0x3808, 0x07}, { 0x3809 ,0x88},//80 { 0x380a ,0x04}, { 0x380b ,0x40},//3 { 0x380c ,0x04}, { 0x380d ,0x38}, { 0x380e ,0x04}, { 0x380f ,0x60}, { 0x3810 ,0x00}, { 0x3811 ,0x04}, { 0x3812 ,0x00}, { 0x3813 ,0x04}, { 0x3814 ,0x01}, { 0x3815 ,0x01}, { 0x3820 ,0x80}, { 0x3821 ,0x46}, { 0x3822 ,0x84}, { 0x3829 ,0x00}, { 0x382a ,0x01}, { 0x382b ,0x01}, { 0x3830 ,0x04}, { 0x3836 ,0x01}, { 0x3837 ,0x08}, { 0x3839 ,0x01}, { 0x383a ,0x00}, { 0x383b ,0x08}, { 0x383c ,0x00}, { 0x3f0b ,0x00}, { 0x4001 ,0x20}, { 0x4009 ,0x07}, { 0x4003, 0x10}, { 0x4010 ,0xe0}, { 0x4016 ,0x00}, { 0x4017 ,0x10}, { 0x4044 ,0x02}, { 0x4304 ,0x08}, { 0x4307 ,0x30}, { 0x4320, 0x80}, { 0x4322 ,0x00}, { 0x4323 ,0x00}, { 0x4324 ,0x00}, { 0x4325, 0x00}, { 0x4326, 0x00}, { 0x4327, 0x00}, { 0x4328, 0x00}, { 0x4329, 0x00}, { 0x432c, 0x03}, { 0x432d ,0x81}, { 0x4501 ,0x84}, { 0x4502, 0x40}, { 0x4503, 0x18}, { 0x4504 ,0x04}, { 0x4508, 0x02}, { 0x4601, 0x10}, { 0x3760, 0x00}, { 0x4816, 0x52}, { 0x4837, 0x16}, { 0x5000 ,0x7f}, { 0x5001 ,0x00}, { 0x5005, 0x38}, { 0x501e, 0x0d}, { 0x5040, 0x00}, { 0x5901, 0x00}, // {0x0100, 0x01}, {IMX219_TABLE_END, 0x00} }; enum { IMX219_MODE_376x376_30FPS, //IMX219_MODE_3264x1848_28FPS, // IMX219_MODE_376x376_60FPS, //IMX219_MODE_1376x1232_30FPS, // IMX219_MODE_400x400_60FPS, IMX219_MODE_COMMON, IMX219_START_STREAM, IMX219_STOP_STREAM, }; static imx219_reg *mode_table[] = { [IMX219_MODE_376x376_30FPS] = imx219_mode_376x376_30fps, //[IMX219_MODE_3264x1848_28FPS] = imx219_mode_3264x1848_28fps, // [IMX219_MODE_376x376_30FPS] = imx219_mode_376x376_60fps, //[IMX219_MODE_1376x1232_30FPS] = imx219_mode_1376x1232_30fps, // [IMX219_MODE_400x400_60FPS] = imx219_mode_400x400_60fps, [IMX219_MODE_COMMON] = imx219_mode_common, [IMX219_START_STREAM] = imx219_start_stream, [IMX219_STOP_STREAM] = imx219_stop_stream, }; static const int imx219_30fps[] = { 30, }; static const int imx219_60fps[] = { 60, }; /* * WARNING: frmfmt ordering need to match mode definition in * device tree! */ static const struct camera_common_frmfmt imx219_frmfmt[] = { {{376, 376}, imx219_30fps, 1, 0, IMX219_MODE_376x376_30FPS}, /* Add modes with no device tree support after below */ //{{3264, 1848}, imx219_28fps, 1, 0, IMX219_MODE_3264x1848_28FPS}, // {{376, 376}, imx219_30fps, 1, 0, IMX219_MODE_376x376_60FPS}, //{{1376, 1232}, imx219_30fps, 1, 0, IMX219_MODE_1376x1232_30FPS}, //{{376, 376}, imx219_60fps, 1, 0, IMX219_MODE_400x400_60FPS}, }; #endif /* __IMX219_I2C_TABLES__ */