aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManjunath Hadli <manjunath.hadli@ti.com>2012-08-21 04:56:21 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-12-21 11:07:20 -0500
commitd31c100250bb07b6d317e1cfc44614b45a16154a (patch)
tree3dbfd82757744e7258569bbe0f4bfdef7be8f8e4
parent3de939419cfaf613b87cf89adc5dda97ca1720e0 (diff)
[media] davinci/vpss: add helper functions for setting hw params
Add vpss helper functions to be used in the main driver for setting hardware parameters. Add interface functions to set sync polarity, interrupt completion and pageframe size in vpss to be used by the main driver. Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/platform/davinci/vpss.c32
-rw-r--r--include/media/davinci/vpss.h16
2 files changed, 48 insertions, 0 deletions
diff --git a/drivers/media/platform/davinci/vpss.c b/drivers/media/platform/davinci/vpss.c
index e4ad63d15265..d945f94053a8 100644
--- a/drivers/media/platform/davinci/vpss.c
+++ b/drivers/media/platform/davinci/vpss.c
@@ -111,6 +111,12 @@ struct vpss_hw_ops {
111 void (*select_ccdc_source)(enum vpss_ccdc_source_sel src_sel); 111 void (*select_ccdc_source)(enum vpss_ccdc_source_sel src_sel);
112 /* clear wbl overflow bit */ 112 /* clear wbl overflow bit */
113 int (*clear_wbl_overflow)(enum vpss_wbl_sel wbl_sel); 113 int (*clear_wbl_overflow)(enum vpss_wbl_sel wbl_sel);
114 /* set sync polarity */
115 void (*set_sync_pol)(struct vpss_sync_pol);
116 /* set the PG_FRAME_SIZE register*/
117 void (*set_pg_frame_size)(struct vpss_pg_frame_size);
118 /* check and clear interrupt if occured */
119 int (*dma_complete_interrupt)(void);
114}; 120};
115 121
116/* vpss configuration */ 122/* vpss configuration */
@@ -175,6 +181,14 @@ static void dm355_select_ccdc_source(enum vpss_ccdc_source_sel src_sel)
175 bl_regw(src_sel << VPSS_HSSISEL_SHIFT, DM355_VPSSBL_CCDCMUX); 181 bl_regw(src_sel << VPSS_HSSISEL_SHIFT, DM355_VPSSBL_CCDCMUX);
176} 182}
177 183
184int vpss_dma_complete_interrupt(void)
185{
186 if (!oper_cfg.hw_ops.dma_complete_interrupt)
187 return 2;
188 return oper_cfg.hw_ops.dma_complete_interrupt();
189}
190EXPORT_SYMBOL(vpss_dma_complete_interrupt);
191
178int vpss_select_ccdc_source(enum vpss_ccdc_source_sel src_sel) 192int vpss_select_ccdc_source(enum vpss_ccdc_source_sel src_sel)
179{ 193{
180 if (!oper_cfg.hw_ops.select_ccdc_source) 194 if (!oper_cfg.hw_ops.select_ccdc_source)
@@ -200,6 +214,15 @@ static int dm644x_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel)
200 return 0; 214 return 0;
201} 215}
202 216
217void vpss_set_sync_pol(struct vpss_sync_pol sync)
218{
219 if (!oper_cfg.hw_ops.set_sync_pol)
220 return;
221
222 oper_cfg.hw_ops.set_sync_pol(sync);
223}
224EXPORT_SYMBOL(vpss_set_sync_pol);
225
203int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel) 226int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel)
204{ 227{
205 if (!oper_cfg.hw_ops.clear_wbl_overflow) 228 if (!oper_cfg.hw_ops.clear_wbl_overflow)
@@ -365,6 +388,15 @@ void dm365_vpss_set_sync_pol(struct vpss_sync_pol sync)
365} 388}
366EXPORT_SYMBOL(dm365_vpss_set_sync_pol); 389EXPORT_SYMBOL(dm365_vpss_set_sync_pol);
367 390
391void vpss_set_pg_frame_size(struct vpss_pg_frame_size frame_size)
392{
393 if (!oper_cfg.hw_ops.set_pg_frame_size)
394 return;
395
396 oper_cfg.hw_ops.set_pg_frame_size(frame_size);
397}
398EXPORT_SYMBOL(vpss_set_pg_frame_size);
399
368void dm365_vpss_set_pg_frame_size(struct vpss_pg_frame_size frame_size) 400void dm365_vpss_set_pg_frame_size(struct vpss_pg_frame_size frame_size)
369{ 401{
370 int current_reg = ((frame_size.hlpfr >> 1) - 1) << 16; 402 int current_reg = ((frame_size.hlpfr >> 1) - 1) << 16;
diff --git a/include/media/davinci/vpss.h b/include/media/davinci/vpss.h
index b586495bcd53..153473daaa32 100644
--- a/include/media/davinci/vpss.h
+++ b/include/media/davinci/vpss.h
@@ -105,4 +105,20 @@ enum vpss_wbl_sel {
105}; 105};
106/* clear wbl overflow flag for DM6446 */ 106/* clear wbl overflow flag for DM6446 */
107int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel); 107int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel);
108
109/* set sync polarity*/
110void vpss_set_sync_pol(struct vpss_sync_pol sync);
111/* set the PG_FRAME_SIZE register */
112void vpss_set_pg_frame_size(struct vpss_pg_frame_size frame_size);
113/*
114 * vpss_check_and_clear_interrupt - check and clear interrupt
115 * @irq - common enumerator for IRQ
116 *
117 * Following return values used:-
118 * 0 - interrupt occurred and cleared
119 * 1 - interrupt not occurred
120 * 2 - interrupt status not available
121 */
122int vpss_dma_complete_interrupt(void);
123
108#endif 124#endif