Commit 6822df52 authored by Erik Andr?n's avatar Erik Andr?n Committed by Mauro Carvalho Chehab

V4L/DVB (11480): gspca - m5602-mt9m111: Remove lots of redundant sensor reads

Signed-off-by: default avatarErik Andr?n <erik.andren@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2ed3bf30
...@@ -193,7 +193,6 @@ static const unsigned char init_mt9m111[][4] = ...@@ -193,7 +193,6 @@ static const unsigned char init_mt9m111[][4] =
{SENSOR, MT9M111_SC_RESET, 0x00, 0x0c}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x0c},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x04}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x04},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x01}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x01},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0xb3, 0x00},
{SENSOR, MT9M111_CP_GLOBAL_CLK_CONTROL, 0x00, 0x03}, {SENSOR, MT9M111_CP_GLOBAL_CLK_CONTROL, 0x00, 0x03},
{BRIDGE, M5602_XB_GPIO_EN_H, 0x06, 0x00}, {BRIDGE, M5602_XB_GPIO_EN_H, 0x06, 0x00},
{BRIDGE, M5602_XB_GPIO_EN_L, 0x00, 0x00}, {BRIDGE, M5602_XB_GPIO_EN_L, 0x00, 0x00},
...@@ -209,81 +208,30 @@ static const unsigned char init_mt9m111[][4] = ...@@ -209,81 +208,30 @@ static const unsigned char init_mt9m111[][4] =
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x09}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x09},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x29}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x29},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x08}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x08},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x0c}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x0c},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x04}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x04},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x01}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x01},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0xb3, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_CP_GLOBAL_CLK_CONTROL, 0x00, 0x03}, {SENSOR, MT9M111_CP_GLOBAL_CLK_CONTROL, 0x00, 0x03},
{BRIDGE, M5602_XB_GPIO_EN_H, 0x06, 0x00},
{BRIDGE, M5602_XB_GPIO_EN_L, 0x00, 0x00},
{BRIDGE, M5602_XB_I2C_CLK_DIV, 0x0a, 0x00},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x05}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x05},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x29}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x29},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x33, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x09}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x09},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x29}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x29},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x08}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x08},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x0c}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x0c},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x04}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x04},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x01}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x01},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0xb3, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_CP_GLOBAL_CLK_CONTROL, 0x00, 0x03}, {SENSOR, MT9M111_CP_GLOBAL_CLK_CONTROL, 0x00, 0x03},
{BRIDGE, M5602_XB_GPIO_DIR, 0x05, 0x00}, {BRIDGE, M5602_XB_GPIO_DIR, 0x05, 0x00},
{BRIDGE, M5602_XB_GPIO_DAT, 0x04, 0x00}, {BRIDGE, M5602_XB_GPIO_DAT, 0x04, 0x00},
{BRIDGE, M5602_XB_GPIO_EN_H, 0x3e, 0x00}, {BRIDGE, M5602_XB_GPIO_EN_H, 0x3e, 0x00},
...@@ -292,8 +240,6 @@ static const unsigned char init_mt9m111[][4] = ...@@ -292,8 +240,6 @@ static const unsigned char init_mt9m111[][4] =
{BRIDGE, M5602_XB_GPIO_EN_L, 0xff, 0x00}, {BRIDGE, M5602_XB_GPIO_EN_L, 0xff, 0x00},
{BRIDGE, M5602_XB_GPIO_DIR_L, 0xff, 0x00}, {BRIDGE, M5602_XB_GPIO_DIR_L, 0xff, 0x00},
{BRIDGE, M5602_XB_GPIO_DAT_L, 0x00, 0x00}, {BRIDGE, M5602_XB_GPIO_DAT_L, 0x00, 0x00},
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x04, 0x00},
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00}, {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
{BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00}, {BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
...@@ -305,21 +251,12 @@ static const unsigned char init_mt9m111[][4] = ...@@ -305,21 +251,12 @@ static const unsigned char init_mt9m111[][4] =
{BRIDGE, M5602_XB_GPIO_EN_H, 0x06, 0x00}, {BRIDGE, M5602_XB_GPIO_EN_H, 0x06, 0x00},
{BRIDGE, M5602_XB_GPIO_EN_L, 0x00, 0x00}, {BRIDGE, M5602_XB_GPIO_EN_L, 0x00, 0x00},
{BRIDGE, M5602_XB_I2C_CLK_DIV, 0x0a, 0x00}, {BRIDGE, M5602_XB_I2C_CLK_DIV, 0x0a, 0x00},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x05}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x05},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x29}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x29},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x0d, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_SC_RESET, 0x00, 0x08}, {SENSOR, MT9M111_SC_RESET, 0x00, 0x08},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x01}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x01},
{SENSOR, MT9M111_CP_OPERATING_MODE_CTL, 0x00, {SENSOR, MT9M111_CP_OPERATING_MODE_CTL, 0x00,
...@@ -332,30 +269,13 @@ static const unsigned char init_mt9m111[][4] = ...@@ -332,30 +269,13 @@ static const unsigned char init_mt9m111[][4] =
{SENSOR, MT9M111_CP_OUTPUT_FORMAT_CTL2_CONTEXT_A, 0x14, 0x00}, {SENSOR, MT9M111_CP_OUTPUT_FORMAT_CTL2_CONTEXT_A, 0x14, 0x00},
{SENSOR, MT9M111_CP_OUTPUT_FORMAT_CTL2_CONTEXT_B, 0x14, 0x00}, {SENSOR, MT9M111_CP_OUTPUT_FORMAT_CTL2_CONTEXT_B, 0x14, 0x00},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0xcd, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, 0xcd, 0x00, 0x0e}, {SENSOR, 0xcd, 0x00, 0x0e},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0xd0, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, 0xd0, 0x00, 0x40}, {SENSOR, 0xd0, 0x00, 0x40},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x02}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x02},
{SENSOR, MT9M111_CC_AUTO_EXPOSURE_PARAMETER_18, 0x00, 0x00}, {SENSOR, MT9M111_CC_AUTO_EXPOSURE_PARAMETER_18, 0x00, 0x00},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x28, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_CC_AWB_PARAMETER_7, 0xef, 0x07},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x28, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, MT9M111_CC_AWB_PARAMETER_7, 0xef, 0x03}, {SENSOR, MT9M111_CC_AWB_PARAMETER_7, 0xef, 0x03},
{SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00}, {SENSOR, MT9M111_PAGE_MAP, 0x00, 0x00},
{BRIDGE, M5602_XB_I2C_DEV_ADDR, 0xba, 0x00},
{BRIDGE, M5602_XB_I2C_REG_ADDR, 0x33, 0x00},
{BRIDGE, M5602_XB_I2C_CTRL, 0x1a, 0x00},
{SENSOR, 0x33, 0x03, 0x49}, {SENSOR, 0x33, 0x03, 0x49},
{SENSOR, 0x34, 0xc0, 0x19}, {SENSOR, 0x34, 0xc0, 0x19},
{SENSOR, 0x3f, 0x20, 0x20}, {SENSOR, 0x3f, 0x20, 0x20},
......
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