Lines Matching +full:gain +full:- +full:scaling +full:- +full:n
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2005-2006 Micronas USA Inc.
11 #include <media/v4l2-device.h>
12 #include <media/v4l2-ctrls.h>
19 * This driver is based on the wis-tw9903.c source that was in
21 * saturation and scaling (neither seemed to work). If anyone ever gets
24 * wis-tw9903 driver is still present.
50 0x0d, 0x00, /* scaling */
51 0x0e, 0x11, /* scaling */
52 0x0f, 0x00, /* scaling */
56 0x13, 0x7f, /* U gain */
57 0x14, 0x5a, /* V gain */
65 0x20, 0xa0, /* clamping gain (working 0x50) */
80 0x2f, 0xe0, /* 0xea is blue test frame -- 0xe0 for normal */
87 0x00, 0x00, /* Terminator (reg 0x00 is read-only) */
103 return -1; in write_regs()
134 dec->norm = norm; in tw9903_s_std()
141 struct tw9903 *dec = container_of(ctrl->handler, struct tw9903, hdl); in tw9903_s_ctrl()
142 struct v4l2_subdev *sd = &dec->sd; in tw9903_s_ctrl()
144 switch (ctrl->id) { in tw9903_s_ctrl()
146 write_reg(sd, 0x10, ctrl->val); in tw9903_s_ctrl()
149 write_reg(sd, 0x11, ctrl->val); in tw9903_s_ctrl()
152 write_reg(sd, 0x15, ctrl->val); in tw9903_s_ctrl()
155 return -EINVAL; in tw9903_s_ctrl()
163 bool is_60hz = dec->norm & V4L2_STD_525_60; in tw9903_log_status()
165 v4l2_info(sd, "Standard: %d Hz\n", is_60hz ? 60 : 50); in tw9903_log_status()
170 /* --------------------------------------------------------------------------*/
190 /* --------------------------------------------------------------------------*/
199 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) in tw9903_probe()
200 return -EIO; in tw9903_probe()
202 v4l_info(client, "chip found @ 0x%02x (%s)\n", in tw9903_probe()
203 client->addr << 1, client->adapter->name); in tw9903_probe()
205 dec = devm_kzalloc(&client->dev, sizeof(*dec), GFP_KERNEL); in tw9903_probe()
207 return -ENOMEM; in tw9903_probe()
208 sd = &dec->sd; in tw9903_probe()
210 hdl = &dec->hdl; in tw9903_probe()
213 V4L2_CID_BRIGHTNESS, -128, 127, 1, 0); in tw9903_probe()
217 V4L2_CID_HUE, -128, 127, 1, 0); in tw9903_probe()
218 sd->ctrl_handler = hdl; in tw9903_probe()
219 if (hdl->error) { in tw9903_probe()
220 int err = hdl->error; in tw9903_probe()
227 dec->norm = V4L2_STD_NTSC; in tw9903_probe()
230 v4l2_err(client, "error initializing TW9903\n"); in tw9903_probe()
231 return -EINVAL; in tw9903_probe()
242 v4l2_ctrl_handler_free(&to_state(sd)->hdl); in tw9903_remove()
245 /* ----------------------------------------------------------------------- */