Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Manjunath Hadli and committed by
Mauro Carvalho Chehab
d31c1002 3de93941

+48
+32
drivers/media/platform/davinci/vpss.c
··· 111 111 void (*select_ccdc_source)(enum vpss_ccdc_source_sel src_sel); 112 112 /* clear wbl overflow bit */ 113 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 122 /* vpss configuration */ ··· 181 175 bl_regw(src_sel << VPSS_HSSISEL_SHIFT, DM355_VPSSBL_CCDCMUX); 182 176 } 183 177 178 + int vpss_dma_complete_interrupt(void) 179 + { 180 + if (!oper_cfg.hw_ops.dma_complete_interrupt) 181 + return 2; 182 + return oper_cfg.hw_ops.dma_complete_interrupt(); 183 + } 184 + EXPORT_SYMBOL(vpss_dma_complete_interrupt); 185 + 184 186 int vpss_select_ccdc_source(enum vpss_ccdc_source_sel src_sel) 185 187 { 186 188 if (!oper_cfg.hw_ops.select_ccdc_source) ··· 213 199 bl_regw(val, DM644X_SBL_PCR_VPSS); 214 200 return 0; 215 201 } 202 + 203 + void vpss_set_sync_pol(struct vpss_sync_pol sync) 204 + { 205 + if (!oper_cfg.hw_ops.set_sync_pol) 206 + return; 207 + 208 + oper_cfg.hw_ops.set_sync_pol(sync); 209 + } 210 + EXPORT_SYMBOL(vpss_set_sync_pol); 216 211 217 212 int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel) 218 213 { ··· 387 364 isp5_write(val, DM365_ISP5_CCDCMUX); 388 365 } 389 366 EXPORT_SYMBOL(dm365_vpss_set_sync_pol); 367 + 368 + void vpss_set_pg_frame_size(struct vpss_pg_frame_size frame_size) 369 + { 370 + if (!oper_cfg.hw_ops.set_pg_frame_size) 371 + return; 372 + 373 + oper_cfg.hw_ops.set_pg_frame_size(frame_size); 374 + } 375 + EXPORT_SYMBOL(vpss_set_pg_frame_size); 390 376 391 377 void dm365_vpss_set_pg_frame_size(struct vpss_pg_frame_size frame_size) 392 378 {
+16
include/media/davinci/vpss.h
··· 105 105 }; 106 106 /* clear wbl overflow flag for DM6446 */ 107 107 int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel); 108 + 109 + /* set sync polarity*/ 110 + void vpss_set_sync_pol(struct vpss_sync_pol sync); 111 + /* set the PG_FRAME_SIZE register */ 112 + void 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 + */ 122 + int vpss_dma_complete_interrupt(void); 123 + 108 124 #endif