Lines Matching full:sd

25 	struct v4l2_subdev sd;  member
63 static inline struct adv7183 *to_adv7183(struct v4l2_subdev *sd) in to_adv7183() argument
65 return container_of(sd, struct adv7183, sd); in to_adv7183()
69 return &container_of(ctrl->handler, struct adv7183, hdl)->sd; in to_sd()
72 static inline int adv7183_read(struct v4l2_subdev *sd, unsigned char reg) in adv7183_read() argument
74 struct i2c_client *client = v4l2_get_subdevdata(sd); in adv7183_read()
79 static inline int adv7183_write(struct v4l2_subdev *sd, unsigned char reg, in adv7183_write() argument
82 struct i2c_client *client = v4l2_get_subdevdata(sd); in adv7183_write()
87 static int adv7183_writeregs(struct v4l2_subdev *sd, in adv7183_writeregs() argument
94 v4l2_err(sd, "invalid regs array\n"); in adv7183_writeregs()
103 adv7183_write(sd, reg, data); in adv7183_writeregs()
108 static int adv7183_log_status(struct v4l2_subdev *sd) in adv7183_log_status() argument
110 struct adv7183 *decoder = to_adv7183(sd); in adv7183_log_status()
112 v4l2_info(sd, "adv7183: Input control = 0x%02x\n", in adv7183_log_status()
113 adv7183_read(sd, ADV7183_IN_CTRL)); in adv7183_log_status()
114 v4l2_info(sd, "adv7183: Video selection = 0x%02x\n", in adv7183_log_status()
115 adv7183_read(sd, ADV7183_VD_SEL)); in adv7183_log_status()
116 v4l2_info(sd, "adv7183: Output control = 0x%02x\n", in adv7183_log_status()
117 adv7183_read(sd, ADV7183_OUT_CTRL)); in adv7183_log_status()
118 v4l2_info(sd, "adv7183: Extended output control = 0x%02x\n", in adv7183_log_status()
119 adv7183_read(sd, ADV7183_EXT_OUT_CTRL)); in adv7183_log_status()
120 v4l2_info(sd, "adv7183: Autodetect enable = 0x%02x\n", in adv7183_log_status()
121 adv7183_read(sd, ADV7183_AUTO_DET_EN)); in adv7183_log_status()
122 v4l2_info(sd, "adv7183: Contrast = 0x%02x\n", in adv7183_log_status()
123 adv7183_read(sd, ADV7183_CONTRAST)); in adv7183_log_status()
124 v4l2_info(sd, "adv7183: Brightness = 0x%02x\n", in adv7183_log_status()
125 adv7183_read(sd, ADV7183_BRIGHTNESS)); in adv7183_log_status()
126 v4l2_info(sd, "adv7183: Hue = 0x%02x\n", in adv7183_log_status()
127 adv7183_read(sd, ADV7183_HUE)); in adv7183_log_status()
128 v4l2_info(sd, "adv7183: Default value Y = 0x%02x\n", in adv7183_log_status()
129 adv7183_read(sd, ADV7183_DEF_Y)); in adv7183_log_status()
130 v4l2_info(sd, "adv7183: Default value C = 0x%02x\n", in adv7183_log_status()
131 adv7183_read(sd, ADV7183_DEF_C)); in adv7183_log_status()
132 v4l2_info(sd, "adv7183: ADI control = 0x%02x\n", in adv7183_log_status()
133 adv7183_read(sd, ADV7183_ADI_CTRL)); in adv7183_log_status()
134 v4l2_info(sd, "adv7183: Power Management = 0x%02x\n", in adv7183_log_status()
135 adv7183_read(sd, ADV7183_POW_MANAGE)); in adv7183_log_status()
136 v4l2_info(sd, "adv7183: Status 1 2 and 3 = 0x%02x 0x%02x 0x%02x\n", in adv7183_log_status()
137 adv7183_read(sd, ADV7183_STATUS_1), in adv7183_log_status()
138 adv7183_read(sd, ADV7183_STATUS_2), in adv7183_log_status()
139 adv7183_read(sd, ADV7183_STATUS_3)); in adv7183_log_status()
140 v4l2_info(sd, "adv7183: Ident = 0x%02x\n", in adv7183_log_status()
141 adv7183_read(sd, ADV7183_IDENT)); in adv7183_log_status()
142 v4l2_info(sd, "adv7183: Analog clamp control = 0x%02x\n", in adv7183_log_status()
143 adv7183_read(sd, ADV7183_ANAL_CLAMP_CTRL)); in adv7183_log_status()
144 v4l2_info(sd, "adv7183: Digital clamp control 1 = 0x%02x\n", in adv7183_log_status()
145 adv7183_read(sd, ADV7183_DIGI_CLAMP_CTRL_1)); in adv7183_log_status()
146 v4l2_info(sd, "adv7183: Shaping filter control 1 and 2 = 0x%02x 0x%02x\n", in adv7183_log_status()
147 adv7183_read(sd, ADV7183_SHAP_FILT_CTRL), in adv7183_log_status()
148 adv7183_read(sd, ADV7183_SHAP_FILT_CTRL_2)); in adv7183_log_status()
149 v4l2_info(sd, "adv7183: Comb filter control = 0x%02x\n", in adv7183_log_status()
150 adv7183_read(sd, ADV7183_COMB_FILT_CTRL)); in adv7183_log_status()
151 v4l2_info(sd, "adv7183: ADI control 2 = 0x%02x\n", in adv7183_log_status()
152 adv7183_read(sd, ADV7183_ADI_CTRL_2)); in adv7183_log_status()
153 v4l2_info(sd, "adv7183: Pixel delay control = 0x%02x\n", in adv7183_log_status()
154 adv7183_read(sd, ADV7183_PIX_DELAY_CTRL)); in adv7183_log_status()
155 v4l2_info(sd, "adv7183: Misc gain control = 0x%02x\n", in adv7183_log_status()
156 adv7183_read(sd, ADV7183_MISC_GAIN_CTRL)); in adv7183_log_status()
157 v4l2_info(sd, "adv7183: AGC mode control = 0x%02x\n", in adv7183_log_status()
158 adv7183_read(sd, ADV7183_AGC_MODE_CTRL)); in adv7183_log_status()
159 v4l2_info(sd, "adv7183: Chroma gain control 1 and 2 = 0x%02x 0x%02x\n", in adv7183_log_status()
160 adv7183_read(sd, ADV7183_CHRO_GAIN_CTRL_1), in adv7183_log_status()
161 adv7183_read(sd, ADV7183_CHRO_GAIN_CTRL_2)); in adv7183_log_status()
162 v4l2_info(sd, "adv7183: Luma gain control 1 and 2 = 0x%02x 0x%02x\n", in adv7183_log_status()
163 adv7183_read(sd, ADV7183_LUMA_GAIN_CTRL_1), in adv7183_log_status()
164 adv7183_read(sd, ADV7183_LUMA_GAIN_CTRL_2)); in adv7183_log_status()
165 v4l2_info(sd, "adv7183: Vsync field control 1 2 and 3 = 0x%02x 0x%02x 0x%02x\n", in adv7183_log_status()
166 adv7183_read(sd, ADV7183_VS_FIELD_CTRL_1), in adv7183_log_status()
167 adv7183_read(sd, ADV7183_VS_FIELD_CTRL_2), in adv7183_log_status()
168 adv7183_read(sd, ADV7183_VS_FIELD_CTRL_3)); in adv7183_log_status()
169 v4l2_info(sd, "adv7183: Hsync position control 1 2 and 3 = 0x%02x 0x%02x 0x%02x\n", in adv7183_log_status()
170 adv7183_read(sd, ADV7183_HS_POS_CTRL_1), in adv7183_log_status()
171 adv7183_read(sd, ADV7183_HS_POS_CTRL_2), in adv7183_log_status()
172 adv7183_read(sd, ADV7183_HS_POS_CTRL_3)); in adv7183_log_status()
173 v4l2_info(sd, "adv7183: Polarity = 0x%02x\n", in adv7183_log_status()
174 adv7183_read(sd, ADV7183_POLARITY)); in adv7183_log_status()
175 v4l2_info(sd, "adv7183: ADC control = 0x%02x\n", in adv7183_log_status()
176 adv7183_read(sd, ADV7183_ADC_CTRL)); in adv7183_log_status()
177 v4l2_info(sd, "adv7183: SD offset Cb and Cr = 0x%02x 0x%02x\n", in adv7183_log_status()
178 adv7183_read(sd, ADV7183_SD_OFFSET_CB), in adv7183_log_status()
179 adv7183_read(sd, ADV7183_SD_OFFSET_CR)); in adv7183_log_status()
180 v4l2_info(sd, "adv7183: SD saturation Cb and Cr = 0x%02x 0x%02x\n", in adv7183_log_status()
181 adv7183_read(sd, ADV7183_SD_SATURATION_CB), in adv7183_log_status()
182 adv7183_read(sd, ADV7183_SD_SATURATION_CR)); in adv7183_log_status()
183 v4l2_info(sd, "adv7183: Drive strength = 0x%02x\n", in adv7183_log_status()
184 adv7183_read(sd, ADV7183_DRIVE_STR)); in adv7183_log_status()
185 v4l2_ctrl_handler_log_status(&decoder->hdl, sd->name); in adv7183_log_status()
189 static int adv7183_g_std(struct v4l2_subdev *sd, v4l2_std_id *std) in adv7183_g_std() argument
191 struct adv7183 *decoder = to_adv7183(sd); in adv7183_g_std()
197 static int adv7183_s_std(struct v4l2_subdev *sd, v4l2_std_id std) in adv7183_s_std() argument
199 struct adv7183 *decoder = to_adv7183(sd); in adv7183_s_std()
202 reg = adv7183_read(sd, ADV7183_IN_CTRL) & 0xF; in adv7183_s_std()
221 adv7183_write(sd, ADV7183_IN_CTRL, reg); in adv7183_s_std()
228 static int adv7183_reset(struct v4l2_subdev *sd, u32 val) in adv7183_reset() argument
232 reg = adv7183_read(sd, ADV7183_POW_MANAGE) | 0x80; in adv7183_reset()
233 adv7183_write(sd, ADV7183_POW_MANAGE, reg); in adv7183_reset()
239 static int adv7183_s_routing(struct v4l2_subdev *sd, in adv7183_s_routing() argument
242 struct adv7183 *decoder = to_adv7183(sd); in adv7183_s_routing()
250 reg = adv7183_read(sd, ADV7183_IN_CTRL) & 0xF0; in adv7183_s_routing()
300 adv7183_write(sd, ADV7183_IN_CTRL, reg); in adv7183_s_routing()
305 reg = adv7183_read(sd, ADV7183_OUT_CTRL) & 0xC0; in adv7183_s_routing()
314 adv7183_write(sd, ADV7183_OUT_CTRL, reg); in adv7183_s_routing()
322 struct v4l2_subdev *sd = to_sd(ctrl); in adv7183_s_ctrl() local
329 adv7183_write(sd, ADV7183_BRIGHTNESS, val); in adv7183_s_ctrl()
332 adv7183_write(sd, ADV7183_CONTRAST, val); in adv7183_s_ctrl()
335 adv7183_write(sd, ADV7183_SD_SATURATION_CB, val >> 8); in adv7183_s_ctrl()
336 adv7183_write(sd, ADV7183_SD_SATURATION_CR, (val & 0xFF)); in adv7183_s_ctrl()
339 adv7183_write(sd, ADV7183_SD_OFFSET_CB, val >> 8); in adv7183_s_ctrl()
340 adv7183_write(sd, ADV7183_SD_OFFSET_CR, (val & 0xFF)); in adv7183_s_ctrl()
349 static int adv7183_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) in adv7183_querystd() argument
351 struct adv7183 *decoder = to_adv7183(sd); in adv7183_querystd()
355 reg = adv7183_read(sd, ADV7183_IN_CTRL) & 0xF; in adv7183_querystd()
356 adv7183_write(sd, ADV7183_IN_CTRL, reg); in adv7183_querystd()
362 reg = adv7183_read(sd, ADV7183_STATUS_1); in adv7183_querystd()
394 adv7183_s_std(sd, decoder->std); in adv7183_querystd()
398 static int adv7183_g_input_status(struct v4l2_subdev *sd, u32 *status) in adv7183_g_input_status() argument
403 reg = adv7183_read(sd, ADV7183_STATUS_1); in adv7183_g_input_status()
411 static int adv7183_enum_mbus_code(struct v4l2_subdev *sd, in adv7183_enum_mbus_code() argument
422 static int adv7183_set_fmt(struct v4l2_subdev *sd, in adv7183_set_fmt() argument
426 struct adv7183 *decoder = to_adv7183(sd); in adv7183_set_fmt()
448 static int adv7183_get_fmt(struct v4l2_subdev *sd, in adv7183_get_fmt() argument
452 struct adv7183 *decoder = to_adv7183(sd); in adv7183_get_fmt()
461 static int adv7183_s_stream(struct v4l2_subdev *sd, int enable) in adv7183_s_stream() argument
463 struct adv7183 *decoder = to_adv7183(sd); in adv7183_s_stream()
474 static int adv7183_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) in adv7183_g_register() argument
476 reg->val = adv7183_read(sd, reg->reg & 0xff); in adv7183_g_register()
481 static int adv7183_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg) in adv7183_s_register() argument
483 adv7183_write(sd, reg->reg & 0xff, reg->val & 0xff); in adv7183_s_register()
525 struct v4l2_subdev *sd; in adv7183_probe() local
562 sd = &decoder->sd; in adv7183_probe()
563 v4l2_i2c_subdev_init(sd, client, &adv7183_ops); in adv7183_probe()
576 sd->ctrl_handler = hdl; in adv7183_probe()
597 adv7183_writeregs(sd, adv7183_init_regs, ARRAY_SIZE(adv7183_init_regs)); in adv7183_probe()
598 adv7183_s_std(sd, decoder->std); in adv7183_probe()
601 adv7183_set_fmt(sd, NULL, &fmt); in adv7183_probe()
615 struct v4l2_subdev *sd = i2c_get_clientdata(client); in adv7183_remove() local
617 v4l2_device_unregister_subdev(sd); in adv7183_remove()
618 v4l2_ctrl_handler_free(sd->ctrl_handler); in adv7183_remove()