diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-08-31 09:53:41 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-11 15:02:01 -0400 |
commit | 73ea57eb5442aece696a7a03e2cd4509d38e55fd (patch) | |
tree | 04d48cc7bf37d6e3ca617820d3ed1a10c74c54e8 /drivers | |
parent | cf7a3d91ade6c56bfd860b377f84bd58132f7a81 (diff) |
[media] omap3isp: ccdc: Remove ispccdc_syncif structure
The structure is only used to store configuration data and pass it to
CCDC configuration functions. Access the data directly from the
locations that need it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/omap3isp/ispccdc.c | 38 | ||||
-rw-r--r-- | drivers/media/video/omap3isp/ispccdc.h | 19 |
2 files changed, 17 insertions, 40 deletions
diff --git a/drivers/media/video/omap3isp/ispccdc.c b/drivers/media/video/omap3isp/ispccdc.c index 8dbb55a92fcf..c58b0c68ce36 100644 --- a/drivers/media/video/omap3isp/ispccdc.c +++ b/drivers/media/video/omap3isp/ispccdc.c | |||
@@ -627,9 +627,12 @@ static void ccdc_configure_lpf(struct isp_ccdc_device *ccdc) | |||
627 | static void ccdc_configure_alaw(struct isp_ccdc_device *ccdc) | 627 | static void ccdc_configure_alaw(struct isp_ccdc_device *ccdc) |
628 | { | 628 | { |
629 | struct isp_device *isp = to_isp_device(ccdc); | 629 | struct isp_device *isp = to_isp_device(ccdc); |
630 | const struct isp_format_info *info; | ||
630 | u32 alaw = 0; | 631 | u32 alaw = 0; |
631 | 632 | ||
632 | switch (ccdc->syncif.datsz) { | 633 | info = omap3isp_video_format_info(ccdc->formats[CCDC_PAD_SINK].code); |
634 | |||
635 | switch (info->width) { | ||
633 | case 8: | 636 | case 8: |
634 | return; | 637 | return; |
635 | 638 | ||
@@ -813,6 +816,7 @@ static void ccdc_config_vp(struct isp_ccdc_device *ccdc) | |||
813 | { | 816 | { |
814 | struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); | 817 | struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); |
815 | struct isp_device *isp = to_isp_device(ccdc); | 818 | struct isp_device *isp = to_isp_device(ccdc); |
819 | const struct isp_format_info *info; | ||
816 | unsigned long l3_ick = pipe->l3_ick; | 820 | unsigned long l3_ick = pipe->l3_ick; |
817 | unsigned int max_div = isp->revision == ISP_REVISION_15_0 ? 64 : 8; | 821 | unsigned int max_div = isp->revision == ISP_REVISION_15_0 ? 64 : 8; |
818 | unsigned int div = 0; | 822 | unsigned int div = 0; |
@@ -821,7 +825,9 @@ static void ccdc_config_vp(struct isp_ccdc_device *ccdc) | |||
821 | fmtcfg_vp = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG) | 825 | fmtcfg_vp = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG) |
822 | & ~(ISPCCDC_FMTCFG_VPIN_MASK | ISPCCDC_FMTCFG_VPIF_FRQ_MASK); | 826 | & ~(ISPCCDC_FMTCFG_VPIN_MASK | ISPCCDC_FMTCFG_VPIF_FRQ_MASK); |
823 | 827 | ||
824 | switch (ccdc->syncif.datsz) { | 828 | info = omap3isp_video_format_info(ccdc->formats[CCDC_PAD_SINK].code); |
829 | |||
830 | switch (info->width) { | ||
825 | case 8: | 831 | case 8: |
826 | case 10: | 832 | case 10: |
827 | fmtcfg_vp |= ISPCCDC_FMTCFG_VPIN_9_0; | 833 | fmtcfg_vp |= ISPCCDC_FMTCFG_VPIN_9_0; |
@@ -959,17 +965,17 @@ void omap3isp_ccdc_max_rate(struct isp_ccdc_device *ccdc, | |||
959 | /* | 965 | /* |
960 | * ccdc_config_sync_if - Set CCDC sync interface configuration | 966 | * ccdc_config_sync_if - Set CCDC sync interface configuration |
961 | * @ccdc: Pointer to ISP CCDC device. | 967 | * @ccdc: Pointer to ISP CCDC device. |
962 | * @syncif: Structure containing the sync parameters like field state, CCDC in | 968 | * @pdata: Parallel interface platform data (may be NULL) |
963 | * master/slave mode, raw/yuv data, polarity of data, field, hs, vs | 969 | * @data_size: Data size |
964 | * signals. | ||
965 | */ | 970 | */ |
966 | static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc, | 971 | static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc, |
967 | struct ispccdc_syncif *syncif) | 972 | struct isp_parallel_platform_data *pdata, |
973 | unsigned int data_size) | ||
968 | { | 974 | { |
969 | struct isp_device *isp = to_isp_device(ccdc); | 975 | struct isp_device *isp = to_isp_device(ccdc); |
970 | u32 syn_mode = ISPCCDC_SYN_MODE_VDHDEN; | 976 | u32 syn_mode = ISPCCDC_SYN_MODE_VDHDEN; |
971 | 977 | ||
972 | switch (syncif->datsz) { | 978 | switch (data_size) { |
973 | case 8: | 979 | case 8: |
974 | syn_mode |= ISPCCDC_SYN_MODE_DATSIZ_8; | 980 | syn_mode |= ISPCCDC_SYN_MODE_DATSIZ_8; |
975 | break; | 981 | break; |
@@ -984,20 +990,16 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc, | |||
984 | break; | 990 | break; |
985 | } | 991 | } |
986 | 992 | ||
987 | if (syncif->datapol) | 993 | if (pdata && pdata->data_pol) |
988 | syn_mode |= ISPCCDC_SYN_MODE_DATAPOL; | 994 | syn_mode |= ISPCCDC_SYN_MODE_DATAPOL; |
989 | 995 | ||
990 | if (syncif->hdpol) | 996 | if (pdata && pdata->hs_pol) |
991 | syn_mode |= ISPCCDC_SYN_MODE_HDPOL; | 997 | syn_mode |= ISPCCDC_SYN_MODE_HDPOL; |
992 | 998 | ||
993 | if (syncif->vdpol) | 999 | if (pdata && pdata->vs_pol) |
994 | syn_mode |= ISPCCDC_SYN_MODE_VDPOL; | 1000 | syn_mode |= ISPCCDC_SYN_MODE_VDPOL; |
995 | 1001 | ||
996 | isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); | 1002 | isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); |
997 | |||
998 | if (!syncif->bt_r656_en) | ||
999 | isp_reg_clr(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_REC656IF, | ||
1000 | ISPCCDC_REC656IF_R656ON); | ||
1001 | } | 1003 | } |
1002 | 1004 | ||
1003 | /* CCDC formats descriptions */ | 1005 | /* CCDC formats descriptions */ |
@@ -1111,11 +1113,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) | |||
1111 | shift = depth_in - depth_out; | 1113 | shift = depth_in - depth_out; |
1112 | omap3isp_configure_bridge(isp, ccdc->input, pdata, shift); | 1114 | omap3isp_configure_bridge(isp, ccdc->input, pdata, shift); |
1113 | 1115 | ||
1114 | ccdc->syncif.datsz = depth_out; | 1116 | ccdc_config_sync_if(ccdc, pdata, depth_out); |
1115 | ccdc->syncif.datapol = 0; | ||
1116 | ccdc->syncif.hdpol = pdata ? pdata->hs_pol : 0; | ||
1117 | ccdc->syncif.vdpol = pdata ? pdata->vs_pol : 0; | ||
1118 | ccdc_config_sync_if(ccdc, &ccdc->syncif); | ||
1119 | 1117 | ||
1120 | /* CCDC_PAD_SINK */ | 1118 | /* CCDC_PAD_SINK */ |
1121 | format = &ccdc->formats[CCDC_PAD_SINK]; | 1119 | format = &ccdc->formats[CCDC_PAD_SINK]; |
@@ -2446,8 +2444,6 @@ int omap3isp_ccdc_init(struct isp_device *isp) | |||
2446 | INIT_LIST_HEAD(&ccdc->lsc.free_queue); | 2444 | INIT_LIST_HEAD(&ccdc->lsc.free_queue); |
2447 | spin_lock_init(&ccdc->lsc.req_lock); | 2445 | spin_lock_init(&ccdc->lsc.req_lock); |
2448 | 2446 | ||
2449 | ccdc->syncif.datsz = 0; | ||
2450 | |||
2451 | ccdc->clamp.oblen = 0; | 2447 | ccdc->clamp.oblen = 0; |
2452 | ccdc->clamp.dcsubval = 0; | 2448 | ccdc->clamp.dcsubval = 0; |
2453 | 2449 | ||
diff --git a/drivers/media/video/omap3isp/ispccdc.h b/drivers/media/video/omap3isp/ispccdc.h index 57007d7b2d56..a5da9e19edbf 100644 --- a/drivers/media/video/omap3isp/ispccdc.h +++ b/drivers/media/video/omap3isp/ispccdc.h | |||
@@ -46,22 +46,6 @@ enum ccdc_input_entity { | |||
46 | 46 | ||
47 | #define OMAP3ISP_CCDC_NEVENTS 16 | 47 | #define OMAP3ISP_CCDC_NEVENTS 16 |
48 | 48 | ||
49 | /* | ||
50 | * struct ispccdc_syncif - Structure for Sync Interface between sensor and CCDC | ||
51 | * @datsz: Data size. | ||
52 | * @datapol: 0 - Positive, 1 - Negative. | ||
53 | * @hdpol: 0 - Positive, 1 - Negative. | ||
54 | * @vdpol: 0 - Positive, 1 - Negative. | ||
55 | * @bt_r656_en: 1 - Enable ITU-R BT656 mode, 0 - Sync mode. | ||
56 | */ | ||
57 | struct ispccdc_syncif { | ||
58 | u8 datsz; | ||
59 | u8 datapol; | ||
60 | u8 hdpol; | ||
61 | u8 vdpol; | ||
62 | u8 bt_r656_en; | ||
63 | }; | ||
64 | |||
65 | enum ispccdc_lsc_state { | 49 | enum ispccdc_lsc_state { |
66 | LSC_STATE_STOPPED = 0, | 50 | LSC_STATE_STOPPED = 0, |
67 | LSC_STATE_STOPPING = 1, | 51 | LSC_STATE_STOPPING = 1, |
@@ -135,7 +119,6 @@ struct ispccdc_lsc { | |||
135 | * @lsc: Lens shading compensation configuration | 119 | * @lsc: Lens shading compensation configuration |
136 | * @update: Bitmask of controls to update during the next interrupt | 120 | * @update: Bitmask of controls to update during the next interrupt |
137 | * @shadow_update: Controls update in progress by userspace | 121 | * @shadow_update: Controls update in progress by userspace |
138 | * @syncif: Interface synchronization configuration | ||
139 | * @underrun: A buffer underrun occurred and a new buffer has been queued | 122 | * @underrun: A buffer underrun occurred and a new buffer has been queued |
140 | * @state: Streaming state | 123 | * @state: Streaming state |
141 | * @lock: Serializes shadow_update with interrupt handler | 124 | * @lock: Serializes shadow_update with interrupt handler |
@@ -164,8 +147,6 @@ struct isp_ccdc_device { | |||
164 | unsigned int update; | 147 | unsigned int update; |
165 | unsigned int shadow_update; | 148 | unsigned int shadow_update; |
166 | 149 | ||
167 | struct ispccdc_syncif syncif; | ||
168 | |||
169 | unsigned int underrun:1; | 150 | unsigned int underrun:1; |
170 | enum isp_pipeline_stream_state state; | 151 | enum isp_pipeline_stream_state state; |
171 | spinlock_t lock; | 152 | spinlock_t lock; |