Lines Matching +full:itu +full:- +full:r

1 // SPDX-License-Identifier: GPL-2.0-or-later
15 #include <media/v4l2-subdev.h>
16 #include <media/v4l2-device.h>
17 #include <media/v4l2-ioctl.h>
18 #include <media/v4l2-ctrls.h>
98 return &container_of(ctrl->handler, struct ml86v7667_priv, hdl)->sd; in to_sd()
116 int ret = -EINVAL; in ml86v7667_s_ctrl()
118 switch (ctrl->id) { in ml86v7667_s_ctrl()
121 SSEPL_LUMINANCE_MASK, ctrl->val); in ml86v7667_s_ctrl()
125 CLC_CONTRAST_MASK, ctrl->val); in ml86v7667_s_ctrl()
129 ctrl->val << ACCRC_CHROMA_SHIFT); in ml86v7667_s_ctrl()
132 ret = ml86v7667_mask_set(client, HUE_REG, ~0, ctrl->val); in ml86v7667_s_ctrl()
137 ctrl->val << ACCC_CHROMA_CR_SHIFT); in ml86v7667_s_ctrl()
142 ctrl->val << ACCC_CHROMA_CB_SHIFT); in ml86v7667_s_ctrl()
147 ctrl->val << LUMC_ONOFF_SHIFT); in ml86v7667_s_ctrl()
152 ctrl->val << CHRCA_MODE_SHIFT); in ml86v7667_s_ctrl()
194 if (code->pad || code->index > 0) in ml86v7667_enum_mbus_code()
195 return -EINVAL; in ml86v7667_enum_mbus_code()
197 code->code = MEDIA_BUS_FMT_YUYV8_2X8; in ml86v7667_enum_mbus_code()
207 struct v4l2_mbus_framefmt *fmt = &format->format; in ml86v7667_fill_fmt()
209 if (format->pad) in ml86v7667_fill_fmt()
210 return -EINVAL; in ml86v7667_fill_fmt()
212 fmt->code = MEDIA_BUS_FMT_YUYV8_2X8; in ml86v7667_fill_fmt()
213 fmt->colorspace = V4L2_COLORSPACE_SMPTE170M; in ml86v7667_fill_fmt()
215 fmt->field = V4L2_FIELD_INTERLACED_TB; in ml86v7667_fill_fmt()
216 fmt->width = 720; in ml86v7667_fill_fmt()
217 fmt->height = priv->std & V4L2_STD_525_60 ? 480 : 576; in ml86v7667_fill_fmt()
226 cfg->flags = V4L2_MBUS_MASTER | V4L2_MBUS_PCLK_SAMPLE_RISING | in ml86v7667_get_mbus_config()
228 cfg->type = V4L2_MBUS_BT656; in ml86v7667_get_mbus_config()
237 *std = priv->std; in ml86v7667_g_std()
245 struct i2c_client *client = v4l2_get_subdevdata(&priv->sd); in ml86v7667_s_std()
249 /* PAL/NTSC ITU-R BT.601 input mode */ in ml86v7667_s_std()
255 priv->std = std; in ml86v7667_s_std()
267 ret = i2c_smbus_read_byte_data(client, (u8)reg->reg); in ml86v7667_g_register()
271 reg->val = ret; in ml86v7667_g_register()
272 reg->size = sizeof(u8); in ml86v7667_g_register()
282 return i2c_smbus_write_byte_data(client, (u8)reg->reg, (u8)reg->val); in ml86v7667_s_register()
319 struct i2c_client *client = v4l2_get_subdevdata(&priv->sd); in ml86v7667_init()
323 /* BT.656-4 output mode, register mode */ in ml86v7667_init()
352 priv->std = val & STATUS_NTSCPAL ? V4L2_STD_625_50 : V4L2_STD_525_60; in ml86v7667_init()
355 val = priv->std & V4L2_STD_525_60 ? MRA_NTSC_BT601 : MRA_PAL_BT601; in ml86v7667_init()
367 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) in ml86v7667_probe()
368 return -EIO; in ml86v7667_probe()
370 priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); in ml86v7667_probe()
372 return -ENOMEM; in ml86v7667_probe()
374 v4l2_i2c_subdev_init(&priv->sd, client, &ml86v7667_subdev_ops); in ml86v7667_probe()
376 v4l2_ctrl_handler_init(&priv->hdl, 8); in ml86v7667_probe()
377 v4l2_ctrl_new_std(&priv->hdl, &ml86v7667_ctrl_ops, in ml86v7667_probe()
378 V4L2_CID_BRIGHTNESS, -64, 63, 1, 0); in ml86v7667_probe()
379 v4l2_ctrl_new_std(&priv->hdl, &ml86v7667_ctrl_ops, in ml86v7667_probe()
380 V4L2_CID_CONTRAST, -8, 7, 1, 0); in ml86v7667_probe()
381 v4l2_ctrl_new_std(&priv->hdl, &ml86v7667_ctrl_ops, in ml86v7667_probe()
382 V4L2_CID_CHROMA_GAIN, -32, 31, 1, 0); in ml86v7667_probe()
383 v4l2_ctrl_new_std(&priv->hdl, &ml86v7667_ctrl_ops, in ml86v7667_probe()
384 V4L2_CID_HUE, -128, 127, 1, 0); in ml86v7667_probe()
385 v4l2_ctrl_new_std(&priv->hdl, &ml86v7667_ctrl_ops, in ml86v7667_probe()
386 V4L2_CID_RED_BALANCE, -4, 3, 1, 0); in ml86v7667_probe()
387 v4l2_ctrl_new_std(&priv->hdl, &ml86v7667_ctrl_ops, in ml86v7667_probe()
388 V4L2_CID_BLUE_BALANCE, -4, 3, 1, 0); in ml86v7667_probe()
389 v4l2_ctrl_new_std(&priv->hdl, &ml86v7667_ctrl_ops, in ml86v7667_probe()
391 v4l2_ctrl_new_std(&priv->hdl, &ml86v7667_ctrl_ops, in ml86v7667_probe()
393 priv->sd.ctrl_handler = &priv->hdl; in ml86v7667_probe()
395 ret = priv->hdl.error; in ml86v7667_probe()
399 v4l2_ctrl_handler_setup(&priv->hdl); in ml86v7667_probe()
406 client->addr, client->adapter->name); in ml86v7667_probe()
410 v4l2_ctrl_handler_free(&priv->hdl); in ml86v7667_probe()
411 v4l2_device_unregister_subdev(&priv->sd); in ml86v7667_probe()
413 client->addr, client->adapter->name); in ml86v7667_probe()
422 v4l2_ctrl_handler_free(&priv->hdl); in ml86v7667_remove()
423 v4l2_device_unregister_subdev(&priv->sd); in ml86v7667_remove()