update(driver): adapt v1.1 hardware configuration.
This commit is contained in:
@@ -677,12 +677,26 @@ static int sensor_power(int id, int on)
|
||||
vin_set_mclk_freq(id, MCLK);
|
||||
vin_set_mclk(id, 1);
|
||||
hal_usleep(1000);
|
||||
vin_gpio_set_status(id, PWDN, 1);
|
||||
vin_gpio_set_status(id, RESET, 1);
|
||||
// vin_gpio_set_status(id, 163, 1);
|
||||
// vin_gpio_write(id, 163, CSI_GPIO_LOW);
|
||||
vin_gpio_write(id, PWDN, CSI_GPIO_LOW);
|
||||
vin_gpio_write(id, RESET, CSI_GPIO_LOW);
|
||||
hal_usleep(1000);
|
||||
vin_gpio_write(id, PWDN, CSI_GPIO_HIGH);
|
||||
vin_gpio_write(id, RESET, CSI_GPIO_HIGH);
|
||||
hal_usleep(1000);
|
||||
break;
|
||||
case PWR_OFF:
|
||||
sensor_dbg("PWR_OFF!do nothing\n");
|
||||
vin_set_mclk(id, 0);
|
||||
hal_usleep(1000);
|
||||
vin_gpio_set_status(id, PWDN, 1);
|
||||
vin_gpio_set_status(id, RESET, 1);
|
||||
vin_gpio_write(id, PWDN, CSI_GPIO_LOW);
|
||||
vin_gpio_write(id, RESET, CSI_GPIO_LOW);
|
||||
// vin_gpio_write(id, 163, CSI_GPIO_HIGH);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
||||
@@ -193,7 +193,7 @@ static struct regval_list sensor_1600x1200_30fps_regs[] = {
|
||||
{0xfd, 0x01},
|
||||
{0x0e, 0x02},
|
||||
{0x0f, 0x1a},
|
||||
{0x12, 0x01}, //mirror and flip
|
||||
{0x12, 0x03}, //mirror and flip
|
||||
{0x18, 0x00},
|
||||
{0x22, 0xff},
|
||||
{0x23, 0x02},
|
||||
@@ -712,7 +712,7 @@ static int sensor_s_exp_gain(int id, struct sensor_exp_gain *exp_gain)
|
||||
/*
|
||||
* Stuff that knows about the sensor.
|
||||
*/
|
||||
static int pwdn_flag = 0;
|
||||
// static int pwdn_flag = 0;
|
||||
static int sensor_power(int id, int on)
|
||||
{
|
||||
if (on && (sensor_power_count[id])++ > 0)
|
||||
@@ -723,17 +723,18 @@ static int sensor_power(int id, int on)
|
||||
switch (on) {
|
||||
case PWR_ON:
|
||||
sensor_dbg("PWR_ON!\n");
|
||||
if (pwdn_flag == 0)
|
||||
{
|
||||
pwdn_flag = 1;
|
||||
vin_gpio_set_status(id, PWDN, 1);
|
||||
}
|
||||
|
||||
// vin_gpio_set_status(id, PWDN, 1);
|
||||
// if (pwdn_flag == 0)
|
||||
// {
|
||||
// pwdn_flag = 1;
|
||||
// vin_gpio_set_status(id, PWDN, 1);
|
||||
// }
|
||||
vin_gpio_set_status(id, 163, 1);
|
||||
vin_gpio_write(id, 163, CSI_GPIO_LOW);
|
||||
vin_gpio_set_status(id, PWDN, 1);
|
||||
vin_gpio_set_status(id, RESET, 1);
|
||||
vin_gpio_set_status(id, IR_LED, 1);
|
||||
|
||||
// vin_gpio_write(id, PWDN, CSI_GPIO_LOW);
|
||||
vin_gpio_write(id, PWDN, CSI_GPIO_LOW);
|
||||
vin_gpio_write(id, RESET, CSI_GPIO_LOW);
|
||||
vin_gpio_write(id, IR_LED, CSI_GPIO_HIGH);
|
||||
hal_usleep(5000);
|
||||
@@ -753,7 +754,8 @@ static int sensor_power(int id, int on)
|
||||
|
||||
vin_gpio_write(id, RESET, CSI_GPIO_LOW);
|
||||
vin_set_mclk(id, 0);
|
||||
// vin_gpio_write(id, PWDN, CSI_GPIO_LOW);
|
||||
vin_gpio_write(id, PWDN, CSI_GPIO_LOW);
|
||||
// vin_gpio_write(id, 163, CSI_GPIO_HIGH);
|
||||
|
||||
break;
|
||||
default:
|
||||
@@ -822,7 +824,8 @@ static struct sensor_format_struct sensor_formats[] = {
|
||||
/* 1600x1200 30fps */
|
||||
{
|
||||
//.mbus_code = MEDIA_BUS_FMT_SRGGB10_1X10,//MEDIA_BUS_FMT_SBGGR10_1X10,
|
||||
.mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10,//MEDIA_BUS_FMT_SBGGR10_1X10,//MEDIA_BUS_FMT_SBGGR10_1X10,
|
||||
// .mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10,//MEDIA_BUS_FMT_SBGGR10_1X10,//MEDIA_BUS_FMT_SBGGR10_1X10,
|
||||
.mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10,//MEDIA_BUS_FMT_SBGGR10_1X10,//MEDIA_BUS_FMT_SBGGR10_1X10,
|
||||
.width = 1600,
|
||||
.height = 1200,
|
||||
.hoffset = 0,
|
||||
|
||||
@@ -91,16 +91,16 @@ struct sensor_list global_sensors_list[2][MAX_DETECT_SENSOR] = {
|
||||
[0] = {
|
||||
.sensor_name = "gc2083_mipi",
|
||||
.sensor_twi_addr = 0x6e,
|
||||
.sensor_twi_id = 1,
|
||||
.sensor_twi_id = 0,
|
||||
.mclk_id = 0,
|
||||
.use_isp = 1,
|
||||
.id = 0,
|
||||
.addr_width = 16,
|
||||
.data_width = 8,
|
||||
.reset_gpio = GPIOA(11),
|
||||
.pwdn_gpio = GPIOA(9),
|
||||
.ir_cut_gpio[0] = GPIOD(18), /*-cut*/
|
||||
.ir_cut_gpio[1] = GPIOD(8), /*+cut*/
|
||||
.reset_gpio = GPIOF(5),
|
||||
.pwdn_gpio = GPIOE(8),
|
||||
.ir_cut_gpio[0] = GPIOF(1), /*-cut*/
|
||||
.ir_cut_gpio[1] = GPIOF(2), /*+cut*/
|
||||
.ir_led_gpio = 0xffff, //GPIOE(10)
|
||||
},
|
||||
[1] = {
|
||||
@@ -448,35 +448,50 @@ struct sensor_list global_sensors[VIN_MAX_CSI] = {
|
||||
.ir_cut_gpio[0] = 0xffff,/*-cut*/
|
||||
.ir_cut_gpio[1] = 0xffff,/*+cut*/
|
||||
.ir_led_gpio = 0xffff,
|
||||
#elif defined(CONFIG_SENSOR_OV02B10_MIPI)
|
||||
#elif defined(CONFIG_SENSOR_GC2083_MIPI)
|
||||
.used = 1,
|
||||
.sensor_name = "ov02b10_mipi",
|
||||
.sensor_twi_addr = 0x78,
|
||||
.sensor_twi_id = 1,
|
||||
.sensor_name = "gc2083_mipi",
|
||||
.sensor_twi_addr = 0x6e,
|
||||
.sensor_twi_id = 0,
|
||||
.mclk_id = 0,
|
||||
.use_isp = 1,
|
||||
.id = 0,
|
||||
.addr_width = 8,
|
||||
.addr_width = 16,
|
||||
.data_width = 8,
|
||||
.reset_gpio = GPIOE(7),
|
||||
.reset_gpio = GPIOF(5),
|
||||
.pwdn_gpio = GPIOE(8),
|
||||
.ir_cut_gpio[0] = 0xffff,/*-cut*/
|
||||
.ir_cut_gpio[1] = 0xffff,/*+cut*/
|
||||
.ir_led_gpio = GPIOF(3),
|
||||
.ir_cut_gpio[0] = GPIOF(1),/*-cut*/
|
||||
.ir_cut_gpio[1] = GPIOF(2),/*+cut*/
|
||||
.ir_led_gpio = 0xffff,
|
||||
// #elif defined(CONFIG_SENSOR_OV02B10_MIPI)
|
||||
// .used = 1,
|
||||
// .sensor_name = "ov02b10_mipi",
|
||||
// .sensor_twi_addr = 0x78,
|
||||
// .sensor_twi_id = 1,
|
||||
// .mclk_id = 0,
|
||||
// .use_isp = 1,
|
||||
// .id = 0,
|
||||
// .addr_width = 8,
|
||||
// .data_width = 8,
|
||||
// .reset_gpio = GPIOE(7),
|
||||
// .pwdn_gpio = GPIOE(8),
|
||||
// .ir_cut_gpio[0] = 0xffff,/*-cut*/
|
||||
// .ir_cut_gpio[1] = 0xffff,/*+cut*/
|
||||
// .ir_led_gpio = GPIOF(3),
|
||||
#else
|
||||
.used = 1,
|
||||
.sensor_name = "gc2083_mipi",
|
||||
.sensor_twi_addr = 0x6e,
|
||||
.sensor_twi_id = 1,
|
||||
.sensor_twi_id = 0,
|
||||
.mclk_id = 0,
|
||||
.use_isp = 1,
|
||||
.id = 0,
|
||||
.addr_width = 8,
|
||||
.addr_width = 16,
|
||||
.data_width = 8,
|
||||
.reset_gpio = GPIOA(11),
|
||||
.pwdn_gpio = GPIOA(9),
|
||||
.ir_cut_gpio[0] = 0xffff,/*-cut*/
|
||||
.ir_cut_gpio[1] = 0xffff,/*+cut*/
|
||||
.reset_gpio = GPIOF(5),
|
||||
.pwdn_gpio = GPIOE(8),
|
||||
.ir_cut_gpio[0] = GPIOF(1),/*-cut*/
|
||||
.ir_cut_gpio[1] = GPIOF(2),/*+cut*/
|
||||
.ir_led_gpio = 0xffff,
|
||||
#endif
|
||||
},
|
||||
@@ -499,16 +514,16 @@ struct sensor_list global_sensors[VIN_MAX_CSI] = {
|
||||
.ir_led_gpio = 0xffff,
|
||||
#elif defined(CONFIG_SENSOR_OV02B10_MIPI)
|
||||
.used = 1,
|
||||
.sensor_name = "ov02b1b_mipi",
|
||||
.sensor_name = "ov02b10_mipi",
|
||||
.sensor_twi_addr = 0x78,
|
||||
.sensor_twi_id = 0,
|
||||
.sensor_twi_id = 1,
|
||||
.mclk_id = 1,
|
||||
.use_isp = 1,
|
||||
.id = 1,
|
||||
.addr_width = 8,
|
||||
.data_width = 8,
|
||||
.reset_gpio = GPIOE(9),
|
||||
.pwdn_gpio = GPIOE(10),
|
||||
.reset_gpio = GPIOE(6),
|
||||
.pwdn_gpio = GPIOE(9),
|
||||
.ir_cut_gpio[0] = 0xffff,/*-cut*/
|
||||
.ir_cut_gpio[1] = 0xffff,/*+cut*/
|
||||
.ir_led_gpio = 0xffff,
|
||||
|
||||
Reference in New Issue
Block a user