update(driver): adapt v1.1 hardware configuration.

This commit is contained in:
kangjun
2024-08-23 15:08:52 +08:00
parent a0d979a885
commit 6e4b2234c8
10 changed files with 252 additions and 485 deletions

View File

@@ -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;

View File

@@ -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,