@@ -409,7 +409,7 @@ static int vfe_get_output(struct vfe_line *line)
spin_lock_irqsave(&vfe->output_lock, flags);
output = &line->output;
- if (output->state != VFE_OUTPUT_OFF) {
+ if (output->state > VFE_OUTPUT_RESERVED) {
dev_err(vfe->camss->dev, "Output is running\n");
goto error;
}
@@ -462,7 +462,7 @@ static int vfe_enable_output(struct vfe_line *line)
ops->reg_update_clear(vfe, line->id);
- if (output->state != VFE_OUTPUT_OFF) {
+ if (output->state > VFE_OUTPUT_RESERVED) {
dev_err(vfe->camss->dev, "Output is not in reserved state %d\n",
output->state);
spin_unlock_irqrestore(&vfe->output_lock, flags);
@@ -239,7 +239,7 @@ static int vfe_get_output(struct vfe_line *line)
spin_lock_irqsave(&vfe->output_lock, flags);
output = &line->output;
- if (output->state != VFE_OUTPUT_OFF) {
+ if (output->state > VFE_OUTPUT_RESERVED) {
dev_err(vfe->camss->dev, "Output is running\n");
goto error;
}
@@ -279,7 +279,7 @@ static int vfe_enable_output(struct vfe_line *line)
vfe_reg_update_clear(vfe, line->id);
- if (output->state != VFE_OUTPUT_OFF) {
+ if (output->state > VFE_OUTPUT_RESERVED) {
dev_err(vfe->camss->dev, "Output is not in reserved state %d\n",
output->state);
spin_unlock_irqrestore(&vfe->output_lock, flags);
@@ -194,7 +194,7 @@ static int vfe_enable_output(struct vfe_line *line)
ops->reg_update_clear(vfe, line->id);
- if (output->state != VFE_OUTPUT_RESERVED) {
+ if (output->state > VFE_OUTPUT_RESERVED) {
dev_err(vfe->camss->dev, "Output is not in reserved state %d\n", output->state);
spin_unlock_irqrestore(&vfe->output_lock, flags);
return -EINVAL;
@@ -289,7 +289,7 @@ static int vfe_get_output(struct vfe_line *line)
spin_lock_irqsave(&vfe->output_lock, flags);
output = &line->output;
- if (output->state != VFE_OUTPUT_OFF) {
+ if (output->state > VFE_OUTPUT_RESERVED) {
dev_err(vfe->camss->dev, "Output is running\n");
goto error;
}
@@ -740,6 +740,7 @@ static int vfe_set_stream(struct v4l2_subdev *sd, int enable)
int ret;
if (enable) {
+ line->output.state = VFE_OUTPUT_RESERVED;
ret = vfe->ops->vfe_enable(line);
if (ret < 0)
dev_err(vfe->camss->dev,
@@ -1320,7 +1320,7 @@ static int camss_register_entities(struct camss *camss)
struct v4l2_subdev *vfe = &camss->vfe[k].line[j].subdev;
ret = media_create_pad_link(&csid->entity,
- MSM_CSID_PAD_SRC,
+ MSM_CSID_PAD_FIRST_SRC + j,
&vfe->entity,
MSM_VFE_PAD_SINK,
0);