Lines Matching full:sd
36 struct v4l2_subdev sd; member
55 static inline struct ths7303_state *to_state(struct v4l2_subdev *sd) in to_state() argument
57 return container_of(sd, struct ths7303_state, sd); in to_state()
60 static int ths7303_read(struct v4l2_subdev *sd, u8 reg) in ths7303_read() argument
62 struct i2c_client *client = v4l2_get_subdevdata(sd); in ths7303_read()
67 static int ths7303_write(struct v4l2_subdev *sd, u8 reg, u8 val) in ths7303_write() argument
69 struct i2c_client *client = v4l2_get_subdevdata(sd); in ths7303_write()
82 static int ths7303_setval(struct v4l2_subdev *sd, in ths7303_setval() argument
85 struct i2c_client *client = v4l2_get_subdevdata(sd); in ths7303_setval()
86 struct ths7303_state *state = to_state(sd); in ths7303_setval()
115 err = ths7303_write(sd, THS7303_CHANNEL_1, val); in ths7303_setval()
122 err = ths7303_write(sd, THS7303_CHANNEL_2, val); in ths7303_setval()
129 err = ths7303_write(sd, THS7303_CHANNEL_3, val); in ths7303_setval()
139 static int ths7303_s_std_output(struct v4l2_subdev *sd, v4l2_std_id norm) in ths7303_s_std_output() argument
141 struct ths7303_state *state = to_state(sd); in ths7303_s_std_output()
146 return ths7303_setval(sd, THS7303_FILTER_MODE_480I_576I); in ths7303_s_std_output()
149 return ths7303_setval(sd, THS7303_FILTER_MODE_DISABLE); in ths7303_s_std_output()
152 static int ths7303_config(struct v4l2_subdev *sd) in ths7303_config() argument
154 struct ths7303_state *state = to_state(sd); in ths7303_config()
158 ths7303_write(sd, THS7303_CHANNEL_1, in ths7303_config()
159 (ths7303_read(sd, THS7303_CHANNEL_1) & 0xf8) | in ths7303_config()
161 ths7303_write(sd, THS7303_CHANNEL_2, in ths7303_config()
162 (ths7303_read(sd, THS7303_CHANNEL_2) & 0xf8) | in ths7303_config()
164 ths7303_write(sd, THS7303_CHANNEL_3, in ths7303_config()
165 (ths7303_read(sd, THS7303_CHANNEL_3) & 0xf8) | in ths7303_config()
171 res = ths7303_setval(sd, THS7303_FILTER_MODE_1080P); in ths7303_config()
173 res = ths7303_setval(sd, THS7303_FILTER_MODE_720P_1080I); in ths7303_config()
175 res = ths7303_setval(sd, THS7303_FILTER_MODE_480P_576P); in ths7303_config()
177 res = ths7303_setval(sd, THS7303_FILTER_MODE_480I_576I); in ths7303_config()
180 res = ths7303_setval(sd, THS7303_FILTER_MODE_DISABLE); in ths7303_config()
186 static int ths7303_s_stream(struct v4l2_subdev *sd, int enable) in ths7303_s_stream() argument
188 struct ths7303_state *state = to_state(sd); in ths7303_s_stream()
192 return ths7303_config(sd); in ths7303_s_stream()
196 static int ths7303_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad, in ths7303_s_dv_timings() argument
199 struct ths7303_state *state = to_state(sd); in ths7303_s_dv_timings()
207 return ths7303_config(sd); in ths7303_s_dv_timings()
217 static int ths7303_g_register(struct v4l2_subdev *sd, in ths7303_g_register() argument
221 reg->val = ths7303_read(sd, reg->reg); in ths7303_g_register()
225 static int ths7303_s_register(struct v4l2_subdev *sd, in ths7303_s_register() argument
228 ths7303_write(sd, reg->reg, reg->val); in ths7303_s_register()
263 static void ths7303_log_channel_status(struct v4l2_subdev *sd, u8 reg) in ths7303_log_channel_status() argument
265 u8 val = ths7303_read(sd, reg); in ths7303_log_channel_status()
268 v4l2_info(sd, "Channel %d Off\n", reg); in ths7303_log_channel_status()
272 v4l2_info(sd, "Channel %d On\n", reg); in ths7303_log_channel_status()
273 v4l2_info(sd, " value 0x%x\n", val); in ths7303_log_channel_status()
274 v4l2_info(sd, " %s\n", stc_lpf_sel_txt[(val >> 6) & 0x3]); in ths7303_log_channel_status()
275 v4l2_info(sd, " %s\n", in_mux_sel_txt[(val >> 5) & 0x1]); in ths7303_log_channel_status()
276 v4l2_info(sd, " %s\n", lpf_freq_sel_txt[(val >> 3) & 0x3]); in ths7303_log_channel_status()
277 v4l2_info(sd, " %s\n", in_bias_sel_dis_cont_txt[(val >> 0) & 0x7]); in ths7303_log_channel_status()
280 static int ths7303_log_status(struct v4l2_subdev *sd) in ths7303_log_status() argument
282 struct ths7303_state *state = to_state(sd); in ths7303_log_status()
284 v4l2_info(sd, "stream %s\n", state->stream_on ? "On" : "Off"); in ths7303_log_status()
292 v4l2_info(sd, in ths7303_log_status()
301 v4l2_info(sd, "no timings set\n"); in ths7303_log_status()
304 ths7303_log_channel_status(sd, THS7303_CHANNEL_1); in ths7303_log_status()
305 ths7303_log_channel_status(sd, THS7303_CHANNEL_2); in ths7303_log_status()
306 ths7303_log_channel_status(sd, THS7303_CHANNEL_3); in ths7303_log_status()
333 struct v4l2_subdev *sd; in ths7303_probe() local
352 sd = &state->sd; in ths7303_probe()
353 v4l2_i2c_subdev_init(sd, client, &ths7303_ops); in ths7303_probe()
356 if (ths7303_setval(sd, THS7303_FILTER_MODE_480I_576I) < 0) { in ths7303_probe()
366 struct v4l2_subdev *sd = i2c_get_clientdata(client); in ths7303_remove() local
368 v4l2_device_unregister_subdev(sd); in ths7303_remove()