Commit 85dc1cff0df3a7e3012cf88b94026f954a72c178
Committed by
Mauro Carvalho Chehab
1 parent
34cae30b84
Exists in
master
and in
7 other branches
V4L/DVB (13665): sh_mobile_ceu_camera: Add support for sync polarity selection
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Showing 2 changed files with 19 additions and 0 deletions Side-by-side Diff
drivers/media/video/sh_mobile_ceu_camera.c
... | ... | @@ -687,6 +687,23 @@ |
687 | 687 | if (!common_flags) |
688 | 688 | return -EINVAL; |
689 | 689 | |
690 | + /* Make choises, based on platform preferences */ | |
691 | + if ((common_flags & SOCAM_HSYNC_ACTIVE_HIGH) && | |
692 | + (common_flags & SOCAM_HSYNC_ACTIVE_LOW)) { | |
693 | + if (pcdev->pdata->flags & SH_CEU_FLAG_HSYNC_LOW) | |
694 | + common_flags &= ~SOCAM_HSYNC_ACTIVE_HIGH; | |
695 | + else | |
696 | + common_flags &= ~SOCAM_HSYNC_ACTIVE_LOW; | |
697 | + } | |
698 | + | |
699 | + if ((common_flags & SOCAM_VSYNC_ACTIVE_HIGH) && | |
700 | + (common_flags & SOCAM_VSYNC_ACTIVE_LOW)) { | |
701 | + if (pcdev->pdata->flags & SH_CEU_FLAG_VSYNC_LOW) | |
702 | + common_flags &= ~SOCAM_VSYNC_ACTIVE_HIGH; | |
703 | + else | |
704 | + common_flags &= ~SOCAM_VSYNC_ACTIVE_LOW; | |
705 | + } | |
706 | + | |
690 | 707 | ret = icd->ops->set_bus_param(icd, common_flags); |
691 | 708 | if (ret < 0) |
692 | 709 | return ret; |
include/media/sh_mobile_ceu.h
... | ... | @@ -3,6 +3,8 @@ |
3 | 3 | |
4 | 4 | #define SH_CEU_FLAG_USE_8BIT_BUS (1 << 0) /* use 8bit bus width */ |
5 | 5 | #define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */ |
6 | +#define SH_CEU_FLAG_HSYNC_LOW (1 << 2) /* default High if possible */ | |
7 | +#define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ | |
6 | 8 | |
7 | 9 | struct sh_mobile_ceu_info { |
8 | 10 | unsigned long flags; |