Commit eb2050f0 authored by Martin Kepplinger's avatar Martin Kepplinger
Browse files

hi846: pull in the init regs into the driver file

this was just meant to ease development
parent fe856fdd
Pipeline #68023 passed with stage
in 63 minutes and 20 seconds
......@@ -239,11 +239,607 @@ struct hi846_mode {
#define to_hi846(_sd) container_of(_sd, struct hi846, sd)
static const struct hi846_reg hi846_init_2lane[] = {
#include "hi846_init_android_patch.txt"
{HI846_REG_MODE_SELECT, 0x0000},
/* regs below are unknown */
{0x2000, 0x100A},
{0x2002, 0x00FF},
{0x2004, 0x0007},
{0x2006, 0x3FFF},
{0x2008, 0x3FFF},
{0x200A, 0xC216},
{0x200C, 0x1292},
{0x200E, 0xC01A},
{0x2010, 0x403D},
{0x2012, 0x000E},
{0x2014, 0x403E},
{0x2016, 0x0B80},
{0x2018, 0x403F},
{0x201A, 0x82AE},
{0x201C, 0x1292},
{0x201E, 0xC00C},
{0x2020, 0x4130},
{0x2022, 0x43E2},
{0x2024, 0x0180},
{0x2026, 0x4130},
{0x2028, 0x7400},
{0x202A, 0x5000},
{0x202C, 0x0253},
{0x202E, 0x0AD1},
{0x2030, 0x2360},
{0x2032, 0x0009},
{0x2034, 0x5020},
{0x2036, 0x000B},
{0x2038, 0x0002},
{0x203A, 0x0044},
{0x203C, 0x0016},
{0x203E, 0x1792},
{0x2040, 0x7002},
{0x2042, 0x154F},
{0x2044, 0x00D5},
{0x2046, 0x000B},
{0x2048, 0x0019},
{0x204A, 0x1698},
{0x204C, 0x000E},
{0x204E, 0x099A},
{0x2050, 0x0058},
{0x2052, 0x7000},
{0x2054, 0x1799},
{0x2056, 0x0310},
{0x2058, 0x03C3},
{0x205A, 0x004C},
{0x205C, 0x064A},
{0x205E, 0x0001},
{0x2060, 0x0007},
{0x2062, 0x0BC7},
{0x2064, 0x0055},
{0x2066, 0x7000},
{0x2068, 0x1550},
{0x206A, 0x158A},
{0x206C, 0x0004},
{0x206E, 0x1488},
{0x2070, 0x7010},
{0x2072, 0x1508},
{0x2074, 0x0004},
{0x2076, 0x0016},
{0x2078, 0x03D5},
{0x207A, 0x0055},
{0x207C, 0x08CA},
{0x207E, 0x2019},
{0x2080, 0x0007},
{0x2082, 0x7057},
{0x2084, 0x0FC7},
{0x2086, 0x5041},
{0x2088, 0x12C8},
{0x208A, 0x5060},
{0x208C, 0x5080},
{0x208E, 0x2084},
{0x2090, 0x12C8},
{0x2092, 0x7800},
{0x2094, 0x0802},
{0x2096, 0x040F},
{0x2098, 0x1007},
{0x209A, 0x0803},
{0x209C, 0x080B},
{0x209E, 0x3803},
{0x20A0, 0x0807},
{0x20A2, 0x0404},
{0x20A4, 0x0400},
{0x20A6, 0xFFFF},
{0x20A8, 0xF0B2},
{0x20AA, 0xFFEF},
{0x20AC, 0x0A84},
{0x20AE, 0x1292},
{0x20B0, 0xC02E},
{0x20B2, 0x4130},
{0x23FE, 0xC056},
{0x3232, 0xFC0C},
{0x3236, 0xFC22},
{0x3248, 0xFCA8},
{0x326A, 0x8302},
{0x326C, 0x830A},
{0x326E, 0x0000},
{0x32CA, 0xFC28},
{0x32CC, 0xC3BC},
{0x32CE, 0xC34C},
{0x32D0, 0xC35A},
{0x32D2, 0xC368},
{0x32D4, 0xC376},
{0x32D6, 0xC3C2},
{0x32D8, 0xC3E6},
{0x32DA, 0x0003},
{0x32DC, 0x0003},
{0x32DE, 0x00C7},
{0x32E0, 0x0031},
{0x32E2, 0x0031},
{0x32E4, 0x0031},
{0x32E6, 0xFC28},
{0x32E8, 0xC3BC},
{0x32EA, 0xC384},
{0x32EC, 0xC392},
{0x32EE, 0xC3A0},
{0x32F0, 0xC3AE},
{0x32F2, 0xC3C4},
{0x32F4, 0xC3E6},
{0x32F6, 0x0003},
{0x32F8, 0x0003},
{0x32FA, 0x00C7},
{0x32FC, 0x0031},
{0x32FE, 0x0031},
{0x3300, 0x0031},
{0x3302, 0x82CA},
{0x3304, 0xC164},
{0x3306, 0x82E6},
{0x3308, 0xC19C},
{0x330A, 0x001F},
{0x330C, 0x001A},
{0x330E, 0x0034},
{0x3310, 0x0000},
{0x3312, 0x0000},
{0x3314, 0xFC94},
{0x3316, 0xC3D8},
/* regs above are unknown */
{HI846_REG_MODE_SELECT, 0x0000},
{HI846_REG_UNKNOWN_0E04, 0x0012},
{HI846_REG_Y_ODD_INC_FOBP, 0x1111},
{HI846_REG_Y_ODD_INC_VACT, 0x1111},
{HI846_REG_UNKNOWN_0022, 0x0008},
{HI846_REG_Y_ADDR_START_VACT_H, 0x0040},
{HI846_REG_UNKNOWN_0028, 0x0017},
{HI846_REG_Y_ADDR_END_VACT_H, 0x09CF},
{HI846_REG_UNKNOWN_005C, 0x2101},
{HI846_REG_FLL, 0x09DE},
{HI846_REG_LLP, 0x0ED8},
{HI846_REG_IMAGE_ORIENTATION, 0x0100},
{HI846_REG_BINNING_MODE, 0x0022},
{HI846_REG_HBIN_MODE, 0x0000},
{HI846_REG_UNKNOWN_0A24, 0x0000},
{HI846_REG_X_START_H, 0x0000},
{HI846_REG_X_OUTPUT_SIZE_H, 0x0CC0},
{HI846_REG_Y_OUTPUT_SIZE_H, 0x0990},
{HI846_REG_EXPOSURE, 0x09D8},
{HI846_REG_ANALOG_GAIN, 0x0000},
{HI846_REG_GROUPED_PARA_HOLD, 0x0000},
{HI846_REG_UNKNOWN_051E, 0x0000},
{HI846_REG_UNKNOWN_0200, 0x0400},
{HI846_REG_PEDESTAL_EN, 0x0C00},
{HI846_REG_UNKNOWN_0A0C, 0x0010},
{HI846_REG_UNKNOWN_0A1E, 0x0CCF},
{HI846_REG_UNKNOWN_0402, 0x0110},
{HI846_REG_UNKNOWN_0404, 0x00F4},
{HI846_REG_UNKNOWN_0408, 0x0000},
{HI846_REG_UNKNOWN_0410, 0x008D},
{HI846_REG_UNKNOWN_0412, 0x011A},
{HI846_REG_UNKNOWN_0414, 0x864C},
{HI846_REG_UNKNOWN_021C, 0x0003},
{HI846_REG_UNKNOWN_021E, 0x0235},
{HI846_REG_BLC_CTL0, 0x9150},
{HI846_REG_UNKNOWN_0C06, 0x0021},
{HI846_REG_UNKNOWN_0C10, 0x0040},
{HI846_REG_UNKNOWN_0C12, 0x0040},
{HI846_REG_UNKNOWN_0C14, 0x0040},
{HI846_REG_UNKNOWN_0C16, 0x0040},
{HI846_REG_FAST_STANDBY_MODE, 0x0100},
{HI846_REG_ISP_EN_H, 0x014A},
{HI846_REG_UNKNOWN_0418, 0x0000},
{HI846_REG_UNKNOWN_012A, 0x03B4},
{HI846_REG_X_ADDR_START_HACT_H, 0x0046},
{HI846_REG_X_ADDR_END_HACT_H, 0x0376},
{HI846_REG_UNKNOWN_0B02, 0xE04D},
{HI846_REG_UNKNOWN_0B10, 0x6821},
{HI846_REG_UNKNOWN_0B12, 0x0120},
{HI846_REG_UNKNOWN_0B14, 0x0001},
{HI846_REG_UNKNOWN_2008, 0x38FD},
{HI846_REG_UNKNOWN_326E, 0x0000},
{HI846_REG_UNKNOWN_0900, 0x0320},
{HI846_REG_MIPI_TX_OP_MODE, 0xC31A},
{HI846_REG_UNKNOWN_0914, 0xC109},
{HI846_REG_TCLK_PREPARE, 0x061A},
{HI846_REG_UNKNOWN_0918, 0x0306},
{HI846_REG_THS_ZERO, 0x0B09},
{HI846_REG_TCLK_POST, 0x0C07},
{HI846_REG_UNKNOWN_091E, 0x0A00},
{HI846_REG_UNKNOWN_090C, 0x042A},
{HI846_REG_UNKNOWN_090E, 0x006B},
{HI846_REG_UNKNOWN_0954, 0x0089},
{HI846_REG_UNKNOWN_0956, 0x0000},
{HI846_REG_UNKNOWN_0958, 0xCA00},
{HI846_REG_UNKNOWN_095A, 0x9240},
{HI846_REG_UNKNOWN_0F08, 0x2F04},
{HI846_REG_UNKNOWN_0F30, 0x001F},
{HI846_REG_UNKNOWN_0F36, 0x001F},
{HI846_REG_UNKNOWN_0F04, 0x3A00},
{HI846_REG_PLL_CFG_RAMP1_H, 0x025A},
{HI846_REG_PLL_CFG_MIPI1_H, 0x025A},
{HI846_REG_PLL_CFG_MIPI2_H, 0x0024},
{HI846_REG_UNKNOWN_006A, 0x0100},
{HI846_REG_TG_ENABLE, 0x0100},
};
static const struct hi846_reg hi846_init_4lane[] = {
#include "hi846_init_android_github1.txt"
{0x2000, 0x987A},
{0x2002, 0x00FF},
{0x2004, 0x0047},
{0x2006, 0x3FFF},
{0x2008, 0x3FFF},
{0x200A, 0xC216},
{0x200C, 0x1292},
{0x200E, 0xC01A},
{0x2010, 0x403D},
{0x2012, 0x000E},
{0x2014, 0x403E},
{0x2016, 0x0B80},
{0x2018, 0x403F},
{0x201A, 0x82AE},
{0x201C, 0x1292},
{0x201E, 0xC00C},
{0x2020, 0x4130},
{0x2022, 0x43E2},
{0x2024, 0x0180},
{0x2026, 0x4130},
{0x2028, 0x7400},
{0x202A, 0x5000},
{0x202C, 0x0253},
{0x202E, 0x0AD1},
{0x2030, 0x2360},
{0x2032, 0x0009},
{0x2034, 0x5020},
{0x2036, 0x000B},
{0x2038, 0x0002},
{0x203A, 0x0044},
{0x203C, 0x0016},
{0x203E, 0x1792},
{0x2040, 0x7002},
{0x2042, 0x154F},
{0x2044, 0x00D5},
{0x2046, 0x000B},
{0x2048, 0x0019},
{0x204A, 0x1698},
{0x204C, 0x000E},
{0x204E, 0x099A},
{0x2050, 0x0058},
{0x2052, 0x7000},
{0x2054, 0x1799},
{0x2056, 0x0310},
{0x2058, 0x03C3},
{0x205A, 0x004C},
{0x205C, 0x064A},
{0x205E, 0x0001},
{0x2060, 0x0007},
{0x2062, 0x0BC7},
{0x2064, 0x0055},
{0x2066, 0x7000},
{0x2068, 0x1550},
{0x206A, 0x158A},
{0x206C, 0x0004},
{0x206E, 0x1488},
{0x2070, 0x7010},
{0x2072, 0x1508},
{0x2074, 0x0004},
{0x2076, 0x0016},
{0x2078, 0x03D5},
{0x207A, 0x0055},
{0x207C, 0x08CA},
{0x207E, 0x2019},
{0x2080, 0x0007},
{0x2082, 0x7057},
{0x2084, 0x0FC7},
{0x2086, 0x5041},
{0x2088, 0x12C8},
{0x208A, 0x5060},
{0x208C, 0x5080},
{0x208E, 0x2084},
{0x2090, 0x12C8},
{0x2092, 0x7800},
{0x2094, 0x0802},
{0x2096, 0x040F},
{0x2098, 0x1007},
{0x209A, 0x0803},
{0x209C, 0x080B},
{0x209E, 0x3803},
{0x20A0, 0x0807},
{0x20A2, 0x0404},
{0x20A4, 0x0400},
{0x20A6, 0xFFFF},
{0x20A8, 0xF0B2},
{0x20AA, 0xFFEF},
{0x20AC, 0x0A84},
{0x20AE, 0x1292},
{0x20B0, 0xC02E},
{0x20B2, 0x4130},
{0x20B4, 0xF0B2},
{0x20B6, 0xFFBF},
{0x20B8, 0x2004},
{0x20BA, 0x403F},
{0x20BC, 0x00C3},
{0x20BE, 0x4FE2},
{0x20C0, 0x8318},
{0x20C2, 0x43CF},
{0x20C4, 0x0000},
{0x20C6, 0x9382},
{0x20C8, 0xC314},
{0x20CA, 0x2003},
{0x20CC, 0x12B0},
{0x20CE, 0xCAB0},
{0x20D0, 0x4130},
{0x20D2, 0x12B0},
{0x20D4, 0xC90A},
{0x20D6, 0x4130},
{0x20D8, 0x42D2},
{0x20DA, 0x8318},
{0x20DC, 0x00C3},
{0x20DE, 0x9382},
{0x20E0, 0xC314},
{0x20E2, 0x2009},
{0x20E4, 0x120B},
{0x20E6, 0x120A},
{0x20E8, 0x1209},
{0x20EA, 0x1208},
{0x20EC, 0x1207},
{0x20EE, 0x1206},
{0x20F0, 0x4030},
{0x20F2, 0xC15E},
{0x20F4, 0x4130},
{0x20F6, 0x1292},
{0x20F8, 0xC008},
{0x20FA, 0x4130},
{0x20FC, 0x42D2},
{0x20FE, 0x82A1},
{0x2100, 0x00C2},
{0x2102, 0x1292},
{0x2104, 0xC040},
{0x2106, 0x4130},
{0x2108, 0x1292},
{0x210A, 0xC006},
{0x210C, 0x42A2},
{0x210E, 0x7324},
{0x2110, 0x9382},
{0x2112, 0xC314},
{0x2114, 0x2011},
{0x2116, 0x425F},
{0x2118, 0x82A1},
{0x211A, 0xF25F},
{0x211C, 0x00C1},
{0x211E, 0xF35F},
{0x2120, 0x2406},
{0x2122, 0x425F},
{0x2124, 0x00C0},
{0x2126, 0xF37F},
{0x2128, 0x522F},
{0x212A, 0x4F82},
{0x212C, 0x7324},
{0x212E, 0x425F},
{0x2130, 0x82D4},
{0x2132, 0xF35F},
{0x2134, 0x4FC2},
{0x2136, 0x01B3},
{0x2138, 0x93C2},
{0x213A, 0x829F},
{0x213C, 0x2421},
{0x213E, 0x403E},
{0x2140, 0xFFFE},
{0x2142, 0x40B2},
{0x2144, 0xEC78},
{0x2146, 0x831C},
{0x2148, 0x40B2},
{0x214A, 0xEC78},
{0x214C, 0x831E},
{0x214E, 0x40B2},
{0x2150, 0xEC78},
{0x2152, 0x8320},
{0x2154, 0xB3D2},
{0x2156, 0x008C},
{0x2158, 0x2405},
{0x215A, 0x4E0F},
{0x215C, 0x503F},
{0x215E, 0xFFD8},
{0x2160, 0x4F82},
{0x2162, 0x831C},
{0x2164, 0x90F2},
{0x2166, 0x0003},
{0x2168, 0x008C},
{0x216A, 0x2401},
{0x216C, 0x4130},
{0x216E, 0x421F},
{0x2170, 0x831C},
{0x2172, 0x5E0F},
{0x2174, 0x4F82},
{0x2176, 0x831E},
{0x2178, 0x5E0F},
{0x217A, 0x4F82},
{0x217C, 0x8320},
{0x217E, 0x3FF6},
{0x2180, 0x432E},
{0x2182, 0x3FDF},
{0x2184, 0x421F},
{0x2186, 0x7100},
{0x2188, 0x4F0E},
{0x218A, 0x503E},
{0x218C, 0xFFD8},
{0x218E, 0x4E82},
{0x2190, 0x7A04},
{0x2192, 0x421E},
{0x2194, 0x831C},
{0x2196, 0x5F0E},
{0x2198, 0x4E82},
{0x219A, 0x7A06},
{0x219C, 0x0B00},
{0x219E, 0x7304},
{0x21A0, 0x0050},
{0x21A2, 0x40B2},
{0x21A4, 0xD081},
{0x21A6, 0x0B88},
{0x21A8, 0x421E},
{0x21AA, 0x831E},
{0x21AC, 0x5F0E},
{0x21AE, 0x4E82},
{0x21B0, 0x7A0E},
{0x21B2, 0x521F},
{0x21B4, 0x8320},
{0x21B6, 0x4F82},
{0x21B8, 0x7A10},
{0x21BA, 0x0B00},
{0x21BC, 0x7304},
{0x21BE, 0x007A},
{0x21C0, 0x40B2},
{0x21C2, 0x0081},
{0x21C4, 0x0B88},
{0x21C6, 0x4392},
{0x21C8, 0x7A0A},
{0x21CA, 0x0800},
{0x21CC, 0x7A0C},
{0x21CE, 0x0B00},
{0x21D0, 0x7304},
{0x21D2, 0x022B},
{0x21D4, 0x40B2},
{0x21D6, 0xD081},
{0x21D8, 0x0B88},
{0x21DA, 0x0B00},
{0x21DC, 0x7304},
{0x21DE, 0x0255},
{0x21E0, 0x40B2},
{0x21E2, 0x0081},
{0x21E4, 0x0B88},
{0x21E6, 0x4130},
{0x23FE, 0xC056},
{0x3232, 0xFC0C},
{0x3236, 0xFC22},
{0x3238, 0xFCFC},
{0x323A, 0xFD84},
{0x323C, 0xFD08},
{0x3246, 0xFCD8},
{0x3248, 0xFCA8},
{0x324E, 0xFCB4},
{0x326A, 0x8302},
{0x326C, 0x830A},
{0x326E, 0x0000},
{0x32CA, 0xFC28},
{0x32CC, 0xC3BC},
{0x32CE, 0xC34C},
{0x32D0, 0xC35A},
{0x32D2, 0xC368},
{0x32D4, 0xC376},
{0x32D6, 0xC3C2},
{0x32D8, 0xC3E6},
{0x32DA, 0x0003},
{0x32DC, 0x0003},
{0x32DE, 0x00C7},
{0x32E0, 0x0031},
{0x32E2, 0x0031},
{0x32E4, 0x0031},
{0x32E6, 0xFC28},
{0x32E8, 0xC3BC},
{0x32EA, 0xC384},
{0x32EC, 0xC392},
{0x32EE, 0xC3A0},
{0x32F0, 0xC3AE},
{0x32F2, 0xC3C4},
{0x32F4, 0xC3E6},
{0x32F6, 0x0003},
{0x32F8, 0x0003},
{0x32FA, 0x00C7},
{0x32FC, 0x0031},
{0x32FE, 0x0031},
{0x3300, 0x0031},
{0x3302, 0x82CA},
{0x3304, 0xC164},
{0x3306, 0x82E6},
{0x3308, 0xC19C},
{0x330A, 0x001F},
{0x330C, 0x001A},
{0x330E, 0x0034},
{0x3310, 0x0000},
{0x3312, 0x0000},
{0x3314, 0xFC94},
{0x3316, 0xC3D8},
{0x0A00, 0x0000},
{0x0E04, 0x0012},
{0x002E, 0x1111},
{0x0032, 0x1111},
{0x0022, 0x0008},
{0x0026, 0x0040},
{0x0028, 0x0017},
{0x002C, 0x09CF},
{0x005C, 0x2101},
{0x0006, 0x09DE},
{0x0008, 0x0ED8},
{0x000E, 0x0100},
{0x000C, 0x0022},
{0x0A22, 0x0000},
{0x0A24, 0x0000},
{0x0804, 0x0000},
{0x0A12, 0x0CC0},
{0x0A14, 0x0990},
{0x0074, 0x09D8},
{0x0076, 0x0000},
{0x051E, 0x0000},
{0x0200, 0x0400},
{0x0A1A, 0x0C00},
{0x0A0C, 0x0010},
{0x0A1E, 0x0CCF},
{0x0402, 0x0110},
{0x0404, 0x00F4},
{0x0408, 0x0000},
{0x0410, 0x008D},
{0x0412, 0x011A},
{0x0414, 0x864C},
/* For OTP */
{0x021C, 0x0003},
{0x021E, 0x0235},
/* For OTP */
{0x0C00, 0x9950},
{0x0C06, 0x0021},
{0x0C10, 0x0040},
{0x0C12, 0x0040},
{0x0C14, 0x0040},
{0x0C16, 0x0040},
{0x0A02, 0x0100},
{0x0A04, 0x015A},
{0x0418, 0x0000},
{0x0128, 0x0028},
{0x012A, 0xFFFF},
{0x0120, 0x0046},
{0x0122, 0x0376},
{0x012C, 0x0020},
{0x012E, 0xFFFF},
{0x0124, 0x0040},
{0x0126, 0x0378},
{0x0746, 0x0050},
{0x0748, 0x01D5},
{0x074A, 0x022B},
{0x074C, 0x03B0},
{0x0756, 0x043F},
{0x0758, 0x3F1D},
{0x0B02, 0xE04D},
{0x0B10, 0x6821},
{0x0B12, 0x0120},
{0x0B14, 0x0001},
{0x2008, 0x38FD},
{0x326E, 0x0000},
{0x0900, 0x0300},
{0x0902, 0xC319},
{0x0914, 0xC109},
{0x0916, 0x061A},
{0x0918, 0x0407},
{0x091A, 0x0A0B},
{0x091C, 0x0E08},
{0x091E, 0x0A00},
{0x090C, 0x0427},
{0x090E, 0x0059},
{0x0954, 0x0089},
{0x0956, 0x0000},
{0x0958, 0xCA80},
{0x095A, 0x9240},
{0x0F08, 0x2F04},
{0x0F30, 0x001F},
{0x0F36, 0x001F},
{0x0F04, 0x3A00},
{0x0F32, 0x025A},
{0x0F38, 0x025A},
{0x0F2A, 0x4124},
{0x006A, 0x0100},
{0x004C, 0x0100},
{0x0044, 0x0001},
};
static const struct hi846_reg mode_640x480_config[] = {
......@@ -261,7 +857,6 @@ static const struct hi846_reg mode_640x480_config[] = {
{HI846_REG_X_START_H, 0x0058},
{HI846_REG_X_OUTPUT_SIZE_H, 0x0280},
{HI846_REG_Y_OUTPUT_SIZE_H, 0x01E0},