Lines Matching +full:video +full:- +full:encoder

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * bt856 - BT856A Digital Video Encoder (Rockwell Part)
15 * - moved over to linux>=2.4.x i2c protocol (9/9/2002)
25 #include <media/v4l2-device.h>
27 MODULE_DESCRIPTION("Brooktree-856A video encoder driver");
33 MODULE_PARM_DESC(debug, "Debug level (0-1)");
36 /* ----------------------------------------------------------------------- */
53 /* ----------------------------------------------------------------------- */
55 static inline int bt856_write(struct bt856 *encoder, u8 reg, u8 value) in bt856_write() argument
57 struct i2c_client *client = v4l2_get_subdevdata(&encoder->sd); in bt856_write()
59 encoder->reg[reg - BT856_REG_OFFSET] = value; in bt856_write()
63 static inline int bt856_setbit(struct bt856 *encoder, u8 reg, u8 bit, u8 value) in bt856_setbit() argument
65 return bt856_write(encoder, reg, in bt856_setbit()
66 (encoder->reg[reg - BT856_REG_OFFSET] & ~(1 << bit)) | in bt856_setbit()
70 static void bt856_dump(struct bt856 *encoder) in bt856_dump() argument
74 v4l2_info(&encoder->sd, "register dump:\n"); in bt856_dump()
76 printk(KERN_CONT " %02x", encoder->reg[i]); in bt856_dump()
80 /* ----------------------------------------------------------------------- */
84 struct bt856 *encoder = to_bt856(sd); in bt856_init() local
88 bt856_write(encoder, 0xdc, 0x18); in bt856_init()
89 bt856_write(encoder, 0xda, 0); in bt856_init()
90 bt856_write(encoder, 0xde, 0); in bt856_init()
92 bt856_setbit(encoder, 0xdc, 3, 1); in bt856_init()
93 /*bt856_setbit(encoder, 0xdc, 6, 0);*/ in bt856_init()
94 bt856_setbit(encoder, 0xdc, 4, 1); in bt856_init()
96 if (encoder->norm & V4L2_STD_NTSC) in bt856_init()
97 bt856_setbit(encoder, 0xdc, 2, 0); in bt856_init()
99 bt856_setbit(encoder, 0xdc, 2, 1); in bt856_init()
101 bt856_setbit(encoder, 0xdc, 1, 1); in bt856_init()
102 bt856_setbit(encoder, 0xde, 4, 0); in bt856_init()
103 bt856_setbit(encoder, 0xde, 3, 1); in bt856_init()
105 bt856_dump(encoder); in bt856_init()
111 struct bt856 *encoder = to_bt856(sd); in bt856_s_std_output() local
116 bt856_setbit(encoder, 0xdc, 2, 0); in bt856_s_std_output()
118 bt856_setbit(encoder, 0xdc, 2, 1); in bt856_s_std_output()
119 bt856_setbit(encoder, 0xda, 0, 0); in bt856_s_std_output()
120 /*bt856_setbit(encoder, 0xda, 0, 1);*/ in bt856_s_std_output()
122 return -EINVAL; in bt856_s_std_output()
124 encoder->norm = std; in bt856_s_std_output()
126 bt856_dump(encoder); in bt856_s_std_output()
133 struct bt856 *encoder = to_bt856(sd); in bt856_s_routing() local
137 /* We only have video bus. in bt856_s_routing()
142 bt856_setbit(encoder, 0xde, 4, 0); in bt856_s_routing()
143 bt856_setbit(encoder, 0xde, 3, 1); in bt856_s_routing()
144 bt856_setbit(encoder, 0xdc, 3, 1); in bt856_s_routing()
145 bt856_setbit(encoder, 0xdc, 6, 0); in bt856_s_routing()
148 bt856_setbit(encoder, 0xde, 4, 0); in bt856_s_routing()
149 bt856_setbit(encoder, 0xde, 3, 1); in bt856_s_routing()
150 bt856_setbit(encoder, 0xdc, 3, 1); in bt856_s_routing()
151 bt856_setbit(encoder, 0xdc, 6, 1); in bt856_s_routing()
154 bt856_setbit(encoder, 0xdc, 3, 0); in bt856_s_routing()
155 bt856_setbit(encoder, 0xde, 4, 1); in bt856_s_routing()
158 return -EINVAL; in bt856_s_routing()
162 bt856_dump(encoder); in bt856_s_routing()
166 /* ----------------------------------------------------------------------- */
179 .video = &bt856_video_ops,
182 /* ----------------------------------------------------------------------- */
187 struct bt856 *encoder; in bt856_probe() local
191 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) in bt856_probe()
192 return -ENODEV; in bt856_probe()
195 client->addr << 1, client->adapter->name); in bt856_probe()
197 encoder = devm_kzalloc(&client->dev, sizeof(*encoder), GFP_KERNEL); in bt856_probe()
198 if (encoder == NULL) in bt856_probe()
199 return -ENOMEM; in bt856_probe()
200 sd = &encoder->sd; in bt856_probe()
202 encoder->norm = V4L2_STD_NTSC; in bt856_probe()
204 bt856_write(encoder, 0xdc, 0x18); in bt856_probe()
205 bt856_write(encoder, 0xda, 0); in bt856_probe()
206 bt856_write(encoder, 0xde, 0); in bt856_probe()
208 bt856_setbit(encoder, 0xdc, 3, 1); in bt856_probe()
209 /*bt856_setbit(encoder, 0xdc, 6, 0);*/ in bt856_probe()
210 bt856_setbit(encoder, 0xdc, 4, 1); in bt856_probe()
212 if (encoder->norm & V4L2_STD_NTSC) in bt856_probe()
213 bt856_setbit(encoder, 0xdc, 2, 0); in bt856_probe()
215 bt856_setbit(encoder, 0xdc, 2, 1); in bt856_probe()
217 bt856_setbit(encoder, 0xdc, 1, 1); in bt856_probe()
218 bt856_setbit(encoder, 0xde, 4, 0); in bt856_probe()
219 bt856_setbit(encoder, 0xde, 3, 1); in bt856_probe()
222 bt856_dump(encoder); in bt856_probe()