diff options
Diffstat (limited to 'drivers/media/platform/s5p-tv/mixer_video.c')
-rw-r--r-- | drivers/media/platform/s5p-tv/mixer_video.c | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c index 82142a2d6d93..ef0efdf422fe 100644 --- a/drivers/media/platform/s5p-tv/mixer_video.c +++ b/drivers/media/platform/s5p-tv/mixer_video.c | |||
@@ -501,8 +501,8 @@ fail: | |||
501 | return -ERANGE; | 501 | return -ERANGE; |
502 | } | 502 | } |
503 | 503 | ||
504 | static int mxr_enum_dv_presets(struct file *file, void *fh, | 504 | static int mxr_enum_dv_timings(struct file *file, void *fh, |
505 | struct v4l2_dv_enum_preset *preset) | 505 | struct v4l2_enum_dv_timings *timings) |
506 | { | 506 | { |
507 | struct mxr_layer *layer = video_drvdata(file); | 507 | struct mxr_layer *layer = video_drvdata(file); |
508 | struct mxr_device *mdev = layer->mdev; | 508 | struct mxr_device *mdev = layer->mdev; |
@@ -510,14 +510,14 @@ static int mxr_enum_dv_presets(struct file *file, void *fh, | |||
510 | 510 | ||
511 | /* lock protects from changing sd_out */ | 511 | /* lock protects from changing sd_out */ |
512 | mutex_lock(&mdev->mutex); | 512 | mutex_lock(&mdev->mutex); |
513 | ret = v4l2_subdev_call(to_outsd(mdev), video, enum_dv_presets, preset); | 513 | ret = v4l2_subdev_call(to_outsd(mdev), video, enum_dv_timings, timings); |
514 | mutex_unlock(&mdev->mutex); | 514 | mutex_unlock(&mdev->mutex); |
515 | 515 | ||
516 | return ret ? -EINVAL : 0; | 516 | return ret ? -EINVAL : 0; |
517 | } | 517 | } |
518 | 518 | ||
519 | static int mxr_s_dv_preset(struct file *file, void *fh, | 519 | static int mxr_s_dv_timings(struct file *file, void *fh, |
520 | struct v4l2_dv_preset *preset) | 520 | struct v4l2_dv_timings *timings) |
521 | { | 521 | { |
522 | struct mxr_layer *layer = video_drvdata(file); | 522 | struct mxr_layer *layer = video_drvdata(file); |
523 | struct mxr_device *mdev = layer->mdev; | 523 | struct mxr_device *mdev = layer->mdev; |
@@ -526,7 +526,7 @@ static int mxr_s_dv_preset(struct file *file, void *fh, | |||
526 | /* lock protects from changing sd_out */ | 526 | /* lock protects from changing sd_out */ |
527 | mutex_lock(&mdev->mutex); | 527 | mutex_lock(&mdev->mutex); |
528 | 528 | ||
529 | /* preset change cannot be done while there is an entity | 529 | /* timings change cannot be done while there is an entity |
530 | * dependant on output configuration | 530 | * dependant on output configuration |
531 | */ | 531 | */ |
532 | if (mdev->n_output > 0) { | 532 | if (mdev->n_output > 0) { |
@@ -534,7 +534,7 @@ static int mxr_s_dv_preset(struct file *file, void *fh, | |||
534 | return -EBUSY; | 534 | return -EBUSY; |
535 | } | 535 | } |
536 | 536 | ||
537 | ret = v4l2_subdev_call(to_outsd(mdev), video, s_dv_preset, preset); | 537 | ret = v4l2_subdev_call(to_outsd(mdev), video, s_dv_timings, timings); |
538 | 538 | ||
539 | mutex_unlock(&mdev->mutex); | 539 | mutex_unlock(&mdev->mutex); |
540 | 540 | ||
@@ -544,8 +544,8 @@ static int mxr_s_dv_preset(struct file *file, void *fh, | |||
544 | return ret ? -EINVAL : 0; | 544 | return ret ? -EINVAL : 0; |
545 | } | 545 | } |
546 | 546 | ||
547 | static int mxr_g_dv_preset(struct file *file, void *fh, | 547 | static int mxr_g_dv_timings(struct file *file, void *fh, |
548 | struct v4l2_dv_preset *preset) | 548 | struct v4l2_dv_timings *timings) |
549 | { | 549 | { |
550 | struct mxr_layer *layer = video_drvdata(file); | 550 | struct mxr_layer *layer = video_drvdata(file); |
551 | struct mxr_device *mdev = layer->mdev; | 551 | struct mxr_device *mdev = layer->mdev; |
@@ -553,13 +553,28 @@ static int mxr_g_dv_preset(struct file *file, void *fh, | |||
553 | 553 | ||
554 | /* lock protects from changing sd_out */ | 554 | /* lock protects from changing sd_out */ |
555 | mutex_lock(&mdev->mutex); | 555 | mutex_lock(&mdev->mutex); |
556 | ret = v4l2_subdev_call(to_outsd(mdev), video, g_dv_preset, preset); | 556 | ret = v4l2_subdev_call(to_outsd(mdev), video, g_dv_timings, timings); |
557 | mutex_unlock(&mdev->mutex); | 557 | mutex_unlock(&mdev->mutex); |
558 | 558 | ||
559 | return ret ? -EINVAL : 0; | 559 | return ret ? -EINVAL : 0; |
560 | } | 560 | } |
561 | 561 | ||
562 | static int mxr_s_std(struct file *file, void *fh, v4l2_std_id *norm) | 562 | static int mxr_dv_timings_cap(struct file *file, void *fh, |
563 | struct v4l2_dv_timings_cap *cap) | ||
564 | { | ||
565 | struct mxr_layer *layer = video_drvdata(file); | ||
566 | struct mxr_device *mdev = layer->mdev; | ||
567 | int ret; | ||
568 | |||
569 | /* lock protects from changing sd_out */ | ||
570 | mutex_lock(&mdev->mutex); | ||
571 | ret = v4l2_subdev_call(to_outsd(mdev), video, dv_timings_cap, cap); | ||
572 | mutex_unlock(&mdev->mutex); | ||
573 | |||
574 | return ret ? -EINVAL : 0; | ||
575 | } | ||
576 | |||
577 | static int mxr_s_std(struct file *file, void *fh, v4l2_std_id norm) | ||
563 | { | 578 | { |
564 | struct mxr_layer *layer = video_drvdata(file); | 579 | struct mxr_layer *layer = video_drvdata(file); |
565 | struct mxr_device *mdev = layer->mdev; | 580 | struct mxr_device *mdev = layer->mdev; |
@@ -576,7 +591,7 @@ static int mxr_s_std(struct file *file, void *fh, v4l2_std_id *norm) | |||
576 | return -EBUSY; | 591 | return -EBUSY; |
577 | } | 592 | } |
578 | 593 | ||
579 | ret = v4l2_subdev_call(to_outsd(mdev), video, s_std_output, *norm); | 594 | ret = v4l2_subdev_call(to_outsd(mdev), video, s_std_output, norm); |
580 | 595 | ||
581 | mutex_unlock(&mdev->mutex); | 596 | mutex_unlock(&mdev->mutex); |
582 | 597 | ||
@@ -616,8 +631,8 @@ static int mxr_enum_output(struct file *file, void *fh, struct v4l2_output *a) | |||
616 | /* try to obtain supported tv norms */ | 631 | /* try to obtain supported tv norms */ |
617 | v4l2_subdev_call(sd, video, g_tvnorms_output, &a->std); | 632 | v4l2_subdev_call(sd, video, g_tvnorms_output, &a->std); |
618 | a->capabilities = 0; | 633 | a->capabilities = 0; |
619 | if (sd->ops->video && sd->ops->video->s_dv_preset) | 634 | if (sd->ops->video && sd->ops->video->s_dv_timings) |
620 | a->capabilities |= V4L2_OUT_CAP_PRESETS; | 635 | a->capabilities |= V4L2_OUT_CAP_DV_TIMINGS; |
621 | if (sd->ops->video && sd->ops->video->s_std_output) | 636 | if (sd->ops->video && sd->ops->video->s_std_output) |
622 | a->capabilities |= V4L2_OUT_CAP_STD; | 637 | a->capabilities |= V4L2_OUT_CAP_STD; |
623 | a->type = V4L2_OUTPUT_TYPE_ANALOG; | 638 | a->type = V4L2_OUTPUT_TYPE_ANALOG; |
@@ -738,10 +753,11 @@ static const struct v4l2_ioctl_ops mxr_ioctl_ops = { | |||
738 | /* Streaming control */ | 753 | /* Streaming control */ |
739 | .vidioc_streamon = mxr_streamon, | 754 | .vidioc_streamon = mxr_streamon, |
740 | .vidioc_streamoff = mxr_streamoff, | 755 | .vidioc_streamoff = mxr_streamoff, |
741 | /* Preset functions */ | 756 | /* DV Timings functions */ |
742 | .vidioc_enum_dv_presets = mxr_enum_dv_presets, | 757 | .vidioc_enum_dv_timings = mxr_enum_dv_timings, |
743 | .vidioc_s_dv_preset = mxr_s_dv_preset, | 758 | .vidioc_s_dv_timings = mxr_s_dv_timings, |
744 | .vidioc_g_dv_preset = mxr_g_dv_preset, | 759 | .vidioc_g_dv_timings = mxr_g_dv_timings, |
760 | .vidioc_dv_timings_cap = mxr_dv_timings_cap, | ||
745 | /* analog TV standard functions */ | 761 | /* analog TV standard functions */ |
746 | .vidioc_s_std = mxr_s_std, | 762 | .vidioc_s_std = mxr_s_std, |
747 | .vidioc_g_std = mxr_g_std, | 763 | .vidioc_g_std = mxr_g_std, |