Commit c84f43a8 authored by Dave Stevenson's avatar Dave Stevenson Committed by Mauro Carvalho Chehab
Browse files

media: i2c: ov9282: Add support for 1280x800 and 640x400 modes



Adds register settings for additional modes.

Signed-off-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: default avatarJacopo Mondi <jacopo@jmondi.org>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 2cb730c6
Loading
Loading
Loading
Loading
+102 −1
Original line number Diff line number Diff line
@@ -246,11 +246,44 @@ struct ov9282_reg_list common_regs_list = {
	.regs = common_regs,
};

#define MODE_1280_720		0
#define MODE_1280_800		0
#define MODE_1280_720		1
#define MODE_640_400		2

#define DEFAULT_MODE		MODE_1280_720

/* Sensor mode registers */
static const struct ov9282_reg mode_1280x800_regs[] = {
	{0x3778, 0x00},
	{0x3800, 0x00},
	{0x3801, 0x00},
	{0x3802, 0x00},
	{0x3803, 0x00},
	{0x3804, 0x05},
	{0x3805, 0x0f},
	{0x3806, 0x03},
	{0x3807, 0x2f},
	{0x3808, 0x05},
	{0x3809, 0x00},
	{0x380a, 0x03},
	{0x380b, 0x20},
	{0x3810, 0x00},
	{0x3811, 0x08},
	{0x3812, 0x00},
	{0x3813, 0x08},
	{0x3814, 0x11},
	{0x3815, 0x11},
	{0x3820, 0x40},
	{0x3821, 0x00},
	{0x4003, 0x40},
	{0x4008, 0x04},
	{0x4009, 0x0b},
	{0x400c, 0x00},
	{0x400d, 0x07},
	{0x4507, 0x00},
	{0x4509, 0x00},
};

static const struct ov9282_reg mode_1280x720_regs[] = {
	{0x3778, 0x00},
	{0x3800, 0x00},
@@ -282,8 +315,57 @@ static const struct ov9282_reg mode_1280x720_regs[] = {
	{0x4509, 0x80},
};

static const struct ov9282_reg mode_640x400_regs[] = {
	{0x3778, 0x10},
	{0x3800, 0x00},
	{0x3801, 0x00},
	{0x3802, 0x00},
	{0x3803, 0x00},
	{0x3804, 0x05},
	{0x3805, 0x0f},
	{0x3806, 0x03},
	{0x3807, 0x2f},
	{0x3808, 0x02},
	{0x3809, 0x80},
	{0x380a, 0x01},
	{0x380b, 0x90},
	{0x3810, 0x00},
	{0x3811, 0x04},
	{0x3812, 0x00},
	{0x3813, 0x04},
	{0x3814, 0x31},
	{0x3815, 0x22},
	{0x3820, 0x60},
	{0x3821, 0x01},
	{0x4008, 0x02},
	{0x4009, 0x05},
	{0x400c, 0x00},
	{0x400d, 0x03},
	{0x4507, 0x03},
	{0x4509, 0x80},
};

/* Supported sensor mode configurations */
static const struct ov9282_mode supported_modes[] = {
	[MODE_1280_800] = {
		.width = 1280,
		.height = 800,
		.hblank_min = { 250, 176 },
		.vblank = 1022,
		.vblank_min = 110,
		.vblank_max = 51540,
		.link_freq_idx = 0,
		.crop = {
			.left = OV9282_PIXEL_ARRAY_LEFT,
			.top = OV9282_PIXEL_ARRAY_TOP,
			.width = 1280,
			.height = 800
		},
		.reg_list = {
			.num_of_regs = ARRAY_SIZE(mode_1280x800_regs),
			.regs = mode_1280x800_regs,
		},
	},
	[MODE_1280_720] = {
		.width = 1280,
		.height = 720,
@@ -307,6 +389,25 @@ static const struct ov9282_mode supported_modes[] = {
			.regs = mode_1280x720_regs,
		},
	},
	[MODE_640_400] = {
		.width = 640,
		.height = 400,
		.hblank_min = { 890, 816 },
		.vblank = 1022,
		.vblank_min = 22,
		.vblank_max = 51540,
		.link_freq_idx = 0,
		.crop = {
			.left = OV9282_PIXEL_ARRAY_LEFT,
			.top = OV9282_PIXEL_ARRAY_TOP,
			.width = 1280,
			.height = 800
		},
		.reg_list = {
			.num_of_regs = ARRAY_SIZE(mode_640x400_regs),
			.regs = mode_640x400_regs,
		},
	},
};

/**