V4L/DVB: usbvision: don't use usb_set_intfdata, let v4l2_device_register handle this
[safe/jmp/linux-2.6] / drivers / media / common / saa7146_hlp.c
index be34ec4..05bde9c 100644 (file)
@@ -158,7 +158,7 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev,
        }
 
        /* the horizontal scaling increment controls the UV filter
-          to reduce the bandwith to improve the display quality,
+          to reduce the bandwidth to improve the display quality,
           so set it ... */
        if ( xsci == 0x400)
                pfuv = 0x00;
@@ -312,7 +312,7 @@ static int sort_and_eliminate(u32* values, int* count)
                return -EINVAL;
        }
 
-       /* bubble sort the first ´count´ items of the array ´values´ */
+       /* bubble sort the first @count items of the array @values */
        for( top = *count; top > 0; top--) {
                for( low = 0, high = 1; high < top; low++, high++) {
                        if( values[low] > values[high] ) {
@@ -338,7 +338,7 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa
        struct saa7146_video_dma *vdma2, u32* clip_format, u32* arbtr_ctrl, enum v4l2_field field)
 {
        struct saa7146_vv *vv = dev->vv_data;
-       u32 *clipping = vv->d_clipping.cpu_addr;
+       __le32 *clipping = vv->d_clipping.cpu_addr;
 
        int width = fh->ov.win.w.width;
        int height =  fh->ov.win.w.height;
@@ -562,6 +562,13 @@ static void saa7146_set_position(struct saa7146_dev *dev, int w_x, int w_y, int
 
        int b_depth = vv->ov_fmt->depth;
        int b_bpl = vv->ov_fb.fmt.bytesperline;
+       /* The unsigned long cast is to remove a 64-bit compile warning since
+          it looks like a 64-bit address is cast to a 32-bit value, even
+          though the base pointer is really a 32-bit physical address that
+          goes into a 32-bit DMA register.
+          FIXME: might not work on some 64-bit platforms, but see the FIXME
+          in struct v4l2_framebuffer (videodev2.h) for that.
+        */
        u32 base = (u32)(unsigned long)vv->ov_fb.base;
 
        struct  saa7146_video_dma vdma1;
@@ -569,12 +576,12 @@ static void saa7146_set_position(struct saa7146_dev *dev, int w_x, int w_y, int
        /* calculate memory offsets for picture, look if we shall top-down-flip */
        vdma1.pitch     = 2*b_bpl;
        if ( 0 == vv->vflip ) {
-               vdma1.base_even = (u32)base + (w_y * (vdma1.pitch/2)) + (w_x * (b_depth / 8));
+               vdma1.base_even = base + (w_y * (vdma1.pitch/2)) + (w_x * (b_depth / 8));
                vdma1.base_odd  = vdma1.base_even + (vdma1.pitch / 2);
                vdma1.prot_addr = vdma1.base_even + (w_height * (vdma1.pitch / 2));
        }
        else {
-               vdma1.base_even = (u32)base + ((w_y+w_height) * (vdma1.pitch/2)) + (w_x * (b_depth / 8));
+               vdma1.base_even = base + ((w_y+w_height) * (vdma1.pitch/2)) + (w_x * (b_depth / 8));
                vdma1.base_odd  = vdma1.base_even - (vdma1.pitch / 2);
                vdma1.prot_addr = vdma1.base_odd - (w_height * (vdma1.pitch / 2));
        }
@@ -634,6 +641,7 @@ void saa7146_set_hps_source_and_sync(struct saa7146_dev *dev, int source, int sy
        vv->current_hps_source = source;
        vv->current_hps_sync = sync;
 }
+EXPORT_SYMBOL_GPL(saa7146_set_hps_source_and_sync);
 
 int saa7146_enable_overlay(struct saa7146_fh *fh)
 {