Lines Matching +full:pre +full:- +full:div

4  * SPDX-License-Identifier: Apache-2.0
213 /* Brightness Control, with signal -128 to +128, 0x00 is middle value */
216 /* Internal clock pre-scalar,F(internal clock) = F(input clock)/(Bit[5:0]+1) */
217 {OV7670_CLKRC, 0x80}, /* Clock Div, Input/(n+1), bit6 set to 1 to disable divider */
233 {OV7670_DNSTH, 0x00}, /* De-noise Strength */
268 /* AGC/AEC - Automatic Gain Control/Automatic exposure Control */
327 /* Histogram-based AEC/AGC Control */
347 caps->format_caps = fmts; in ov7670_get_caps()
354 const struct ov7670_config *config = dev->config; in ov7670_set_fmt()
355 struct ov7670_data *data = dev->data; in ov7670_set_fmt()
360 if (fmt->pixelformat != VIDEO_PIX_FMT_RGB565 && fmt->pixelformat != VIDEO_PIX_FMT_YUYV) { in ov7670_set_fmt()
362 return -ENOTSUP; in ov7670_set_fmt()
365 if (!memcmp(&data->fmt, fmt, sizeof(data->fmt))) { in ov7670_set_fmt()
370 memcpy(&data->fmt, fmt, sizeof(data->fmt)); in ov7670_set_fmt()
374 if (fmts[i].width_min == fmt->width && fmts[i].height_min == fmt->height && in ov7670_set_fmt()
375 fmts[i].pixelformat == fmt->pixelformat) { in ov7670_set_fmt()
392 ret = i2c_reg_write_byte_dt(&config->bus, OV7670_COM7, in ov7670_set_fmt()
393 resolution->com7); in ov7670_set_fmt()
397 ret = i2c_reg_write_byte_dt(&config->bus, OV7670_COM3, in ov7670_set_fmt()
398 resolution->com3); in ov7670_set_fmt()
402 ret = i2c_reg_write_byte_dt(&config->bus, OV7670_COM14, in ov7670_set_fmt()
403 resolution->com14); in ov7670_set_fmt()
407 ret = i2c_reg_write_byte_dt(&config->bus, OV7670_SCALING_XSC, in ov7670_set_fmt()
408 resolution->scaling_xsc); in ov7670_set_fmt()
412 ret = i2c_reg_write_byte_dt(&config->bus, OV7670_SCALING_YSC, in ov7670_set_fmt()
413 resolution->scaling_ysc); in ov7670_set_fmt()
417 ret = i2c_reg_write_byte_dt(&config->bus, OV7670_SCALING_DCWCTR, in ov7670_set_fmt()
418 resolution->dcwctr); in ov7670_set_fmt()
422 ret = i2c_reg_write_byte_dt(&config->bus, OV7670_SCALING_PCLK_DIV, in ov7670_set_fmt()
423 resolution->pclk_div); in ov7670_set_fmt()
427 return i2c_reg_write_byte_dt(&config->bus, OV7670_SCALING_PCLK_DELAY, in ov7670_set_fmt()
428 resolution->pclk_delay); in ov7670_set_fmt()
434 return -ENOTSUP; in ov7670_set_fmt()
440 struct ov7670_data *data = dev->data; in ov7670_get_fmt()
443 return -EINVAL; in ov7670_get_fmt()
445 memcpy(fmt, &data->fmt, sizeof(data->fmt)); in ov7670_get_fmt()
451 const struct ov7670_config *config = dev->config; in ov7670_init()
457 if (!i2c_is_ready_dt(&config->bus)) { in ov7670_init()
459 return -ENODEV; in ov7670_init()
464 if (config->pwdn.port != NULL) { in ov7670_init()
465 if (!gpio_is_ready_dt(&config->pwdn)) { in ov7670_init()
466 return -ENODEV; in ov7670_init()
468 ret = gpio_pin_configure_dt(&config->pwdn, GPIO_OUTPUT_INACTIVE); in ov7670_init()
477 if (config->reset.port != NULL) { in ov7670_init()
478 if (!gpio_is_ready_dt(&config->reset)) { in ov7670_init()
479 return -ENODEV; in ov7670_init()
481 ret = gpio_pin_configure_dt(&config->reset, GPIO_OUTPUT); in ov7670_init()
487 gpio_pin_set_dt(&config->reset, 0); in ov7670_init()
489 gpio_pin_set_dt(&config->reset, 1); in ov7670_init()
496 * spec- which *should* be I2C compatible, but in practice does in ov7670_init()
503 ret = i2c_write_dt(&config->bus, &cmd, sizeof(cmd)); in ov7670_init()
508 ret = i2c_read_dt(&config->bus, &pid, sizeof(pid)); in ov7670_init()
516 return -ENODEV; in ov7670_init()
520 ret = i2c_reg_write_byte_dt(&config->bus, OV7670_COM7, 0x80); in ov7670_init()
541 ret = i2c_reg_write_byte_dt(&config->bus, reg->reg, reg->cmd); in ov7670_init()