Commit 73ea57eb authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent cf7a3d91
...@@ -627,9 +627,12 @@ static void ccdc_configure_lpf(struct isp_ccdc_device *ccdc) ...@@ -627,9 +627,12 @@ static void ccdc_configure_lpf(struct isp_ccdc_device *ccdc)
static void ccdc_configure_alaw(struct isp_ccdc_device *ccdc) static void ccdc_configure_alaw(struct isp_ccdc_device *ccdc)
{ {
struct isp_device *isp = to_isp_device(ccdc); struct isp_device *isp = to_isp_device(ccdc);
const struct isp_format_info *info;
u32 alaw = 0; u32 alaw = 0;
switch (ccdc->syncif.datsz) { info = omap3isp_video_format_info(ccdc->formats[CCDC_PAD_SINK].code);
switch (info->width) {
case 8: case 8:
return; return;
...@@ -813,6 +816,7 @@ static void ccdc_config_vp(struct isp_ccdc_device *ccdc) ...@@ -813,6 +816,7 @@ static void ccdc_config_vp(struct isp_ccdc_device *ccdc)
{ {
struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity);
struct isp_device *isp = to_isp_device(ccdc); struct isp_device *isp = to_isp_device(ccdc);
const struct isp_format_info *info;
unsigned long l3_ick = pipe->l3_ick; unsigned long l3_ick = pipe->l3_ick;
unsigned int max_div = isp->revision == ISP_REVISION_15_0 ? 64 : 8; unsigned int max_div = isp->revision == ISP_REVISION_15_0 ? 64 : 8;
unsigned int div = 0; unsigned int div = 0;
...@@ -821,7 +825,9 @@ static void ccdc_config_vp(struct isp_ccdc_device *ccdc) ...@@ -821,7 +825,9 @@ static void ccdc_config_vp(struct isp_ccdc_device *ccdc)
fmtcfg_vp = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG) fmtcfg_vp = isp_reg_readl(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_FMTCFG)
& ~(ISPCCDC_FMTCFG_VPIN_MASK | ISPCCDC_FMTCFG_VPIF_FRQ_MASK); & ~(ISPCCDC_FMTCFG_VPIN_MASK | ISPCCDC_FMTCFG_VPIF_FRQ_MASK);
switch (ccdc->syncif.datsz) { info = omap3isp_video_format_info(ccdc->formats[CCDC_PAD_SINK].code);
switch (info->width) {
case 8: case 8:
case 10: case 10:
fmtcfg_vp |= ISPCCDC_FMTCFG_VPIN_9_0; fmtcfg_vp |= ISPCCDC_FMTCFG_VPIN_9_0;
...@@ -959,17 +965,17 @@ void omap3isp_ccdc_max_rate(struct isp_ccdc_device *ccdc, ...@@ -959,17 +965,17 @@ void omap3isp_ccdc_max_rate(struct isp_ccdc_device *ccdc,
/* /*
* ccdc_config_sync_if - Set CCDC sync interface configuration * ccdc_config_sync_if - Set CCDC sync interface configuration
* @ccdc: Pointer to ISP CCDC device. * @ccdc: Pointer to ISP CCDC device.
* @syncif: Structure containing the sync parameters like field state, CCDC in * @pdata: Parallel interface platform data (may be NULL)
* master/slave mode, raw/yuv data, polarity of data, field, hs, vs * @data_size: Data size
* signals.
*/ */
static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc, static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc,
struct ispccdc_syncif *syncif) struct isp_parallel_platform_data *pdata,
unsigned int data_size)
{ {
struct isp_device *isp = to_isp_device(ccdc); struct isp_device *isp = to_isp_device(ccdc);
u32 syn_mode = ISPCCDC_SYN_MODE_VDHDEN; u32 syn_mode = ISPCCDC_SYN_MODE_VDHDEN;
switch (syncif->datsz) { switch (data_size) {
case 8: case 8:
syn_mode |= ISPCCDC_SYN_MODE_DATSIZ_8; syn_mode |= ISPCCDC_SYN_MODE_DATSIZ_8;
break; break;
...@@ -984,20 +990,16 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc, ...@@ -984,20 +990,16 @@ static void ccdc_config_sync_if(struct isp_ccdc_device *ccdc,
break; break;
} }
if (syncif->datapol) if (pdata && pdata->data_pol)
syn_mode |= ISPCCDC_SYN_MODE_DATAPOL; syn_mode |= ISPCCDC_SYN_MODE_DATAPOL;
if (syncif->hdpol) if (pdata && pdata->hs_pol)
syn_mode |= ISPCCDC_SYN_MODE_HDPOL; syn_mode |= ISPCCDC_SYN_MODE_HDPOL;
if (syncif->vdpol) if (pdata && pdata->vs_pol)
syn_mode |= ISPCCDC_SYN_MODE_VDPOL; syn_mode |= ISPCCDC_SYN_MODE_VDPOL;
isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE); isp_reg_writel(isp, syn_mode, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_SYN_MODE);
if (!syncif->bt_r656_en)
isp_reg_clr(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_REC656IF,
ISPCCDC_REC656IF_R656ON);
} }
/* CCDC formats descriptions */ /* CCDC formats descriptions */
...@@ -1111,11 +1113,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) ...@@ -1111,11 +1113,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
shift = depth_in - depth_out; shift = depth_in - depth_out;
omap3isp_configure_bridge(isp, ccdc->input, pdata, shift); omap3isp_configure_bridge(isp, ccdc->input, pdata, shift);
ccdc->syncif.datsz = depth_out; ccdc_config_sync_if(ccdc, pdata, depth_out);
ccdc->syncif.datapol = 0;
ccdc->syncif.hdpol = pdata ? pdata->hs_pol : 0;
ccdc->syncif.vdpol = pdata ? pdata->vs_pol : 0;
ccdc_config_sync_if(ccdc, &ccdc->syncif);
/* CCDC_PAD_SINK */ /* CCDC_PAD_SINK */
format = &ccdc->formats[CCDC_PAD_SINK]; format = &ccdc->formats[CCDC_PAD_SINK];
...@@ -2446,8 +2444,6 @@ int omap3isp_ccdc_init(struct isp_device *isp) ...@@ -2446,8 +2444,6 @@ int omap3isp_ccdc_init(struct isp_device *isp)
INIT_LIST_HEAD(&ccdc->lsc.free_queue); INIT_LIST_HEAD(&ccdc->lsc.free_queue);
spin_lock_init(&ccdc->lsc.req_lock); spin_lock_init(&ccdc->lsc.req_lock);
ccdc->syncif.datsz = 0;
ccdc->clamp.oblen = 0; ccdc->clamp.oblen = 0;
ccdc->clamp.dcsubval = 0; ccdc->clamp.dcsubval = 0;
......
...@@ -46,22 +46,6 @@ enum ccdc_input_entity { ...@@ -46,22 +46,6 @@ enum ccdc_input_entity {
#define OMAP3ISP_CCDC_NEVENTS 16 #define OMAP3ISP_CCDC_NEVENTS 16
/*
* struct ispccdc_syncif - Structure for Sync Interface between sensor and CCDC
* @datsz: Data size.
* @datapol: 0 - Positive, 1 - Negative.
* @hdpol: 0 - Positive, 1 - Negative.
* @vdpol: 0 - Positive, 1 - Negative.
* @bt_r656_en: 1 - Enable ITU-R BT656 mode, 0 - Sync mode.
*/
struct ispccdc_syncif {
u8 datsz;
u8 datapol;
u8 hdpol;
u8 vdpol;
u8 bt_r656_en;
};
enum ispccdc_lsc_state { enum ispccdc_lsc_state {
LSC_STATE_STOPPED = 0, LSC_STATE_STOPPED = 0,
LSC_STATE_STOPPING = 1, LSC_STATE_STOPPING = 1,
...@@ -135,7 +119,6 @@ struct ispccdc_lsc { ...@@ -135,7 +119,6 @@ struct ispccdc_lsc {
* @lsc: Lens shading compensation configuration * @lsc: Lens shading compensation configuration
* @update: Bitmask of controls to update during the next interrupt * @update: Bitmask of controls to update during the next interrupt
* @shadow_update: Controls update in progress by userspace * @shadow_update: Controls update in progress by userspace
* @syncif: Interface synchronization configuration
* @underrun: A buffer underrun occurred and a new buffer has been queued * @underrun: A buffer underrun occurred and a new buffer has been queued
* @state: Streaming state * @state: Streaming state
* @lock: Serializes shadow_update with interrupt handler * @lock: Serializes shadow_update with interrupt handler
...@@ -164,8 +147,6 @@ struct isp_ccdc_device { ...@@ -164,8 +147,6 @@ struct isp_ccdc_device {
unsigned int update; unsigned int update;
unsigned int shadow_update; unsigned int shadow_update;
struct ispccdc_syncif syncif;
unsigned int underrun:1; unsigned int underrun:1;
enum isp_pipeline_stream_state state; enum isp_pipeline_stream_state state;
spinlock_t lock; spinlock_t lock;
......
...@@ -67,6 +67,8 @@ enum { ...@@ -67,6 +67,8 @@ enum {
* 0 - Active high, 1 - Active low * 0 - Active high, 1 - Active low
* @vs_pol: Vertical synchronization polarity * @vs_pol: Vertical synchronization polarity
* 0 - Active high, 1 - Active low * 0 - Active high, 1 - Active low
* @data_pol: Data polarity
* 0 - Normal, 1 - One's complement
* @bridge: CCDC Bridge input control * @bridge: CCDC Bridge input control
* ISP_BRIDGE_DISABLE - Disable * ISP_BRIDGE_DISABLE - Disable
* ISP_BRIDGE_LITTLE_ENDIAN - Little endian * ISP_BRIDGE_LITTLE_ENDIAN - Little endian
...@@ -77,6 +79,7 @@ struct isp_parallel_platform_data { ...@@ -77,6 +79,7 @@ struct isp_parallel_platform_data {
unsigned int clk_pol:1; unsigned int clk_pol:1;
unsigned int hs_pol:1; unsigned int hs_pol:1;
unsigned int vs_pol:1; unsigned int vs_pol:1;
unsigned int data_pol:1;
unsigned int bridge:2; unsigned int bridge:2;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment