Lines Matching +full:reset +full:- +full:assert +full:- +full:ms
1 // SPDX-License-Identifier: GPL-2.0-only
19 #include <media/v4l2-ctrls.h>
20 #include <media/v4l2-device.h>
38 * All standards are supported through autodetect, 8-bit, 4:2:2, ITU-R BT.656 output on P15 to P8.
69 return &container_of(ctrl->handler, struct adv7183, hdl)->sd; in to_sd()
95 return -1; in adv7183_writeregs()
185 v4l2_ctrl_handler_log_status(&decoder->hdl, sd->name); in adv7183_log_status()
193 *std = decoder->std; in adv7183_g_std()
220 return -EINVAL; in adv7183_s_std()
223 decoder->std = std; in adv7183_s_std()
234 /* wait 5ms before any further i2c writes are performed */ in adv7183_reset()
246 return -EINVAL; in adv7183_s_routing()
248 if (input != decoder->input) { in adv7183_s_routing()
249 decoder->input = input; in adv7183_s_routing()
303 if (output != decoder->output) { in adv7183_s_routing()
304 decoder->output = output; in adv7183_s_routing()
323 int val = ctrl->val; in adv7183_s_ctrl()
325 switch (ctrl->id) { in adv7183_s_ctrl()
328 val = 127 - val; in adv7183_s_ctrl()
343 return -EINVAL; in adv7183_s_ctrl()
394 adv7183_s_std(sd, decoder->std); in adv7183_querystd()
415 if (code->pad || code->index > 0) in adv7183_enum_mbus_code()
416 return -EINVAL; in adv7183_enum_mbus_code()
418 code->code = MEDIA_BUS_FMT_UYVY8_2X8; in adv7183_enum_mbus_code()
427 struct v4l2_mbus_framefmt *fmt = &format->format; in adv7183_set_fmt()
429 if (format->pad) in adv7183_set_fmt()
430 return -EINVAL; in adv7183_set_fmt()
432 fmt->code = MEDIA_BUS_FMT_UYVY8_2X8; in adv7183_set_fmt()
433 fmt->colorspace = V4L2_COLORSPACE_SMPTE170M; in adv7183_set_fmt()
434 if (decoder->std & V4L2_STD_525_60) { in adv7183_set_fmt()
435 fmt->field = V4L2_FIELD_SEQ_TB; in adv7183_set_fmt()
436 fmt->width = 720; in adv7183_set_fmt()
437 fmt->height = 480; in adv7183_set_fmt()
439 fmt->field = V4L2_FIELD_SEQ_BT; in adv7183_set_fmt()
440 fmt->width = 720; in adv7183_set_fmt()
441 fmt->height = 576; in adv7183_set_fmt()
443 if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) in adv7183_set_fmt()
444 decoder->fmt = *fmt; in adv7183_set_fmt()
446 sd_state->pads->try_fmt = *fmt; in adv7183_set_fmt()
456 if (format->pad) in adv7183_get_fmt()
457 return -EINVAL; in adv7183_get_fmt()
459 format->format = decoder->fmt; in adv7183_get_fmt()
468 gpiod_set_value(decoder->oe_pin, 1); in adv7183_s_stream()
470 gpiod_set_value(decoder->oe_pin, 0); in adv7183_s_stream()
478 reg->val = adv7183_read(sd, reg->reg & 0xff); in adv7183_g_register()
479 reg->size = 1; in adv7183_g_register()
485 adv7183_write(sd, reg->reg & 0xff, reg->val & 0xff); in adv7183_s_register()
496 .reset = adv7183_reset,
536 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) in adv7183_probe()
537 return -EIO; in adv7183_probe()
540 client->addr << 1, client->adapter->name); in adv7183_probe()
542 decoder = devm_kzalloc(&client->dev, sizeof(*decoder), GFP_KERNEL); in adv7183_probe()
544 return -ENOMEM; in adv7183_probe()
547 * Requesting high will assert reset, the line should be in adv7183_probe()
550 decoder->reset_pin = devm_gpiod_get(&client->dev, "reset", in adv7183_probe()
552 if (IS_ERR(decoder->reset_pin)) in adv7183_probe()
553 return PTR_ERR(decoder->reset_pin); in adv7183_probe()
554 gpiod_set_consumer_name(decoder->reset_pin, "ADV7183 Reset"); in adv7183_probe()
559 decoder->oe_pin = devm_gpiod_get(&client->dev, "oe", in adv7183_probe()
561 if (IS_ERR(decoder->oe_pin)) in adv7183_probe()
562 return PTR_ERR(decoder->oe_pin); in adv7183_probe()
563 gpiod_set_consumer_name(decoder->reset_pin, "ADV7183 Output Enable"); in adv7183_probe()
565 sd = &decoder->sd; in adv7183_probe()
568 hdl = &decoder->hdl; in adv7183_probe()
571 V4L2_CID_BRIGHTNESS, -128, 127, 1, 0); in adv7183_probe()
579 sd->ctrl_handler = hdl; in adv7183_probe()
580 if (hdl->error) { in adv7183_probe()
581 ret = hdl->error; in adv7183_probe()
588 decoder->std = V4L2_STD_PAL; in adv7183_probe()
589 decoder->input = ADV7183_COMPOSITE4; in adv7183_probe()
590 decoder->output = ADV7183_8BIT_OUT; in adv7183_probe()
592 /* reset chip */ in adv7183_probe()
593 /* reset pulse width at least 5ms */ in adv7183_probe()
595 /* De-assert reset line (descriptor tagged active low) */ in adv7183_probe()
596 gpiod_set_value(decoder->reset_pin, 0); in adv7183_probe()
597 /* wait 5ms before any further i2c writes are performed */ in adv7183_probe()
601 adv7183_s_std(sd, decoder->std); in adv7183_probe()
621 v4l2_ctrl_handler_free(sd->ctrl_handler); in adv7183_remove()