diff options
Diffstat (limited to 'linux/drivers/media/common/saa7146_hlp.c')
-rw-r--r-- | linux/drivers/media/common/saa7146_hlp.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/linux/drivers/media/common/saa7146_hlp.c b/linux/drivers/media/common/saa7146_hlp.c index fd7a9033f..4ebbfa2ff 100644 --- a/linux/drivers/media/common/saa7146_hlp.c +++ b/linux/drivers/media/common/saa7146_hlp.c @@ -8,6 +8,7 @@ #define my_max(type,x,y) \ ({ type __x = (x), __y = (y); __x > __y ? __x: __y; }) +static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format) { /* clear out the necessary bits */ @@ -16,17 +17,20 @@ void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* *clip_format |= (( ((palette&0xf00)>>8) << 30) | ((palette&0x00f) << 24) | (((palette&0x0f0)>>4) << 16)); } +static void calculate_bcs_ctrl_register(struct saa7146_dev *dev, int brightness, int contrast, int colour, u32 *bcs_ctrl) { *bcs_ctrl = ((brightness << 24) | (contrast << 16) | (colour << 0)); } +static void calculate_hps_source_and_sync(struct saa7146_dev *dev, int source, int sync, u32* hps_ctrl) { *hps_ctrl &= ~(MASK_30 | MASK_31 | MASK_28); *hps_ctrl |= (source << 30) | (sync << 28); } +static void calculate_hxo_and_hyo(struct saa7146_dev *dev, u32* hps_h_scale, u32* hps_ctrl) { int hyo = 0, hxo = 0; @@ -49,7 +53,7 @@ void calculate_hxo_and_hyo(struct saa7146_dev *dev, u32* hps_h_scale, u32* hps_c */ /* hps_coeff used for CXY and CXUV; scale 1/1 -> scale 1/64 */ -struct { +static struct { u16 hps_coeff; u16 weight_sum; } hps_h_coeff_tab [] = { @@ -72,6 +76,7 @@ struct { u8 h_attenuation[] = { 1, 2, 4, 8, 2, 4, 8, 16, 0}; /* calculate horizontal scale registers */ +static int calculate_h_scale_registers(struct saa7146_dev *dev, int in_x, int out_x, int flip_lr, u32* hps_ctrl, u32* hps_v_gain, u32* hps_h_prescale, u32* hps_h_scale) @@ -196,7 +201,7 @@ int calculate_h_scale_registers(struct saa7146_dev *dev, return 0; } -struct { +static struct { u16 hps_coeff; u16 weight_sum; } hps_v_coeff_tab [] = { @@ -219,6 +224,7 @@ struct { u16 v_attenuation[] = { 2, 4, 8, 16, 32, 64, 128, 256, 0}; /* calculate vertical scale registers */ +static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field field, int in_y, int out_y, u32* hps_v_scale, u32* hps_v_gain) { @@ -315,6 +321,7 @@ int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field field, } /* simple bubble-sort algorithm with duplicate elimination */ +static int sort_and_eliminate(u32* values, int* count) { int low = 0, high = 0, top = 0, temp = 0; @@ -347,6 +354,7 @@ int sort_and_eliminate(u32* values, int* count) return 0; } +static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct saa7146_fh *fh, struct saa7146_video_dma *vdma2, u32* clip_format, u32* arbtr_ctrl, enum v4l2_field field) { @@ -479,6 +487,7 @@ void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct saa7146_f } /* disable clipping */ +static void saa7146_disable_clipping(struct saa7146_dev *dev) { u32 clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); @@ -494,6 +503,7 @@ void saa7146_disable_clipping(struct saa7146_dev *dev) saa7146_write(dev, MC1, (MASK_21)); } +static void saa7146_set_clipping_rect(struct saa7146_dev *dev, struct saa7146_fh *fh) { enum v4l2_field field = fh->ov.win.field; @@ -536,6 +546,7 @@ void saa7146_set_clipping_rect(struct saa7146_dev *dev, struct saa7146_fh *fh) saa7146_write(dev, MC1, (MASK_05 | MASK_21)); } +static void saa7146_set_window(struct saa7146_dev *dev, int width, int height, enum v4l2_field field) { int flip_lr = dev->hflip; @@ -571,6 +582,7 @@ void saa7146_set_window(struct saa7146_dev *dev, int width, int height, enum v4l } /* calculate the new memory offsets for a desired position */ +static void saa7146_set_position(struct saa7146_dev *dev, int w_x, int w_y, int w_height, enum v4l2_field field) { int td_flip = dev->vflip; @@ -621,6 +633,7 @@ void saa7146_set_position(struct saa7146_dev *dev, int w_x, int w_y, int w_heigh saa7146_write(dev, MC2, (MASK_02 | MASK_18)); } +static void saa7146_set_output_format(struct saa7146_dev *dev, unsigned long palette) { u32 clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); @@ -730,7 +743,7 @@ void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_vi printk("vdma%d.num_line_byte: 0x%08x\n", which,vdma->num_line_byte); */ } - +static int calculate_video_dma_grab_packed(struct saa7146_dev* dev, struct saa7146_buf *buf) { struct saa7146_video_dma vdma1; @@ -781,6 +794,7 @@ int calculate_video_dma_grab_packed(struct saa7146_dev* dev, struct saa7146_buf return 0; } +static int calculate_video_dma_grab_planar(struct saa7146_dev* dev, struct saa7146_buf *buf) { struct saa7146_video_dma vdma1; @@ -886,6 +900,7 @@ int calculate_video_dma_grab_planar(struct saa7146_dev* dev, struct saa7146_buf return 0; } +static void program_capture_engine(struct saa7146_dev *dev, int planar) { int count = 0; |