Skip to content
Snippets Groups Projects
Commit ec4eaf97 authored by Stefano Radaelli's avatar Stefano Radaelli
Browse files

[i.MX8][C43][C26] Apply NXP patch for HDMI-IN working

parent cb228d92
No related branches found
No related tags found
2 merge requests!71[i.MX8][C43][C26] Apply NXP patch for HDMI-IN working,!70[i.MX8][C43][C26] Apply NXP patch for HDMI-IN working
...@@ -480,6 +480,33 @@ static int hdmirx_s_stream(struct v4l2_subdev *sd, int enable) ...@@ -480,6 +480,33 @@ static int hdmirx_s_stream(struct v4l2_subdev *sd, int enable)
return 0; return 0;
} }
static int mxc_hdmi_link_setup(struct media_entity *entity,
const struct media_pad *local,
const struct media_pad *remote, u32 flags)
{
struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
struct platform_device *pdev = v4l2_get_subdevdata(sd);
if (local->flags & MEDIA_PAD_FL_SOURCE) {
switch (local->index) {
case MXC_HDMI_RX_PAD_SOURCE:
break;
default:
dev_err(&pdev->dev, "%s invalid source pad\n", __func__);
return -EINVAL;
}
} else if (local->flags & MEDIA_PAD_FL_SINK) {
switch (local->index) {
case MXC_HDMI_RX_PAD_SINK:
break;
default:
dev_err(&pdev->dev, "%s invalid sink pad\n", __func__);
return -EINVAL;
}
}
return 0;
}
static const struct v4l2_subdev_video_ops cdns_video_ops_hdmi = { static const struct v4l2_subdev_video_ops cdns_video_ops_hdmi = {
.s_stream = hdmirx_s_stream, .s_stream = hdmirx_s_stream,
.g_parm = hdmirx_g_parm, .g_parm = hdmirx_g_parm,
...@@ -491,6 +518,7 @@ static const struct v4l2_subdev_video_ops cdns_video_ops_hdmi = { ...@@ -491,6 +518,7 @@ static const struct v4l2_subdev_video_ops cdns_video_ops_hdmi = {
*/ */
static const struct media_entity_operations hdmi_media_ops = { static const struct media_entity_operations hdmi_media_ops = {
.link_setup = mxc_hdmi_link_setup,
.link_validate = v4l2_subdev_link_validate, .link_validate = v4l2_subdev_link_validate,
}; };
...@@ -564,9 +592,6 @@ static int hdmirx_get_format(struct v4l2_subdev *sd, ...@@ -564,9 +592,6 @@ static int hdmirx_get_format(struct v4l2_subdev *sd,
return -EINVAL; return -EINVAL;
} }
if (sdformat->pad != MXC_HDMI_RX_PAD_SOURCE)
return -EINVAL;
switch (hdmirx->pixel_encoding) { switch (hdmirx->pixel_encoding) {
case PIXEL_ENCODING_YUV422: case PIXEL_ENCODING_YUV422:
mbusformat->code = MEDIA_BUS_FMT_YUYV8_1X16; mbusformat->code = MEDIA_BUS_FMT_YUYV8_1X16;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment