Lines Matching +full:- +full:vv

4  * SPDX-License-Identifier: Apache-2.0
13 #include <zephyr/drivers/video-controls.h>
145 #define VV 0x26 macro
199 { VV, VV_AGC_TH_SET(0x08, 0x02) },
407 { 0x00, 0x04, 0x09, 0x00, 0x00 }, /* -2 */
408 { 0x00, 0x04, 0x09, 0x10, 0x00 }, /* -1 */
417 { 0x00, 0x04, 0x07, 0x20, 0x18, 0x34, 0x06 }, /* -2 */
418 { 0x00, 0x04, 0x07, 0x20, 0x1c, 0x2a, 0x06 }, /* -1 */
427 { 0x00, 0x02, 0x03, 0x28, 0x28 }, /* -2 */
428 { 0x00, 0x02, 0x03, 0x38, 0x38 }, /* -1 */
493 while (tries--) { in ov2640_write_reg()
502 return -1; in ov2640_write_reg()
516 while (tries--) { in ov2640_read_reg()
525 return -1; in ov2640_read_reg()
532 const struct ov2640_config *cfg = dev->config; in ov2640_write_all()
537 err = ov2640_write_reg(&cfg->i2c, regs[i].addr, regs[i].value); in ov2640_write_all()
549 const struct ov2640_config *cfg = dev->config; in ov2640_soft_reset()
552 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_SENSOR); in ov2640_soft_reset()
555 ret |= ov2640_write_reg(&cfg->i2c, COM7, COM7_SRST); in ov2640_soft_reset()
564 const struct ov2640_config *cfg = dev->config; in ov2640_set_level()
568 return -ENOTSUP; in ov2640_set_level()
572 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_DSP); in ov2640_set_level()
575 ret |= ov2640_write_reg(&cfg->i2c, regs[0][i], regs[level][i]); in ov2640_set_level()
588 if (ret == -ENOTSUP) { in ov2640_set_brightness()
602 if (ret == -ENOTSUP) { in ov2640_set_saturation()
616 if (ret == -ENOTSUP) { in ov2640_set_contrast()
627 const struct ov2640_config *cfg = dev->config; in ov2640_set_output_format()
630 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_DSP); in ov2640_set_output_format()
634 ret |= ov2640_write_reg(&cfg->i2c, IMAGE_MODE, IMAGE_MODE_JPEG_EN); in ov2640_set_output_format()
637 ret |= ov2640_write_reg(&cfg->i2c, IMAGE_MODE, IMAGE_MODE_RGB565); in ov2640_set_output_format()
640 return -ENOTSUP; in ov2640_set_output_format()
650 const struct ov2640_config *cfg = dev->config; in ov2640_set_quality()
653 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_DSP); in ov2640_set_quality()
656 ret |= ov2640_write_reg(&cfg->i2c, QS, qs); in ov2640_set_quality()
664 const struct ov2640_config *cfg = dev->config; in ov2640_set_colorbar()
669 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_SENSOR); in ov2640_set_colorbar()
672 reg = ov2640_read_reg(&cfg->i2c, COM7); in ov2640_set_colorbar()
680 ret |= ov2640_write_reg(&cfg->i2c, COM7, reg); in ov2640_set_colorbar()
688 const struct ov2640_config *cfg = dev->config; in ov2640_set_white_bal()
693 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_SENSOR); in ov2640_set_white_bal()
696 reg = ov2640_read_reg(&cfg->i2c, CTRL1); in ov2640_set_white_bal()
704 ret |= ov2640_write_reg(&cfg->i2c, CTRL1, reg); in ov2640_set_white_bal()
712 const struct ov2640_config *cfg = dev->config; in ov2640_set_gain_ctrl()
717 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_SENSOR); in ov2640_set_gain_ctrl()
720 reg = ov2640_read_reg(&cfg->i2c, COM8); in ov2640_set_gain_ctrl()
728 ret |= ov2640_write_reg(&cfg->i2c, COM8, reg); in ov2640_set_gain_ctrl()
736 const struct ov2640_config *cfg = dev->config; in ov2640_set_exposure_ctrl()
741 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_SENSOR); in ov2640_set_exposure_ctrl()
744 reg = ov2640_read_reg(&cfg->i2c, COM8); in ov2640_set_exposure_ctrl()
752 ret |= ov2640_write_reg(&cfg->i2c, COM8, reg); in ov2640_set_exposure_ctrl()
761 const struct ov2640_config *cfg = dev->config; in ov2640_set_horizontal_mirror()
766 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_SENSOR); in ov2640_set_horizontal_mirror()
769 reg = ov2640_read_reg(&cfg->i2c, REG04); in ov2640_set_horizontal_mirror()
777 ret |= ov2640_write_reg(&cfg->i2c, REG04, reg); in ov2640_set_horizontal_mirror()
785 const struct ov2640_config *cfg = dev->config; in ov2640_set_vertical_flip()
790 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_SENSOR); in ov2640_set_vertical_flip()
793 reg = ov2640_read_reg(&cfg->i2c, REG04); in ov2640_set_vertical_flip()
801 ret |= ov2640_write_reg(&cfg->i2c, REG04, reg); in ov2640_set_vertical_flip()
810 const struct ov2640_config *cfg = dev->config; in ov2640_set_resolution()
816 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_DSP); in ov2640_set_resolution()
817 ret |= ov2640_write_reg(&cfg->i2c, R_BYPASS, R_BYPASS_DSP_BYPAS); in ov2640_set_resolution()
820 ret |= ov2640_write_reg(&cfg->i2c, ZMOW, (w >> 2) & 0xFF); /* OUTW[7:0] (real/4) */ in ov2640_set_resolution()
821 ret |= ov2640_write_reg(&cfg->i2c, ZMOH, (h >> 2) & 0xFF); /* OUTH[7:0] (real/4) */ in ov2640_set_resolution()
822 ret |= ov2640_write_reg(&cfg->i2c, ZMHH, ((h >> 8) & 0x04) | in ov2640_set_resolution()
826 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_SENSOR); in ov2640_set_resolution()
827 ret |= ov2640_write_reg(&cfg->i2c, CLKRC, cfg->clock_rate_control); in ov2640_set_resolution()
833 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_DSP); in ov2640_set_resolution()
834 ret |= ov2640_write_reg(&cfg->i2c, R_BYPASS, R_BYPASS_DSP_EN); in ov2640_set_resolution()
844 const struct ov2640_config *cfg = dev->config; in ov2640_check_connection()
848 ret |= ov2640_write_reg(&cfg->i2c, BANK_SEL, BANK_SEL_SENSOR); in ov2640_check_connection()
849 reg_pid_val = ov2640_read_reg(&cfg->i2c, REG_PID); in ov2640_check_connection()
850 reg_ver_val = ov2640_read_reg(&cfg->i2c, REG_VER); in ov2640_check_connection()
854 return -ENODEV; in ov2640_check_connection()
863 struct ov2640_data *drv_data = dev->data; in ov2640_set_fmt()
869 if (fmt->pixelformat != VIDEO_PIX_FMT_RGB565 && fmt->pixelformat != VIDEO_PIX_FMT_JPEG) { in ov2640_set_fmt()
871 return -ENOTSUP; in ov2640_set_fmt()
874 width = fmt->width; in ov2640_set_fmt()
875 height = fmt->height; in ov2640_set_fmt()
877 if (!memcmp(&drv_data->fmt, fmt, sizeof(drv_data->fmt))) { in ov2640_set_fmt()
882 drv_data->fmt = *fmt; in ov2640_set_fmt()
885 ret |= ov2640_set_output_format(dev, fmt->pixelformat); in ov2640_set_fmt()
890 fmts[i].pixelformat == fmt->pixelformat) { in ov2640_set_fmt()
892 ret |= ov2640_set_resolution(dev, fmt->width, fmt->height); in ov2640_set_fmt()
900 return -ENOTSUP; in ov2640_set_fmt()
906 struct ov2640_data *drv_data = dev->data; in ov2640_get_fmt()
908 *fmt = drv_data->fmt; in ov2640_get_fmt()
927 caps->format_caps = fmts; in ov2640_get_caps()
968 return -ENOTSUP; in ov2640_set_ctrl()
989 const struct ov2640_config *cfg = dev->config; in ov2640_init()
991 ret = gpio_pin_configure_dt(&cfg->reset_gpio, GPIO_OUTPUT_ACTIVE); in ov2640_init()
996 gpio_pin_set_dt(&cfg->reset_gpio, 0); in ov2640_init()
998 gpio_pin_set_dt(&cfg->reset_gpio, 1); in ov2640_init()
1021 return -EIO; in ov2640_init()
1042 const struct ov2640_config *cfg = dev->config; in ov2640_init_0()
1044 if (!device_is_ready(cfg->i2c.bus)) { in ov2640_init_0()
1046 return -ENODEV; in ov2640_init_0()
1050 if (!gpio_is_ready_dt(&cfg->reset_gpio)) { in ov2640_init_0()
1051 LOG_ERR("%s: device %s is not ready", dev->name, in ov2640_init_0()
1052 cfg->reset_gpio.port->name); in ov2640_init_0()
1053 return -ENODEV; in ov2640_init_0()
1060 if (i2c_configure(cfg->i2c.bus, i2c_cfg)) { in ov2640_init_0()