static int bru_s_ctrl(struct v4l2_ctrl *ctrl) { struct vsp1_bru *bru = container_of(ctrl->handler, struct vsp1_bru, ctrls); if (!vsp1_entity_is_streaming(&bru->entity)) return 0; switch (ctrl->id) { case V4L2_CID_BG_COLOR: vsp1_bru_write(bru, VI6_BRU_VIRRPF_COL, ctrl->val | (0xff << VI6_BRU_VIRRPF_COL_A_SHIFT)); break; } return 0; }
static void rpf_set_memory(struct vsp1_rwpf *rpf, struct vsp1_rwpf_memory *mem) { unsigned int i; for (i = 0; i < 3; ++i) rpf->buf_addr[i] = mem->addr[i]; if (!vsp1_entity_is_streaming(&rpf->entity)) return; vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_Y, mem->addr[0] + rpf->offsets[0]); if (mem->num_planes > 1) vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_C0, mem->addr[1] + rpf->offsets[1]); if (mem->num_planes > 2) vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_C1, mem->addr[2] + rpf->offsets[1]); }
static int wpf_s_ctrl(struct v4l2_ctrl *ctrl) { struct vsp1_rwpf *wpf = container_of(ctrl->handler, struct vsp1_rwpf, ctrls); u32 value; if (!vsp1_entity_is_streaming(&wpf->entity)) return 0; switch (ctrl->id) { case V4L2_CID_ALPHA_COMPONENT: value = vsp1_wpf_read(wpf, VI6_WPF_OUTFMT); value &= ~VI6_WPF_OUTFMT_PDV_MASK; value |= ctrl->val << VI6_WPF_OUTFMT_PDV_SHIFT; vsp1_wpf_write(wpf, VI6_WPF_OUTFMT, value); break; } return 0; }
static int rpf_s_ctrl(struct v4l2_ctrl *ctrl) { struct vsp1_rwpf *rpf = container_of(ctrl->handler, struct vsp1_rwpf, ctrls); struct vsp1_pipeline *pipe; if (!vsp1_entity_is_streaming(&rpf->entity)) return 0; switch (ctrl->id) { case V4L2_CID_ALPHA_COMPONENT: vsp1_rpf_write(rpf, VI6_RPF_VRTCOL_SET, ctrl->val << VI6_RPF_VRTCOL_SET_LAYA_SHIFT); pipe = to_vsp1_pipeline(&rpf->entity.subdev.entity); vsp1_pipeline_propagate_alpha(pipe, &rpf->entity, ctrl->val); break; } return 0; }