Lines Matching refs:ctrl
135 static inline struct tw2804 *to_state_from_ctrl(struct v4l2_ctrl *ctrl)
137 return container_of(ctrl->handler, struct tw2804, hdl);
164 static int tw2804_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
166 struct tw2804 *state = to_state_from_ctrl(ctrl);
169 switch (ctrl->id) {
171 ctrl->val = read_reg(client, TW2804_REG_GAIN, 0);
175 ctrl->val = read_reg(client, TW2804_REG_CHROMA_GAIN, 0);
179 ctrl->val = read_reg(client, TW2804_REG_BLUE_BALANCE, 0);
183 ctrl->val = read_reg(client, TW2804_REG_RED_BALANCE, 0);
189 static int tw2804_s_ctrl(struct v4l2_ctrl *ctrl)
191 struct tw2804 *state = to_state_from_ctrl(ctrl);
196 switch (ctrl->id) {
202 if (ctrl->val == 0)
213 reg = (reg & ~(0x03)) | (ctrl->val == 0 ? 0x02 : 0x03);
217 return write_reg(client, TW2804_REG_GAIN, ctrl->val, 0);
220 return write_reg(client, TW2804_REG_CHROMA_GAIN, ctrl->val, 0);
223 return write_reg(client, TW2804_REG_BLUE_BALANCE, ctrl->val, 0);
226 return write_reg(client, TW2804_REG_RED_BALANCE, ctrl->val, 0);
230 ctrl->val, state->channel);
234 ctrl->val, state->channel);
238 ctrl->val, state->channel);
242 ctrl->val, state->channel);
351 struct v4l2_ctrl *ctrl;
378 ctrl = v4l2_ctrl_new_std(&state->hdl, &tw2804_ctrl_ops,
380 if (ctrl)
381 ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE;
382 ctrl = v4l2_ctrl_new_std(&state->hdl, &tw2804_ctrl_ops,
384 if (ctrl)
385 ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE;
386 ctrl = v4l2_ctrl_new_std(&state->hdl, &tw2804_ctrl_ops,
388 if (ctrl)
389 ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE;
390 ctrl = v4l2_ctrl_new_std(&state->hdl, &tw2804_ctrl_ops,
392 if (ctrl)
393 ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE;