Lines Matching +full:data +full:- +full:lines

1 // SPDX-License-Identifier: GPL-2.0-or-later
16 #include <media/v4l2-device.h>
17 #include <media/v4l2-ctrls.h>
25 MODULE_PARM_DESC(debug, "Debug level (0-1)");
30 /* ----------------------------------------------------------------------- */
49 return &container_of(ctrl->handler, struct vpx3220, hdl)->sd; in to_sd()
54 /* ----------------------------------------------------------------------- */
61 decoder->reg[reg] = value; in vpx3220_write()
89 return -1; in vpx3220_fp_status()
92 static int vpx3220_fp_write(struct v4l2_subdev *sd, u8 fpaddr, u16 data) in vpx3220_fp_write() argument
96 /* Write the 16-bit address to the FPWR register */ in vpx3220_fp_write()
97 if (i2c_smbus_write_word_data(client, 0x27, swab16(fpaddr)) == -1) { in vpx3220_fp_write()
99 return -1; in vpx3220_fp_write()
103 return -1; in vpx3220_fp_write()
105 /* Write the 16-bit data to the FPDAT register */ in vpx3220_fp_write()
106 if (i2c_smbus_write_word_data(client, 0x28, swab16(data)) == -1) { in vpx3220_fp_write()
108 return -1; in vpx3220_fp_write()
117 s16 data; in vpx3220_fp_read() local
119 /* Write the 16-bit address to the FPRD register */ in vpx3220_fp_read()
120 if (i2c_smbus_write_word_data(client, 0x26, swab16(fpaddr)) == -1) { in vpx3220_fp_read()
122 return -1; in vpx3220_fp_read()
126 return -1; in vpx3220_fp_read()
128 /* Read the 16-bit data from the FPDAT register */ in vpx3220_fp_read()
129 data = i2c_smbus_read_word_data(client, 0x28); in vpx3220_fp_read()
130 if (data == -1) { in vpx3220_fp_read()
132 return -1; in vpx3220_fp_read()
135 return swab16(data); in vpx3220_fp_read()
138 static int vpx3220_write_block(struct v4l2_subdev *sd, const u8 *data, unsigned int len) in vpx3220_write_block() argument
141 int ret = -1; in vpx3220_write_block()
144 reg = *data++; in vpx3220_write_block()
145 ret = vpx3220_write(sd, reg, *data++); in vpx3220_write_block()
148 len -= 2; in vpx3220_write_block()
155 const u16 *data, unsigned int len) in vpx3220_write_fp_block() argument
161 reg = *data++; in vpx3220_write_fp_block()
162 ret |= vpx3220_fp_write(sd, reg, *data++); in vpx3220_write_fp_block()
163 len -= 2; in vpx3220_write_fp_block()
169 /* ---------------------------------------------------------------------- */
174 0x89, 240, /* Vertical lines in */
175 0x8a, 240, /* Vertical lines out */
184 * locking @ 240 lines */
189 0x89, 288, /* Vertical lines in (16 lines
191 0x8a, 288, /* Vertical lines out (16 lines
201 0xe7, 0x241, /* PAL/SECAM set to 288 lines */
206 0x89, 288, /* Vertical lines in (16 lines
208 0x8a, 288, /* Vertical lines out (16 lines
218 0xe7, 0x241, /* PAL/SECAM set to 288 lines */
236 * 10 to 8 2-bit error diffusion */
271 if (decoder->norm & V4L2_STD_NTSC) in vpx3220_init()
273 else if (decoder->norm & V4L2_STD_PAL) in vpx3220_init()
275 else if (decoder->norm & V4L2_STD_SECAM) in vpx3220_init()
358 return -EINVAL; in vpx3220_s_std()
361 decoder->norm = std; in vpx3220_s_std()
372 int data; in vpx3220_s_routing() local
385 return -EINVAL; in vpx3220_s_routing()
391 data = vpx3220_fp_read(sd, 0xf2) & ~(0x0020); in vpx3220_s_routing()
392 if (data < 0) in vpx3220_s_routing()
393 return data; in vpx3220_s_routing()
396 data | (input_vals[input][1] << 5) | 0x0010); in vpx3220_s_routing()
414 switch (ctrl->id) { in vpx3220_s_ctrl()
416 vpx3220_write(sd, 0xe6, ctrl->val); in vpx3220_s_ctrl()
420 vpx3220_write(sd, 0xe7, ctrl->val + 192); in vpx3220_s_ctrl()
423 vpx3220_fp_write(sd, 0xa0, ctrl->val); in vpx3220_s_ctrl()
426 vpx3220_fp_write(sd, 0x1c, ctrl->val); in vpx3220_s_ctrl()
429 return -EINVAL; in vpx3220_s_ctrl()
432 /* ----------------------------------------------------------------------- */
455 /* -----------------------------------------------------------------------
468 if (!i2c_check_functionality(client->adapter, in vpx3220_probe()
470 return -ENODEV; in vpx3220_probe()
472 decoder = devm_kzalloc(&client->dev, sizeof(*decoder), GFP_KERNEL); in vpx3220_probe()
474 return -ENOMEM; in vpx3220_probe()
475 sd = &decoder->sd; in vpx3220_probe()
477 decoder->norm = V4L2_STD_PAL; in vpx3220_probe()
478 decoder->input = 0; in vpx3220_probe()
479 decoder->enable = 1; in vpx3220_probe()
480 v4l2_ctrl_handler_init(&decoder->hdl, 4); in vpx3220_probe()
481 v4l2_ctrl_new_std(&decoder->hdl, &vpx3220_ctrl_ops, in vpx3220_probe()
482 V4L2_CID_BRIGHTNESS, -128, 127, 1, 0); in vpx3220_probe()
483 v4l2_ctrl_new_std(&decoder->hdl, &vpx3220_ctrl_ops, in vpx3220_probe()
485 v4l2_ctrl_new_std(&decoder->hdl, &vpx3220_ctrl_ops, in vpx3220_probe()
487 v4l2_ctrl_new_std(&decoder->hdl, &vpx3220_ctrl_ops, in vpx3220_probe()
488 V4L2_CID_HUE, -512, 511, 1, 0); in vpx3220_probe()
489 sd->ctrl_handler = &decoder->hdl; in vpx3220_probe()
490 if (decoder->hdl.error) { in vpx3220_probe()
491 int err = decoder->hdl.error; in vpx3220_probe()
493 v4l2_ctrl_handler_free(&decoder->hdl); in vpx3220_probe()
496 v4l2_ctrl_handler_setup(&decoder->hdl); in vpx3220_probe()
516 client->addr << 1, client->adapter->name); in vpx3220_probe()
519 ver, pn, client->addr << 1, client->adapter->name); in vpx3220_probe()
534 v4l2_ctrl_handler_free(&decoder->hdl); in vpx3220_remove()