Commit 41532b91 authored by Erik Andrén's avatar Erik Andrén Committed by Mauro Carvalho Chehab

V4L/DVB (12985): gspca - m5602-ov7660: Replace magic constants with defines

Signed-off-by: default avatarErik Andrén <erik.andren@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent bf40b382
...@@ -271,251 +271,174 @@ static const unsigned char init_ov7660[][4] = ...@@ -271,251 +271,174 @@ static const unsigned char init_ov7660[][4] =
}; };
static const unsigned char init2_ov7660[][4] = { static const unsigned char init2_ov7660[][4] = {
{BRIDGE, 0x13, 0x02}, {BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02},
{BRIDGE, 0x12, 0xb0}, {BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0},
{BRIDGE, 0x15, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00},
{BRIDGE, 0x14, 0xb0}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
{BRIDGE, 0x60, 0xc0}, {BRIDGE, M5602_XB_ADC_CTRL, 0xc0},
{BRIDGE, 0x00, 0x0d}, {BRIDGE, M5602_XB_SENSOR_TYPE, 0x0d},
{BRIDGE, 0x01, 0x00}, {BRIDGE, M5602_XB_SENSOR_CTRL, 0x00},
{BRIDGE, 0x77, 0x01}, {BRIDGE, M5602_XB_GPIO_DIR, 0x01},
{BRIDGE, 0x77, 0x01}, {BRIDGE, M5602_XB_GPIO_DIR, 0x01},
{BRIDGE, 0x15, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00},
{BRIDGE, 0x14, 0xb0}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
{BRIDGE, 0x60, 0xc0}, {BRIDGE, M5602_XB_ADC_CTRL, 0xc0},
{BRIDGE, 0x00, 0x0c}, {BRIDGE, M5602_XB_SENSOR_TYPE, 0x0c},
{BRIDGE, 0x77, 0x05}, {BRIDGE, M5602_XB_GPIO_DIR, 0x05},
{BRIDGE, 0x76, 0x00}, {BRIDGE, M5602_XB_GPIO_DAT, 0x00},
{BRIDGE, 0x74, 0x06}, {BRIDGE, M5602_XB_GPIO_EN_H, 0x06},
{BRIDGE, 0x75, 0x00}, {BRIDGE, M5602_XB_GPIO_EN_L, 0x00},
{SENSOR, 0x12, 0x80}, {SENSOR, OV7660_COM7, 0x80},
{SENSOR, 0x11, 0x80}, {SENSOR, OV7660_CLKRC, 0x80},
{SENSOR, 0x01, 0x80}, {SENSOR, OV7660_BLUE_GAIN, 0x80},
{SENSOR, 0x02, 0x80}, {SENSOR, OV7660_RED_GAIN, 0x80},
{SENSOR, 0x14, 0x4c}, {SENSOR, OV7660_COM9, 0x4c},
{SENSOR, 0x39, 0x43}, {SENSOR, OV7660_OFON, 0x43},
{SENSOR, 0x3c, 0x28}, {SENSOR, OV7660_COM12, 0x28},
{SENSOR, 0x13, 0x00}, {SENSOR, OV7660_COM8, 0x00},
{SENSOR, 0x15, 0x40}, {SENSOR, OV7660_COM10, 0x40},
{SENSOR, 0x17, 0x0c}, {SENSOR, OV7660_HSTART, 0x0c},
{SENSOR, 0x18, 0x61}, {SENSOR, OV7660_HSTOP, 0x61},
{SENSOR, 0x32, 0xa4}, {SENSOR, OV7660_HREF, 0xa4},
{SENSOR, 0x1b, 0x0b}, {SENSOR, OV7660_PSHFT, 0x0b},
{SENSOR, 0x19, 0x01}, {SENSOR, OV7660_VSTART, 0x01},
{SENSOR, 0x1a, 0x7a}, {SENSOR, OV7660_VSTOP, 0x7a},
{SENSOR, 0x03, 0x00}, {SENSOR, OV7660_VSTOP, 0x00},
{SENSOR, 0x12, 0x05}, {SENSOR, OV7660_COM7, 0x05},
{SENSOR, 0x0f, 0x42}, {SENSOR, OV7660_COM6, 0x42},
{SENSOR, 0x27, 0x94}, {SENSOR, OV7660_BBIAS, 0x94},
{SENSOR, 0x28, 0x94}, {SENSOR, OV7660_GbBIAS, 0x94},
{SENSOR, 0x29, 0x94}, {SENSOR, OV7660_RSVD29, 0x94},
{SENSOR, 0x2c, 0x94}, {SENSOR, OV7660_RBIAS, 0x94},
{SENSOR, 0x04, 0x00}, {SENSOR, OV7660_COM1, 0x00},
{SENSOR, 0x10, 0x00}, {SENSOR, OV7660_AECH, 0x00},
{SENSOR, 0x07, 0x00}, {SENSOR, OV7660_AECHH, 0x00},
{SENSOR, 0x37, 0x05}, {SENSOR, OV7660_ADC, 0x05},
{SENSOR, 0x3d, 0x00}, {SENSOR, OV7660_COM13, 0x00},
{SENSOR, 0xa1, 0x23}, {SENSOR, OV7660_RSVDA1, 0x23},
{SENSOR, 0x3a, 0x0d}, {SENSOR, OV7660_TSLB, 0x0d},
{SENSOR, 0x69, 0x80}, {SENSOR, OV7660_HV, 0x80},
{SENSOR, 0x62, 0x00}, {SENSOR, OV7660_LCC1, 0x00},
{SENSOR, 0x63, 0x00}, {SENSOR, OV7660_LCC2, 0x00},
{SENSOR, 0x64, 0x10}, {SENSOR, OV7660_LCC3, 0x10},
{SENSOR, 0x65, 0x40}, {SENSOR, OV7660_LCC4, 0x40},
{SENSOR, 0x66, 0x01}, {SENSOR, OV7660_LCC5, 0x01},
{BRIDGE, 0x15, 0x06}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06},
{BRIDGE, 0x14, 0xb0}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
{BRIDGE, 0x60, 0xc0}, {BRIDGE, M5602_XB_ADC_CTRL, 0xc0},
{BRIDGE, 0x00, 0x0c}, {BRIDGE, M5602_XB_SENSOR_TYPE, 0x0c},
{BRIDGE, 0x02, 0x81}, {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x81},
{BRIDGE, 0x04, 0x82}, {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82},
{BRIDGE, 0x0a, 0x01}, {BRIDGE, M5602_XB_SIG_INI, 0x01},
{BRIDGE, 0x06, 0x00}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, 0x06, 0x08}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x08},
{BRIDGE, 0x06, 0x00}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, 0x06, 0x00}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, 0x06, 0x01}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x01},
{BRIDGE, 0x06, 0xec}, {BRIDGE, M5602_XB_VSYNC_PARA, 0xec},
{BRIDGE, 0x06, 0x00}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, 0x06, 0x00}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, 0x0a, 0x00}, {BRIDGE, M5602_XB_SIG_INI, 0x00},
{BRIDGE, 0x0a, 0x02}, {BRIDGE, M5602_XB_SIG_INI, 0x02},
{BRIDGE, 0x07, 0x00}, {BRIDGE, M5602_XB_HSYNC_PARA, 0x00},
{BRIDGE, 0x07, 0x27}, {BRIDGE, M5602_XB_HSYNC_PARA, 0x27},
{BRIDGE, 0x07, 0x02}, {BRIDGE, M5602_XB_HSYNC_PARA, 0x02},
{BRIDGE, 0x07, 0xae}, {BRIDGE, M5602_XB_HSYNC_PARA, 0xae},
{BRIDGE, 0x0a, 0x00}, {BRIDGE, M5602_XB_SIG_INI, 0x00},
{SENSOR, 0x01, 0x80}, {SENSOR, OV7660_BLUE_GAIN, 0x80},
{SENSOR, 0x02, 0x80}, {SENSOR, OV7660_RED_GAIN, 0x80},
{BRIDGE, 0x15, 0x02}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x02},
{BRIDGE, 0x14, 0xb0}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
{SENSOR, 0x10, 0x20}, {SENSOR, OV7660_AECH, 0x20},
{SENSOR, 0x04, 0x00}, {SENSOR, OV7660_COM1, 0x00},
{SENSOR, 0x00, 0x07}, {SENSOR, OV7660_GAIN, 0x07},
{SENSOR, 0x39, 0x0c}, {SENSOR, OV7660_OFON, 0x0c},
{SENSOR, 0x09, 0x11}, {SENSOR, OV7660_COM2, 0x11},
{SENSOR, 0x12, 0x05}, {SENSOR, OV7660_COM7, 0x05},
{BRIDGE, 0x77, 0x01}, {BRIDGE, M5602_XB_GPIO_DIR, 0x01},
{BRIDGE, 0x76, 0x04}, {BRIDGE, M5602_XB_GPIO_DAT, 0x04},
{BRIDGE, 0x74, 0x06}, {BRIDGE, M5602_XB_GPIO_EN_H, 0x06},
{BRIDGE, 0x72, 0x06}, {BRIDGE, M5602_XB_GPIO_DIR_H, 0x06},
{BRIDGE, 0x70, 0x00}, {BRIDGE, M5602_XB_GPIO_DAT_H, 0x00},
{BRIDGE, 0x15, 0x08}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x08},
{BRIDGE, 0x14, 0xb0}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
{BRIDGE, 0x15, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00},
{BRIDGE, 0x14, 0xb0}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
{BRIDGE, 0x60, 0xc0}, {BRIDGE, M5602_XB_ADC_CTRL, 0xc0},
{BRIDGE, 0x00, 0x0c}, {BRIDGE, M5602_XB_SENSOR_TYPE, 0x0c},
{BRIDGE, 0x77, 0x05}, {BRIDGE, M5602_XB_GPIO_DIR, 0x05},
{BRIDGE, 0x76, 0x00}, {BRIDGE, M5602_XB_GPIO_DAT, 0x00},
{BRIDGE, 0x74, 0x06}, {BRIDGE, M5602_XB_GPIO_EN_H, 0x06},
{BRIDGE, 0x75, 0x00}, {BRIDGE, M5602_XB_GPIO_EN_L, 0x00},
{SENSOR, 0x12, 0x80}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06},
{SENSOR, 0x11, 0x80}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
{SENSOR, 0x01, 0x80}, {BRIDGE, M5602_XB_ADC_CTRL, 0xc0},
{SENSOR, 0x02, 0x80}, {BRIDGE, M5602_XB_SENSOR_TYPE, 0x0c},
{SENSOR, 0x14, 0x4c}, {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x81},
{SENSOR, 0x39, 0x43}, {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82},
{SENSOR, 0x3c, 0x28}, {BRIDGE, M5602_XB_SIG_INI, 0x01},
{SENSOR, 0x13, 0x00}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{SENSOR, 0x15, 0x40}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x08},
{SENSOR, 0x17, 0x0c}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{SENSOR, 0x18, 0x61}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{SENSOR, 0x32, 0xa4}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x01},
{SENSOR, 0x1b, 0x0b}, {BRIDGE, M5602_XB_VSYNC_PARA, 0xec},
{SENSOR, 0x19, 0x01}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{SENSOR, 0x1a, 0x7a}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{SENSOR, 0x03, 0x00}, {BRIDGE, M5602_XB_SIG_INI, 0x00},
{SENSOR, 0x12, 0x05}, {BRIDGE, M5602_XB_SIG_INI, 0x02},
{SENSOR, 0x0f, 0x42}, {BRIDGE, M5602_XB_HSYNC_PARA, 0x00},
{SENSOR, 0x27, 0x94}, {BRIDGE, M5602_XB_HSYNC_PARA, 0x27},
{SENSOR, 0x28, 0x94}, {BRIDGE, M5602_XB_HSYNC_PARA, 0x02},
{SENSOR, 0x29, 0x94}, {BRIDGE, M5602_XB_HSYNC_PARA, 0xae},
{SENSOR, 0x2c, 0x94}, {BRIDGE, M5602_XB_SIG_INI, 0x00},
{SENSOR, 0x04, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00},
{SENSOR, 0x10, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
{SENSOR, 0x07, 0x00}, {SENSOR, OV7660_AECH, 0x5f},
{SENSOR, 0x37, 0x05}, {SENSOR, OV7660_COM1, 0x03},
{SENSOR, 0x3d, 0x00}, {SENSOR, OV7660_GAIN, 0x02},
{SENSOR, 0xa1, 0x23}, {SENSOR, OV7660_OFON, 0x0c},
{SENSOR, 0x3a, 0x0d}, {SENSOR, OV7660_COM2, 0x11},
{SENSOR, 0x69, 0x80}, {SENSOR, OV7660_COM7, 0x05},
{SENSOR, 0x62, 0x00}, {BRIDGE, M5602_XB_GPIO_DIR, 0x01},
{SENSOR, 0x63, 0x00}, {BRIDGE, M5602_XB_GPIO_DAT, 0x04},
{SENSOR, 0x64, 0x10}, {BRIDGE, M5602_XB_GPIO_EN_H, 0x06},
{SENSOR, 0x65, 0x40}, {BRIDGE, M5602_XB_GPIO_DIR_H, 0x06},
{SENSOR, 0x66, 0x01}, {BRIDGE, M5602_XB_GPIO_DAT_H, 0x00},
{BRIDGE, 0x15, 0x06}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x08},
{BRIDGE, 0x14, 0xb0}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
{BRIDGE, 0x60, 0xc0}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00},
{BRIDGE, 0x00, 0x0c}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
{BRIDGE, 0x02, 0x81}, {BRIDGE, M5602_XB_ADC_CTRL, 0xc0},
{BRIDGE, 0x04, 0x82}, {BRIDGE, M5602_XB_SENSOR_TYPE, 0x0c},
{BRIDGE, 0x0a, 0x01}, {BRIDGE, M5602_XB_GPIO_DIR, 0x05},
{BRIDGE, 0x06, 0x00}, {BRIDGE, M5602_XB_GPIO_DAT, 0x00},
{BRIDGE, 0x06, 0x08}, {BRIDGE, M5602_XB_GPIO_EN_H, 0x06},
{BRIDGE, 0x06, 0x00}, {BRIDGE, M5602_XB_GPIO_EN_L, 0x00},
{BRIDGE, 0x06, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06},
{BRIDGE, 0x06, 0x01}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
{BRIDGE, 0x06, 0xec}, {BRIDGE, M5602_XB_ADC_CTRL, 0xc0},
{BRIDGE, 0x06, 0x00}, {BRIDGE, M5602_XB_SENSOR_TYPE, 0x0c},
{BRIDGE, 0x06, 0x00}, {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x81},
{BRIDGE, 0x0a, 0x00}, {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82},
{BRIDGE, 0x0a, 0x02}, {BRIDGE, M5602_XB_SIG_INI, 0x01},
{BRIDGE, 0x07, 0x00}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, 0x07, 0x27}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x08},
{BRIDGE, 0x07, 0x02}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, 0x07, 0xae}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, 0x0a, 0x00}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x01},
{SENSOR, 0x01, 0x80}, {BRIDGE, M5602_XB_VSYNC_PARA, 0xec},
{SENSOR, 0x02, 0x80}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, 0x15, 0x00}, {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, 0x14, 0xb0}, {BRIDGE, M5602_XB_SIG_INI, 0x00},
{SENSOR, 0x10, 0x5f}, {BRIDGE, M5602_XB_SIG_INI, 0x02},
{SENSOR, 0x04, 0x03}, {BRIDGE, M5602_XB_HSYNC_PARA, 0x00},
{SENSOR, 0x00, 0x02}, {BRIDGE, M5602_XB_HSYNC_PARA, 0x27},
{SENSOR, 0x39, 0x0c}, {BRIDGE, M5602_XB_HSYNC_PARA, 0x02},
{SENSOR, 0x09, 0x11}, {BRIDGE, M5602_XB_HSYNC_PARA, 0xae},
{SENSOR, 0x12, 0x05}, {BRIDGE, M5602_XB_SIG_INI, 0x00},
{BRIDGE, 0x77, 0x01}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00},
{BRIDGE, 0x76, 0x04}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
{BRIDGE, 0x74, 0x06},
{BRIDGE, 0x72, 0x06},
{BRIDGE, 0x70, 0x00},
{BRIDGE, 0x15, 0x08},
{BRIDGE, 0x14, 0xb0},
{BRIDGE, 0x15, 0x00},
{BRIDGE, 0x14, 0xb0},
{BRIDGE, 0x60, 0xc0},
{BRIDGE, 0x00, 0x0c},
{BRIDGE, 0x77, 0x05},
{BRIDGE, 0x76, 0x00},
{BRIDGE, 0x74, 0x06},
{BRIDGE, 0x75, 0x00},
{SENSOR, 0x12, 0x80},
{SENSOR, 0x11, 0x80},
{SENSOR, 0x01, 0x80},
{SENSOR, 0x02, 0x80},
{SENSOR, 0x14, 0x4c},
{SENSOR, 0x39, 0x43},
{SENSOR, 0x3c, 0x28},
{SENSOR, 0x13, 0x00},
{SENSOR, 0x15, 0x40},
{SENSOR, 0x17, 0x0c},
{SENSOR, 0x18, 0x61},
{SENSOR, 0x32, 0xa4},
{SENSOR, 0x1b, 0x0b},
{SENSOR, 0x19, 0x01},
{SENSOR, 0x1a, 0x7a},
{SENSOR, 0x03, 0x00},
{SENSOR, 0x12, 0x05},
{SENSOR, 0x0f, 0x42},
{SENSOR, 0x27, 0x94},
{SENSOR, 0x28, 0x94},
{SENSOR, 0x29, 0x94},
{SENSOR, 0x2c, 0x94},
{SENSOR, 0x04, 0x00},
{SENSOR, 0x10, 0x00},
{SENSOR, 0x07, 0x00},
{SENSOR, 0x37, 0x05},
{SENSOR, 0x3d, 0x00},
{SENSOR, 0xa1, 0x23},
{SENSOR, 0x3a, 0x0d},
{SENSOR, 0x69, 0x80},
{SENSOR, 0x62, 0x00},
{SENSOR, 0x63, 0x00},
{SENSOR, 0x64, 0x10},
{SENSOR, 0x65, 0x40},
{SENSOR, 0x66, 0x01},
{BRIDGE, 0x15, 0x06},
{BRIDGE, 0x14, 0xb0},
{BRIDGE, 0x60, 0xc0},
{BRIDGE, 0x00, 0x0c},
{BRIDGE, 0x02, 0x81},
{BRIDGE, 0x04, 0x82},
{BRIDGE, 0x0a, 0x01},
{BRIDGE, 0x06, 0x00},
{BRIDGE, 0x06, 0x08},
{BRIDGE, 0x06, 0x00},
{BRIDGE, 0x06, 0x00},
{BRIDGE, 0x06, 0x01},
{BRIDGE, 0x06, 0xec},
{BRIDGE, 0x06, 0x00},
{BRIDGE, 0x06, 0x00},
{BRIDGE, 0x0a, 0x00},
{BRIDGE, 0x0a, 0x02},
{BRIDGE, 0x07, 0x00},
{BRIDGE, 0x07, 0x27},
{BRIDGE, 0x07, 0x02},
{BRIDGE, 0x07, 0xae},
{BRIDGE, 0x0a, 0x00},
{SENSOR, 0x01, 0x80},
{SENSOR, 0x02, 0x80},
{BRIDGE, 0x15, 0x00},
{BRIDGE, 0x14, 0xb0},
{SENSOR, 0x10, 0x5f},
{SENSOR, 0x04, 0x03},
{SENSOR, 0x00, 0x02}
}; };
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment