diff --git a/drivers/media/i2c/gc8613.c b/drivers/media/i2c/gc8613.c index f3f2670da473..0a4b248fe5eb 100644 --- a/drivers/media/i2c/gc8613.c +++ b/drivers/media/i2c/gc8613.c @@ -9,6 +9,7 @@ * V0.0X01.0X03 add support thunder boot. * V0.0X01.0X04 add support linear 3840x2160@30fps for gc8613 ya. * V0.0X01.0X05 add support staggered hdr 3840x2160@30fps for gc8613 ya. + * V0.0X01.0X06 add support linear 3840x2160@40fps for gc8613 ya. */ //#define DEBUG @@ -35,7 +36,7 @@ #include "cam-tb-setup.h" #include "cam-sleep-wakeup.h" -#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x05) +#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x06) #ifndef V4L2_CID_DIGITAL_GAIN #define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN @@ -892,6 +893,222 @@ static const struct regval __maybe_unused gc8613ya_linear_10bit_3840x2160_30fps_ {REG_NULL, 0x00}, }; +/* + * Xclk 24Mhz + * max_framerate 40fps + * mipi_datarate per lane 1458Mbps, 4lane + * 10-bit 3840x2160@40fps + * linear mode + * release_liner_v2.2.1_04_4lane_raw10_3840x2160_40fps_24mhz_GC8613YA.txt + */ +static const struct regval __maybe_unused gc8613ya_linear_10bit_3840x2160_40fps_regs[] = { + {0x03fe, 0xf0}, + {0x03fe, 0x00}, + {0x03fe, 0x10}, + {0x0a38, 0x01}, + {0x0a20, 0x19}, + {0x061b, 0x17}, + {0x061c, 0x44}, + {0x061d, 0x05}, + {0x061e, 0x75}, + {0x061f, 0x04}, + {0x0a21, 0x10}, + {0x0a30, 0x00}, + {0x0a31, 0xf3}, + {0x0a34, 0x40}, + {0x0a35, 0x08}, + {0x0a37, 0x44}, + {0x0314, 0x50}, + {0x031c, 0xce}, + {0x0219, 0x47}, + {0x0342, 0x03}, + {0x0343, 0xb4}, + {0x0259, 0x08}, + {0x025a, 0x96}, + {0x0340, 0x09}, + {0x0341, 0x0a}, + {0x0351, 0x00}, + {0x0345, 0x02}, + {0x0347, 0x02}, + {0x0348, 0x0f}, + {0x0349, 0x18}, + {0x034a, 0x08}, + {0x034b, 0x88}, + {0x034f, 0xf0}, + {0x0094, 0x0f}, + {0x0095, 0x00}, + {0x0096, 0x08}, + {0x0097, 0x70}, + {0x0099, 0x0c}, + {0x009b, 0x0c}, + {0x060c, 0x06}, + {0x060e, 0x20}, + {0x060f, 0x0f}, + {0x070c, 0x06}, + {0x070e, 0x20}, + {0x070f, 0x0f}, + {0x0087, 0x50}, + {0x141b, 0x03}, + {0x0901, 0x0e}, + {0x0907, 0xd5}, + {0x0909, 0x06}, + {0x0902, 0x0b}, + {0x0904, 0x08}, + {0x0908, 0x09}, + {0x0903, 0xc5}, + {0x090c, 0x09}, + {0x0905, 0x10}, + {0x0906, 0x00}, + {0x0724, 0x2b}, + {0x0727, 0x2b}, + {0x072b, 0x1a}, + {0x072a, 0x5e}, + {0x0601, 0x00}, + {0x073e, 0x40}, + {0x0078, 0x88}, + {0x0618, 0x01}, + {0x1466, 0x12}, + {0x1468, 0x07}, + {0x1467, 0x07}, + {0x1478, 0x10}, + {0x1477, 0x10}, + {0x0709, 0x40}, + {0x0719, 0x40}, + {0x1469, 0x80}, + {0x146a, 0x20}, + {0x146b, 0x03}, + {0x1479, 0x80}, + {0x147a, 0x20}, + {0x147b, 0x03}, + {0x1480, 0x02}, + {0x1481, 0x80}, + {0x1482, 0x02}, + {0x1483, 0x80}, + {0x1484, 0x08}, + {0x1485, 0xc0}, + {0x1486, 0x08}, + {0x1487, 0xc0}, + {0x1407, 0x10}, + {0x1408, 0x16}, + {0x1409, 0x03}, + {0x1434, 0x04}, + {0x1447, 0x75}, + {0x140d, 0x04}, + {0x1461, 0x10}, + {0x146c, 0x10}, + {0x146d, 0x10}, + {0x146e, 0x2e}, + {0x146f, 0x30}, + {0x1474, 0x34}, + {0x1470, 0x10}, + {0x1471, 0x13}, + {0x143a, 0x00}, + {0x024b, 0x02}, + {0x0245, 0xc7}, + {0x025b, 0x07}, + {0x02bb, 0x77}, + {0x0612, 0x01}, + {0x0613, 0x26}, + {0x0243, 0x66}, + {0x0087, 0x53}, + {0x0053, 0x05}, + {0x0089, 0x02}, + {0x0002, 0xeb}, + {0x005a, 0x0c}, + {0x0040, 0x83}, + {0x0075, 0x58}, + {0x0205, 0x0c}, + {0x0202, 0x06}, + {0x0203, 0x27}, + {0x061a, 0x02}, + {0x0122, 0x12}, + {0x0123, 0x50}, + {0x0126, 0x0f}, + {0x0129, 0x10}, + {0x012a, 0x20}, + {0x012b, 0x10}, + {0x03fe, 0x00}, + {0x0106, 0x78}, + {0x0136, 0x00}, + {0x0181, 0xf0}, + {0x0185, 0x01}, + {0x0180, 0x46}, + {0x0106, 0x38}, + {0x010d, 0xc0}, + {0x010e, 0x12}, + {0x0113, 0x02}, + {0x0114, 0x03}, + {0x0100, 0x09}, + {0x0619, 0x01}, + {0x023b, 0x58}, + {0x023e, 0x00}, + {0x023f, 0x84}, + {0x0220, 0x80}, + {0x021b, 0x96}, + {0x0004, 0x0f}, + {0x000e, 0x07}, + {0x0219, 0x47}, + {0x0054, 0x98}, + {0x0076, 0x01}, + {0x0052, 0x02}, + {0x021a, 0x10}, + {0x0430, 0x10}, + {0x0431, 0x10}, + {0x0432, 0x10}, + {0x0433, 0x10}, + {0x0434, 0x6d}, + {0x0435, 0x6d}, + {0x0436, 0x6d}, + {0x0437, 0x6d}, + {0x0704, 0x03}, + {0x0706, 0x02}, + {0x0716, 0x02}, + {0x0708, 0xc8}, + {0x0718, 0xc8}, + {0x071d, 0xdc}, + {0x071e, 0x05}, //otp autoload + {0x031f, 0x01}, + {0x031f, 0x00}, + {0x0a67, 0x80}, + {0x0a54, 0x0e}, + {0x0a65, 0x10}, + {0x0a98, 0x04}, + {0x05be, 0x00}, + {0x05a9, 0x01}, + {0x0089, 0x02}, + {0x0aa0, 0x00}, + {0x0023, 0x00}, + {0x0022, 0x00}, + {0x0025, 0x00}, + {0x0024, 0x00}, + {0x0028, 0x0f}, + {0x0029, 0x18}, + {0x002a, 0x08}, + {0x002b, 0x88}, + {0x0317, 0x1c}, + {0x0a70, 0x03}, + {0x0a82, 0x00}, + {0x0a83, 0xe0}, + {0x0a71, 0x00}, + {0x0a72, 0x02}, + {0x0a73, 0x60}, + {0x0a75, 0x41}, + {0x0a70, 0x03}, + {0x0a5a, 0x80}, + {REG_DELAY, 0x14}, //sleep 20 + {0x0089, 0x02}, + {0x05be, 0x01}, + {0x0a70, 0x00}, + {0x0080, 0x02}, + {0x0a67, 0x00}, + {0x0020, 0x01}, + {0x024b, 0x02}, + {0x0220, 0x80}, + {0x0058, 0x00}, + {0x0059, 0x04}, + {REG_NULL, 0x00}, +}; + //version 2.2 // //mclk 24MHz, mipiclk 1458Mbps, wpclk 351MHz, rpclk 291.6MHz @@ -1550,6 +1767,24 @@ static const struct gc8613_mode supported_modes[] = { .mipi_freq_idx = 0, .bpp = 10, }, + { + .width = 3840, + .height = 2160, + .max_fps = { + .numerator = 10000, + .denominator = 400000, + }, + .exp_def = 0x0100, + .hts_def = 0x03b4, + .vts_def = 0x090a, + .bus_fmt = MEDIA_BUS_FMT_SRGGB10_1X10, + .reg_list[0] = NULL, + .reg_list[1] = gc8613ya_linear_10bit_3840x2160_40fps_regs, + .hdr_mode = NO_HDR, + .vc[PAD0] = 0, + .mipi_freq_idx = 0, + .bpp = 10, + }, { .width = 3840, .height = 2160,