diff options
-rw-r--r-- | drivers/media/platform/davinci/vpss.c | 32 | ||||
-rw-r--r-- | include/media/davinci/vpss.h | 16 |
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 | ||
184 | int 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 | } | ||
190 | EXPORT_SYMBOL(vpss_dma_complete_interrupt); | ||
191 | |||
178 | int vpss_select_ccdc_source(enum vpss_ccdc_source_sel src_sel) | 192 | int 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 | ||
217 | void 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 | } | ||
224 | EXPORT_SYMBOL(vpss_set_sync_pol); | ||
225 | |||
203 | int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel) | 226 | int 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 | } |
366 | EXPORT_SYMBOL(dm365_vpss_set_sync_pol); | 389 | EXPORT_SYMBOL(dm365_vpss_set_sync_pol); |
367 | 390 | ||
391 | void 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 | } | ||
398 | EXPORT_SYMBOL(vpss_set_pg_frame_size); | ||
399 | |||
368 | void dm365_vpss_set_pg_frame_size(struct vpss_pg_frame_size frame_size) | 400 | void 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 */ |
107 | int vpss_clear_wbl_overflow(enum vpss_wbl_sel wbl_sel); | 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 | #endif | 124 | #endif |