Lines Matching +full:- +full:vstart
4 * SPDX-License-Identifier: Apache-2.0
378 const struct ov7725_config *cfg = dev->config; in ov7725_write_all()
383 err = ov7725_write_reg(&cfg->i2c, regs[i].addr, regs[i].value); in ov7725_write_all()
396 const struct ov7725_config *cfg = dev->config; in ov7725_set_clock()
401 ov7725_write_reg(&cfg->i2c, OV7725_CLKRC, in ov7725_set_clock()
403 ov7725_modify_reg(&cfg->i2c, OV7725_COM4, 0xc0, in ov7725_set_clock()
405 ov7725_write_reg(&cfg->i2c, OV7725_EXHCL, 0x00); in ov7725_set_clock()
406 ov7725_write_reg(&cfg->i2c, OV7725_DM_LNL, in ov7725_set_clock()
408 ov7725_write_reg(&cfg->i2c, OV7725_DM_LNH, 0x00); in ov7725_set_clock()
409 ov7725_write_reg(&cfg->i2c, OV7725_ADVFL, 0x00); in ov7725_set_clock()
410 ov7725_write_reg(&cfg->i2c, OV7725_ADVFH, 0x00); in ov7725_set_clock()
411 return ov7725_write_reg(&cfg->i2c, OV7725_COM5, 0x65); in ov7725_set_clock()
415 return -1; in ov7725_set_clock()
422 struct ov7725_data *drv_data = dev->data; in ov7725_set_fmt()
423 const struct ov7725_config *cfg = dev->config; in ov7725_set_fmt()
426 uint16_t hstart, vstart, hsize; in ov7725_set_fmt() local
430 if (fmt->pixelformat != VIDEO_PIX_FMT_RGB565 || fmt->height != 480 || in ov7725_set_fmt()
431 fmt->width != 640) { in ov7725_set_fmt()
432 return -ENOTSUP; in ov7725_set_fmt()
435 width = fmt->width; in ov7725_set_fmt()
436 height = fmt->height; in ov7725_set_fmt()
438 if (!memcmp(&drv_data->fmt, fmt, sizeof(drv_data->fmt))) { in ov7725_set_fmt()
443 drv_data->fmt = *fmt; in ov7725_set_fmt()
458 if (ov7725_pf_configs[i].pixel_format == fmt->pixelformat) { in ov7725_set_fmt()
459 ret = ov7725_modify_reg(&cfg->i2c, in ov7725_set_fmt()
470 ov7725_modify_reg(&cfg->i2c, OV7725_COM7, (1 << 5), (0 << 5)); in ov7725_set_fmt()
473 ov7725_write_reg(&cfg->i2c, OV7725_COM10, com10); in ov7725_set_fmt()
476 ov7725_write_reg(&cfg->i2c, OV7725_COM3, 0x00); in ov7725_set_fmt()
485 ov7725_modify_reg(&cfg->i2c, OV7725_COM2, 0x03, 0x03); in ov7725_set_fmt()
489 vstart = 0x07U << 1U; in ov7725_set_fmt()
493 ov7725_write_reg(&cfg->i2c, OV7725_HSTART, hstart >> 2U); in ov7725_set_fmt()
494 ov7725_write_reg(&cfg->i2c, OV7725_HSIZE, hsize >> 2U); in ov7725_set_fmt()
495 ov7725_write_reg(&cfg->i2c, OV7725_VSTART, vstart >> 1U); in ov7725_set_fmt()
496 ov7725_write_reg(&cfg->i2c, OV7725_VSIZE, height >> 1U); in ov7725_set_fmt()
497 ov7725_write_reg(&cfg->i2c, OV7725_HOUTSIZE, width >> 2U); in ov7725_set_fmt()
498 ov7725_write_reg(&cfg->i2c, OV7725_VOUTSIZE, height >> 1U); in ov7725_set_fmt()
499 ov7725_write_reg(&cfg->i2c, OV7725_HREF, in ov7725_set_fmt()
500 ((vstart & 1U) << 6U) | in ov7725_set_fmt()
504 return ov7725_write_reg(&cfg->i2c, OV7725_EXHCH, in ov7725_set_fmt()
513 struct ov7725_data *drv_data = dev->data; in ov7725_get_fmt()
515 *fmt = drv_data->fmt; in ov7725_get_fmt()
547 caps->format_caps = fmts; in ov7725_get_caps()
561 const struct ov7725_config *cfg = dev->config; in ov7725_init()
567 ret = gpio_pin_configure_dt(&cfg->reset_gpio, GPIO_OUTPUT_ACTIVE); in ov7725_init()
572 gpio_pin_set_dt(&cfg->reset_gpio, 0); in ov7725_init()
574 gpio_pin_set_dt(&cfg->reset_gpio, 1); in ov7725_init()
579 ret = ov7725_read_reg(&cfg->i2c, OV7725_PID, &pid); in ov7725_init()
582 return -ENODEV; in ov7725_init()
585 ret = ov7725_read_reg(&cfg->i2c, OV7725_VER, &ver); in ov7725_init()
588 return -ENODEV; in ov7725_init()
593 return -ENODEV; in ov7725_init()
597 ov7725_write_reg(&cfg->i2c, OV7725_COM7, 0x80); in ov7725_init()
609 return -EIO; in ov7725_init()
626 const struct ov7725_config *cfg = dev->config; in ov7725_init_0()
628 if (!device_is_ready(cfg->i2c.bus)) { in ov7725_init_0()
630 return -ENODEV; in ov7725_init_0()
634 if (!gpio_is_ready_dt(&cfg->reset_gpio)) { in ov7725_init_0()
635 LOG_ERR("%s: device %s is not ready", dev->name, in ov7725_init_0()
636 cfg->reset_gpio.port->name); in ov7725_init_0()
637 return -ENODEV; in ov7725_init_0()