[media] vpif_display: use a v4l2_subdev pointer to call a subdev
This makes it easier to have outputs without subdevs. This needs more work. The way the outputs are configured should be identical to how inputs are configured. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com> Tested-by: Lad, Prabhakar <prabhakar.lad@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
178cce1262
commit
882084ad0f
|
@ -1246,6 +1246,8 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i)
|
||||||
vpif_err("Failed to set output standard\n");
|
vpif_err("Failed to set output standard\n");
|
||||||
|
|
||||||
ch->output_idx = i;
|
ch->output_idx = i;
|
||||||
|
if (vpif_obj.sd[i])
|
||||||
|
ch->sd = vpif_obj.sd[i];
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1317,14 +1319,13 @@ static int vpif_s_dv_timings(struct file *file, void *priv,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Configure subdevice timings, if any */
|
/* Configure subdevice timings, if any */
|
||||||
ret = v4l2_subdev_call(vpif_obj.sd[ch->output_idx],
|
ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
|
||||||
video, s_dv_timings, timings);
|
|
||||||
if (ret == -ENOIOCTLCMD) {
|
if (ret == -ENOIOCTLCMD) {
|
||||||
vpif_dbg(2, debug, "Custom DV timings not supported by "
|
vpif_dbg(2, debug, "Custom DV timings not supported by "
|
||||||
"subdevice\n");
|
"subdevice\n");
|
||||||
return -EINVAL;
|
return -ENODATA;
|
||||||
}
|
}
|
||||||
if (ret < 0) {
|
if (ret < 0 && ret != -ENODEV) {
|
||||||
vpif_dbg(2, debug, "Error setting custom DV timings\n");
|
vpif_dbg(2, debug, "Error setting custom DV timings\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1449,8 +1450,7 @@ static int vpif_dbg_g_register(struct file *file, void *priv,
|
||||||
struct vpif_fh *fh = priv;
|
struct vpif_fh *fh = priv;
|
||||||
struct channel_obj *ch = fh->channel;
|
struct channel_obj *ch = fh->channel;
|
||||||
|
|
||||||
return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], core,
|
return v4l2_subdev_call(ch->sd, core, g_register, reg);
|
||||||
g_register, reg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1467,8 +1467,7 @@ static int vpif_dbg_s_register(struct file *file, void *priv,
|
||||||
struct vpif_fh *fh = priv;
|
struct vpif_fh *fh = priv;
|
||||||
struct channel_obj *ch = fh->channel;
|
struct channel_obj *ch = fh->channel;
|
||||||
|
|
||||||
return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], core,
|
return v4l2_subdev_call(ch->sd, core, s_register, reg);
|
||||||
s_register, reg);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1739,6 +1738,8 @@ static __init int vpif_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
}
|
}
|
||||||
ch->initialized = 0;
|
ch->initialized = 0;
|
||||||
|
if (subdev_count)
|
||||||
|
ch->sd = vpif_obj.sd[0];
|
||||||
ch->channel_id = j;
|
ch->channel_id = j;
|
||||||
if (j < 2)
|
if (j < 2)
|
||||||
ch->common[VPIF_VIDEO_INDEX].numbuffers =
|
ch->common[VPIF_VIDEO_INDEX].numbuffers =
|
||||||
|
|
|
@ -125,6 +125,7 @@ struct channel_obj {
|
||||||
u8 initialized; /* flag to indicate whether
|
u8 initialized; /* flag to indicate whether
|
||||||
* encoder is initialized */
|
* encoder is initialized */
|
||||||
u32 output_idx; /* Current output index */
|
u32 output_idx; /* Current output index */
|
||||||
|
struct v4l2_subdev *sd; /* Current output subdev(may be NULL) */
|
||||||
|
|
||||||
enum vpif_channel_id channel_id;/* Identifies channel */
|
enum vpif_channel_id channel_id;/* Identifies channel */
|
||||||
struct vpif_params vpifparams;
|
struct vpif_params vpifparams;
|
||||||
|
|
Loading…
Reference in a new issue