diff options
author | Johannes Stezenbach <devnull@localhost> | 2005-03-02 21:42:00 +0000 |
---|---|---|
committer | Johannes Stezenbach <devnull@localhost> | 2005-03-02 21:42:00 +0000 |
commit | 22369c7b769f439e3b351ecc9cd396a40b452db1 (patch) | |
tree | d7c330a08914350746300715a74c8fa6dc1fcebf | |
parent | ca7fda81614047eda9a192f937edf43dbbb11e88 (diff) | |
download | mediapointer-dvb-s2-22369c7b769f439e3b351ecc9cd396a40b452db1.tar.gz mediapointer-dvb-s2-22369c7b769f439e3b351ecc9cd396a40b452db1.tar.bz2 |
whitespace cleanup (remove ws at eol, sync with changes in mainline kernel)
69 files changed, 1104 insertions, 1429 deletions
diff --git a/linux/Documentation/dvb/faq.txt b/linux/Documentation/dvb/faq.txt index ba743da79..3bf51e45c 100644 --- a/linux/Documentation/dvb/faq.txt +++ b/linux/Documentation/dvb/faq.txt @@ -35,7 +35,7 @@ Some very frequently asked questions about linuxtv-dvb Note: Only very recent versions of Mplayer and xine can decode. MPEG2 transport streams (TS) directly. Then, run '[sct]zap channelname -r' in one xterm, and keep it running, - and start 'mplayer - < /dev/dvb/adapter0/dvr0' or + and start 'mplayer - < /dev/dvb/adapter0/dvr0' or 'xine stdin://mpeg2 < /dev/dvb/adapter0/dvr0' in a second xterm. That's all far from perfect, but it seems no one has written a nice DVB application which includes a builtin software MPEG @@ -93,7 +93,7 @@ Some very frequently asked questions about linuxtv-dvb http://www.mythtv.org/ MythTV - analog TV PVR, but now with DVB support, too (with software MPEG decode) - + http://dvbsnoop.sourceforge.net/ DVB sniffer program to monitor, analyze, debug, dump or view dvb/mpeg/dsm-cc/mhp stream information (TS, @@ -129,25 +129,25 @@ Some very frequently asked questions about linuxtv-dvb $ "echo 0 > /proc/sys/net/ipv4/conf/dvb0/rp_filter" 7. What the hell are all those modules that need to be loaded? - + For a dvb-ttpci av7110 based full-featured card the following modules are loaded: - videodev: Video4Linux core module. This is the base module that gives you access to the "analog" tv picture of the av7110 mpeg2 decoder. - + - v4l2-common: common functions for Video4Linux-2 drivers - + - v4l1-compat: backward compatiblity layer for Video4Linux-1 legacy applications - dvb-core: DVB core module. This provides you with the /dev/dvb/adapter entries - + - saa7146: SAA7146 core driver. This is need to access any SAA7146 based card in your system. - + - saa7146_vv: SAA7146 video and vbi functions. These are only needed for full-featured cards. diff --git a/linux/drivers/media/common/saa7146_hlp.c b/linux/drivers/media/common/saa7146_hlp.c index 9c93c3fe1..ec52dff8c 100644 --- a/linux/drivers/media/common/saa7146_hlp.c +++ b/linux/drivers/media/common/saa7146_hlp.c @@ -4,7 +4,7 @@ static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format) { /* clear out the necessary bits */ - *clip_format &= 0x0000ffff; + *clip_format &= 0x0000ffff; /* set these bits new */ *clip_format |= (( ((palette&0xf00)>>8) << 30) | ((palette&0x00f) << 24) | (((palette&0x0f0)>>4) << 16)); } @@ -21,7 +21,7 @@ static void calculate_hxo_and_hyo(struct saa7146_vv *vv, u32* hps_h_scale, u32* hyo = vv->standard->v_offset; hxo = vv->standard->h_offset; - + *hps_h_scale &= ~(MASK_B0 | 0xf00); *hps_h_scale |= (hxo << 0); @@ -40,7 +40,7 @@ static void calculate_hxo_and_hyo(struct saa7146_vv *vv, u32* hps_h_scale, u32* static struct { u16 hps_coeff; u16 weight_sum; -} hps_h_coeff_tab [] = { +} hps_h_coeff_tab [] = { {0x00, 2}, {0x02, 4}, {0x00, 4}, {0x06, 8}, {0x02, 8}, {0x08, 8}, {0x00, 8}, {0x1E, 16}, {0x0E, 8}, {0x26, 8}, {0x06, 8}, {0x42, 8}, {0x02, 8}, {0x80, 8}, {0x00, 8}, @@ -65,11 +65,11 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev, u32* hps_ctrl, u32* hps_v_gain, u32* hps_h_prescale, u32* hps_h_scale) { /* horizontal prescaler */ - u32 dcgx = 0, xpsc = 0, xacm = 0, cxy = 0, cxuv = 0; + u32 dcgx = 0, xpsc = 0, xacm = 0, cxy = 0, cxuv = 0; /* horizontal scaler */ - u32 xim = 0, xp = 0, xsci =0; + u32 xim = 0, xp = 0, xsci =0; /* vertical scale & gain */ - u32 pfuv = 0; + u32 pfuv = 0; /* helper variables */ u32 h_atten = 0, i = 0; @@ -77,29 +77,29 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev, if ( 0 == out_x ) { return -EINVAL; } - + /* mask out vanity-bit */ *hps_ctrl &= ~MASK_29; - + /* calculate prescale-(xspc)-value: [n .. 1/2) : 1 - [1/2 .. 1/3) : 2 - [1/3 .. 1/4) : 3 - ... */ + [1/2 .. 1/3) : 2 + [1/3 .. 1/4) : 3 + ... */ if (in_x > out_x) { xpsc = in_x / out_x; } else { /* zooming */ - xpsc = 1; + xpsc = 1; } - + /* if flip_lr-bit is set, number of pixels after horizontal prescaling must be < 384 */ if ( 0 != flip_lr ) { - + /* set vanity bit */ *hps_ctrl |= MASK_29; - + while (in_x / xpsc >= 384 ) xpsc++; } @@ -109,35 +109,35 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev, while ( in_x / xpsc >= 768 ) xpsc++; } - + /* maximum prescale is 64 (p.69) */ if ( xpsc > 64 ) xpsc = 64; /* keep xacm clear*/ xacm = 0; - + /* set horizontal filter parameters (CXY = CXUV) */ cxy = hps_h_coeff_tab[( (xpsc - 1) < 63 ? (xpsc - 1) : 63 )].hps_coeff; cxuv = cxy; - + /* calculate and set horizontal fine scale (xsci) */ - + /* bypass the horizontal scaler ? */ if ( (in_x == out_x) && ( 1 == xpsc ) ) xsci = 0x400; - else + else xsci = ( (1024 * in_x) / (out_x * xpsc) ) + xpsc; - /* set start phase for horizontal fine scale (xp) to 0 */ + /* set start phase for horizontal fine scale (xp) to 0 */ xp = 0; - + /* set xim, if we bypass the horizontal scaler */ if ( 0x400 == xsci ) xim = 1; else xim = 0; - + /* if the prescaler is bypassed, enable horizontal accumulation mode (xacm) and clear dcgx */ if( 1 == xpsc ) { @@ -148,12 +148,12 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev, /* get best match in the table of attenuations for horizontal scaling */ h_atten = hps_h_coeff_tab[( (xpsc - 1) < 63 ? (xpsc - 1) : 63 )].weight_sum; - + for (i = 0; h_attenuation[i] != 0; i++) { if (h_attenuation[i] >= h_atten) break; } - + dcgx = i; } @@ -171,11 +171,11 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev, else pfuv = 0x33; - + *hps_v_gain &= MASK_W0|MASK_B2; - *hps_v_gain |= (pfuv << 24); + *hps_v_gain |= (pfuv << 24); - *hps_h_scale &= ~(MASK_W1 | 0xf000); + *hps_h_scale &= ~(MASK_W1 | 0xf000); *hps_h_scale |= (xim << 31) | (xp << 24) | (xsci << 12); *hps_h_prescale |= (dcgx << 27) | ((xpsc-1) << 18) | (xacm << 17) | (cxy << 8) | (cxuv << 0); @@ -186,7 +186,7 @@ static int calculate_h_scale_registers(struct saa7146_dev *dev, static struct { u16 hps_coeff; u16 weight_sum; -} hps_v_coeff_tab [] = { +} hps_v_coeff_tab [] = { {0x0100, 2}, {0x0102, 4}, {0x0300, 4}, {0x0106, 8}, {0x0502, 8}, {0x0708, 8}, {0x0F00, 8}, {0x011E, 16}, {0x110E, 16}, {0x1926, 16}, {0x3906, 16}, {0x3D42, 16}, {0x7D02, 16}, {0x7F80, 16}, {0xFF00, 16}, @@ -210,14 +210,14 @@ static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field int in_y, int out_y, u32* hps_v_scale, u32* hps_v_gain) { int lpi = 0; - + /* vertical scaling */ u32 yacm = 0, ysci = 0, yacl = 0, ypo = 0, ype = 0; /* vertical scale & gain */ u32 dcgy = 0, cya_cyb = 0; - + /* helper variables */ - u32 v_atten = 0, i = 0; + u32 v_atten = 0, i = 0; /* error, if vertical zooming */ if ( in_y < out_y ) { @@ -245,7 +245,7 @@ static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field yacm = 0; yacl = 0; cya_cyb = 0x00ff; - + /* calculate scaling increment */ if ( in_y > out_y ) ysci = ((1024 * in_y) / (out_y + 1)) - 1024; @@ -257,9 +257,9 @@ static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field /* calculate ype and ypo */ ype = ysci / 16; ypo = ype + (ysci / 64); - + } else { - yacm = 1; + yacm = 1; /* calculate scaling increment */ ysci = (((10 * 1024 * (in_y - out_y - 1)) / in_y) + 9) / 10; @@ -269,7 +269,7 @@ static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field /* the sequence length interval (yacl) has to be set according to the prescale value, e.g. [n .. 1/2) : 0 - [1/2 .. 1/3) : 1 + [1/2 .. 1/3) : 1 [1/3 .. 1/4) : 2 ... */ if ( ysci < 512) { @@ -278,7 +278,7 @@ static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field yacl = ( ysci / (1024 - ysci) ); } - /* get filter coefficients for cya, cyb from table hps_v_coeff_tab */ + /* get filter coefficients for cya, cyb from table hps_v_coeff_tab */ cya_cyb = hps_v_coeff_tab[ (yacl < 63 ? yacl : 63 ) ].hps_coeff; /* get best match in the table of attenuations for vertical scaling */ @@ -288,7 +288,7 @@ static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field if (v_attenuation[i] >= v_atten) break; } - + dcgy = i; } @@ -306,12 +306,12 @@ static int sort_and_eliminate(u32* values, int* count) { int low = 0, high = 0, top = 0, temp = 0; int cur = 0, next = 0; - + /* sanity checks */ if( (0 > *count) || (NULL == values) ) { return -EINVAL; } - + /* 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++) { @@ -328,9 +328,9 @@ static int sort_and_eliminate(u32* values, int* count) if( values[cur] != values[next]) values[++cur] = values[next]; } - + *count = cur + 1; - + return 0; } @@ -343,8 +343,8 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa int width = fh->ov.win.w.width; int height = fh->ov.win.w.height; int clipcount = fh->ov.nclips; - - u32 line_list[32]; + + u32 line_list[32]; u32 pixel_list[32]; int numdwords = 0; @@ -361,12 +361,12 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa /* fill the line and pixel-lists */ for(i = 0; i < clipcount; i++) { int l = 0, r = 0, t = 0, b = 0; - + x[i] = fh->ov.clips[i].c.left; y[i] = fh->ov.clips[i].c.top; w[i] = fh->ov.clips[i].c.width; h[i] = fh->ov.clips[i].c.height; - + if( w[i] < 0) { x[i] += w[i]; w[i] = -w[i]; } @@ -378,7 +378,7 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa } if( y[i] < 0) { h[i] += y[i]; y[i] = 0; - } + } if( 0 != vv->vflip ) { y[i] = height - y[i] - h[i]; } @@ -387,7 +387,7 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa r = x[i]+w[i]; t = y[i]; b = y[i]+h[i]; - + /* insert left/right coordinates */ pixel_list[ 2*i ] = min_t(int, l, width); pixel_list[(2*i)+1] = min_t(int, r, width); @@ -423,9 +423,9 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa x[j] = 0; if( pixel_list[i] < (x[j] + w[j])) { - + if ( pixel_list[i] >= x[j] ) { - clipping[2*i] |= cpu_to_le32(1 << j); + clipping[2*i] |= cpu_to_le32(1 << j); } } } @@ -437,7 +437,7 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa if( line_list[i] < (y[j] + h[j]) ) { if( line_list[i] >= y[j] ) { - clipping[(2*i)+1] |= cpu_to_le32(1 << j); + clipping[(2*i)+1] |= cpu_to_le32(1 << j); } } } @@ -445,8 +445,8 @@ static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct sa /* adjust arbitration control register */ *arbtr_ctrl &= 0xffff00ff; - *arbtr_ctrl |= 0x00001c00; - + *arbtr_ctrl |= 0x00001c00; + vdma2->base_even = vv->d_clipping.dma_handle; vdma2->base_odd = vv->d_clipping.dma_handle; vdma2->prot_addr = vv->d_clipping.dma_handle+((sizeof(u32))*(numdwords)); @@ -473,9 +473,9 @@ static void saa7146_disable_clipping(struct saa7146_dev *dev) /* upload clipping-registers*/ saa7146_write(dev, CLIP_FORMAT_CTRL,clip_format); - saa7146_write(dev, MC2, (MASK_05 | MASK_21)); - - /* disable video dma2 */ + saa7146_write(dev, MC2, (MASK_05 | MASK_21)); + + /* disable video dma2 */ saa7146_write(dev, MC1, MASK_21); } @@ -486,10 +486,10 @@ static void saa7146_set_clipping_rect(struct saa7146_fh *fh) struct saa7146_video_dma vdma2; u32 clip_format; u32 arbtr_ctrl; - + /* check clipcount, disable clipping if clipcount == 0*/ if( fh->ov.nclips == 0 ) { - saa7146_disable_clipping(dev); + saa7146_disable_clipping(dev); return; } @@ -509,10 +509,10 @@ static void saa7146_set_clipping_rect(struct saa7146_fh *fh) saa7146_write(dev, BASE_PAGE2, vdma2.base_page); saa7146_write(dev, PITCH2, vdma2.pitch); saa7146_write(dev, NUM_LINE_BYTE2, vdma2.num_line_byte); - + /* prepare the rest */ saa7146_write(dev, CLIP_FORMAT_CTRL,clip_format); - saa7146_write(dev, PCI_BT_V1, arbtr_ctrl); + saa7146_write(dev, PCI_BT_V1, arbtr_ctrl); /* upload clip_control-register, clipping-registers, enable video dma2 */ saa7146_write(dev, MC2, (MASK_05 | MASK_21 | MASK_03 | MASK_19)); @@ -530,11 +530,11 @@ static void saa7146_set_window(struct saa7146_dev *dev, int width, int height, e /* set vertical scale */ hps_v_scale = 0; /* all bits get set by the function-call */ - hps_v_gain = 0; /* fixme: saa7146_read(dev, HPS_V_GAIN);*/ + hps_v_gain = 0; /* fixme: saa7146_read(dev, HPS_V_GAIN);*/ calculate_v_scale_registers(dev, field, vv->standard->v_field*2, height, &hps_v_scale, &hps_v_gain); /* set horizontal scale */ - hps_ctrl = 0; + hps_ctrl = 0; hps_h_prescale = 0; /* all bits get set in the function */ hps_h_scale = 0; calculate_h_scale_registers(dev, vv->standard->h_pixels, width, vv->hflip, &hps_ctrl, &hps_v_gain, &hps_h_prescale, &hps_h_scale); @@ -542,43 +542,43 @@ static void saa7146_set_window(struct saa7146_dev *dev, int width, int height, e /* set hyo and hxo */ calculate_hxo_and_hyo(vv, &hps_h_scale, &hps_ctrl); calculate_hps_source_and_sync(dev, source, sync, &hps_ctrl); - + /* write out new register contents */ saa7146_write(dev, HPS_V_SCALE, hps_v_scale); saa7146_write(dev, HPS_V_GAIN, hps_v_gain); saa7146_write(dev, HPS_CTRL, hps_ctrl); saa7146_write(dev, HPS_H_PRESCALE,hps_h_prescale); saa7146_write(dev, HPS_H_SCALE, hps_h_scale); - + /* upload shadow-ram registers */ - saa7146_write(dev, MC2, (MASK_05 | MASK_06 | MASK_21 | MASK_22) ); + saa7146_write(dev, MC2, (MASK_05 | MASK_06 | MASK_21 | MASK_22) ); } /* 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, u32 pixelformat) -{ +{ struct saa7146_vv *vv = dev->vv_data; struct saa7146_format *sfmt = format_by_fourcc(dev, pixelformat); int b_depth = vv->ov_fmt->depth; int b_bpl = vv->ov_fb.fmt.bytesperline; u32 base = (u32)vv->ov_fb.base; - + struct saa7146_video_dma vdma1; /* 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 = (u32)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 = (u32)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)); } - + if (V4L2_FIELD_HAS_BOTH(field)) { } else if (field == V4L2_FIELD_ALTERNATE) { /* fixme */ @@ -596,7 +596,7 @@ static void saa7146_set_position(struct saa7146_dev *dev, int w_x, int w_y, int if ( 0 != vv->vflip ) { vdma1.pitch *= -1; } - + vdma1.base_page = sfmt->swap; vdma1.num_line_byte = (vv->standard->v_field<<16)+vv->standard->h_pixels; @@ -606,13 +606,13 @@ static void saa7146_set_position(struct saa7146_dev *dev, int w_x, int w_y, int static void saa7146_set_output_format(struct saa7146_dev *dev, unsigned long palette) { u32 clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); - + /* call helper function */ calculate_output_format_register(dev,palette,&clip_format); /* update the hps registers */ saa7146_write(dev, CLIP_FORMAT_CTRL, clip_format); - saa7146_write(dev, MC2, (MASK_05 | MASK_21)); + saa7146_write(dev, MC2, (MASK_05 | MASK_21)); } /* select input-source */ @@ -630,10 +630,10 @@ void saa7146_set_hps_source_and_sync(struct saa7146_dev *dev, int source, int sy /* write back & upload register */ saa7146_write(dev, HPS_CTRL, hps_ctrl); saa7146_write(dev, MC2, (MASK_05 | MASK_21)); - + vv->current_hps_source = source; vv->current_hps_sync = sync; -} +} int saa7146_enable_overlay(struct saa7146_fh *fh) { @@ -648,38 +648,38 @@ int saa7146_enable_overlay(struct saa7146_fh *fh) /* enable video dma1 */ saa7146_write(dev, MC1, (MASK_06 | MASK_22)); return 0; -} +} void saa7146_disable_overlay(struct saa7146_fh *fh) { struct saa7146_dev *dev = fh->dev; /* disable clipping + video dma1 */ - saa7146_disable_clipping(dev); + saa7146_disable_clipping(dev); saa7146_write(dev, MC1, MASK_22); -} +} -void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_video_dma* vdma) +void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_video_dma* vdma) { int where = 0; - + if( which < 1 || which > 3) { return; } - + /* calculate starting address */ where = (which-1)*0x18; - saa7146_write(dev, where, vdma->base_odd); - saa7146_write(dev, where+0x04, vdma->base_even); - saa7146_write(dev, where+0x08, vdma->prot_addr); - saa7146_write(dev, where+0x0c, vdma->pitch); - saa7146_write(dev, where+0x10, vdma->base_page); + saa7146_write(dev, where, vdma->base_odd); + saa7146_write(dev, where+0x04, vdma->base_even); + saa7146_write(dev, where+0x08, vdma->prot_addr); + saa7146_write(dev, where+0x0c, vdma->pitch); + saa7146_write(dev, where+0x10, vdma->base_page); saa7146_write(dev, where+0x14, vdma->num_line_byte); - + /* upload */ - saa7146_write(dev, MC2, (MASK_02<<(which-1))|(MASK_18<<(which-1))); -/* + saa7146_write(dev, MC2, (MASK_02<<(which-1))|(MASK_18<<(which-1))); +/* printk("vdma%d.base_even: 0x%08x\n", which,vdma->base_even); printk("vdma%d.base_odd: 0x%08x\n", which,vdma->base_odd); printk("vdma%d.prot_addr: 0x%08x\n", which,vdma->prot_addr); @@ -713,7 +713,7 @@ static int calculate_video_dma_grab_packed(struct saa7146_dev* dev, struct saa71 } vdma1.num_line_byte = ((vv->standard->v_field<<16) + vv->standard->h_pixels); vdma1.base_page = buf->pt[0].dma | ME1 | sfmt->swap; - + if( 0 != vv->vflip ) { vdma1.prot_addr = buf->pt[0].offset; vdma1.base_even = buf->pt[0].offset+(vdma1.pitch/2)*height; @@ -746,7 +746,7 @@ static int calculate_video_dma_grab_packed(struct saa7146_dev* dev, struct saa71 if( 0 != vv->vflip ) { vdma1.pitch *= -1; - } + } saa7146_write_out_dma(dev, 1, &vdma1); return 0; @@ -774,7 +774,7 @@ static int calc_planar_422(struct saa7146_vv *vv, struct saa7146_buf *buf, struc vdma3->base_even = buf->pt[2].offset; vdma3->base_odd = vdma3->base_even + (vdma3->pitch/2); vdma3->prot_addr = (vdma3->pitch/2)*height+buf->pt[2].offset; - + vdma2->base_even = buf->pt[1].offset; vdma2->base_odd = vdma2->base_even + (vdma2->pitch/2); vdma2->prot_addr = (vdma2->pitch/2)*height+buf->pt[1].offset; @@ -904,7 +904,7 @@ static int calculate_video_dma_grab_planar(struct saa7146_dev* dev, struct saa71 vdma1.pitch *= -1; vdma2.pitch *= -1; vdma3.pitch *= -1; - } + } saa7146_write_out_dma(dev, 1, &vdma1); if( (sfmt->flags & FORMAT_BYTE_SWAP) != 0 ) { @@ -921,7 +921,7 @@ static void program_capture_engine(struct saa7146_dev *dev, int planar) { struct saa7146_vv *vv = dev->vv_data; int count = 0; - + unsigned long e_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_E_FID_A : CMD_E_FID_B; unsigned long o_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_O_FID_A : CMD_O_FID_B; @@ -930,25 +930,25 @@ static void program_capture_engine(struct saa7146_dev *dev, int planar) WRITE_RPS0(CMD_PAUSE | CMD_OAN | CMD_SIG0 | e_wait); /* set rps register 0 */ - WRITE_RPS0(CMD_WR_REG | (1 << 8) | (MC2/4)); + WRITE_RPS0(CMD_WR_REG | (1 << 8) | (MC2/4)); WRITE_RPS0(MASK_27 | MASK_11); - + /* turn on video-dma1 */ - WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); - WRITE_RPS0(MASK_06 | MASK_22); /* => mask */ + WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); + WRITE_RPS0(MASK_06 | MASK_22); /* => mask */ WRITE_RPS0(MASK_06 | MASK_22); /* => values */ if( 0 != planar ) { /* turn on video-dma2 */ - WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); - WRITE_RPS0(MASK_05 | MASK_21); /* => mask */ + WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); + WRITE_RPS0(MASK_05 | MASK_21); /* => mask */ WRITE_RPS0(MASK_05 | MASK_21); /* => values */ /* turn on video-dma3 */ - WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); - WRITE_RPS0(MASK_04 | MASK_20); /* => mask */ + WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); + WRITE_RPS0(MASK_04 | MASK_20); /* => mask */ WRITE_RPS0(MASK_04 | MASK_20); /* => values */ } - + /* wait for o_fid_a/b / e_fid_a/b toggle */ if ( vv->last_field == V4L2_FIELD_INTERLACED ) { WRITE_RPS0(CMD_PAUSE | o_wait); @@ -963,25 +963,25 @@ static void program_capture_engine(struct saa7146_dev *dev, int planar) /* turn off video-dma1 */ WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); - WRITE_RPS0(MASK_22 | MASK_06); /* => mask */ + WRITE_RPS0(MASK_22 | MASK_06); /* => mask */ WRITE_RPS0(MASK_22); /* => values */ if( 0 != planar ) { /* turn off video-dma2 */ - WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); - WRITE_RPS0(MASK_05 | MASK_21); /* => mask */ + WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); + WRITE_RPS0(MASK_05 | MASK_21); /* => mask */ WRITE_RPS0(MASK_21); /* => values */ /* turn off video-dma3 */ - WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); - WRITE_RPS0(MASK_04 | MASK_20); /* => mask */ + WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); + WRITE_RPS0(MASK_04 | MASK_20); /* => mask */ WRITE_RPS0(MASK_20); /* => values */ } /* generate interrupt */ - WRITE_RPS0(CMD_INTERRUPT); + WRITE_RPS0(CMD_INTERRUPT); /* stop */ - WRITE_RPS0(CMD_STOP); + WRITE_RPS0(CMD_STOP); } void saa7146_set_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next) @@ -989,7 +989,7 @@ void saa7146_set_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struc struct saa7146_format *sfmt = format_by_fourcc(dev,buf->fmt->pixelformat); struct saa7146_vv *vv = dev->vv_data; u32 vdma1_prot_addr; - + DEB_CAP(("buf:%p, next:%p\n",buf,next)); vdma1_prot_addr = saa7146_read(dev, PROT_ADDR1); @@ -1017,7 +1017,7 @@ void saa7146_set_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struc calculate_video_dma_grab_packed(dev, buf); program_capture_engine(dev,0); } - + /* printk("vdma%d.base_even: 0x%08x\n", 1,saa7146_read(dev,BASE_EVEN1)); printk("vdma%d.base_odd: 0x%08x\n", 1,saa7146_read(dev,BASE_ODD1)); @@ -1032,6 +1032,5 @@ void saa7146_set_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struc saa7146_write(dev, RPS_ADDR0, dev->d_rps0.dma_handle); /* turn on rps */ - saa7146_write(dev, MC1, (MASK_12 | MASK_28)); + saa7146_write(dev, MC1, (MASK_12 | MASK_28)); } - diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c index 1a83c0148..3e4cfd892 100644 --- a/linux/drivers/media/common/saa7146_i2c.c +++ b/linux/drivers/media/common/saa7146_i2c.c @@ -12,7 +12,7 @@ static u32 saa7146_i2c_func(struct i2c_adapter *adapter) } /* this function returns the status-register of our i2c-device */ -static inline u32 saa7146_i2c_status(struct saa7146_dev *dev) +static inline u32 saa7146_i2c_status(struct saa7146_dev *dev) { u32 iicsta = saa7146_read(dev, I2C_STATUS); /* @@ -22,7 +22,7 @@ static inline u32 saa7146_i2c_status(struct saa7146_dev *dev) } /* this function runs through the i2c-messages and prepares the data to be - sent through the saa7146. have a look at the specifications p. 122 ff + sent through the saa7146. have a look at the specifications p. 122 ff to understand this. it returns the number of u32s to send, or -1 in case of an error. */ static int saa7146_i2c_msg_prepare(const struct i2c_msg m[], int num, u32 *op) @@ -56,7 +56,7 @@ static int saa7146_i2c_msg_prepare(const struct i2c_msg m[], int num, u32 *op) /* insert the address of the i2c-slave. note: we get 7 bit i2c-addresses, so we have to perform a translation */ - addr = (m[i].addr*2) + ( (0 != (m[i].flags & I2C_M_RD)) ? 1 : 0); + addr = (m[i].addr*2) + ( (0 != (m[i].flags & I2C_M_RD)) ? 1 : 0); h1 = op_count/3; h2 = op_count%3; op[h1] |= ( (u8)addr << ((3-h2)*8)); op[h1] |= (SAA7146_I2C_START << ((3-h2)*2)); @@ -70,8 +70,8 @@ static int saa7146_i2c_msg_prepare(const struct i2c_msg m[], int num, u32 *op) op[h1] |= ( SAA7146_I2C_CONT << ((3-h2)*2)); op_count++; } - - } + + } /* have a look at the last byte inserted: if it was: ...CONT change it to ...STOP */ @@ -81,7 +81,7 @@ static int saa7146_i2c_msg_prepare(const struct i2c_msg m[], int num, u32 *op) op[h1] |= (SAA7146_I2C_STOP << ((3-h2)*2)); } - /* return the number of u32s to send */ + /* return the number of u32s to send */ return mem; } @@ -106,16 +106,16 @@ static int saa7146_i2c_msg_cleanup(const struct i2c_msg m[], int num, u32 *op) op_count++; } } - + return 0; } /* this functions resets the i2c-device and returns 0 if everything was fine, otherwise -1 */ -static int saa7146_i2c_reset(struct saa7146_dev *dev) +static int saa7146_i2c_reset(struct saa7146_dev *dev) { /* get current status */ u32 status = saa7146_i2c_status(dev); - + /* clear registers for sure */ saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); saa7146_write(dev, I2C_TRANSFER, 0); @@ -135,7 +135,7 @@ static int saa7146_i2c_reset(struct saa7146_dev *dev) saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); saa7146_write(dev, MC2, (MASK_00 | MASK_16)); msleep(SAA7146_I2C_DELAY); - } + } /* check if any error is (still) present. (this can be necessary because p.123, note 1) */ status = saa7146_i2c_status(dev); @@ -160,7 +160,7 @@ static int saa7146_i2c_reset(struct saa7146_dev *dev) saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); saa7146_write(dev, MC2, (MASK_00 | MASK_16)); msleep(SAA7146_I2C_DELAY); - } + } /* if any error is still present, a fatal error has occured ... */ status = saa7146_i2c_status(dev); @@ -279,14 +279,14 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg msgs[], i int err = 0; int address_err = 0; int short_delay = 0; - + if (down_interruptible (&dev->i2c_lock)) return -ERESTARTSYS; for(i=0;i<num;i++) { DEB_I2C(("msg:%d/%d\n",i+1,num)); } - + /* prepare the message(s), get number of u32s to transfer */ count = saa7146_i2c_msg_prepare(msgs, num, buffer); if ( 0 > count ) { @@ -303,7 +303,7 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg msgs[], i if ( 0 > err ) { DEB_I2C(("could not reset i2c-device.\n")); goto out; - } + } /* write out the u32s one after another */ for(i = 0; i < count; i++) { @@ -314,10 +314,10 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg msgs[], i thinks that an address error occured. in that case, the transaction should be retrying, even if an address error occured. analog saa7146 based cards extensively rely on - i2c address probing, however, and address errors indicate that a + i2c address probing, however, and address errors indicate that a device is really *not* there. retrying in that case increases the time the device needs to probe greatly, so - it should be avoided. because of the fact, that only + it should be avoided. because of the fact, that only analog based cards use irq based i2c transactions (for dvb cards, this screwes up other interrupt sources), we bail out completely for analog cards after an address error and trust @@ -336,17 +336,17 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg msgs[], i err = num; break; } - + /* delay a bit before retrying */ msleep(10); - + } while (err != num && retries--); /* if every retry had an address error, exit right away */ if (address_err == retries) { goto out; } - + /* if any things had to be read, get the results */ if ( 0 != saa7146_i2c_msg_cleanup(msgs, num, buffer)) { DEB_I2C(("could not cleanup i2c-message.\n")); @@ -358,7 +358,7 @@ int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg msgs[], i DEB_I2C(("transmission successful. (msg:%d).\n",err)); out: /* another bug in revision 0: the i2c-registers get uploaded randomly by other - uploads, so we better clear them out before continueing */ + uploads, so we better clear them out before continueing */ if( 0 == dev->revision ) { u32 zero = 0; saa7146_i2c_reset(dev); @@ -368,7 +368,7 @@ out: } up(&dev->i2c_lock); - return err; + return err; } /* utility functions */ @@ -396,7 +396,7 @@ static struct i2c_algorithm saa7146_algo = { int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate) { DEB_EE(("bitrate: 0x%08x\n",bitrate)); - + /* enable i2c-port pins */ saa7146_write(dev, MC1, (MASK_08 | MASK_24)); @@ -405,17 +405,17 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c if( NULL != i2c_adapter ) { #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) - i2c_adapter->data = dev; + i2c_adapter->data = dev; #else BUG_ON(!i2c_adapter->class); i2c_set_adapdata(i2c_adapter,dev); #endif i2c_adapter->algo = &saa7146_algo; i2c_adapter->algo_data = NULL; - i2c_adapter->id = I2C_ALGO_SAA7146; + i2c_adapter->id = I2C_ALGO_SAA7146; i2c_adapter->timeout = SAA7146_I2C_TIMEOUT; i2c_adapter->retries = SAA7146_I2C_RETRIES; } - + return 0; } diff --git a/linux/drivers/media/common/saa7146_vbi.c b/linux/drivers/media/common/saa7146_vbi.c index 1b8661f4a..3766cf533 100644 --- a/linux/drivers/media/common/saa7146_vbi.c +++ b/linux/drivers/media/common/saa7146_vbi.c @@ -8,14 +8,14 @@ static int vbi_workaround(struct saa7146_dev *dev) u32 *cpu; dma_addr_t dma_addr; - + int count = 0; int i; DECLARE_WAITQUEUE(wait, current); - + DEB_VBI(("dev:%p\n",dev)); - + /* once again, a bug in the saa7146: the brs acquisition is buggy and especially the BXO-counter does not work as specified. there is this workaround, but please @@ -29,7 +29,7 @@ static int vbi_workaround(struct saa7146_dev *dev) saa7146_write(dev, BASE_EVEN3, dma_addr); saa7146_write(dev, BASE_ODD3, dma_addr+vbi_pixel_to_capture); saa7146_write(dev, PROT_ADDR3, dma_addr+4096); - saa7146_write(dev, PITCH3, vbi_pixel_to_capture); + saa7146_write(dev, PITCH3, vbi_pixel_to_capture); saa7146_write(dev, BASE_PAGE3, 0x0); saa7146_write(dev, NUM_LINE_BYTE3, (2<<16)|((vbi_pixel_to_capture)<<0)); saa7146_write(dev, MC2, MASK_04|MASK_20); @@ -37,7 +37,7 @@ static int vbi_workaround(struct saa7146_dev *dev) /* load brs-control register */ WRITE_RPS1(CMD_WR_REG | (1 << 8) | (BRS_CTRL/4)); /* BXO = 1h, BRS to outbound */ - WRITE_RPS1(0xc000008c); + WRITE_RPS1(0xc000008c); /* wait for vbi_a or vbi_b*/ if ( 0 != (SAA7146_USE_PORT_B_FOR_VBI & dev->ext_vv_data->flags)) { DEB_D(("...using port b\n")); @@ -67,7 +67,7 @@ static int vbi_workaround(struct saa7146_dev *dev) /* load brs-control register */ WRITE_RPS1(CMD_WR_REG | (1 << 8) | (BRS_CTRL/4)); /* Set BRS right: note: this is an experimental value for BXO (=> PAL!) */ - WRITE_RPS1((540 << 7) | (5 << 19)); // 5 == vbi_start + WRITE_RPS1((540 << 7) | (5 << 19)); // 5 == vbi_start /* wait for brs_done */ WRITE_RPS1(CMD_PAUSE | MASK_08); /* upload brs and video-dma3*/ @@ -79,7 +79,7 @@ static int vbi_workaround(struct saa7146_dev *dev) WRITE_RPS1(CMD_INTERRUPT); /* stop rps1 */ WRITE_RPS1(CMD_STOP); - + /* we have to do the workaround twice to be sure that everything is ok */ for(i = 0; i < 2; i++) { @@ -89,7 +89,7 @@ static int vbi_workaround(struct saa7146_dev *dev) saa7146_write(dev, NUM_LINE_BYTE3, (1<<16)|(2<<0)); saa7146_write(dev, MC2, MASK_04|MASK_20); - + /* enable rps1 irqs */ SAA7146_IER_ENABLE(dev,MASK_28); @@ -99,12 +99,12 @@ static int vbi_workaround(struct saa7146_dev *dev) /* start rps1 to enable workaround */ saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); - saa7146_write(dev, MC1, (MASK_13 | MASK_29)); - + saa7146_write(dev, MC1, (MASK_13 | MASK_29)); + schedule(); DEB_VBI(("brs bug workaround %d/1.\n",i)); - + remove_wait_queue(&vv->vbi_wq, &wait); current->state = TASK_RUNNING; @@ -115,7 +115,7 @@ static int vbi_workaround(struct saa7146_dev *dev) saa7146_write(dev, MC1, MASK_20); if(signal_pending(current)) { - + DEB_VBI(("aborted (rps:0x%08x).\n",saa7146_read(dev,RPS_ADDR1))); /* stop rps1 for sure */ @@ -166,29 +166,29 @@ static void saa7146_set_vbi_capture(struct saa7146_dev *dev, struct saa7146_buf capture and might cause that the first buffer is only half filled (with only one field). but since this is some sort of streaming data, this is not that negative. but by doing this, we can use the whole engine from video-buf.c... */ - + /* WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | e_wait); WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | o_wait); */ /* set bit 1 */ - WRITE_RPS1(CMD_WR_REG | (1 << 8) | (MC2/4)); + WRITE_RPS1(CMD_WR_REG | (1 << 8) | (MC2/4)); WRITE_RPS1(MASK_28 | MASK_12); - + /* turn on video-dma3 */ - WRITE_RPS1(CMD_WR_REG_MASK | (MC1/4)); - WRITE_RPS1(MASK_04 | MASK_20); /* => mask */ + WRITE_RPS1(CMD_WR_REG_MASK | (MC1/4)); + WRITE_RPS1(MASK_04 | MASK_20); /* => mask */ WRITE_RPS1(MASK_04 | MASK_20); /* => values */ - + /* wait for o_fid_a/b / e_fid_a/b toggle */ WRITE_RPS1(CMD_PAUSE | o_wait); WRITE_RPS1(CMD_PAUSE | e_wait); /* generate interrupt */ - WRITE_RPS1(CMD_INTERRUPT); + WRITE_RPS1(CMD_INTERRUPT); /* stop */ - WRITE_RPS1(CMD_STOP); + WRITE_RPS1(CMD_STOP); /* enable rps1 irqs */ SAA7146_IER_ENABLE(dev, MASK_28); @@ -197,7 +197,7 @@ static void saa7146_set_vbi_capture(struct saa7146_dev *dev, struct saa7146_buf saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); /* turn on rps */ - saa7146_write(dev, MC1, (MASK_13 | MASK_29)); + saa7146_write(dev, MC1, (MASK_13 | MASK_29)); } static int buffer_activate(struct saa7146_dev *dev, @@ -234,12 +234,12 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e size = lines * llength; DEB_VBI(("vb:%p\n",vb)); - + if (0 != buf->vb.baddr && buf->vb.bsize < size) { DEB_VBI(("size mismatch.\n")); return -EINVAL; } - + if (buf->vb.size != size) saa7146_dma_free(dev,buf); @@ -278,7 +278,7 @@ static int buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned #endif { int llength,lines; - + lines = 16 * 2 ; /* 2 fields */ llength = vbi_pixel_to_capture; @@ -302,7 +302,7 @@ static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) struct saa7146_dev *dev = fh->dev; struct saa7146_vv *vv = dev->vv_data; struct saa7146_buf *buf = (struct saa7146_buf *)vb; - + DEB_VBI(("vb:%p\n",vb)); saa7146_buffer_queue(dev,&vv->vbi_q,buf); } @@ -318,7 +318,7 @@ static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; struct saa7146_buf *buf = (struct saa7146_buf *)vb; - + DEB_VBI(("vb:%p\n",vb)); saa7146_dma_free(dev,buf); } @@ -373,7 +373,7 @@ static void vbi_read_timeout(unsigned long data) struct file *file = (struct file*)data; struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; - + DEB_VBI(("dev:%p, fh:%p\n",dev, fh)); vbi_stop(fh, file); @@ -396,10 +396,10 @@ static void vbi_init(struct saa7146_dev *dev, struct saa7146_vv *vv) static int vbi_open(struct saa7146_dev *dev, struct file *file) { struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data; - + u32 arbtr_ctrl = saa7146_read(dev, PCI_BT_V1); int ret = 0; - + DEB_VBI(("dev:%p, fh:%p\n",dev,fh)); ret = saa7146_res_get(fh, RESOURCE_DMA3_BRS); @@ -412,12 +412,12 @@ static int vbi_open(struct saa7146_dev *dev, struct file *file) arbtr_ctrl &= ~0x1f0000; arbtr_ctrl |= 0x1d0000; saa7146_write(dev, PCI_BT_V1, arbtr_ctrl); - saa7146_write(dev, MC2, (MASK_04|MASK_20)); - + saa7146_write(dev, MC2, (MASK_04|MASK_20)); + memset(&fh->vbi_fmt,0,sizeof(fh->vbi_fmt)); fh->vbi_fmt.sampling_rate = 27000000; - fh->vbi_fmt.offset = 248; /* todo */ + fh->vbi_fmt.offset = 248; /* todo */ fh->vbi_fmt.samples_per_line = vbi_pixel_to_capture; fh->vbi_fmt.sample_format = V4L2_PIX_FMT_GREY; @@ -456,7 +456,7 @@ static int vbi_open(struct saa7146_dev *dev, struct file *file) /* upload brs register */ saa7146_write(dev, MC2, (MASK_08|MASK_24)); - return 0; + return 0; } static void vbi_close(struct saa7146_dev *dev, struct file *file) @@ -498,7 +498,7 @@ static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff ssize_t ret = 0; DEB_VBI(("dev:%p, fh:%p\n",dev,fh)); - + if( NULL == vv->vbi_streaming ) { // fixme: check if dma3 is available // fixme: activate vbi engine here if necessary. (really?) diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c index 5b37c8f4f..397b01d1c 100644 --- a/linux/drivers/media/common/saa7146_video.c +++ b/linux/drivers/media/common/saa7146_video.c @@ -14,64 +14,64 @@ MODULE_PARM_DESC(max_memory, "maximum memory usage for capture buffers (default: /* format descriptions for capture and preview */ static struct saa7146_format formats[] = { { - .name = "RGB-8 (3-3-2)", + .name = "RGB-8 (3-3-2)", .pixelformat = V4L2_PIX_FMT_RGB332, - .trans = RGB08_COMPOSED, + .trans = RGB08_COMPOSED, .depth = 8, .flags = 0, }, { - .name = "RGB-16 (5/B-6/G-5/R)", + .name = "RGB-16 (5/B-6/G-5/R)", .pixelformat = V4L2_PIX_FMT_RGB565, - .trans = RGB16_COMPOSED, + .trans = RGB16_COMPOSED, .depth = 16, .flags = 0, }, { - .name = "RGB-24 (B-G-R)", + .name = "RGB-24 (B-G-R)", .pixelformat = V4L2_PIX_FMT_BGR24, - .trans = RGB24_COMPOSED, + .trans = RGB24_COMPOSED, .depth = 24, .flags = 0, }, { - .name = "RGB-32 (B-G-R)", + .name = "RGB-32 (B-G-R)", .pixelformat = V4L2_PIX_FMT_BGR32, - .trans = RGB32_COMPOSED, + .trans = RGB32_COMPOSED, .depth = 32, .flags = 0, }, { - .name = "RGB-32 (R-G-B)", + .name = "RGB-32 (R-G-B)", .pixelformat = V4L2_PIX_FMT_RGB32, - .trans = RGB32_COMPOSED, + .trans = RGB32_COMPOSED, .depth = 32, .flags = 0, .swap = 0x2, }, { - .name = "Greyscale-8", + .name = "Greyscale-8", .pixelformat = V4L2_PIX_FMT_GREY, - .trans = Y8, + .trans = Y8, .depth = 8, .flags = 0, }, { - .name = "YUV 4:2:2 planar (Y-Cb-Cr)", + .name = "YUV 4:2:2 planar (Y-Cb-Cr)", .pixelformat = V4L2_PIX_FMT_YUV422P, - .trans = YUV422_DECOMPOSED, + .trans = YUV422_DECOMPOSED, .depth = 16, .flags = FORMAT_BYTE_SWAP|FORMAT_IS_PLANAR, }, { - .name = "YVU 4:2:0 planar (Y-Cb-Cr)", + .name = "YVU 4:2:0 planar (Y-Cb-Cr)", .pixelformat = V4L2_PIX_FMT_YVU420, - .trans = YUV420_DECOMPOSED, + .trans = YUV420_DECOMPOSED, .depth = 12, .flags = FORMAT_BYTE_SWAP|FORMAT_IS_PLANAR, }, { - .name = "YUV 4:2:0 planar (Y-Cb-Cr)", + .name = "YUV 4:2:0 planar (Y-Cb-Cr)", .pixelformat = V4L2_PIX_FMT_YUV420, - .trans = YUV420_DECOMPOSED, + .trans = YUV420_DECOMPOSED, .depth = 12, .flags = FORMAT_IS_PLANAR, }, { - .name = "YUV 4:2:2 (U-Y-V-Y)", + .name = "YUV 4:2:2 (U-Y-V-Y)", .pixelformat = V4L2_PIX_FMT_UYVY, - .trans = YUV422_COMPOSED, + .trans = YUV422_COMPOSED, .depth = 16, .flags = 0, } @@ -80,19 +80,19 @@ static struct saa7146_format formats[] = { /* unfortunately, the saa7146 contains a bug which prevents it from doing on-the-fly byte swaps. due to this, it's impossible to provide additional *packed* formats, which are simply byte swapped (like V4L2_PIX_FMT_YUYV) ... 8-( */ - + static int NUM_FORMATS = sizeof(formats)/sizeof(struct saa7146_format); struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc) { int i, j = NUM_FORMATS; - + for (i = 0; i < j; i++) { if (formats[i].pixelformat == fourcc) { return formats+i; } } - + DEB_D(("unknown pixelformat:'%4.4s'\n",(char *)&fourcc)); return NULL; } @@ -182,7 +182,7 @@ static int try_fmt(struct saa7146_fh *fh, struct v4l2_format *f) struct saa7146_dev *dev = fh->dev; struct saa7146_vv *vv = dev->vv_data; int err; - + switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: { @@ -190,7 +190,7 @@ static int try_fmt(struct saa7146_fh *fh, struct v4l2_format *f) enum v4l2_field field; int maxw, maxh; int calc_bpl; - + DEB_EE(("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n",dev,fh)); fmt = format_by_fourcc(dev,f->fmt.pix.pixelformat); @@ -201,7 +201,7 @@ static int try_fmt(struct saa7146_fh *fh, struct v4l2_format *f) field = f->fmt.pix.field; maxw = vv->standard->h_max_out; maxh = vv->standard->v_max_out; - + if (V4L2_FIELD_ANY == field) { field = (f->fmt.pix.height > maxh/2) ? V4L2_FIELD_INTERLACED @@ -237,10 +237,10 @@ static int try_fmt(struct saa7146_fh *fh, struct v4l2_format *f) if (f->fmt.pix.bytesperline < calc_bpl) f->fmt.pix.bytesperline = calc_bpl; - + if (f->fmt.pix.bytesperline > (2*PAGE_SIZE * fmt->depth)/8) /* arbitrary constraint */ f->fmt.pix.bytesperline = calc_bpl; - + f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * f->fmt.pix.height; DEB_D(("w:%d, h:%d, bytesperline:%d, sizeimage:%d\n",f->fmt.pix.width,f->fmt.pix.height,f->fmt.pix.bytesperline,f->fmt.pix.sizeimage)); @@ -280,7 +280,7 @@ int saa7146_start_preview(struct saa7146_fh *fh) } /* check if overlay is running */ - if (IS_OVERLAY_ACTIVE(fh) != 0) { + if (IS_OVERLAY_ACTIVE(fh) != 0) { if (vv->video_fh == fh) { DEB_D(("overlay is already active.\n")); return 0; @@ -299,14 +299,14 @@ int saa7146_start_preview(struct saa7146_fh *fh) saa7146_res_free(vv->video_fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP); return -EBUSY; } - + vv->ov_data = &fh->ov; DEB_D(("%dx%d+%d+%d %s field=%s\n", fh->ov.win.w.width,fh->ov.win.w.height, fh->ov.win.w.left,fh->ov.win.w.top, vv->ov_fmt->name,v4l2_field_names[fh->ov.win.field])); - + if (0 != (ret = saa7146_enable_overlay(fh))) { DEB_D(("enabling overlay failed: %d\n",ret)); saa7146_res_free(vv->video_fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP); @@ -331,9 +331,9 @@ int saa7146_stop_preview(struct saa7146_fh *fh) DEB_D(("streaming capture is active.\n")); return -EBUSY; } - + /* check if overlay is running at all */ - if ((vv->video_status & STATUS_OVERLAY) == 0) { + if ((vv->video_status & STATUS_OVERLAY) == 0) { DEB_D(("no active overlay.\n")); return 0; } @@ -359,7 +359,7 @@ static int s_fmt(struct saa7146_fh *fh, struct v4l2_format *f) struct saa7146_vv *vv = dev->vv_data; int err; - + switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: DEB_EE(("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n",dev,fh)); @@ -387,7 +387,7 @@ static int s_fmt(struct saa7146_fh *fh, struct v4l2_format *f) up(&dev->lock); return -EFAULT; } - + /* fh->ov.fh is used to indicate that we have valid overlay informations, too */ fh->ov.fh = fh; @@ -454,7 +454,7 @@ static int NUM_CONTROLS = sizeof(controls)/sizeof(struct v4l2_queryctrl); static struct v4l2_queryctrl* ctrl_by_id(int id) { int i; - + for (i = 0; i < NUM_CONTROLS; i++) if (controls[i].id == id) return controls+i; @@ -515,7 +515,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c) DEB_D(("unknown control %d\n",c->id)); return -EINVAL; } - + down(&dev->lock); switch (ctrl->type) { @@ -578,7 +578,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c) } } up(&dev->lock); - + if (IS_OVERLAY_ACTIVE(fh) != 0) { saa7146_stop_preview(fh); saa7146_start_preview(fh); @@ -633,7 +633,7 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu return -1; } } - + ptr1 = pt1->cpu; ptr2 = pt2->cpu; ptr3 = pt3->cpu; @@ -649,14 +649,14 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu for(j=0;j<40;j++) { printk("ptr1 %d: 0x%08x\n",j,ptr1[j]); } -*/ +*/ /* if we have a user buffer, the first page may not be aligned to a page boundary. */ pt1->offset = buf->vb.dma.sglist->offset; pt2->offset = pt1->offset+o1; pt3->offset = pt1->offset+o2; - + /* create video-dma2 page table */ ptr1 = pt1->cpu; for(i = m1; i <= m2 ; i++, ptr2++) { @@ -675,7 +675,7 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu for(;i<1024;i++,ptr3++) { *ptr3 = fill; } - /* finally: finish up video-dma1 page table */ + /* finally: finish up video-dma1 page table */ ptr1 = pt1->cpu+m1; fill = pt1->cpu[m1]; for(i=m1;i<1024;i++,ptr1++) { @@ -694,7 +694,7 @@ static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *bu for(j=0;j<40;j++) { printk("ptr3 %d: 0x%08x\n",j,ptr3[j]); } -*/ +*/ } else { struct saa7146_pgtable *pt = &buf->pt[0]; return saa7146_pgtable_build_single(pci, pt, list, length); @@ -725,7 +725,7 @@ static int video_begin(struct saa7146_fh *fh) DEB_S(("already capturing in another open.\n")); return -EBUSY; } - + if ((vv->video_status & STATUS_OVERLAY) != 0) { DEB_S(("warning: suspending overlay video for streaming capture.\n")); vv->ov_suspend = vv->video_fh; @@ -735,7 +735,7 @@ static int video_begin(struct saa7146_fh *fh) return err; } } - + fmt = format_by_fourcc(dev,fh->video_fmt.pixelformat); /* we need to have a valid format set here */ BUG_ON(NULL == fmt); @@ -755,7 +755,7 @@ static int video_begin(struct saa7146_fh *fh) } return -EBUSY; } - + /* clear out beginning of streaming bit (rps register 0)*/ saa7146_write(dev, MC2, MASK_27 ); @@ -821,7 +821,7 @@ static int video_end(struct saa7146_fh *fh, struct file *file) saa7146_start_preview(vv->ov_suspend); vv->ov_suspend = NULL; } - + return 0; } @@ -847,7 +847,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int if( cmd == dev->ext_vv_data->ioctls[ee].cmd ) break; } - + if( 0 != (dev->ext_vv_data->ioctls[ee].flags & SAA7146_EXCLUSIVE) ) { DEB_D(("extension handles ioctl exclusive.\n")); result = dev->ext_vv_data->ioctl(fh, cmd, arg); @@ -860,7 +860,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int return result; } } - + /* fixme: add handle "after" case (is it still needed?) */ switch (fh->type) { @@ -880,13 +880,13 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int } switch (cmd) { - case VIDIOC_QUERYCAP: + case VIDIOC_QUERYCAP: { struct v4l2_capability *cap = arg; memset(cap,0,sizeof(*cap)); DEB_EE(("VIDIOC_QUERYCAP\n")); - + strcpy(cap->driver, "saa7146 v4l2"); strlcpy(cap->card, dev->ext->name, sizeof(cap->card)); sprintf(cap->bus_info,"PCI:%s",dev->pci->slot_name); @@ -894,7 +894,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OVERLAY | - V4L2_CAP_READWRITE | + V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; cap->capabilities |= dev->ext_vv_data->capabilities; return 0; @@ -915,7 +915,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int struct saa7146_format *fmt; DEB_EE(("VIDIOC_S_FBUF\n")); - + if(!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RAWIO)) return -EPERM; @@ -925,14 +925,14 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int if (NULL == fmt) { return -EINVAL; } - + /* planar formats are not allowed for overlay video, clipping and video dma would clash */ if (0 != (fmt->flags & FORMAT_IS_PLANAR)) { DEB_S(("planar pixelformat '%4.4s' not allowed for overlay\n",(char *)&fmt->pixelformat)); } /* check if overlay is running */ - if (IS_OVERLAY_ACTIVE(fh) != 0) { + if (IS_OVERLAY_ACTIVE(fh) != 0) { if (vv->video_fh != fh) { DEB_D(("refusing to change framebuffer informations while overlay is active in another open.\n")); return -EBUSY; @@ -971,7 +971,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int break; } default: - return -EINVAL; + return -EINVAL; } DEB_EE(("VIDIOC_ENUM_FMT: type:%d, index:%d\n",f->type,f->index)); @@ -987,12 +987,12 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int (c->id < V4L2_CID_PRIVATE_BASE || c->id >= V4L2_CID_PRIVATE_LASTP1)) return -EINVAL; - + ctrl = ctrl_by_id(c->id); if( NULL == ctrl ) { return -EINVAL; /* - c->flags = V4L2_CTRL_FLAG_DISABLED; + c->flags = V4L2_CTRL_FLAG_DISABLED; return 0; */ } @@ -1073,7 +1073,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int v4l2_std_id *id = arg; int found = 0; int i, err; - + DEB_EE(("VIDIOC_S_STD\n")); if ((vv->video_status & STATUS_CAPTURE) == STATUS_CAPTURE) { @@ -1091,7 +1091,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int } down(&dev->lock); - + for(i = 0; i < dev->ext_vv_data->num_stds; i++) if (*id & dev->ext_vv_data->stds[i].id) break; @@ -1173,7 +1173,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int case VIDIOC_STREAMON: { int *type = arg; DEB_D(("VIDIOC_STREAMON, type:%d\n",*type)); - + err = video_begin(fh); if( 0 != err) { return err; @@ -1223,9 +1223,9 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int int i; /* fixme: number of capture buffers and sizes for v4l apps */ - int gbuffers = 2; + int gbuffers = 2; int gbufsize = 768*576*4; - + DEB_D(("VIDIOCGMBUF \n")); q = &fh->video_q; @@ -1236,7 +1236,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int #else err = videobuf_mmap_setup(q,gbuffers,gbufsize, V4L2_MEMORY_MMAP); -#endif +#endif if (err < 0) { up(&q->lock); return err; @@ -1267,7 +1267,7 @@ static int buffer_activate (struct saa7146_dev *dev, buf->vb.state = STATE_ACTIVE; saa7146_set_capture(dev,buf,next); - + mod_timer(&vv->video_q.timeout, jiffies+BUFFER_TIMEOUT); return 0; } @@ -1302,7 +1302,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e DEB_D(("size mismatch.\n")); return -EINVAL; } - + DEB_CAP(("buffer_prepare [size=%dx%d,bytes=%d,fields=%s]\n", fh->video_fmt.width,fh->video_fmt.height,size,v4l2_field_names[fh->video_fmt.field])); if (buf->vb.width != fh->video_fmt.width || @@ -1317,7 +1317,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e if (STATE_NEEDS_INIT == buf->vb.state) { struct saa7146_format *sfmt; - + buf->vb.bytesperline = fh->video_fmt.bytesperline; buf->vb.width = fh->video_fmt.width; buf->vb.height = fh->video_fmt.height; @@ -1325,9 +1325,9 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e buf->vb.field = field; buf->fmt = &fh->video_fmt; buf->vb.field = fh->video_fmt.field; - + sfmt = format_by_fourcc(dev,buf->fmt->pixelformat); - + if( 0 != IS_PLANAR(sfmt->trans)) { saa7146_pgtable_free(dev->pci, &buf->pt[0]); saa7146_pgtable_free(dev->pci, &buf->pt[1]); @@ -1340,7 +1340,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e saa7146_pgtable_free(dev->pci, &buf->pt[0]); saa7146_pgtable_alloc(dev->pci, &buf->pt[0]); } - + err = videobuf_iolock(dev->pci,&buf->vb, &vv->ov_fb); if (err) goto oops; @@ -1379,7 +1379,7 @@ static int buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned if( (*count * *size) > (max_memory*1048576) ) { *count = (max_memory*1048576) / *size; } - + DEB_CAP(("%d buffers, %d bytes each.\n",*count,*size)); return 0; @@ -1397,7 +1397,7 @@ static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) struct saa7146_dev *dev = fh->dev; struct saa7146_vv *vv = dev->vv_data; struct saa7146_buf *buf = (struct saa7146_buf *)vb; - + DEB_CAP(("vbuf:%p\n",vb)); saa7146_buffer_queue(fh->dev,&vv->video_q,buf); } @@ -1413,7 +1413,7 @@ static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; struct saa7146_buf *buf = (struct saa7146_buf *)vb; - + DEB_CAP(("vbuf:%p\n",vb)); saa7146_dma_free(dev,buf); } @@ -1480,13 +1480,13 @@ static void video_close(struct saa7146_dev *dev, struct file *file) struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data; struct saa7146_vv *vv = dev->vv_data; int err; - + if (IS_CAPTURE_ACTIVE(fh) != 0) { - err = video_end(fh, file); + err = video_end(fh, file); } else if (IS_OVERLAY_ACTIVE(fh) != 0) { err = saa7146_stop_preview(fh); } - + /* hmm, why is this function declared void? */ /* return err */ } @@ -1496,7 +1496,7 @@ static void video_irq_done(struct saa7146_dev *dev, unsigned long st) { struct saa7146_vv *vv = dev->vv_data; struct saa7146_dmaqueue *q = &vv->video_q; - + spin_lock(&dev->slock); DEB_CAP(("called.\n")); @@ -1515,7 +1515,7 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo struct saa7146_dev *dev = fh->dev; struct saa7146_vv *vv = dev->vv_data; ssize_t ret = 0; - + DEB_EE(("called.\n")); if ((vv->video_status & STATUS_CAPTURE) != 0) { diff --git a/linux/drivers/media/dvb/bt8xx/dst.c b/linux/drivers/media/dvb/bt8xx/dst.c index 053c1ba65..859946703 100644 --- a/linux/drivers/media/dvb/bt8xx/dst.c +++ b/linux/drivers/media/dvb/bt8xx/dst.c @@ -1,4 +1,4 @@ -/* +/* Frontend-driver for TwinHan DST Frontend Copyright (C) 2003 Jamie Honan @@ -45,7 +45,7 @@ struct dst_state { const struct dst_config* config; struct dvb_frontend frontend; - + /* private demodulator data */ u8 tx_tuna[10]; u8 rx_tuna[10]; @@ -135,13 +135,13 @@ static int dst_gpio_inb(struct dst_state *state, u8 * result) dprintk("%s: dst_gpio_inb error (err == %i)\n", __FUNCTION__, err); return -EREMOTEIO; } - + *result = (u8) rd_packet.rd.value; return 0; } #define DST_I2C_ENABLE 1 -#define DST_8820 2 +#define DST_8820 2 static int dst_reset8820(struct dst_state *state) { @@ -173,7 +173,7 @@ static int dst_i2c_enable(struct dst_state *state) if (retval < 0) return retval; // dprintk ("%s: i2c enable delay\n", __FUNCTION__); - msleep(33); + msleep(33); return 0; } @@ -690,10 +690,10 @@ static int dst_get_tuna(struct dst_state* state) state->decode_lock = 1; /* - dst->decode_n1 = (dst->rx_tuna[4] << 8) + + dst->decode_n1 = (dst->rx_tuna[4] << 8) + (dst->rx_tuna[5]); - dst->decode_n2 = (dst->rx_tuna[8] << 8) + + dst->decode_n2 = (dst->rx_tuna[8] << 8) + (dst->rx_tuna[7]); */ state->diseq_flags |= HAS_LOCK; @@ -755,9 +755,9 @@ static int dst_write_tuna(struct dvb_frontend* fe) * power_off 0x00, 0x09, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 * power_on 0x00, 0x09, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00 * Diseqc 1 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf0, 0xec - * Diseqc 2 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf4, 0xe8 - * Diseqc 3 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf8, 0xe4 - * Diseqc 4 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xfc, 0xe0 + * Diseqc 2 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf4, 0xe8 + * Diseqc 3 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xf8, 0xe4 + * Diseqc 4 0x00, 0x08, 0x04, 0xe0, 0x10, 0x38, 0xfc, 0xe0 */ static int dst_set_diseqc(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd* cmd) @@ -1036,7 +1036,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = { .frequency_tolerance = 29500, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, - /* . symbol_rate_tolerance = ???,*/ + /* . symbol_rate_tolerance = ???,*/ .caps = FE_CAN_FEC_AUTO | FE_CAN_QPSK }, @@ -1066,7 +1066,7 @@ static struct dvb_frontend_ops dst_dvbc_ops = { .frequency_max = 858000000, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, - /* . symbol_rate_tolerance = ???,*/ + /* . symbol_rate_tolerance = ???,*/ .caps = FE_CAN_FEC_AUTO | FE_CAN_QAM_AUTO }, diff --git a/linux/drivers/media/dvb/bt8xx/dst.h b/linux/drivers/media/dvb/bt8xx/dst.h index 79fbe24ad..bcb418c5c 100644 --- a/linux/drivers/media/dvb/bt8xx/dst.h +++ b/linux/drivers/media/dvb/bt8xx/dst.h @@ -1,4 +1,4 @@ -/* +/* Frontend-driver for TwinHan DST Frontend Copyright (C) 2003 Jamie Honan diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c index ca15bdd42..73ce1f661 100644 --- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c @@ -167,9 +167,9 @@ static int thomson_dtt7579_pll_set(struct dvb_frontend* fe, struct dvb_frontend_ pllbuf[0] = 0xc0; // Note: non-linux standard PLL i2c address pllbuf[1] = div >> 8; - pllbuf[2] = div & 0xff; - pllbuf[3] = cp; - pllbuf[4] = bs; + pllbuf[2] = div & 0xff; + pllbuf[3] = cp; + pllbuf[4] = bs; return 0; } @@ -184,25 +184,25 @@ static struct mt352_config thomson_dtt7579_config = { static int cx24108_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) { u32 freq = params->frequency; - - int i, a, n, pump; + + int i, a, n, pump; u32 band, pll; - - + + u32 osci[]={950000,1019000,1075000,1178000,1296000,1432000, 1576000,1718000,1856000,2036000,2150000}; u32 bandsel[]={0,0x00020000,0x00040000,0x00100800,0x00101000, 0x00102000,0x00104000,0x00108000,0x00110000, 0x00120000,0x00140000}; - + #define XTAL 1011100 /* Hz, really 1.0111 MHz and a /10 prescaler */ printk("cx24108 debug: entering SetTunerFreq, freq=%d\n",freq); - + /* This is really the bit driving the tuner chip cx24108 */ - + if(freq<950000) freq=950000; /* kHz */ if(freq>2150000) freq=2150000; /* satellite IF is 950..2150MHz */ - + /* decide which VCO to use for the input frequency */ for(i=1;(i<sizeof(osci)/sizeof(osci[0]))&&(osci[i]<freq);i++); printk("cx24108 debug: select vco #%d (f=%d)\n",i,freq); @@ -210,7 +210,7 @@ static int cx24108_pll_set(struct dvb_frontend* fe, struct dvb_frontend_paramete /* the gain values must be set by SetSymbolrate */ /* compute the pll divider needed, from Conexant data sheet, resolved for (n*32+a), remember f(vco) is f(receive) *2 or *4, - depending on the divider bit. It is set to /4 on the 2 lowest + depending on the divider bit. It is set to /4 on the 2 lowest bands */ n=((i<=2?2:1)*freq*10L)/(XTAL/100); a=n%32; n/=32; if(a==0) n--; @@ -348,9 +348,9 @@ static int advbt771_samsung_tdtc9251dh0_pll_set(struct dvb_frontend* fe, struct pllbuf[0] = 0xc2; // Note: non-linux standard PLL i2c address pllbuf[1] = div >> 8; - pllbuf[2] = div & 0xff; - pllbuf[3] = cp; - pllbuf[4] = bs; + pllbuf[2] = div & 0xff; + pllbuf[3] = cp; + pllbuf[4] = bs; return 0; } @@ -465,7 +465,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) break; } break; - + case BTTV_PINNACLESAT: card->fe = cx24110_attach(&pctvsat_config, card->i2c_adapter); if (card->fe != NULL) { @@ -609,7 +609,7 @@ static int dvb_bt8xx_probe(struct device *dev) card->op_sync_orin = 0; card->irq_err_ignore = 0; break; - + #ifdef BTTV_DVICO_DVBT_LITE case BTTV_DVICO_DVBT_LITE: #endif @@ -752,4 +752,3 @@ module_exit(dvb_bt8xx_exit); MODULE_DESCRIPTION("Bt8xx based DVB adapter driver"); MODULE_AUTHOR("Florian Schirmer <jolt@tuxbox.org>"); MODULE_LICENSE("GPL"); - diff --git a/linux/drivers/media/dvb/dibusb/Kconfig b/linux/drivers/media/dvb/dibusb/Kconfig index 725926904..6164ec52c 100644 --- a/linux/drivers/media/dvb/dibusb/Kconfig +++ b/linux/drivers/media/dvb/dibusb/Kconfig @@ -6,7 +6,7 @@ config DVB_DIBUSB select DVB_DIB3000MC select DVB_MT352 help - Support for USB 1.1 and 2.0 DVB-T devices based on reference designs made by + Support for USB 1.1 and 2.0 DVB-T devices based on reference designs made by DiBcom (<http://www.dibcom.fr>) and C&E. Devices supported by this driver: @@ -25,7 +25,7 @@ config DVB_DIBUSB Hanftek UMT-010 USB2.0 Hauppauge WinTV NOVA-T USB2 - The VP7041 seems to be identical to "CTS Portable" (Chinese + The VP7041 seems to be identical to "CTS Portable" (Chinese Television System). These devices can be understood as budget ones, they "only" deliver @@ -41,7 +41,7 @@ config DVB_DIBUSB_MISDESIGNED_DEVICES bool "Enable support for some misdesigned (see help) devices, which identify with wrong IDs" depends on DVB_DIBUSB help - Somehow Artec/Ultima Electronic forgot to program the eeprom of some of their + Somehow Artec/Ultima Electronic forgot to program the eeprom of some of their USB1.1/USB2.0 devices. So comes that they identify with the default Vendor and Product ID of the Cypress CY7C64613 (AN2235) or Cypress FX2. diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb.h b/linux/drivers/media/dvb/dibusb/dvb-dibusb.h index 6ccdc3fe3..e42182502 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb.h +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb.h @@ -1,8 +1,8 @@ /* * dvb-dibusb.h - * + * * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, version 2. @@ -105,7 +105,7 @@ extern struct dibusb_tuner dibusb_tuner[]; #define DIBUSB_POSSIBLE_I2C_ADDR_NUM 4 struct dibusb_demod { dibusb_demodulator_t id; - + int pid_filter_count; /* counter of the internal pid_filter */ u8 i2c_addrs[DIBUSB_POSSIBLE_I2C_ADDR_NUM]; /* list of possible i2c addresses of the demod */ }; @@ -113,13 +113,13 @@ struct dibusb_demod { #define DIBUSB_MAX_TUNER_NUM 2 struct dibusb_device_class { dibusb_class_t id; - + const struct dibusb_usb_controller *usb_ctrl; /* usb controller */ const char *firmware; /* valid firmware filenames */ int pipe_cmd; /* command pipe (read/write) */ int pipe_data; /* data pipe */ - + int urb_count; /* number of data URBs to be submitted */ int urb_buffer_size; /* the size of the buffer for each URB */ @@ -155,21 +155,21 @@ struct usb_dibusb { #define DIBUSB_STATE_INIT 0x000 #define DIBUSB_STATE_URB_LIST 0x001 #define DIBUSB_STATE_URB_BUF 0x002 -#define DIBUSB_STATE_URB_SUBMIT 0x004 +#define DIBUSB_STATE_URB_SUBMIT 0x004 #define DIBUSB_STATE_DVB 0x008 #define DIBUSB_STATE_I2C 0x010 #define DIBUSB_STATE_REMOTE 0x020 int init_state; - + int feedcount; struct dib_fe_xfer_ops xfer_ops; struct dibusb_tuner *tuner; - + struct urb **urb_list; u8 *buffer; dma_addr_t dma_handle; - + /* I2C */ struct i2c_adapter i2c_adap; @@ -235,11 +235,11 @@ int dibusb_urb_exit(struct usb_dibusb *); /* i2c and transfer stuff */ #define DIBUSB_I2C_TIMEOUT HZ*5 -/* +/* * protocol of all dibusb related devices */ -/* +/* * bulk msg to/from endpoint 0x01 * * general structure: @@ -249,23 +249,23 @@ int dibusb_urb_exit(struct usb_dibusb *); #define DIBUSB_REQ_START_READ 0x00 #define DIBUSB_REQ_START_DEMOD 0x01 -/* - * i2c read +/* + * i2c read * bulk write: 0x02 ((7bit i2c_addr << 1) & 0x01) register_bytes length_word * bulk read: byte_buffer (length_word bytes) */ -#define DIBUSB_REQ_I2C_READ 0x02 - +#define DIBUSB_REQ_I2C_READ 0x02 + /* * i2c write * bulk write: 0x03 (7bit i2c_addr << 1) register_bytes value_bytes */ -#define DIBUSB_REQ_I2C_WRITE 0x03 +#define DIBUSB_REQ_I2C_WRITE 0x03 -/* - * polling the value of the remote control +/* + * polling the value of the remote control * bulk write: 0x04 - * bulk read: byte_buffer (5 bytes) + * bulk read: byte_buffer (5 bytes) * * first byte of byte_buffer shows the status (0x00, 0x01, 0x02) */ @@ -280,35 +280,35 @@ int dibusb_urb_exit(struct usb_dibusb *); #define DIBUSB_RC_HAUPPAUGE_KEY_EMPTY 0x03 /* streaming mode: - * bulk write: 0x05 mode_byte + * bulk write: 0x05 mode_byte * * mode_byte is mostly 0x00 */ #define DIBUSB_REQ_SET_STREAMING_MODE 0x05 /* interrupt the internal read loop, when blocking */ -#define DIBUSB_REQ_INTR_READ 0x06 +#define DIBUSB_REQ_INTR_READ 0x06 /* io control * 0x07 cmd_byte param_bytes * * param_bytes can be up to 32 bytes * - * cmd_byte function parameter name + * cmd_byte function parameter name * 0x00 power mode * 0x00 sleep * 0x01 wakeup * - * 0x01 enable streaming + * 0x01 enable streaming * 0x02 disable streaming * * - */ + */ #define DIBUSB_REQ_SET_IOCTL 0x07 /* IOCTL commands */ -/* change the power mode in firmware */ +/* change the power mode in firmware */ #define DIBUSB_IOCTL_CMD_POWER_MODE 0x00 #define DIBUSB_IOCTL_POWER_SLEEP 0x00 #define DIBUSB_IOCTL_POWER_WAKEUP 0x01 diff --git a/linux/drivers/media/dvb/dvb-core/Kconfig b/linux/drivers/media/dvb/dvb-core/Kconfig index 7dc3511c7..a9a7b3421 100644 --- a/linux/drivers/media/dvb/dvb-core/Kconfig +++ b/linux/drivers/media/dvb/dvb-core/Kconfig @@ -8,4 +8,4 @@ config DVB_CORE to build your drivers outside the kernel, but need the DVB core. All in-kernel drivers will select this automatically if needed. If unsure say N. - + diff --git a/linux/drivers/media/dvb/dvb-core/demux.h b/linux/drivers/media/dvb/dvb-core/demux.h index 806c4e656..fb55eaa5c 100644 --- a/linux/drivers/media/dvb/dvb-core/demux.h +++ b/linux/drivers/media/dvb/dvb-core/demux.h @@ -1,8 +1,8 @@ -/* - * demux.h +/* + * demux.h * * Copyright (c) 2002 Convergence GmbH - * + * * based on code: * Copyright (c) 2000 Nokia Research Center * Tampere, FINLAND @@ -23,56 +23,56 @@ * */ -#ifndef __DEMUX_H -#define __DEMUX_H +#ifndef __DEMUX_H +#define __DEMUX_H #include <linux/types.h> #include <linux/errno.h> -#include <linux/list.h> -#include <linux/time.h> +#include <linux/list.h> +#include <linux/time.h> -/*--------------------------------------------------------------------------*/ -/* Common definitions */ -/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ +/* Common definitions */ +/*--------------------------------------------------------------------------*/ /* * DMX_MAX_FILTER_SIZE: Maximum length (in bytes) of a section/PES filter. - */ + */ -#ifndef DMX_MAX_FILTER_SIZE +#ifndef DMX_MAX_FILTER_SIZE #define DMX_MAX_FILTER_SIZE 18 -#endif +#endif /* * DMX_MAX_SECFEED_SIZE: Maximum length (in bytes) of a private section feed filter. - */ + */ -#ifndef DMX_MAX_SECFEED_SIZE +#ifndef DMX_MAX_SECFEED_SIZE #define DMX_MAX_SECFEED_SIZE 4096 -#endif +#endif /* - * enum dmx_success: Success codes for the Demux Callback API. - */ - -enum dmx_success { - DMX_OK = 0, /* Received Ok */ - DMX_LENGTH_ERROR, /* Incorrect length */ - DMX_OVERRUN_ERROR, /* Receiver ring buffer overrun */ - DMX_CRC_ERROR, /* Incorrect CRC */ - DMX_FRAME_ERROR, /* Frame alignment error */ - DMX_FIFO_ERROR, /* Receiver FIFO overrun */ - DMX_MISSED_ERROR /* Receiver missed packet */ -} ; - -/*--------------------------------------------------------------------------*/ -/* TS packet reception */ + * enum dmx_success: Success codes for the Demux Callback API. + */ + +enum dmx_success { + DMX_OK = 0, /* Received Ok */ + DMX_LENGTH_ERROR, /* Incorrect length */ + DMX_OVERRUN_ERROR, /* Receiver ring buffer overrun */ + DMX_CRC_ERROR, /* Incorrect CRC */ + DMX_FRAME_ERROR, /* Frame alignment error */ + DMX_FIFO_ERROR, /* Receiver FIFO overrun */ + DMX_MISSED_ERROR /* Receiver missed packet */ +} ; + +/*--------------------------------------------------------------------------*/ +/* TS packet reception */ /*--------------------------------------------------------------------------*/ /* TS filter type for set() */ -#define TS_PACKET 1 /* send TS packets (188 bytes) to callback (default) */ +#define TS_PACKET 1 /* send TS packets (188 bytes) to callback (default) */ #define TS_PAYLOAD_ONLY 2 /* in case TS_PACKET is set, only send the TS payload (<=184 bytes per packet) to callback */ #define TS_DECODER 4 /* send stream to built-in decoder (if present) */ @@ -116,38 +116,38 @@ enum dmx_ts_pes #define DMX_TS_PES_PCR DMX_TS_PES_PCR0 -struct dmx_ts_feed { +struct dmx_ts_feed { int is_filtering; /* Set to non-zero when filtering in progress */ struct dmx_demux *parent; /* Back-pointer */ - void *priv; /* Pointer to private data of the API client */ - int (*set) (struct dmx_ts_feed *feed, + void *priv; /* Pointer to private data of the API client */ + int (*set) (struct dmx_ts_feed *feed, u16 pid, - int type, + int type, enum dmx_ts_pes pes_type, - size_t callback_length, - size_t circular_buffer_size, - int descramble, - struct timespec timeout); - int (*start_filtering) (struct dmx_ts_feed* feed); - int (*stop_filtering) (struct dmx_ts_feed* feed); + size_t callback_length, + size_t circular_buffer_size, + int descramble, + struct timespec timeout); + int (*start_filtering) (struct dmx_ts_feed* feed); + int (*stop_filtering) (struct dmx_ts_feed* feed); }; -/*--------------------------------------------------------------------------*/ -/* Section reception */ -/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ +/* Section reception */ +/*--------------------------------------------------------------------------*/ -struct dmx_section_filter { - u8 filter_value [DMX_MAX_FILTER_SIZE]; - u8 filter_mask [DMX_MAX_FILTER_SIZE]; - u8 filter_mode [DMX_MAX_FILTER_SIZE]; - struct dmx_section_feed* parent; /* Back-pointer */ - void* priv; /* Pointer to private data of the API client */ +struct dmx_section_filter { + u8 filter_value [DMX_MAX_FILTER_SIZE]; + u8 filter_mask [DMX_MAX_FILTER_SIZE]; + u8 filter_mode [DMX_MAX_FILTER_SIZE]; + struct dmx_section_feed* parent; /* Back-pointer */ + void* priv; /* Pointer to private data of the API client */ }; -struct dmx_section_feed { - int is_filtering; /* Set to non-zero when filtering in progress */ +struct dmx_section_feed { + int is_filtering; /* Set to non-zero when filtering in progress */ struct dmx_demux* parent; /* Back-pointer */ - void* priv; /* Pointer to private data of the API client */ + void* priv; /* Pointer to private data of the API client */ int check_crc; u32 crc_val; @@ -156,42 +156,42 @@ struct dmx_section_feed { u8 secbuf_base[DMX_MAX_SECFEED_SIZE]; u16 secbufp, seclen, tsfeedp; - int (*set) (struct dmx_section_feed* feed, - u16 pid, - size_t circular_buffer_size, - int descramble, - int check_crc); - int (*allocate_filter) (struct dmx_section_feed* feed, - struct dmx_section_filter** filter); - int (*release_filter) (struct dmx_section_feed* feed, - struct dmx_section_filter* filter); - int (*start_filtering) (struct dmx_section_feed* feed); - int (*stop_filtering) (struct dmx_section_feed* feed); + int (*set) (struct dmx_section_feed* feed, + u16 pid, + size_t circular_buffer_size, + int descramble, + int check_crc); + int (*allocate_filter) (struct dmx_section_feed* feed, + struct dmx_section_filter** filter); + int (*release_filter) (struct dmx_section_feed* feed, + struct dmx_section_filter* filter); + int (*start_filtering) (struct dmx_section_feed* feed); + int (*stop_filtering) (struct dmx_section_feed* feed); }; -/*--------------------------------------------------------------------------*/ -/* Callback functions */ -/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ +/* Callback functions */ +/*--------------------------------------------------------------------------*/ -typedef int (*dmx_ts_cb) ( const u8 * buffer1, +typedef int (*dmx_ts_cb) ( const u8 * buffer1, size_t buffer1_length, - const u8 * buffer2, + const u8 * buffer2, size_t buffer2_length, - struct dmx_ts_feed* source, - enum dmx_success success); + struct dmx_ts_feed* source, + enum dmx_success success); typedef int (*dmx_section_cb) ( const u8 * buffer1, size_t buffer1_len, - const u8 * buffer2, + const u8 * buffer2, size_t buffer2_len, - struct dmx_section_filter * source, - enum dmx_success success); + struct dmx_section_filter * source, + enum dmx_success success); -/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ /* DVB Front-End */ -/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ -enum dmx_frontend_source { +enum dmx_frontend_source { DMX_MEMORY_FE, DMX_FRONTEND_0, DMX_FRONTEND_1, @@ -201,84 +201,84 @@ enum dmx_frontend_source { DMX_STREAM_1, DMX_STREAM_2, DMX_STREAM_3 -}; +}; -struct dmx_frontend { - struct list_head connectivity_list; /* List of front-ends that can - be connected to a particular - demux */ - void* priv; /* Pointer to private data of the API client */ +struct dmx_frontend { + struct list_head connectivity_list; /* List of front-ends that can + be connected to a particular + demux */ + void* priv; /* Pointer to private data of the API client */ enum dmx_frontend_source source; }; -/*--------------------------------------------------------------------------*/ -/* MPEG-2 TS Demux */ -/*--------------------------------------------------------------------------*/ - -/* - * Flags OR'ed in the capabilites field of struct dmx_demux. - */ - -#define DMX_TS_FILTERING 1 -#define DMX_PES_FILTERING 2 -#define DMX_SECTION_FILTERING 4 -#define DMX_MEMORY_BASED_FILTERING 8 /* write() available */ -#define DMX_CRC_CHECKING 16 -#define DMX_TS_DESCRAMBLING 32 -#define DMX_SECTION_PAYLOAD_DESCRAMBLING 64 -#define DMX_MAC_ADDRESS_DESCRAMBLING 128 - -/* - * Demux resource type identifier. -*/ - -/* - * DMX_FE_ENTRY(): Casts elements in the list of registered +/*--------------------------------------------------------------------------*/ +/* MPEG-2 TS Demux */ +/*--------------------------------------------------------------------------*/ + +/* + * Flags OR'ed in the capabilites field of struct dmx_demux. + */ + +#define DMX_TS_FILTERING 1 +#define DMX_PES_FILTERING 2 +#define DMX_SECTION_FILTERING 4 +#define DMX_MEMORY_BASED_FILTERING 8 /* write() available */ +#define DMX_CRC_CHECKING 16 +#define DMX_TS_DESCRAMBLING 32 +#define DMX_SECTION_PAYLOAD_DESCRAMBLING 64 +#define DMX_MAC_ADDRESS_DESCRAMBLING 128 + +/* + * Demux resource type identifier. +*/ + +/* + * DMX_FE_ENTRY(): Casts elements in the list of registered * front-ends from the generic type struct list_head * to the type * struct dmx_frontend - *. + *. */ -#define DMX_FE_ENTRY(list) list_entry(list, struct dmx_frontend, connectivity_list) +#define DMX_FE_ENTRY(list) list_entry(list, struct dmx_frontend, connectivity_list) -struct dmx_demux { - u32 capabilities; /* Bitfield of capability flags */ - struct dmx_frontend* frontend; /* Front-end connected to the demux */ +struct dmx_demux { + u32 capabilities; /* Bitfield of capability flags */ + struct dmx_frontend* frontend; /* Front-end connected to the demux */ struct list_head reg_list; /* List of registered demuxes */ - void* priv; /* Pointer to private data of the API client */ + void* priv; /* Pointer to private data of the API client */ int users; /* Number of users */ - int (*open) (struct dmx_demux* demux); - int (*close) (struct dmx_demux* demux); - int (*write) (struct dmx_demux* demux, const char* buf, size_t count); - int (*allocate_ts_feed) (struct dmx_demux* demux, - struct dmx_ts_feed** feed, - dmx_ts_cb callback); - int (*release_ts_feed) (struct dmx_demux* demux, - struct dmx_ts_feed* feed); - int (*allocate_section_feed) (struct dmx_demux* demux, - struct dmx_section_feed** feed, - dmx_section_cb callback); + int (*open) (struct dmx_demux* demux); + int (*close) (struct dmx_demux* demux); + int (*write) (struct dmx_demux* demux, const char* buf, size_t count); + int (*allocate_ts_feed) (struct dmx_demux* demux, + struct dmx_ts_feed** feed, + dmx_ts_cb callback); + int (*release_ts_feed) (struct dmx_demux* demux, + struct dmx_ts_feed* feed); + int (*allocate_section_feed) (struct dmx_demux* demux, + struct dmx_section_feed** feed, + dmx_section_cb callback); int (*release_section_feed) (struct dmx_demux* demux, - struct dmx_section_feed* feed); - int (*descramble_mac_address) (struct dmx_demux* demux, - u8* buffer1, - size_t buffer1_length, - u8* buffer2, + struct dmx_section_feed* feed); + int (*descramble_mac_address) (struct dmx_demux* demux, + u8* buffer1, + size_t buffer1_length, + u8* buffer2, size_t buffer2_length, - u16 pid); + u16 pid); int (*descramble_section_payload) (struct dmx_demux* demux, - u8* buffer1, + u8* buffer1, size_t buffer1_length, u8* buffer2, size_t buffer2_length, - u16 pid); - int (*add_frontend) (struct dmx_demux* demux, - struct dmx_frontend* frontend); + u16 pid); + int (*add_frontend) (struct dmx_demux* demux, + struct dmx_frontend* frontend); int (*remove_frontend) (struct dmx_demux* demux, - struct dmx_frontend* frontend); - struct list_head* (*get_frontends) (struct dmx_demux* demux); - int (*connect_frontend) (struct dmx_demux* demux, - struct dmx_frontend* frontend); - int (*disconnect_frontend) (struct dmx_demux* demux); + struct dmx_frontend* frontend); + struct list_head* (*get_frontends) (struct dmx_demux* demux); + int (*connect_frontend) (struct dmx_demux* demux, + struct dmx_frontend* frontend); + int (*disconnect_frontend) (struct dmx_demux* demux); int (*get_pes_pids) (struct dmx_demux* demux, u16 *pids); @@ -286,17 +286,16 @@ struct dmx_demux { u64 *stc, unsigned int *base); }; -/*--------------------------------------------------------------------------*/ -/* Demux directory */ -/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ +/* Demux directory */ +/*--------------------------------------------------------------------------*/ -/* - * DMX_DIR_ENTRY(): Casts elements in the list of registered +/* + * DMX_DIR_ENTRY(): Casts elements in the list of registered * demuxes from the generic type struct list_head* to the type struct dmx_demux - *. - */ + *. + */ #define DMX_DIR_ENTRY(list) list_entry(list, struct dmx_demux, reg_list) #endif /* #ifndef __DEMUX_H */ - diff --git a/linux/drivers/media/dvb/dvb-core/dmxdev.c b/linux/drivers/media/dvb/dvb-core/dmxdev.c index d3c774b3d..7d26f91e9 100644 --- a/linux/drivers/media/dvb/dvb-core/dmxdev.c +++ b/linux/drivers/media/dvb/dvb-core/dmxdev.c @@ -1,5 +1,5 @@ -/* - * dmxdev.c - DVB demultiplexer device +/* + * dmxdev.c - DVB demultiplexer device * * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de> * & Marcus Metzler <marcus@convergence.de> @@ -48,7 +48,7 @@ dvb_dmxdev_file_to_filter(struct file *file) return (struct dmxdev_filter *) file->private_data; } -static inline void dvb_dmxdev_buffer_init(struct dmxdev_buffer *buffer) +static inline void dvb_dmxdev_buffer_init(struct dmxdev_buffer *buffer) { buffer->data=NULL; buffer->size=8192; @@ -58,7 +58,7 @@ static inline void dvb_dmxdev_buffer_init(struct dmxdev_buffer *buffer) init_waitqueue_head(&buffer->queue); } -static inline int dvb_dmxdev_buffer_write(struct dmxdev_buffer *buf, const u8 *src, int len) +static inline int dvb_dmxdev_buffer_write(struct dmxdev_buffer *buf, const u8 *src, int len) { int split; int free; @@ -68,7 +68,7 @@ static inline int dvb_dmxdev_buffer_write(struct dmxdev_buffer *buf, const u8 *s return 0; if (!buf->data) return 0; - + free=buf->pread-buf->pwrite; split=0; if (free<=0) { @@ -97,14 +97,14 @@ static ssize_t dvb_dmxdev_buffer_read(struct dmxdev_buffer *src, { unsigned long todo=count; int split, avail, error; - + if (!src->data) return 0; if ((error=src->error)) { src->pwrite=src->pread; src->error=0; - return error; + return error; } if (non_blocking && (src->pwrite==src->pread)) @@ -122,9 +122,9 @@ static ssize_t dvb_dmxdev_buffer_read(struct dmxdev_buffer *src, if ((error=src->error)) { src->pwrite=src->pread; src->error=0; - return error; + return error; } - + split=src->size; avail=src->pwrite - src->pread; if (avail<0) { @@ -162,7 +162,7 @@ static struct dmx_frontend * get_fe(struct dmx_demux *demux, int type) list_for_each(pos, head) if (DMX_FE_ENTRY(pos)->source==type) return DMX_FE_ENTRY(pos); - + return NULL; } @@ -183,7 +183,7 @@ static int dvb_dvr_open(struct inode *inode, struct file *file) if (down_interruptible (&dmxdev->mutex)) return -ERESTARTSYS; - + if ((file->f_flags&O_ACCMODE)==O_RDWR) { if (!(dmxdev->capabilities&DMXDEV_CAP_DUPLEX)) { up(&dmxdev->mutex); @@ -203,20 +203,20 @@ static int dvb_dvr_open(struct inode *inode, struct file *file) if ((file->f_flags&O_ACCMODE)==O_WRONLY) { dmxdev->dvr_orig_fe=dmxdev->demux->frontend; - + if (!dmxdev->demux->write) { up(&dmxdev->mutex); return -EOPNOTSUPP; } - + front=get_fe(dmxdev->demux, DMX_MEMORY_FE); - + if (!front) { up(&dmxdev->mutex); return -EINVAL; } - dmxdev->demux->disconnect_frontend(dmxdev->demux); - dmxdev->demux->connect_frontend(dmxdev->demux, front); + dmxdev->demux->disconnect_frontend(dmxdev->demux); + dmxdev->demux->connect_frontend(dmxdev->demux, front); } up(&dmxdev->mutex); return 0; @@ -231,8 +231,8 @@ static int dvb_dvr_release(struct inode *inode, struct file *file) return -ERESTARTSYS; if ((file->f_flags&O_ACCMODE)==O_WRONLY) { - dmxdev->demux->disconnect_frontend(dmxdev->demux); - dmxdev->demux->connect_frontend(dmxdev->demux, + dmxdev->demux->disconnect_frontend(dmxdev->demux); + dmxdev->demux->connect_frontend(dmxdev->demux, dmxdev->dvr_orig_fe); } if ((file->f_flags&O_ACCMODE)==O_RDONLY) { @@ -275,8 +275,8 @@ static ssize_t dvb_dvr_read(struct file *file, char __user *buf, size_t count, int ret; //down(&dmxdev->mutex); - ret= dvb_dmxdev_buffer_read(&dmxdev->dvr_buffer, - file->f_flags&O_NONBLOCK, + ret= dvb_dmxdev_buffer_read(&dmxdev->dvr_buffer, + file->f_flags&O_NONBLOCK, buf, count, ppos); //up(&dmxdev->mutex); return ret; @@ -302,11 +302,11 @@ static int dvb_dmxdev_set_buffer_size(struct dmxdev_filter *dmxdevfilter, unsign mem=buf->data; buf->data=NULL; buf->size=size; - buf->pwrite=buf->pread=0; + buf->pwrite=buf->pread=0; spin_unlock_irq(&dmxdevfilter->dev->lock); - if (mem) + if (mem) vfree(mem); - + if (buf->size) { mem=vmalloc(dmxdevfilter->buffer.size); if (!mem) @@ -321,7 +321,7 @@ static int dvb_dmxdev_set_buffer_size(struct dmxdev_filter *dmxdevfilter, unsign static void dvb_dmxdev_filter_timeout(unsigned long data) { struct dmxdev_filter *dmxdevfilter=(struct dmxdev_filter *)data; - + dmxdevfilter->buffer.error=-ETIMEDOUT; spin_lock_irq(&dmxdevfilter->dev->lock); dmxdevfilter->state=DMXDEV_STATE_TIMEDOUT; @@ -332,7 +332,7 @@ static void dvb_dmxdev_filter_timeout(unsigned long data) static void dvb_dmxdev_filter_timer(struct dmxdev_filter *dmxdevfilter) { struct dmx_sct_filter_params *para=&dmxdevfilter->params.sec; - + del_timer(&dmxdevfilter->timer); if (para->timeout) { dmxdevfilter->timer.function=dvb_dmxdev_filter_timeout; @@ -348,7 +348,7 @@ static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len, { struct dmxdev_filter *dmxdevfilter=(struct dmxdev_filter *) filter->priv; int ret; - + if (dmxdevfilter->buffer.error) { wake_up(&dmxdevfilter->buffer.queue); return 0; @@ -359,16 +359,16 @@ static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len, return 0; } del_timer(&dmxdevfilter->timer); - dprintk("dmxdev: section callback %02x %02x %02x %02x %02x %02x\n", - buffer1[0], buffer1[1], - buffer1[2], buffer1[3], + dprintk("dmxdev: section callback %02x %02x %02x %02x %02x %02x\n", + buffer1[0], buffer1[1], + buffer1[2], buffer1[3], buffer1[4], buffer1[5]); ret=dvb_dmxdev_buffer_write(&dmxdevfilter->buffer, buffer1, buffer1_len); if (ret==buffer1_len) { ret=dvb_dmxdev_buffer_write(&dmxdevfilter->buffer, buffer2, buffer2_len); } if (ret<0) { - dmxdevfilter->buffer.pwrite=dmxdevfilter->buffer.pread; + dmxdevfilter->buffer.pwrite=dmxdevfilter->buffer.pread; dmxdevfilter->buffer.error=-EOVERFLOW; } if (dmxdevfilter->params.sec.flags&DMX_ONESHOT) @@ -385,7 +385,7 @@ static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len, struct dmxdev_filter *dmxdevfilter=(struct dmxdev_filter *) feed->priv; struct dmxdev_buffer *buffer; int ret; - + spin_lock(&dmxdevfilter->dev->lock); if (dmxdevfilter->params.pes.output==DMX_OUT_DECODER) { spin_unlock(&dmxdevfilter->dev->lock); @@ -402,10 +402,10 @@ static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len, return 0; } ret=dvb_dmxdev_buffer_write(buffer, buffer1, buffer1_len); - if (ret==buffer1_len) + if (ret==buffer1_len) ret=dvb_dmxdev_buffer_write(buffer, buffer2, buffer2_len); if (ret<0) { - buffer->pwrite=buffer->pread; + buffer->pwrite=buffer->pread; buffer->error=-EOVERFLOW; } spin_unlock(&dmxdevfilter->dev->lock); @@ -456,7 +456,7 @@ static int dvb_dmxdev_feed_start(struct dmxdev_filter *filter) } -/* restart section feed if it has filters left associated with it, +/* restart section feed if it has filters left associated with it, otherwise release the feed */ static int dvb_dmxdev_feed_restart(struct dmxdev_filter *filter) @@ -464,15 +464,15 @@ static int dvb_dmxdev_feed_restart(struct dmxdev_filter *filter) int i; struct dmxdev *dmxdev = filter->dev; u16 pid = filter->params.sec.pid; - - for (i=0; i<dmxdev->filternum; i++) + + for (i=0; i<dmxdev->filternum; i++) if (dmxdev->filter[i].state>=DMXDEV_STATE_GO && dmxdev->filter[i].type==DMXDEV_TYPE_SEC && dmxdev->filter[i].pid==pid) { dvb_dmxdev_feed_start(&dmxdev->filter[i]); return 0; } - + filter->dev->demux->release_section_feed(dmxdev->demux, filter->feed.sec); return 0; @@ -480,7 +480,7 @@ static int dvb_dmxdev_feed_restart(struct dmxdev_filter *filter) static int dvb_dmxdev_filter_stop(struct dmxdev_filter *dmxdevfilter) { - if (dmxdevfilter->state<DMXDEV_STATE_GO) + if (dmxdevfilter->state<DMXDEV_STATE_GO) return 0; switch (dmxdevfilter->type) { @@ -505,17 +505,17 @@ static int dvb_dmxdev_filter_stop(struct dmxdev_filter *dmxdevfilter) dmxdevfilter->feed.ts=NULL; break; default: - if (dmxdevfilter->state==DMXDEV_STATE_ALLOCATED) + if (dmxdevfilter->state==DMXDEV_STATE_ALLOCATED) return 0; return -EINVAL; } - dmxdevfilter->buffer.pwrite=dmxdevfilter->buffer.pread=0; + dmxdevfilter->buffer.pwrite=dmxdevfilter->buffer.pread=0; return 0; } static inline int dvb_dmxdev_filter_reset(struct dmxdev_filter *dmxdevfilter) { - if (dmxdevfilter->state<DMXDEV_STATE_SET) + if (dmxdevfilter->state<DMXDEV_STATE_SET) return 0; dmxdevfilter->type=DMXDEV_TYPE_NONE; @@ -530,11 +530,11 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter) void *mem; int ret, i; - if (filter->state < DMXDEV_STATE_SET) + if (filter->state < DMXDEV_STATE_SET) return -EINVAL; if (filter->state >= DMXDEV_STATE_GO) - dvb_dmxdev_filter_stop(filter); + dvb_dmxdev_filter_stop(filter); if (!(mem = filter->buffer.data)) { mem = vmalloc(filter->buffer.size); @@ -560,27 +560,27 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter) /* find active filter/feed with same PID */ for (i=0; i<dmxdev->filternum; i++) { if (dmxdev->filter[i].state >= DMXDEV_STATE_GO && - dmxdev->filter[i].pid == para->pid && + dmxdev->filter[i].pid == para->pid && dmxdev->filter[i].type == DMXDEV_TYPE_SEC) { *secfeed = dmxdev->filter[i].feed.sec; break; } } - /* if no feed found, try to allocate new one */ + /* if no feed found, try to allocate new one */ if (!*secfeed) { - ret=dmxdev->demux->allocate_section_feed(dmxdev->demux, - secfeed, + ret=dmxdev->demux->allocate_section_feed(dmxdev->demux, + secfeed, dvb_dmxdev_section_callback); if (ret<0) { printk ("DVB (%s): could not alloc feed\n", __FUNCTION__); return ret; } - - ret=(*secfeed)->set(*secfeed, para->pid, 32768, 0, + + ret=(*secfeed)->set(*secfeed, para->pid, 32768, 0, (para->flags & DMX_CHECK_CRC) ? 1 : 0); - + if (ret<0) { printk ("DVB (%s): could not set feed\n", __FUNCTION__); @@ -590,7 +590,7 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter) } else { dvb_dmxdev_feed_stop(filter); } - + ret=(*secfeed)->allocate_filter(*secfeed, secfilter); if (ret < 0) { @@ -602,11 +602,11 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter) (*secfilter)->priv = filter; - memcpy(&((*secfilter)->filter_value[3]), + memcpy(&((*secfilter)->filter_value[3]), &(para->filter.filter[1]), DMX_FILTER_SIZE-1); - memcpy(&(*secfilter)->filter_mask[3], + memcpy(&(*secfilter)->filter_mask[3], ¶->filter.mask[1], DMX_FILTER_SIZE-1); - memcpy(&(*secfilter)->filter_mode[3], + memcpy(&(*secfilter)->filter_mode[3], ¶->filter.mode[1], DMX_FILTER_SIZE-1); (*secfilter)->filter_value[0]=para->filter.filter[0]; @@ -614,7 +614,7 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter) (*secfilter)->filter_mode[0]=para->filter.mode[0]; (*secfilter)->filter_mask[1]=0; (*secfilter)->filter_mask[2]=0; - + filter->todo = 0; ret = filter->feed.sec->start_filtering (filter->feed.sec); @@ -626,7 +626,7 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter) break; } - case DMXDEV_TYPE_PES: + case DMXDEV_TYPE_PES: { struct timespec timeout = { 0 }; struct dmx_pes_filter_params *para = &filter->params.pes; @@ -635,27 +635,27 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter) int ts_type; enum dmx_ts_pes ts_pes; struct dmx_ts_feed **tsfeed = &filter->feed.ts; - + filter->feed.ts = NULL; otype=para->output; - + ts_pes=(enum dmx_ts_pes) para->pes_type; - - if (ts_pes<DMX_PES_OTHER) + + if (ts_pes<DMX_PES_OTHER) ts_type=TS_DECODER; else ts_type=0; - - if (otype == DMX_OUT_TS_TAP) + + if (otype == DMX_OUT_TS_TAP) ts_type |= TS_PACKET; - - if (otype == DMX_OUT_TAP) + + if (otype == DMX_OUT_TAP) ts_type |= TS_PAYLOAD_ONLY|TS_PACKET; - - ret=dmxdev->demux->allocate_ts_feed(dmxdev->demux, - tsfeed, + + ret=dmxdev->demux->allocate_ts_feed(dmxdev->demux, + tsfeed, dvb_dmxdev_ts_callback); - if (ret<0) + if (ret<0) return ret; (*tsfeed)->priv = (void *) filter; @@ -730,13 +730,13 @@ static int dvb_dmxdev_filter_free(struct dmxdev *dmxdev, struct dmxdev_filter *d up(&dmxdev->mutex); return -ERESTARTSYS; } - + dvb_dmxdev_filter_stop(dmxdevfilter); dvb_dmxdev_filter_reset(dmxdevfilter); - + if (dmxdevfilter->buffer.data) { void *mem=dmxdevfilter->buffer.data; - + spin_lock_irq(&dmxdev->lock); dmxdevfilter->buffer.data=NULL; spin_unlock_irq(&dmxdev->lock); @@ -759,22 +759,22 @@ static inline void invert_mode(dmx_filter_t *filter) } -static int dvb_dmxdev_filter_set(struct dmxdev *dmxdev, - struct dmxdev_filter *dmxdevfilter, +static int dvb_dmxdev_filter_set(struct dmxdev *dmxdev, + struct dmxdev_filter *dmxdevfilter, struct dmx_sct_filter_params *params) { dprintk ("function : %s\n", __FUNCTION__); dvb_dmxdev_filter_stop(dmxdevfilter); - + dmxdevfilter->type=DMXDEV_TYPE_SEC; dmxdevfilter->pid=params->pid; - memcpy(&dmxdevfilter->params.sec, + memcpy(&dmxdevfilter->params.sec, params, sizeof(struct dmx_sct_filter_params)); invert_mode(&dmxdevfilter->params.sec.filter); dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_SET); - - if (params->flags&DMX_IMMEDIATE_START) + + if (params->flags&DMX_IMMEDIATE_START) return dvb_dmxdev_filter_start(dmxdevfilter); return 0; @@ -795,7 +795,7 @@ static int dvb_dmxdev_pes_filter_set(struct dmxdev *dmxdev, dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_SET); - if (params->flags&DMX_IMMEDIATE_START) + if (params->flags&DMX_IMMEDIATE_START) return dvb_dmxdev_filter_start(dmxdevfilter); return 0; @@ -806,18 +806,18 @@ static ssize_t dvb_dmxdev_read_sec(struct dmxdev_filter *dfil, { int result, hcount; int done=0; - + if (dfil->todo<=0) { hcount=3+dfil->todo; if (hcount>count) hcount=count; - result=dvb_dmxdev_buffer_read(&dfil->buffer, file->f_flags&O_NONBLOCK, + result=dvb_dmxdev_buffer_read(&dfil->buffer, file->f_flags&O_NONBLOCK, buf, hcount, ppos); if (result<0) { dfil->todo=0; return result; } - if (copy_from_user(dfil->secheader-dfil->todo, buf, result)) + if (copy_from_user(dfil->secheader-dfil->todo, buf, result)) return -EFAULT; buf+=result; done=result; @@ -831,7 +831,7 @@ static ssize_t dvb_dmxdev_read_sec(struct dmxdev_filter *dfil, } if (count>dfil->todo) count=dfil->todo; - result=dvb_dmxdev_buffer_read(&dfil->buffer, file->f_flags&O_NONBLOCK, + result=dvb_dmxdev_buffer_read(&dfil->buffer, file->f_flags&O_NONBLOCK, buf, count, ppos); if (result<0) return result; @@ -840,7 +840,7 @@ static ssize_t dvb_dmxdev_read_sec(struct dmxdev_filter *dfil, } -static ssize_t +static ssize_t dvb_demux_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct dmxdev_filter *dmxdevfilter=dvb_dmxdev_file_to_filter(file); @@ -852,8 +852,8 @@ dvb_demux_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) if (dmxdevfilter->type==DMXDEV_TYPE_SEC) ret=dvb_dmxdev_read_sec(dmxdevfilter, file, buf, count, ppos); else - ret=dvb_dmxdev_buffer_read(&dmxdevfilter->buffer, - file->f_flags&O_NONBLOCK, + ret=dvb_dmxdev_buffer_read(&dmxdevfilter->buffer, + file->f_flags&O_NONBLOCK, buf, count, ppos); up(&dmxdevfilter->mutex); @@ -868,7 +868,7 @@ static int dvb_demux_do_ioctl(struct inode *inode, struct file *file, struct dmxdev *dmxdev=dmxdevfilter->dev; unsigned long arg=(unsigned long) parg; int ret=0; - + if (down_interruptible (&dmxdev->mutex)) return -ERESTARTSYS; @@ -894,27 +894,27 @@ static int dvb_demux_do_ioctl(struct inode *inode, struct file *file, up(&dmxdevfilter->mutex); break; - case DMX_SET_FILTER: + case DMX_SET_FILTER: if (down_interruptible(&dmxdevfilter->mutex)) { up(&dmxdev->mutex); return -ERESTARTSYS; } - ret = dvb_dmxdev_filter_set(dmxdev, dmxdevfilter, + ret = dvb_dmxdev_filter_set(dmxdev, dmxdevfilter, (struct dmx_sct_filter_params *)parg); up(&dmxdevfilter->mutex); break; - case DMX_SET_PES_FILTER: + case DMX_SET_PES_FILTER: if (down_interruptible(&dmxdevfilter->mutex)) { up(&dmxdev->mutex); return -ERESTARTSYS; } - ret=dvb_dmxdev_pes_filter_set(dmxdev, dmxdevfilter, + ret=dvb_dmxdev_pes_filter_set(dmxdev, dmxdevfilter, (struct dmx_pes_filter_params *)parg); up(&dmxdevfilter->mutex); break; - case DMX_SET_BUFFER_SIZE: + case DMX_SET_BUFFER_SIZE: if (down_interruptible(&dmxdevfilter->mutex)) { up(&dmxdev->mutex); return -ERESTARTSYS; @@ -922,11 +922,11 @@ static int dvb_demux_do_ioctl(struct inode *inode, struct file *file, ret=dvb_dmxdev_set_buffer_size(dmxdevfilter, arg); up(&dmxdevfilter->mutex); break; - - case DMX_GET_EVENT: + + case DMX_GET_EVENT: break; - - case DMX_GET_PES_PIDS: + + case DMX_GET_PES_PIDS: if (!dmxdev->demux->get_pes_pids) { ret=-EINVAL; break; @@ -1023,11 +1023,11 @@ static int dvb_dvr_do_ioctl(struct inode *inode, struct file *file, return -ERESTARTSYS; switch (cmd) { - case DMX_SET_BUFFER_SIZE: + case DMX_SET_BUFFER_SIZE: // FIXME: implement ret=0; break; - + default: ret=-EINVAL; } @@ -1059,7 +1059,7 @@ static unsigned int dvb_dvr_poll (struct file *file, poll_table *wait) if (dmxdev->dvr_buffer.pread!=dmxdev->dvr_buffer.pwrite) mask |= (POLLIN | POLLRDNORM | POLLPRI); - } else + } else mask |= (POLLOUT | POLLWRNORM | POLLPRI); return mask; @@ -1083,14 +1083,14 @@ static struct dvb_device dvbdev_dvr = { .fops = &dvb_dvr_fops }; -int +int dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *dvb_adapter) { int i; if (dmxdev->demux->open(dmxdev->demux) < 0) return -EUSERS; - + dmxdev->filter = vmalloc(dmxdev->filternum*sizeof(struct dmxdev_filter)); if (!dmxdev->filter) return -ENOMEM; @@ -1123,7 +1123,7 @@ dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *dvb_adapter) } EXPORT_SYMBOL(dvb_dmxdev_init); -void +void dvb_dmxdev_release(struct dmxdev *dmxdev) { dvb_unregister_device(dmxdev->dvbdev); @@ -1141,4 +1141,3 @@ dvb_dmxdev_release(struct dmxdev *dmxdev) dmxdev->demux->close(dmxdev->demux); } EXPORT_SYMBOL(dvb_dmxdev_release); - diff --git a/linux/drivers/media/dvb/dvb-core/dmxdev.h b/linux/drivers/media/dvb/dvb-core/dmxdev.h index 47d31777c..395a9cd75 100644 --- a/linux/drivers/media/dvb/dvb-core/dmxdev.h +++ b/linux/drivers/media/dvb/dvb-core/dmxdev.h @@ -1,4 +1,4 @@ -/* +/* * dmxdev.h * * Copyright (C) 2000 Ralph Metzler & Marcus Metzler diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.c b/linux/drivers/media/dvb/dvb-core/dvb_demux.c index 19fb4d99c..ac9889d22 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_demux.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.c @@ -1,4 +1,4 @@ -/* +/* * dvb_demux.c - DVB kernel demux API * * Copyright (C) 2000-2001 Ralph Metzler <ralph@convergence.de> @@ -32,8 +32,8 @@ #include "dvb_demux.h" -#define NOBUFS -/* +#define NOBUFS +/* ** #define DVB_DEMUX_SECTION_LOSS_LOG to monitor payload loss in the syslog */ // #define DVB_DEMUX_SECTION_LOSS_LOG @@ -42,7 +42,7 @@ static LIST_HEAD(dmx_muxs); -static int dmx_register_demux(struct dmx_demux *demux) +static int dmx_register_demux(struct dmx_demux *demux) { demux->users = 0; list_add(&demux->reg_list, &dmx_muxs); @@ -87,14 +87,12 @@ static inline u8 payload(const u8 *tsp) { if (!(tsp[3] & 0x10)) // no payload? return 0; - if (tsp[3] & 0x20) { // adaptation field? if (tsp[4] > 183) // corrupted data? return 0; else return 184-1-tsp[4]; } - return 184; } @@ -115,7 +113,7 @@ static void dvb_dmx_memcopy (struct dvb_demux_feed *f, u8 *d, const u8 *s, size_ * Software filter functions ******************************************************************************/ -static inline int dvb_dmx_swfilter_payload (struct dvb_demux_feed *feed, const u8 *buf) +static inline int dvb_dmx_swfilter_payload (struct dvb_demux_feed *feed, const u8 *buf) { int count = payload(buf); int p; @@ -140,11 +138,11 @@ static inline int dvb_dmx_swfilter_payload (struct dvb_demux_feed *feed, const u feed->peslen += count; - return feed->cb.ts (&buf[p], count, NULL, 0, &feed->feed.ts, DMX_OK); + return feed->cb.ts (&buf[p], count, NULL, 0, &feed->feed.ts, DMX_OK); } -static int dvb_dmx_swfilter_sectionfilter (struct dvb_demux_feed *feed, +static int dvb_dmx_swfilter_sectionfilter (struct dvb_demux_feed *feed, struct dvb_demux_filter *f) { u8 neq = 0; @@ -162,8 +160,8 @@ static int dvb_dmx_swfilter_sectionfilter (struct dvb_demux_feed *feed, if (f->doneq && !neq) return 0; - return feed->cb.sec (feed->feed.sec.secbuf, feed->feed.sec.seclen, - NULL, 0, &f->filter, DMX_OK); + return feed->cb.sec (feed->feed.sec.secbuf, feed->feed.sec.seclen, + NULL, 0, &f->filter, DMX_OK); } @@ -213,7 +211,7 @@ static void dvb_dmx_swfilter_section_new(struct dvb_demux_feed *feed) */ if(sec->secbuf[0] != 0xff || sec->secbuf[n-1] != 0xff) { - printk("dvb_demux.c section ts padding loss: %d/%d\n", + printk("dvb_demux.c section ts padding loss: %d/%d\n", n, sec->tsfeedp); printk("dvb_demux.c pad data:"); for(i = 0; i < n; i++) @@ -227,13 +225,13 @@ static void dvb_dmx_swfilter_section_new(struct dvb_demux_feed *feed) sec->secbuf = sec->secbuf_base; } -/* +/* ** Losless Section Demux 1.4.1 by Emard ** Valsecchi Patrick: ** - middle of section A (no PUSI) -** - end of section A and start of section B +** - end of section A and start of section B ** (with PUSI pointing to the start of the second section) -** +** ** In this case, without feed->pusi_seen you'll receive a garbage section ** consisting of the end of section A. Basically because tsfeedp ** is incemented and the use=0 condition is not raised @@ -257,7 +255,7 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const if(sec->tsfeedp + len > DMX_MAX_SECFEED_SIZE) { #ifdef DVB_DEMUX_SECTION_LOSS_LOG - printk("dvb_demux.c section buffer full loss: %d/%d\n", + printk("dvb_demux.c section buffer full loss: %d/%d\n", sec->tsfeedp + len - DMX_MAX_SECFEED_SIZE, DMX_MAX_SECFEED_SIZE); #endif len = DMX_MAX_SECFEED_SIZE - sec->tsfeedp; @@ -272,7 +270,7 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const /* ----------------------------------------------------- ** Dump all the sections we can find in the data (Emard) */ - + limit = sec->tsfeedp; if(limit > DMX_MAX_SECFEED_SIZE) return -1; /* internal error should never happen */ @@ -283,7 +281,7 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const for(n = 0; sec->secbufp + 2 < limit; n++) { seclen = section_length(sec->secbuf); - if(seclen <= 0 || seclen > DMX_MAX_SECFEED_SIZE + if(seclen <= 0 || seclen > DMX_MAX_SECFEED_SIZE || seclen + sec->secbufp > limit) return 0; sec->seclen = seclen; @@ -303,7 +301,7 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const } -static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8 *buf) +static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8 *buf) { u8 p, count; int ccok, dc_i = 0; @@ -381,9 +379,9 @@ static inline void dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed, con if (feed->ts_type & TS_PAYLOAD_ONLY) dvb_dmx_swfilter_payload(feed, buf); else - feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK); + feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK); } - if (feed->ts_type & TS_DECODER) + if (feed->ts_type & TS_DECODER) if (feed->demux->write_to_decoder) feed->demux->write_to_decoder(feed, buf, 188); break; @@ -439,7 +437,7 @@ void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf, size_t cou spin_lock(&demux->lock); while (count--) { - if(buf[0] == 0x47) { + if(buf[0] == 0x47) { dvb_dmx_swfilter_packet(demux, buf); } buf += 188; @@ -480,7 +478,7 @@ void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count) demux->tsbufp=i; goto bailout; } - } else + } else p++; } @@ -524,7 +522,7 @@ void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count) demux->tsbufp=i; goto bailout; } - } else { + } else { p++; } } @@ -606,9 +604,9 @@ out: spin_unlock_irq(&feed->demux->lock); } -static int dmx_ts_feed_set (struct dmx_ts_feed* ts_feed, u16 pid, int ts_type, - enum dmx_ts_pes pes_type, size_t callback_length, - size_t circular_buffer_size, int descramble, +static int dmx_ts_feed_set (struct dmx_ts_feed* ts_feed, u16 pid, int ts_type, + enum dmx_ts_pes pes_type, size_t callback_length, + size_t circular_buffer_size, int descramble, struct timespec timeout) { struct dvb_demux_feed *feed = (struct dvb_demux_feed *) ts_feed; @@ -626,7 +624,7 @@ static int dmx_ts_feed_set (struct dmx_ts_feed* ts_feed, u16 pid, int ts_type, return -EINVAL; } - if (demux->pesfilter[pes_type] && + if (demux->pesfilter[pes_type] && demux->pesfilter[pes_type] != feed) { up(&demux->mutex); return -EINVAL; @@ -662,7 +660,7 @@ static int dmx_ts_feed_set (struct dmx_ts_feed* ts_feed, u16 pid, int ts_type, } #endif } - + feed->state = DMX_STATE_READY; up(&demux->mutex); @@ -702,7 +700,7 @@ static int dmx_ts_feed_start_filtering(struct dmx_ts_feed* ts_feed) return 0; } - + static int dmx_ts_feed_stop_filtering(struct dmx_ts_feed* ts_feed) { struct dvb_demux_feed *feed = (struct dvb_demux_feed *) ts_feed; @@ -722,7 +720,7 @@ static int dmx_ts_feed_stop_filtering(struct dmx_ts_feed* ts_feed) return -ENODEV; } - ret = demux->stop_feed(feed); + ret = demux->stop_feed(feed); spin_lock_irq(&demux->lock); ts_feed->is_filtering = 0; @@ -733,7 +731,7 @@ static int dmx_ts_feed_stop_filtering(struct dmx_ts_feed* ts_feed) return ret; } -static int dvbdmx_allocate_ts_feed (struct dmx_demux *dmx, struct dmx_ts_feed **ts_feed, +static int dvbdmx_allocate_ts_feed (struct dmx_demux *dmx, struct dmx_ts_feed **ts_feed, dmx_ts_cb callback) { struct dvb_demux *demux = (struct dvb_demux *) dmx; @@ -772,7 +770,7 @@ static int dvbdmx_allocate_ts_feed (struct dmx_demux *dmx, struct dmx_ts_feed ** feed->filter->type = DMX_TYPE_TS; feed->filter->feed = feed; feed->filter->state = DMX_STATE_READY; - + up(&demux->mutex); return 0; @@ -815,8 +813,8 @@ static int dvbdmx_release_ts_feed(struct dmx_demux *dmx, struct dmx_ts_feed *ts_ * dmx_section_feed API calls ******************************************************************************/ -static int dmx_section_feed_allocate_filter(struct dmx_section_feed* feed, - struct dmx_section_filter** filter) +static int dmx_section_feed_allocate_filter(struct dmx_section_feed* feed, + struct dmx_section_filter** filter) { struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) feed; struct dvb_demux *dvbdemux = dvbdmxfeed->demux; @@ -847,9 +845,9 @@ static int dmx_section_feed_allocate_filter(struct dmx_section_feed* feed, } -static int dmx_section_feed_set(struct dmx_section_feed* feed, - u16 pid, size_t circular_buffer_size, - int descramble, int check_crc) +static int dmx_section_feed_set(struct dmx_section_feed* feed, + u16 pid, size_t circular_buffer_size, + int descramble, int check_crc) { struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) feed; struct dvb_demux *dvbdmx = dvbdmxfeed->demux; @@ -859,7 +857,7 @@ static int dmx_section_feed_set(struct dmx_section_feed* feed, if (down_interruptible (&dvbdmx->mutex)) return -ERESTARTSYS; - + dvb_demux_feed_add(dvbdmxfeed); dvbdmxfeed->pid = pid; @@ -919,7 +917,7 @@ static int dmx_section_feed_start_filtering(struct dmx_section_feed *feed) if (down_interruptible (&dvbdmx->mutex)) return -ERESTARTSYS; - + if (feed->is_filtering) { up(&dvbdmx->mutex); return -EBUSY; @@ -934,7 +932,7 @@ static int dmx_section_feed_start_filtering(struct dmx_section_feed *feed) dvbdmxfeed->feed.sec.secbuf = dvbdmxfeed->feed.sec.secbuf_base; dvbdmxfeed->feed.sec.secbufp = 0; dvbdmxfeed->feed.sec.seclen = 0; - + if (!dvbdmx->start_feed) { up(&dvbdmx->mutex); return -ENODEV; @@ -971,7 +969,7 @@ static int dmx_section_feed_stop_filtering(struct dmx_section_feed* feed) return -ENODEV; } - ret = dvbdmx->stop_feed(dvbdmxfeed); + ret = dvbdmx->stop_feed(dvbdmxfeed); spin_lock_irq(&dvbdmx->lock); dvbdmxfeed->state = DMX_STATE_READY; @@ -983,7 +981,7 @@ static int dmx_section_feed_stop_filtering(struct dmx_section_feed* feed) } -static int dmx_section_feed_release_filter(struct dmx_section_feed *feed, +static int dmx_section_feed_release_filter(struct dmx_section_feed *feed, struct dmx_section_filter* filter) { struct dvb_demux_filter *dvbdmxfilter = (struct dvb_demux_filter *) filter, *f; @@ -998,9 +996,9 @@ static int dmx_section_feed_release_filter(struct dmx_section_feed *feed, return -EINVAL; } - if (feed->is_filtering) + if (feed->is_filtering) feed->stop_filtering(feed); - + spin_lock_irq(&dvbdmx->lock); f = dvbdmxfeed->filter; @@ -1018,7 +1016,7 @@ static int dmx_section_feed_release_filter(struct dmx_section_feed *feed, return 0; } -static int dvbdmx_allocate_section_feed(struct dmx_demux *demux, +static int dvbdmx_allocate_section_feed(struct dmx_demux *demux, struct dmx_section_feed **feed, dmx_section_cb callback) { @@ -1058,7 +1056,7 @@ static int dvbdmx_allocate_section_feed(struct dmx_demux *demux, return 0; } -static int dvbdmx_release_section_feed(struct dmx_demux *demux, +static int dvbdmx_release_section_feed(struct dmx_demux *demux, struct dmx_section_feed *feed) { struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) feed; @@ -1137,7 +1135,7 @@ static int dvbdmx_add_frontend(struct dmx_demux *demux, struct dmx_frontend *fro { struct dvb_demux *dvbdemux = (struct dvb_demux *) demux; struct list_head *head = &dvbdemux->frontend_list; - + list_add(&(frontend->connectivity_list), head); return 0; @@ -1166,7 +1164,6 @@ static struct list_head * dvbdmx_get_frontends(struct dmx_demux *demux) if (list_empty(&dvbdemux->frontend_list)) return NULL; - return &dvbdemux->frontend_list; } @@ -1177,7 +1174,7 @@ static int dvbdmx_connect_frontend(struct dmx_demux *demux, struct dmx_frontend if (demux->frontend) return -EINVAL; - + if (down_interruptible (&dvbdemux->mutex)) return -ERESTARTSYS; @@ -1195,7 +1192,6 @@ static int dvbdmx_disconnect_frontend(struct dmx_demux *demux) return -ERESTARTSYS; demux->frontend = NULL; - up(&dvbdemux->mutex); return 0; } @@ -1226,21 +1222,17 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux) vfree(dvbdemux->filter); return -ENOMEM; } - for (i=0; i<dvbdemux->filternum; i++) { dvbdemux->filter[i].state = DMX_STATE_FREE; dvbdemux->filter[i].index = i; } - for (i=0; i<dvbdemux->feednum; i++) { dvbdemux->feed[i].state = DMX_STATE_FREE; dvbdemux->feed[i].index = i; } - dvbdemux->frontend_list.next= dvbdemux->frontend_list.prev= &dvbdemux->frontend_list; - for (i=0; i<DMX_TS_PES_OTHER; i++) { dvbdemux->pesfilter[i] = NULL; dvbdemux->pids[i] = 0xffff; @@ -1271,7 +1263,7 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux) dmx->descramble_mac_address = NULL; dmx->descramble_section_payload = NULL; - + dmx->add_frontend = dvbdmx_add_frontend; dmx->remove_frontend = dvbdmx_remove_frontend; dmx->get_frontends = dvbdmx_get_frontends; @@ -1282,7 +1274,7 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux) sema_init(&dvbdemux->mutex, 1); spin_lock_init(&dvbdemux->lock); - if ((err = dmx_register_demux(dmx)) < 0) + if ((err = dmx_register_demux(dmx)) < 0) return err; return 0; @@ -1300,4 +1292,3 @@ int dvb_dmx_release(struct dvb_demux *dvbdemux) return 0; } EXPORT_SYMBOL(dvb_dmx_release); - diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.h b/linux/drivers/media/dvb/dvb-core/dvb_demux.h index 326cce056..c09beb391 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_demux.h +++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.h @@ -1,4 +1,4 @@ -/* +/* * dvb_demux.h: DVB kernel demux API * * Copyright (C) 2000-2001 Marcus Metzler & Ralph Metzler @@ -45,10 +45,10 @@ struct dvb_demux_filter { struct dmx_section_filter filter; - u8 maskandmode [DMX_MAX_FILTER_SIZE]; - u8 maskandnotmode [DMX_MAX_FILTER_SIZE]; + u8 maskandmode [DMX_MAX_FILTER_SIZE]; + u8 maskandnotmode [DMX_MAX_FILTER_SIZE]; int doneq; - + struct dvb_demux_filter *next; struct dvb_demux_feed *feed; int index; @@ -85,16 +85,16 @@ struct dvb_demux_feed { int buffer_size; int descramble; - struct timespec timeout; + struct timespec timeout; struct dvb_demux_filter *filter; int cb_length; - + int ts_type; enum dmx_ts_pes pes_type; int cc; int pusi_seen; /* prevents feeding of garbage from previous section */ - + u16 peslen; struct list_head list_head; @@ -114,7 +114,7 @@ struct dvb_demux { const u8 *buf, size_t len); void (*memcopy) (struct dvb_demux_feed *feed, u8 *dst, const u8 *src, size_t len); - + int users; #define MAX_DVB_DEMUX_USERS 10 struct dvb_demux_filter *filter; @@ -124,8 +124,8 @@ struct dvb_demux { struct dvb_demux_feed *pesfilter[DMX_TS_PES_OTHER]; u16 pids[DMX_TS_PES_OTHER]; - int playing; - int recording; + int playing; + int recording; #define DMX_MAX_PID 0x2000 struct list_head feed_list; @@ -144,4 +144,3 @@ void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count); void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count); #endif /* _DVB_DEMUX_H_ */ - diff --git a/linux/drivers/media/dvb/dvb-core/dvb_filter.c b/linux/drivers/media/dvb/dvb-core/dvb_filter.c index 5e541bfb6..bd5143906 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_filter.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_filter.c @@ -22,12 +22,12 @@ static u32 ac3_frames[3][32] = {69,87,104,121,139,174,208,243,278,348,417,487,557,696,835,975,1114, 1253,1393,0,0,0,0,0,0,0,0,0,0,0,0,0}, {96,120,144,168,192,240,288,336,384,480,576,672,768,960,1152,1344, - 1536,1728,1920,0,0,0,0,0,0,0,0,0,0,0,0,0}}; + 1536,1728,1920,0,0,0,0,0,0,0,0,0,0,0,0,0}}; #if 0 -static void setup_ts2pes(ipack *pa, ipack *pv, u16 *pida, u16 *pidv, +static void setup_ts2pes(ipack *pa, ipack *pv, u16 *pida, u16 *pidv, void (*pes_write)(u8 *buf, int count, void *data), void *priv) { @@ -72,7 +72,7 @@ static int read_picture_header(u8 *headr, struct mpg_picture *pic, int field, in u8 pct; if (pr) printk( "Pic header: "); - pic->temporal_reference[field] = (( headr[0] << 2 ) | + pic->temporal_reference[field] = (( headr[0] << 2 ) | (headr[1] & 0x03) )& 0x03ff; if (pr) printk( " temp ref: 0x%04x", pic->temporal_reference[field]); @@ -93,31 +93,31 @@ static int read_picture_header(u8 *headr, struct mpg_picture *pic, int field, in } - pic->vinfo.vbv_delay = (( headr[1] >> 5 ) | ( headr[2] << 3) | + pic->vinfo.vbv_delay = (( headr[1] >> 5 ) | ( headr[2] << 3) | ( (headr[3] & 0x1F) << 11) ) & 0xffff; if (pr) printk( " vbv delay: 0x%04x", pic->vinfo.vbv_delay); - pic->picture_header_parameter = ( headr[3] & 0xe0 ) | + pic->picture_header_parameter = ( headr[3] & 0xe0 ) | ((headr[4] & 0x80) >> 3); if ( pct == B_FRAME ){ pic->picture_header_parameter |= ( headr[4] >> 3 ) & 0x0f; } - if (pr) printk( " pic head param: 0x%x", + if (pr) printk( " pic head param: 0x%x", pic->picture_header_parameter); return pct; -} +} #endif #if 0 /* needs 4 byte input */ static int read_gop_header(u8 *headr, struct mpg_picture *pic, int pr) { - if (pr) printk("GOP header: "); + if (pr) printk("GOP header: "); - pic->time_code = (( headr[0] << 17 ) | ( headr[1] << 9) | + pic->time_code = (( headr[0] << 17 ) | ( headr[1] << 9) | ( headr[2] << 1 ) | (headr[3] &0x01)) & 0x1ffffff; if (pr) printk(" time: %d:%d.%d ", (headr[0]>>2)& 0x1F, @@ -129,14 +129,14 @@ static int read_gop_header(u8 *headr, struct mpg_picture *pic, int pr) } else { pic->closed_gop = 0; } - if (pr) printk("closed: %d", pic->closed_gop); + if (pr) printk("closed: %d", pic->closed_gop); if ( ( headr[3] & 0x20 ) != 0 ){ pic->broken_link = 1; } else { pic->broken_link = 0; } - if (pr) printk(" broken: %d\n", pic->broken_link); + if (pr) printk(" broken: %d\n", pic->broken_link); return 0; } @@ -153,39 +153,39 @@ static int read_sequence_header(u8 *headr, struct dvb_video_info *vi, int pr) vi->horizontal_size = ((headr[1] &0xF0) >> 4) | (headr[0] << 4); vi->vertical_size = ((headr[1] &0x0F) << 8) | (headr[2]); - + sw = (int)((headr[3]&0xF0) >> 4) ; switch( sw ){ case 1: if (pr) printk("Videostream: ASPECT: 1:1"); - vi->aspect_ratio = 100; + vi->aspect_ratio = 100; break; case 2: if (pr) printk("Videostream: ASPECT: 4:3"); - vi->aspect_ratio = 133; + vi->aspect_ratio = 133; break; case 3: if (pr) printk("Videostream: ASPECT: 16:9"); - vi->aspect_ratio = 177; + vi->aspect_ratio = 177; break; case 4: if (pr) printk("Videostream: ASPECT: 2.21:1"); - vi->aspect_ratio = 221; + vi->aspect_ratio = 221; break; case 5 ... 15: if (pr) printk("Videostream: ASPECT: reserved"); - vi->aspect_ratio = 0; + vi->aspect_ratio = 0; break; default: - vi->aspect_ratio = 0; + vi->aspect_ratio = 0; return -1; } @@ -240,7 +240,7 @@ static int read_sequence_header(u8 *headr, struct dvb_video_info *vi, int pr) } vi->bit_rate = (headr[4] << 10) | (headr[5] << 2) | (headr[6] & 0x03); - + vi->vbv_buffer_size = (( headr[6] & 0xF8) >> 3 ) | (( headr[7] & 0x1F )<< 5); @@ -303,7 +303,7 @@ static int get_ainfo(u8 *mbuf, int count, struct dvb_audio_info *ai, int pr) else { c++; } - } + } if (!found) return -1; @@ -333,8 +333,8 @@ static int get_ainfo(u8 *mbuf, int count, struct dvb_audio_info *ai, int pr) if (ai->frequency == 3) printk(" Freq: reserved\n"); else - printk(" Freq: %d kHz\n",ai->frequency); - + printk(" Freq: %d kHz\n",ai->frequency); + } ai->off = c; return 0; @@ -349,7 +349,7 @@ int dvb_filter_get_ac3info(u8 *mbuf, int count, struct dvb_audio_info *ai, int p int c = 0; u8 frame = 0; int fr = 0; - + while ( !found && c < count){ u8 *b = mbuf+c; @@ -358,7 +358,7 @@ int dvb_filter_get_ac3info(u8 *mbuf, int count, struct dvb_audio_info *ai, int p else { c++; } - } + } if (!found) return -1; if (pr) @@ -402,7 +402,7 @@ static u8 *skip_pes_header(u8 **bufp) int skip = 0; static const int mpeg1_skip_table[16] = { - 1, 0xffff, 5, 10, 0xffff, 0xffff, 0xffff, 0xffff, + 1, 0xffff, 5, 10, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; @@ -479,9 +479,9 @@ static void initialize_mpg_picture(struct mpg_picture *pic) pic->picture_display_extension_flag[0] = 0; pic->picture_display_extension_flag[1] = 0; - pic->sequence_header_flag = 0; - pic->gop_flag = 0; - pic->sequence_end_flag = 0; + pic->sequence_header_flag = 0; + pic->gop_flag = 0; + pic->sequence_end_flag = 0; } #endif @@ -553,7 +553,7 @@ static void init_mpg_picture( struct mpg_picture *pic, int chan, int32_t field_t } #endif -void dvb_filter_pes2ts_init(struct dvb_filter_pes2ts *p2ts, unsigned short pid, +void dvb_filter_pes2ts_init(struct dvb_filter_pes2ts *p2ts, unsigned short pid, dvb_filter_pes2ts_cb_t *cb, void *priv) { unsigned char *buf=p2ts->buf; @@ -601,4 +601,3 @@ int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, return p2ts->cb(p2ts->priv, buf); } EXPORT_SYMBOL(dvb_filter_pes2ts); - diff --git a/linux/drivers/media/dvb/dvb-core/dvb_filter.h b/linux/drivers/media/dvb/dvb-core/dvb_filter.h index bd328dc25..b0848f783 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_filter.h +++ b/linux/drivers/media/dvb/dvb-core/dvb_filter.h @@ -34,8 +34,8 @@ struct dvb_filter_pes2ts { void *priv; }; -void dvb_filter_pes2ts_init(struct dvb_filter_pes2ts *p2ts, unsigned short pid, - dvb_filter_pes2ts_cb_t *cb, void *priv); +void dvb_filter_pes2ts_init(struct dvb_filter_pes2ts *p2ts, unsigned short pid, + dvb_filter_pes2ts_cb_t *cb, void *priv); int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, int len, int payload_start); @@ -70,8 +70,8 @@ int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, #define QUANT_MATRIX_EXTENSION 0x03 #define PICTURE_DISPLAY_EXTENSION 0x07 -#define I_FRAME 0x01 -#define B_FRAME 0x02 +#define I_FRAME 0x01 +#define B_FRAME 0x02 #define P_FRAME 0x03 /* Initialize sequence_data */ @@ -92,7 +92,7 @@ int dvb_filter_pes2ts(struct dvb_filter_pes2ts *p2ts, unsigned char *pes, #define PES_CRC_FLAG 0x02 #define PES_EXT_FLAG 0x01 -//pts_dts flags +//pts_dts flags #define PTS_ONLY 0x80 #define PTS_DTS 0xC0 @@ -165,7 +165,7 @@ struct dvb_video_info { s16 vbv_delay; u32 CSPF; u32 off; -}; +}; #define OFF_SIZE 4 #define FIRST_FIELD 0 @@ -181,10 +181,10 @@ struct mpg_picture { int low_delay; int closed_gop; int broken_link; - int sequence_header_flag; - int gop_flag; + int sequence_header_flag; + int gop_flag; int sequence_end_flag; - + u8 profile_and_level; s32 picture_coding_parameter; u32 matrix[32]; @@ -211,11 +211,11 @@ struct mpg_picture { int forward_bank; int backward_bank; int compress; - s16 frame_centre_horizontal_offset[OFF_SIZE]; + s16 frame_centre_horizontal_offset[OFF_SIZE]; /* [0-2] 1st field, [3] 2nd field */ s16 frame_centre_vertical_offset[OFF_SIZE]; /* [0-2] 1st field, [3] 2nd field */ - s16 temporal_reference[2]; + s16 temporal_reference[2]; /* [0] 1st field, [1] 2nd field */ s8 picture_coding_type[2]; diff --git a/linux/drivers/media/dvb/dvb-core/dvb_net.h b/linux/drivers/media/dvb/dvb-core/dvb_net.h index 5b701efe8..f14e4ca38 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_net.h +++ b/linux/drivers/media/dvb/dvb-core/dvb_net.h @@ -1,4 +1,4 @@ -/* +/* * dvb_net.h * * Copyright (C) 2001 Ralph Metzler for convergence integrated media GmbH @@ -44,4 +44,3 @@ void dvb_net_release(struct dvb_net *); int dvb_net_init(struct dvb_adapter *, struct dvb_net *, struct dmx_demux *); #endif - diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c index d949ad77d..fa857dd48 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.c +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c @@ -1,4 +1,4 @@ -/* +/* * dvbdev.c * * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de> @@ -80,7 +80,7 @@ static struct dvb_device* dvbdev_find_device (int minor) static int dvb_device_open(struct inode *inode, struct file *file) { struct dvb_device *dvbdev; - + dvbdev = dvbdev_find_device (iminor(inode)); if (dvbdev && dvbdev->fops) { @@ -152,7 +152,7 @@ int dvb_generic_release(struct inode *inode, struct file *file) } else { dvbdev->writers++; } - + dvbdev->users++; return 0; } @@ -163,7 +163,7 @@ int dvb_generic_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { struct dvb_device *dvbdev = file->private_data; - + if (!dvbdev) return -ENODEV; @@ -195,7 +195,7 @@ skip: } -int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, +int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, const struct dvb_device *template, void *priv, int type) { struct dvb_device *dvbdev; @@ -219,7 +219,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, } up (&dvbdev_register_lock); - + memcpy(dvbdev, template, sizeof(struct dvb_device)); dvbdev->type = type; dvbdev->id = id; @@ -231,7 +231,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, list_add_tail (&dvbdev->list_head, &adap->device_list); devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), - S_IFCHR | S_IRUSR | S_IWUSR, + S_IFCHR | S_IRUSR | S_IWUSR, "dvb/adapter%d/%s%d", adap->num, dnames[type], id); class_simple_device_add(dvb_class, MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), @@ -239,7 +239,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n", adap->num, dnames[type], id, nums2minor(adap->num, type, id), - nums2minor(adap->num, type, id)); + nums2minor(adap->num, type, id)); return 0; } @@ -306,7 +306,7 @@ int dvb_register_adapter(struct dvb_adapter **padap, const char *name, struct mo INIT_LIST_HEAD (&adap->device_list); printk ("DVB: registering new adapter (%s).\n", name); - + devfs_mk_dir("dvb/adapter%d", num); adap->num = num; adap->name = name; @@ -447,4 +447,3 @@ module_exit(exit_dvbdev); MODULE_DESCRIPTION("DVB Core Driver"); MODULE_AUTHOR("Marcus Metzler, Ralph Metzler, Holger Waechtler"); MODULE_LICENSE("GPL"); - diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.h b/linux/drivers/media/dvb/dvb-core/dvbdev.h index ef1f5f9d9..184edba3c 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.h +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h @@ -1,4 +1,4 @@ -/* +/* * dvbdev.h * * Copyright (C) 2000 Ralph Metzler & Marcus Metzler @@ -80,7 +80,7 @@ extern int dvb_register_adapter (struct dvb_adapter **padap, const char *name, s extern int dvb_unregister_adapter (struct dvb_adapter *adap); extern int dvb_register_device (struct dvb_adapter *adap, - struct dvb_device **pdvbdev, + struct dvb_device **pdvbdev, const struct dvb_device *template, void *priv, int type); @@ -100,6 +100,5 @@ extern int dvb_usercopy(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg, int (*func)(struct inode *inode, struct file *file, unsigned int cmd, void *arg)); - -#endif /* #ifndef _DVBDEV_H_ */ +#endif /* #ifndef _DVBDEV_H_ */ diff --git a/linux/drivers/media/dvb/frontends/at76c651.c b/linux/drivers/media/dvb/frontends/at76c651.c index 812d814dc..861876791 100644 --- a/linux/drivers/media/dvb/frontends/at76c651.c +++ b/linux/drivers/media/dvb/frontends/at76c651.c @@ -255,14 +255,6 @@ static int at76c651_set_inversion(struct at76c651_state* state, fe_spectral_inve return at76c651_writereg(state, 0x60, feciqinv); } - - - - - - - - static int at76c651_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { @@ -355,7 +347,6 @@ static int at76c651_read_snr(struct dvb_frontend* fe, u16* snr) ((at76c651_readreg(state, 0x8F) << 8) | at76c651_readreg(state, 0x90)); - return 0; } diff --git a/linux/drivers/media/dvb/frontends/at76c651.h b/linux/drivers/media/dvb/frontends/at76c651.h index 47fd9af48..34054df93 100644 --- a/linux/drivers/media/dvb/frontends/at76c651.h +++ b/linux/drivers/media/dvb/frontends/at76c651.h @@ -1,6 +1,6 @@ /* * at76c651.c - * + * * Atmel DVB-C Frontend Driver (at76c651) * * Copyright (C) 2001 fnbrd <fnbrd@gmx.de> @@ -41,7 +41,7 @@ struct at76c651_config int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); }; -extern struct dvb_frontend* at76c651_attach(const struct at76c651_config* config, +extern struct dvb_frontend* at76c651_attach(const struct at76c651_config* config, struct i2c_adapter* i2c); #endif // AT76C651_H diff --git a/linux/drivers/media/dvb/frontends/cx22700.c b/linux/drivers/media/dvb/frontends/cx22700.c index cddfe05a8..663002da3 100644 --- a/linux/drivers/media/dvb/frontends/cx22700.c +++ b/linux/drivers/media/dvb/frontends/cx22700.c @@ -230,16 +230,6 @@ static int cx22700_get_tps (struct cx22700_state* state, struct dvb_ofdm_paramet return 0; } - - - - - - - - - - static int cx22700_init (struct dvb_frontend* fe) { struct cx22700_state* state = (struct cx22700_state*) fe->demodulator_priv; @@ -409,11 +399,11 @@ error: static struct dvb_frontend_ops cx22700_ops = { .info = { - .name = "Conexant CX22700 DVB-T", - .type = FE_OFDM, - .frequency_min = 470000000, - .frequency_max = 860000000, - .frequency_stepsize = 166667, + .name = "Conexant CX22700 DVB-T", + .type = FE_OFDM, + .frequency_min = 470000000, + .frequency_max = 860000000, + .frequency_stepsize = 166667, .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | diff --git a/linux/drivers/media/dvb/frontends/cx22702.c b/linux/drivers/media/dvb/frontends/cx22702.c index 845a5a4cd..7bcff1c62 100644 --- a/linux/drivers/media/dvb/frontends/cx22702.c +++ b/linux/drivers/media/dvb/frontends/cx22702.c @@ -195,18 +195,6 @@ static int cx22702_get_tps (struct cx22702_state *state, struct dvb_ofdm_paramet return 0; } - - - - - - - - - - - - /* Talk to the demod, set the FEC, GUARD, QAM settings etc */ static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { @@ -259,7 +247,7 @@ static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_paramet return 0; } - /* manually programmed values */ + /* manually programmed values */ val=0; switch(p->u.ofdm.constellation) { case QPSK: val = (val&0xe7); break; @@ -332,7 +320,6 @@ static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_paramet return 0; } - /* Reset the demod hardware and reset all of the configuration registers to a default state. */ static int cx22702_init (struct dvb_frontend* fe) diff --git a/linux/drivers/media/dvb/frontends/cx24110.c b/linux/drivers/media/dvb/frontends/cx24110.c index 5121a8939..4bbffaae2 100644 --- a/linux/drivers/media/dvb/frontends/cx24110.c +++ b/linux/drivers/media/dvb/frontends/cx24110.c @@ -131,7 +131,6 @@ static int cx24110_writereg (struct cx24110_state* state, int reg, int data) return 0; } - static int cx24110_readreg (struct cx24110_state* state, u8 reg) { int ret; @@ -181,7 +180,6 @@ static int cx24110_set_inversion (struct cx24110_state* state, fe_spectral_inver return 0; } - static int cx24110_set_fec (struct cx24110_state* state, fe_code_rate_t fec) { /* fixme (low): error handling */ @@ -227,7 +225,6 @@ static int cx24110_set_fec (struct cx24110_state* state, fe_code_rate_t fec) return 0; } - static fe_code_rate_t cx24110_get_fec (struct cx24110_state* state) { int i; @@ -244,7 +241,6 @@ static fe_code_rate_t cx24110_get_fec (struct cx24110_state* state) } } - static int cx24110_set_symbolrate (struct cx24110_state* state, u32 srate) { /* fixme (low): add error handling */ @@ -317,17 +313,6 @@ dprintk("cx24110 debug: entering %s(%d)\n",__FUNCTION__,srate); } - - - - - - - - - - - int cx24110_pll_write (struct dvb_frontend* fe, u32 data) { struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; @@ -369,8 +354,6 @@ int cx24110_pll_write (struct dvb_frontend* fe, u32 data) return 0; } - - static int cx24110_initfe(struct dvb_frontend* fe) { struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; @@ -388,7 +371,6 @@ static int cx24110_initfe(struct dvb_frontend* fe) return 0; } - static int cx24110_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) { struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; @@ -531,7 +513,7 @@ static int cx24110_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par static int cx24110_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { - struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; + struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; s32 afc; unsigned sclk; /* cannot read back tuner settings (freq). Need to have some private storage */ @@ -558,7 +540,7 @@ static int cx24110_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par static int cx24110_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) { - struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; + struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; return cx24110_writereg(state,0x76,(cx24110_readreg(state,0x76)&~0x10)|(((tone==SEC_TONE_ON))?0x10:0)); } @@ -587,7 +569,7 @@ struct dvb_frontend* cx24110_attach(const struct cx24110_config* config, memcpy(&state->ops, &cx24110_ops, sizeof(struct dvb_frontend_ops)); state->lastber = 0; state->lastbler = 0; - state->lastesn0 = 0; + state->lastesn0 = 0; /* check if the demod is there */ ret = cx24110_readreg(state, 0x00); diff --git a/linux/drivers/media/dvb/frontends/dib3000-common.c b/linux/drivers/media/dvb/frontends/dib3000-common.c index 13ba61d53..1a4f1f7c2 100644 --- a/linux/drivers/media/dvb/frontends/dib3000-common.c +++ b/linux/drivers/media/dvb/frontends/dib3000-common.c @@ -9,6 +9,7 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,2=i2c,4=srch (|-able))."); #define deb_i2c(args...) dprintk(0x02,args) #define deb_srch(args...) dprintk(0x04,args) + int dib3000_read_reg(struct dib3000_state *state, u16 reg) { u8 wb[] = { ((reg >> 8) | 0x80) & 0xff, reg & 0xff }; @@ -17,10 +18,10 @@ int dib3000_read_reg(struct dib3000_state *state, u16 reg) { .addr = state->config.demod_address, .flags = 0, .buf = wb, .len = 2 }, { .addr = state->config.demod_address, .flags = I2C_M_RD, .buf = rb, .len = 2 }, }; - + if (i2c_transfer(state->i2c, msg, 2) != 2) deb_i2c("i2c read error\n"); - + deb_i2c("reading i2c bus (reg: %5d 0x%04x, val: %5d 0x%04x)\n",reg,reg, (rb[0] << 8) | rb[1],(rb[0] << 8) | rb[1]); @@ -33,8 +34,8 @@ int dib3000_write_reg(struct dib3000_state *state, u16 reg, u16 val) (reg >> 8) & 0xff, reg & 0xff, (val >> 8) & 0xff, val & 0xff, }; - struct i2c_msg msg[] = { - { .addr = state->config.demod_address, .flags = 0, .buf = b, .len = 4 } + struct i2c_msg msg[] = { + { .addr = state->config.demod_address, .flags = 0, .buf = b, .len = 4 } }; deb_i2c("writing i2c bus (reg: %5d 0x%04x, val: %5d 0x%04x)\n",reg,reg,val,val); @@ -55,7 +56,7 @@ int dib3000_search_status(u16 irq,u16 lock) deb_srch("auto search failed\n"); return 0; // auto search failed } - return -1; // try again + return -1; // try again } /* for auto search */ @@ -72,7 +73,7 @@ u16 dib3000_seq[2][2][2] = /* fft,gua, inv */ }; MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de"); -MODULE_DESCRIPTION("Common functions for the dib3000mb/dib3000mc dvb-frontend drivers"); +MODULE_DESCRIPTION("Common functions for the dib3000mb/dib3000mc dvb frontend drivers"); MODULE_LICENSE("GPL"); EXPORT_SYMBOL(dib3000_seq); diff --git a/linux/drivers/media/dvb/frontends/dib3000.h b/linux/drivers/media/dvb/frontends/dib3000.h index a5e21f6bb..80687c130 100644 --- a/linux/drivers/media/dvb/frontends/dib3000.h +++ b/linux/drivers/media/dvb/frontends/dib3000.h @@ -1,5 +1,5 @@ /* - * public header file of the frontend drivers for mobile DVB-T demodulators + * public header file of the frontend drivers for mobile DVB-T demodulators * DiBcom 3000M-B and DiBcom 3000P/M-C (http://www.dibcom.fr/) * * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) diff --git a/linux/drivers/media/dvb/frontends/dib3000mb.c b/linux/drivers/media/dvb/frontends/dib3000mb.c index 71bd57705..3beb4483a 100644 --- a/linux/drivers/media/dvb/frontends/dib3000mb.c +++ b/linux/drivers/media/dvb/frontends/dib3000mb.c @@ -20,6 +20,7 @@ * see Documentation/dvb/README.dibusb for more information * */ + #include <linux/config.h> #include <linux/kernel.h> #include <linux/version.h> @@ -41,7 +42,7 @@ static int debug; module_param(debug, int, 0644); MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=setfe,8=getfe (|-able))."); -#endif +#endif #define deb_info(args...) dprintk(0x01,args) #define deb_xfer(args...) dprintk(0x02,args) #define deb_setf(args...) dprintk(0x04,args) @@ -290,12 +291,12 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe, wr(DIB3000MB_REG_RESTART, DIB3000MB_RESTART_AUTO_SEARCH); wr(DIB3000MB_REG_RESTART, DIB3000MB_RESTART_OFF); - while ((search_state = + while ((search_state = dib3000_search_status( rd(DIB3000MB_REG_AS_IRQ_PENDING), - rd(DIB3000MB_REG_LOCK2_VALUE))) < 0 && as_count++ < 100) + rd(DIB3000MB_REG_LOCK2_VALUE))) < 0 && as_count++ < 100) msleep(1); - + deb_setf("search_state after autosearch %d after %d checks\n",search_state,as_count); if (search_state == 1) { @@ -430,7 +431,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe, fep->inversion = ((inv_test2 == 2) && (inv_test1==1 || inv_test1==0)) || - ((inv_test2 == 0) && (inv_test1==1 || inv_test1==2)) ? + ((inv_test2 == 0) && (inv_test1==1 || inv_test1==2)) ? INVERSION_ON : INVERSION_OFF; deb_getf("inversion %d %d, %d\n", inv_test2, inv_test1, fep->inversion); @@ -451,7 +452,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe, default: err("Unexpected constellation returned by TPS (%d)", tps_val); break; - } + } deb_getf("TPS: %d\n", tps_val); if (rd(DIB3000MB_REG_TPS_HRCH)) { @@ -480,7 +481,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe, break; } deb_getf("TPS: %d\n", tps_val); - + tps_val = rd(DIB3000MB_REG_TPS_CODE_RATE_LP); } else { deb_getf("HRCH OFF\n"); @@ -668,7 +669,7 @@ static int dib3000mb_pid_control(struct dvb_frontend *fe,int index, int pid,int return 0; } -static int dib3000mb_fifo_control(struct dvb_frontend *fe, int onoff) +static int dib3000mb_fifo_control(struct dvb_frontend *fe, int onoff) { struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; @@ -681,7 +682,7 @@ static int dib3000mb_fifo_control(struct dvb_frontend *fe, int onoff) return 0; } -static int dib3000mb_pid_parse(struct dvb_frontend *fe, int onoff) +static int dib3000mb_pid_parse(struct dvb_frontend *fe, int onoff) { struct dib3000_state *state = fe->demodulator_priv; deb_xfer("%s pid parsing\n",onoff ? "enabling" : "disabling"); @@ -718,12 +719,12 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, memcpy(&state->ops, &dib3000mb_ops, sizeof(struct dvb_frontend_ops)); /* check for the correct demod */ - if (rd(DIB3000_REG_MANUFACTOR_ID) != DIB3000_I2C_ID_DIBCOM) + if (rd(DIB3000_REG_MANUFACTOR_ID) != DIB3000_I2C_ID_DIBCOM) goto error; if (rd(DIB3000_REG_DEVICE_ID) != DIB3000MB_DEVICE_ID) goto error; - + /* create dvb_frontend */ state->frontend.ops = &state->ops; state->frontend.demodulator_priv = state; @@ -733,7 +734,7 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, xfer_ops->fifo_ctrl = dib3000mb_fifo_control; xfer_ops->pid_ctrl = dib3000mb_pid_control; xfer_ops->tuner_pass_ctrl = dib3000mb_tuner_pass_ctrl; - + return &state->frontend; error: @@ -741,14 +742,14 @@ error: kfree(state); return NULL; } - + static struct dvb_frontend_ops dib3000mb_ops = { .info = { .name = "DiBcom 3000M-B DVB-T", - .type = FE_OFDM, - .frequency_min = 44250000, - .frequency_max = 867250000, + .type = FE_OFDM, + .frequency_min = 44250000, + .frequency_max = 867250000, .frequency_stepsize = 62500, .caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | diff --git a/linux/drivers/media/dvb/frontends/dib3000mc.c b/linux/drivers/media/dvb/frontends/dib3000mc.c index 9bed3dd05..76707bfca 100644 --- a/linux/drivers/media/dvb/frontends/dib3000mc.c +++ b/linux/drivers/media/dvb/frontends/dib3000mc.c @@ -51,7 +51,7 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=setfe,8=getfe,16=s static int dib3000mc_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr); static int dib3000mc_set_impulse_noise(struct dib3000_state * state, int mode, - fe_transmit_mode_t transmission_mode, fe_bandwidth_t bandwidth) + fe_transmit_mode_t transmission_mode, fe_bandwidth_t bandwidth) { switch (transmission_mode) { case TRANSMISSION_MODE_2K: @@ -60,13 +60,13 @@ static int dib3000mc_set_impulse_noise(struct dib3000_state * state, int mode, case TRANSMISSION_MODE_8K: wr_foreach(dib3000mc_reg_fft,dib3000mc_fft_modes[1]); break; - default: + default: break; } switch (bandwidth) { /* case BANDWIDTH_5_MHZ: - wr_foreach(dib3000mc_reg_impulse_noise,dib3000mc_impluse_noise[0]); + wr_foreach(dib3000mc_reg_impulse_noise,dib3000mc_impluse_noise[0]); break; */ case BANDWIDTH_6_MHZ: wr_foreach(dib3000mc_reg_impulse_noise,dib3000mc_impluse_noise[1]); @@ -77,12 +77,12 @@ static int dib3000mc_set_impulse_noise(struct dib3000_state * state, int mode, case BANDWIDTH_8_MHZ: wr_foreach(dib3000mc_reg_impulse_noise,dib3000mc_impluse_noise[3]); break; - default: + default: break; } switch (mode) { - case 0: /* no impulse */ /* fall through */ + case 0: /* no impulse */ /* fall through */ wr_foreach(dib3000mc_reg_imp_noise_ctl,dib3000mc_imp_noise_ctl[0]); break; case 1: /* new algo */ @@ -107,14 +107,14 @@ static int dib3000mc_set_timing(struct dib3000_state *state, int upd_offset, case BANDWIDTH_8_MHZ: comp = DIB3000MC_CLOCK_REF*8; break; case BANDWIDTH_7_MHZ: comp = DIB3000MC_CLOCK_REF*7; break; case BANDWIDTH_6_MHZ: comp = DIB3000MC_CLOCK_REF*6; break; - default: err("unknown bandwidth (%d)",bw); break; + default: err("unknown bandwidth (%d)",bw); break; } timf_msb = (comp >> 16) & 0xff; timf_lsb = (comp & 0xffff); // Update the timing offset ; if (upd_offset > 0) { - if (!state->timing_offset_comp_done) { + if (!state->timing_offset_comp_done) { msleep(200); state->timing_offset_comp_done = 1; } @@ -128,11 +128,11 @@ static int dib3000mc_set_timing(struct dib3000_state *state, int upd_offset, tim_offset = state->timing_offset; if (tim_offset < 0) { - tim_sgn = 1; + tim_sgn = 1; tim_offset = -tim_offset; - } else + } else tim_sgn = 0; - + comp1 = (u32)tim_offset * (u32)timf_lsb ; comp2 = (u32)tim_offset * (u32)timf_msb ; comp = ((comp1 >> 16) + comp2) >> 7; @@ -141,7 +141,7 @@ static int dib3000mc_set_timing(struct dib3000_state *state, int upd_offset, comp = (u32)(timf_msb << 16) + (u32) timf_lsb + comp; else comp = (u32)(timf_msb << 16) + (u32) timf_lsb - comp ; - + timf_msb = (comp >> 16) & 0xff; timf_lsb = comp & 0xffff; @@ -177,7 +177,7 @@ static int dib3000mc_init_auto_scan(struct dib3000_state *state, fe_bandwidth_t return -EINVAL; } if (boost) { - u32 timeout = (rd(DIB3000MC_REG_BW_TIMOUT_MSB) << 16) + + u32 timeout = (rd(DIB3000MC_REG_BW_TIMOUT_MSB) << 16) + rd(DIB3000MC_REG_BW_TIMOUT_LSB); timeout *= 85; timeout >>= 7; wr(DIB3000MC_REG_BW_TIMOUT_MSB,(timeout >> 16) & 0xffff); @@ -189,13 +189,13 @@ static int dib3000mc_init_auto_scan(struct dib3000_state *state, fe_bandwidth_t static int dib3000mc_set_adp_cfg(struct dib3000_state *state, fe_modulation_t con) { switch (con) { - case QAM_64: + case QAM_64: wr_foreach(dib3000mc_reg_adp_cfg,dib3000mc_adp_cfg[2]); break; - case QAM_16: + case QAM_16: wr_foreach(dib3000mc_reg_adp_cfg,dib3000mc_adp_cfg[1]); break; - case QPSK: + case QPSK: wr_foreach(dib3000mc_reg_adp_cfg,dib3000mc_adp_cfg[0]); break; case QAM_AUTO: @@ -237,7 +237,7 @@ static int dib3000mc_set_general_cfg(struct dib3000_state *state, struct dvb_fro } switch (ofdm->hierarchy_information) { case HIERARCHY_NONE: /* fall through */ - case HIERARCHY_1: alpha = DIB3000_ALPHA_1; break; + case HIERARCHY_1: alpha = DIB3000_ALPHA_1; break; case HIERARCHY_2: alpha = DIB3000_ALPHA_2; break; case HIERARCHY_4: alpha = DIB3000_ALPHA_4; break; case HIERARCHY_AUTO: break; @@ -262,7 +262,7 @@ static int dib3000mc_set_general_cfg(struct dib3000_state *state, struct dvb_fro case FEC_AUTO: break; default: return -EINVAL; } - + wr(DIB3000MC_REG_DEMOD_PARM,DIB3000MC_DEMOD_PARM(alpha,qam,guard,fft)); wr(DIB3000MC_REG_HRCH_PARM,DIB3000MC_HRCH_PARM(sel_hp,cr,hrch)); @@ -327,14 +327,14 @@ static int dib3000mc_get_frontend(struct dvb_frontend* fe, fep->inversion = ((inv_test2 == 2) && (inv_test1==1 || inv_test1==0)) || - ((inv_test2 == 0) && (inv_test1==1 || inv_test1==2)) ? + ((inv_test2 == 0) && (inv_test1==1 || inv_test1==2)) ? INVERSION_ON : INVERSION_OFF; deb_getf("inversion %d %d, %d\n", inv_test2, inv_test1, fep->inversion); fep->frequency = state->last_tuned_freq; fep->u.ofdm.bandwidth= state->last_tuned_bw; - + tps_val = rd(DIB3000MC_REG_TUNING_PARM); switch (DIB3000MC_TP_QAM(tps_val)) { @@ -353,7 +353,7 @@ static int dib3000mc_get_frontend(struct dvb_frontend* fe, default: err("Unexpected constellation returned by TPS (%d)", tps_val); break; - } + } if (DIB3000MC_TP_HRCH(tps_val)) { deb_getf("HRCH ON "); @@ -462,12 +462,12 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; int search_state,auto_val; u16 val; - + if (tuner) { /* initial call from dvb */ dib3000mc_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe)); state->config.pll_set(fe,fep,NULL); dib3000mc_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe)); - + state->last_tuned_freq = fep->frequency; // if (!scanboost) { dib3000mc_set_timing(state,0,ofdm->transmission_mode,ofdm->bandwidth); @@ -477,7 +477,7 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth); wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_AGC); wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_OFF); - + /* Default cfg isi offset adp */ wr_foreach(dib3000mc_reg_offset,dib3000mc_offset[0]); @@ -495,7 +495,7 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, auto_val = 0; dib3000mc_set_general_cfg(state,fep,&auto_val); dib3000mc_set_impulse_noise(state,0,ofdm->constellation,ofdm->bandwidth); - + val = rd(DIB3000MC_REG_DEMOD_PARM); wr(DIB3000MC_REG_DEMOD_PARM,val|DIB3000MC_DEMOD_RST_DEMOD_ON); wr(DIB3000MC_REG_DEMOD_PARM,val); @@ -507,17 +507,17 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, int as_count=0; deb_setf("autosearch enabled.\n"); - + val = rd(DIB3000MC_REG_DEMOD_PARM); wr(DIB3000MC_REG_DEMOD_PARM,val | DIB3000MC_DEMOD_RST_AUTO_SRCH_ON); wr(DIB3000MC_REG_DEMOD_PARM,val); while ((search_state = dib3000_search_status( - rd(DIB3000MC_REG_AS_IRQ),1)) < 0 && as_count++ < 100) + rd(DIB3000MC_REG_AS_IRQ),1)) < 0 && as_count++ < 100) msleep(10); - + deb_info("search_state after autosearch %d after %d checks\n",search_state,as_count); - + if (search_state == 1) { struct dvb_frontend_parameters feps; if (dib3000mc_get_frontend(fe, &feps) == 0) { @@ -529,33 +529,31 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, dib3000mc_set_impulse_noise(state,0,ofdm->transmission_mode,ofdm->bandwidth); wr(DIB3000MC_REG_ISI,DIB3000MC_ISI_DEFAULT|DIB3000MC_ISI_ACTIVATE); dib3000mc_set_adp_cfg(state,ofdm->constellation); - + /* set_offset_cfg */ wr_foreach(dib3000mc_reg_offset, dib3000mc_offset[(ofdm->transmission_mode == TRANSMISSION_MODE_8K)+1]); } } else { /* second call, after autosearch (fka: set_WithKnownParams) */ // dib3000mc_set_timing(state,1,ofdm->transmission_mode,ofdm->bandwidth); - + auto_val = 0; dib3000mc_set_general_cfg(state,fep,&auto_val); if (auto_val) deb_info("auto_val is true, even though an auto search was already performed.\n"); dib3000mc_set_impulse_noise(state,0,ofdm->constellation,ofdm->bandwidth); - + val = rd(DIB3000MC_REG_DEMOD_PARM); wr(DIB3000MC_REG_DEMOD_PARM,val | DIB3000MC_DEMOD_RST_AUTO_SRCH_ON); wr(DIB3000MC_REG_DEMOD_PARM,val); - + msleep(30); - + wr(DIB3000MC_REG_ISI,DIB3000MC_ISI_DEFAULT|DIB3000MC_ISI_ACTIVATE); dib3000mc_set_adp_cfg(state,ofdm->constellation); wr_foreach(dib3000mc_reg_offset, dib3000mc_offset[(ofdm->transmission_mode == TRANSMISSION_MODE_8K)+1]); - - } return 0; } @@ -567,26 +565,26 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) state->timing_offset = 0; state->timing_offset_comp_done = 0; - + wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_CONFIG); wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_OFF); wr(DIB3000MC_REG_CLK_CFG_1,DIB3000MC_CLK_CFG_1_POWER_UP); wr(DIB3000MC_REG_CLK_CFG_2,DIB3000MC_CLK_CFG_2_PUP_MOBILE); wr(DIB3000MC_REG_CLK_CFG_3,DIB3000MC_CLK_CFG_3_POWER_UP); wr(DIB3000MC_REG_CLK_CFG_7,DIB3000MC_CLK_CFG_7_INIT); - + wr(DIB3000MC_REG_RST_UNC,DIB3000MC_RST_UNC_OFF); wr(DIB3000MC_REG_UNK_19,DIB3000MC_UNK_19); wr(33,5); wr(36,81); - wr(DIB3000MC_REG_UNK_88,DIB3000MC_UNK_88); - + wr(DIB3000MC_REG_UNK_88,DIB3000MC_UNK_88); + wr(DIB3000MC_REG_UNK_99,DIB3000MC_UNK_99); wr(DIB3000MC_REG_UNK_111,DIB3000MC_UNK_111_PH_N_MODE_0); /* phase noise algo off */ /* mobile mode - portable reception */ - wr_foreach(dib3000mc_reg_mobile_mode,dib3000mc_mobile_mode[1]); + wr_foreach(dib3000mc_reg_mobile_mode,dib3000mc_mobile_mode[1]); /* TUNER_PANASONIC_ENV57H12D5: */ wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth); @@ -599,24 +597,24 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) wr(DIB3000MC_REG_UNK_2,DIB3000MC_UNK_2); wr(DIB3000MC_REG_UNK_3,DIB3000MC_UNK_3); wr(DIB3000MC_REG_SEQ_TPS,DIB3000MC_SEQ_TPS_DEFAULT); - + wr_foreach(dib3000mc_reg_bandwidth,dib3000mc_bandwidth_8mhz); wr_foreach(dib3000mc_reg_bandwidth_general,dib3000mc_bandwidth_general); - + wr(DIB3000MC_REG_UNK_4,DIB3000MC_UNK_4); wr(DIB3000MC_REG_SET_DDS_FREQ_MSB,DIB3000MC_DDS_FREQ_MSB_INV_OFF); wr(DIB3000MC_REG_SET_DDS_FREQ_LSB,DIB3000MC_DDS_FREQ_LSB); - dib3000mc_set_timing(state,0,TRANSMISSION_MODE_8K,BANDWIDTH_8_MHZ); + dib3000mc_set_timing(state,0,TRANSMISSION_MODE_8K,BANDWIDTH_8_MHZ); // wr_foreach(dib3000mc_reg_timing_freq,dib3000mc_timing_freq[3]); - + wr(DIB3000MC_REG_UNK_120,DIB3000MC_UNK_120); wr(DIB3000MC_REG_UNK_134,DIB3000MC_UNK_134); wr(DIB3000MC_REG_FEC_CFG,DIB3000MC_FEC_CFG); - + wr(DIB3000MC_REG_DIVERSITY3,DIB3000MC_DIVERSITY3_IN_OFF); - + dib3000mc_set_impulse_noise(state,0,TRANSMISSION_MODE_8K,BANDWIDTH_8_MHZ); /* output mode control, just the MPEG2_SLAVE */ @@ -632,13 +630,13 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) rd(DIB3000MC_REG_OUTMODE))); wr(DIB3000MC_REG_SMO_MODE, - DIB3000MC_SMO_MODE_DEFAULT | + DIB3000MC_SMO_MODE_DEFAULT | DIB3000MC_SMO_MODE_188); wr(DIB3000MC_REG_FIFO_THRESHOLD,DIB3000MC_FIFO_THRESHOLD_DEFAULT); wr(DIB3000MC_REG_ELEC_OUT,DIB3000MC_ELEC_OUT_DIV_OUT_ON); */ - + /* diversity */ wr(DIB3000MC_REG_DIVERSITY1,DIB3000MC_DIVERSITY1_DEFAULT); wr(DIB3000MC_REG_DIVERSITY2,DIB3000MC_DIVERSITY2_DEFAULT); @@ -708,14 +706,14 @@ static int dib3000mc_read_snr(struct dvb_frontend* fe, u16 *snr) u16 val = rd(DIB3000MC_REG_SIGNAL_NOISE_LSB), val2 = rd(DIB3000MC_REG_SIGNAL_NOISE_MSB); u16 sig,noise; - + sig = (((val >> 6) & 0xff) << 8) + (val & 0x3f); noise = (((val >> 4) & 0xff) << 8) + ((val & 0xf) << 2) + ((val2 >> 14) & 0x3); if (noise == 0) *snr = 0xffff; else *snr = (u16) sig/noise; - + deb_stat("signal: mantisse = %d, exponent = %d\n",(sig >> 8) & 0xff, sig & 0xff); deb_stat("noise: mantisse = %d, exponent = %d\n",(noise >> 8) & 0xff, noise & 0xff); deb_stat("snr: %d\n",*snr); @@ -753,7 +751,7 @@ static int dib3000mc_set_frontend_and_tuner(struct dvb_frontend* fe, struct dvb_ } static void dib3000mc_release(struct dvb_frontend* fe) -{ +{ struct dib3000_state *state = (struct dib3000_state *) fe->demodulator_priv; kfree(state); } @@ -771,9 +769,9 @@ static int dib3000mc_fifo_control(struct dvb_frontend *fe, int onoff) { struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; u16 tmp = rd(DIB3000MC_REG_SMO_MODE); - + deb_xfer("%s fifo\n",onoff ? "enabling" : "disabling"); - + if (onoff) { deb_xfer("%d %x\n",tmp & DIB3000MC_SMO_MODE_FIFO_UNFLUSH,tmp & DIB3000MC_SMO_MODE_FIFO_UNFLUSH); wr(DIB3000MC_REG_SMO_MODE,tmp & DIB3000MC_SMO_MODE_FIFO_UNFLUSH); @@ -784,13 +782,13 @@ static int dib3000mc_fifo_control(struct dvb_frontend *fe, int onoff) return 0; } -static int dib3000mc_pid_parse(struct dvb_frontend *fe, int onoff) +static int dib3000mc_pid_parse(struct dvb_frontend *fe, int onoff) { struct dib3000_state *state = fe->demodulator_priv; u16 tmp = rd(DIB3000MC_REG_SMO_MODE); - + deb_xfer("%s pid parsing\n",onoff ? "enabling" : "disabling"); - + if (onoff) { wr(DIB3000MC_REG_SMO_MODE,tmp | DIB3000MC_SMO_MODE_PID_PARSE); } else { @@ -810,7 +808,7 @@ static int dib3000mc_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_ return 0; } -static int dib3000mc_demod_init(struct dib3000_state *state) +static int dib3000mc_demod_init(struct dib3000_state *state) { u16 default_addr = 0x0a; /* first init */ @@ -818,13 +816,13 @@ static int dib3000mc_demod_init(struct dib3000_state *state) deb_info("initializing the demod the first time. Setting demod addr to 0x%x\n",default_addr); wr(DIB3000MC_REG_ELEC_OUT,DIB3000MC_ELEC_OUT_DIV_OUT_ON); wr(DIB3000MC_REG_OUTMODE,DIB3000MC_OM_PAR_CONT_CLK); - + wr(DIB3000MC_REG_RST_I2C_ADDR, DIB3000MC_DEMOD_ADDR(default_addr) | DIB3000MC_DEMOD_ADDR_ON); - + state->config.demod_address = default_addr; - + wr(DIB3000MC_REG_RST_I2C_ADDR, DIB3000MC_DEMOD_ADDR(default_addr)); } else @@ -852,13 +850,13 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, memcpy(&state->ops, &dib3000mc_ops, sizeof(struct dvb_frontend_ops)); /* check for the correct demod */ - if (rd(DIB3000_REG_MANUFACTOR_ID) != DIB3000_I2C_ID_DIBCOM) + if (rd(DIB3000_REG_MANUFACTOR_ID) != DIB3000_I2C_ID_DIBCOM) goto error; devid = rd(DIB3000_REG_DEVICE_ID); if (devid != DIB3000MC_DEVICE_ID && devid != DIB3000P_DEVICE_ID) goto error; - + switch (devid) { case DIB3000MC_DEVICE_ID: info("Found a DiBcom 3000M-C, interesting..."); @@ -879,7 +877,7 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, xfer_ops->tuner_pass_ctrl = dib3000mc_tuner_pass_ctrl; dib3000mc_demod_init(state); - + return &state->frontend; error: @@ -887,20 +885,20 @@ error: kfree(state); return NULL; } - + static struct dvb_frontend_ops dib3000mc_ops = { .info = { .name = "DiBcom 3000P/M-C DVB-T", - .type = FE_OFDM, - .frequency_min = 44250000, - .frequency_max = 867250000, + .type = FE_OFDM, + .frequency_min = 44250000, + .frequency_max = 867250000, .frequency_stepsize = 62500, .caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | - FE_CAN_TRANSMISSION_MODE_AUTO | + FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_RECOVER | FE_CAN_HIERARCHY_AUTO, diff --git a/linux/drivers/media/dvb/frontends/dib3000mc_priv.h b/linux/drivers/media/dvb/frontends/dib3000mc_priv.h index 178403da1..2930aac75 100644 --- a/linux/drivers/media/dvb/frontends/dib3000mc_priv.h +++ b/linux/drivers/media/dvb/frontends/dib3000mc_priv.h @@ -1,12 +1,12 @@ /* * dib3000mc_priv.h - * + * * Copyright (C) 2004 Patrick Boettcher (patrick.boettcher@desy.de) - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, version 2. - * + * * for more information see dib3000mc.c . */ @@ -15,10 +15,10 @@ /* * Demodulator parameters - * reg: 0 1 1 1 11 11 111 + * reg: 0 1 1 1 11 11 111 * | | | | | | * | | | | | +-- alpha (000=0, 001=1, 010=2, 100=4) - * | | | | +----- constellation (00=QPSK, 01=16QAM, 10=64QAM) + * | | | | +----- constellation (00=QPSK, 01=16QAM, 10=64QAM) * | | | +-------- guard (00=1/32, 01=1/16, 10=1/8, 11=1/4) * | | +----------- transmission mode (0=2k, 1=8k) * | | @@ -49,7 +49,7 @@ (0x1 & s) | \ ((0x7 & f) << 1) | \ ((0x1 & h) << 4) ) - + /* timeout ??? */ #define DIB3000MC_REG_UNK_1 ( 1) #define DIB3000MC_UNK_1 ( 0x04) @@ -74,16 +74,16 @@ #define DIB3000MC_IS_TPS(v) ((v << 8) & 0x1) #define DIB3000MC_IS_AS(v) ((v >> 4) & 0xf) -/* parameters for the bandwidth */ +/* parameters for the bandwidth */ #define DIB3000MC_REG_BW_TIMOUT_MSB ( 6) #define DIB3000MC_REG_BW_TIMOUT_LSB ( 7) static u16 dib3000mc_reg_bandwidth[] = { 6,7,8,9,10,11,16,17 }; -/*static u16 dib3000mc_bandwidth_5mhz[] = +/*static u16 dib3000mc_bandwidth_5mhz[] = { 0x28, 0x9380, 0x87, 0x4100, 0x2a4, 0x4500, 0x1, 0xb0d0 };*/ -static u16 dib3000mc_bandwidth_6mhz[] = +static u16 dib3000mc_bandwidth_6mhz[] = { 0x21, 0xd040, 0x70, 0xb62b, 0x233, 0x8ed5, 0x1, 0xb0d0 }; static u16 dib3000mc_bandwidth_7mhz[] = @@ -107,7 +107,7 @@ static u16 dib3000mc_bandwidth_general[] = { 0x0000, 0x03e8, 0x0000, 0x03f2 }; #define DIB3000MC_REG_UNK_19 ( 19) #define DIB3000MC_UNK_19 ( 0) -/* DDS frequency value (IF position) and inversion bit */ +/* DDS frequency value (IF position) and inversion bit */ #define DIB3000MC_REG_INVERSION ( 21) #define DIB3000MC_REG_SET_DDS_FREQ_MSB ( 21) #define DIB3000MC_DDS_FREQ_MSB_INV_OFF (0x0164) @@ -125,7 +125,7 @@ static u16 dib3000mc_bandwidth_general[] = { 0x0000, 0x03e8, 0x0000, 0x03f2 }; //static u16 dib3000mc_timing_freq[][2] = { // { 0x69, 0x9f18 }, /* 5 MHz */ -// { 0x7e ,0xbee9 }, /* 6 MHz */ +// { 0x7e ,0xbee9 }, /* 6 MHz */ // { 0x93 ,0xdebb }, /* 7 MHz */ // { 0xa8 ,0xfe8c }, /* 8 MHz */ //}; @@ -155,7 +155,7 @@ static u16 dib3000mc_imp_noise_ctl[][2] = { { 0x1294, 0x1ff8 }, /* mode 4 */ }; -/* AGC registers */ +/* AGC registers */ static u16 dib3000mc_reg_agc[] = { 36,37,38,39,42,43,44,45,46,47,48,49 }; @@ -164,8 +164,8 @@ static u16 dib3000mc_agc_tuner[][12] = { { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xcf5c, 0x6666, 0xbae1, 0xa148, 0x3b5e, 0x3c1c, 0x001a, 0x2019 }, /* TUNER_PANASONIC_ENV77H04D5, */ - - { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xdc29, 0x570a, + + { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xdc29, 0x570a, 0xbae1, 0x8ccd, 0x3b6d, 0x551d, 0x000a, 0x951e }, /* TUNER_PANASONIC_ENV57H13D5, TUNER_PANASONIC_ENV57H12D5 */ @@ -184,10 +184,10 @@ static u16 dib3000mc_reg_agc_bandwidth[] = { 40,41 }; static u16 dib3000mc_agc_bandwidth[] = { 0x119,0x330 }; static u16 dib3000mc_reg_agc_bandwidth_general[] = { 50,51,52,53,54 }; -static u16 dib3000mc_agc_bandwidth_general[] = +static u16 dib3000mc_agc_bandwidth_general[] = { 0x8000, 0x91ca, 0x01ba, 0x0087, 0x0087 }; -#define DIB3000MC_REG_IMP_NOISE_55 ( 55) +#define DIB3000MC_REG_IMP_NOISE_55 ( 55) #define DIB3000MC_IMP_NEW_ALGO(w) (w | (1<<10)) /* Impulse noise params */ @@ -202,26 +202,26 @@ static u16 dib3000mc_impluse_noise[][3] = { static u16 dib3000mc_reg_fft[] = { 58,59,60,61,62,63,64,65,66,67,68,69, 70,71,72,73,74,75,76,77,78,79,80,81, - 82,83,84,85,86 + 82,83,84,85,86 }; static u16 dib3000mc_fft_modes[][29] = { - { 0x38, 0x6d9, 0x3f28, 0x7a7, 0x3a74, 0x196, 0x32a, 0x48c, - 0x3ffe, 0x7f3, 0x2d94, 0x76, 0x53d, - 0x3ff8, 0x7e3, 0x3320, 0x76, 0x5b3, - 0x3feb, 0x7d2, 0x365e, 0x76, 0x48c, - 0x3ffe, 0x5b3, 0x3feb, 0x76, 0x0, 0xd + { 0x38, 0x6d9, 0x3f28, 0x7a7, 0x3a74, 0x196, 0x32a, 0x48c, + 0x3ffe, 0x7f3, 0x2d94, 0x76, 0x53d, + 0x3ff8, 0x7e3, 0x3320, 0x76, 0x5b3, + 0x3feb, 0x7d2, 0x365e, 0x76, 0x48c, + 0x3ffe, 0x5b3, 0x3feb, 0x76, 0x0, 0xd }, /* fft mode 0 */ { 0x3b, 0x6d9, 0x3f28, 0x7a7, 0x3a74, 0x196, 0x32a, 0x48c, - 0x3ffe, 0x7f3, 0x2d94, 0x76, 0x53d, - 0x3ff8, 0x7e3, 0x3320, 0x76, 0x5b3, - 0x3feb, 0x7d2, 0x365e, 0x76, 0x48c, - 0x3ffe, 0x5b3, 0x3feb, 0x0, 0x8200, 0xd + 0x3ffe, 0x7f3, 0x2d94, 0x76, 0x53d, + 0x3ff8, 0x7e3, 0x3320, 0x76, 0x5b3, + 0x3feb, 0x7d2, 0x365e, 0x76, 0x48c, + 0x3ffe, 0x5b3, 0x3feb, 0x0, 0x8200, 0xd }, /* fft mode 1 */ }; #define DIB3000MC_REG_UNK_88 ( 88) -#define DIB3000MC_UNK_88 (0x0410) +#define DIB3000MC_UNK_88 (0x0410) static u16 dib3000mc_reg_bw[] = { 93,94,95,96,97,98 }; static u16 dib3000mc_bw[][6] = { @@ -261,7 +261,7 @@ static u16 dib3000mc_bw[][6] = { /* adapter config for constellation */ static u16 dib3000mc_reg_adp_cfg[] = { 129, 130, 131, 132 }; -static u16 dib3000mc_adp_cfg[][4] = { +static u16 dib3000mc_adp_cfg[][4] = { { 0x99a, 0x7fae, 0x333, 0x7ff0 }, /* QPSK */ { 0x23d, 0x7fdf, 0x0a4, 0x7ff0 }, /* 16-QAM */ { 0x148, 0x7ff0, 0x0a4, 0x7ff8 }, /* 64-QAM */ @@ -299,7 +299,7 @@ static u16 dib3000mc_mobile_mode[][5] = { * |||| +---- fifo_ctrl (1 = inhibit (flushed), 0 = active (unflushed)) * |||+------ pid_parse (1 = enabled, 0 = disabled) * ||+------- outp_188 (1 = TS packet size 188, 0 = packet size 204) - * |+-------- unk + * |+-------- unk * +--------- unk */ diff --git a/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c b/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c index 8e94d99f3..375d6f3b4 100644 --- a/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c +++ b/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c @@ -27,14 +27,12 @@ #include "dvb_dummy_fe.h" - struct dvb_dummy_fe_state { - struct dvb_frontend_ops ops; - struct dvb_frontend frontend; }; + static int dvb_dummy_fe_read_status(struct dvb_frontend* fe, fe_status_t* status) { *status = FE_HAS_SIGNAL @@ -179,9 +177,9 @@ static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = { .info = { .name = "Dummy DVB-T", - .type = FE_OFDM, - .frequency_min = 0, - .frequency_max = 863250000, + .type = FE_OFDM, + .frequency_min = 0, + .frequency_max = 863250000, .frequency_stepsize = 62500, .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | @@ -211,12 +209,12 @@ static struct dvb_frontend_ops dvb_dummy_fe_qam_ops = { .info = { .name = "Dummy DVB-C", - .type = FE_QAM, + .type = FE_QAM, .frequency_stepsize = 62500, - .frequency_min = 51000000, - .frequency_max = 858000000, - .symbol_rate_min = (57840000/2)/64, /* SACLK/64 == (XIN/2)/64 */ - .symbol_rate_max = (57840000/2)/4, /* SACLK/4 */ + .frequency_min = 51000000, + .frequency_max = 858000000, + .symbol_rate_min = (57840000/2)/64, /* SACLK/64 == (XIN/2)/64 */ + .symbol_rate_max = (57840000/2)/4, /* SACLK/4 */ .caps = FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 | FE_CAN_QAM_128 | FE_CAN_QAM_256 | FE_CAN_FEC_AUTO | FE_CAN_INVERSION_AUTO @@ -240,14 +238,14 @@ static struct dvb_frontend_ops dvb_dummy_fe_qam_ops = { static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = { .info = { - .name = "Dummy DVB-S", - .type = FE_QPSK, - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 250, /* kHz for QPSK frontends */ - .frequency_tolerance = 29500, - .symbol_rate_min = 1000000, - .symbol_rate_max = 45000000, + .name = "Dummy DVB-S", + .type = FE_QPSK, + .frequency_min = 950000, + .frequency_max = 2150000, + .frequency_stepsize = 250, /* kHz for QPSK frontends */ + .frequency_tolerance = 29500, + .symbol_rate_min = 1000000, + .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | @@ -269,7 +267,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = { .read_ucblocks = dvb_dummy_fe_read_ucblocks, .set_voltage = dvb_dummy_fe_set_voltage, - .set_tone = dvb_dummy_fe_set_tone, + .set_tone = dvb_dummy_fe_set_tone, }; MODULE_DESCRIPTION("DVB DUMMY Frontend"); diff --git a/linux/drivers/media/dvb/frontends/l64781.c b/linux/drivers/media/dvb/frontends/l64781.c index 9d2a98194..66e7426d0 100644 --- a/linux/drivers/media/dvb/frontends/l64781.c +++ b/linux/drivers/media/dvb/frontends/l64781.c @@ -31,17 +31,13 @@ struct l64781_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - const struct l64781_config* config; - struct dvb_frontend frontend; /* private demodulator data */ - int first:1; + int first:1; }; #define dprintk(args...) \ @@ -543,7 +539,7 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config, /* Responds to all reads with 0 */ if (l64781_readreg(state, 0x1a) != 0) { - dprintk("Read 1 returned unexpcted value\n"); + dprintk("Read 1 returned unexpcted value\n"); goto error; } @@ -552,7 +548,7 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config, /* Responds with register default value */ if (l64781_readreg(state, 0x1a) != 0xa1) { - dprintk("Read 2 returned unexpcted value\n"); + dprintk("Read 2 returned unexpcted value\n"); goto error; } @@ -580,10 +576,10 @@ static struct dvb_frontend_ops l64781_ops = { .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | - FE_CAN_MUTE_TS + FE_CAN_MUTE_TS }, - .release = l64781_release, + .release = l64781_release, .init = l64781_init, .sleep = l64781_sleep, diff --git a/linux/drivers/media/dvb/frontends/mt312.c b/linux/drivers/media/dvb/frontends/mt312.c index 4f4fef72a..9880b3742 100644 --- a/linux/drivers/media/dvb/frontends/mt312.c +++ b/linux/drivers/media/dvb/frontends/mt312.c @@ -36,14 +36,10 @@ struct mt312_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct mt312_config* config; - struct dvb_frontend frontend; u8 id; @@ -228,20 +224,6 @@ static int mt312_get_code_rate(struct mt312_state* state, fe_code_rate_t *cr) return 0; } - - - - - - - - - - - - - - static int mt312_initfe(struct dvb_frontend* fe) { struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; @@ -716,7 +698,7 @@ static struct dvb_frontend_ops vp310_mt312_ops = { FE_CAN_RECOVER }, - .release = mt312_release, + .release = mt312_release, .init = mt312_initfe, .sleep = mt312_sleep, diff --git a/linux/drivers/media/dvb/frontends/mt312_priv.h b/linux/drivers/media/dvb/frontends/mt312_priv.h index 1ddff687e..5e0b95b53 100644 --- a/linux/drivers/media/dvb/frontends/mt312_priv.h +++ b/linux/drivers/media/dvb/frontends/mt312_priv.h @@ -1,4 +1,4 @@ -/* +/* Driver for Zarlink MT312 QPSK Frontend Copyright (C) 2003 Andreas Oberritter <obi@linuxtv.org> diff --git a/linux/drivers/media/dvb/frontends/mt352.c b/linux/drivers/media/dvb/frontends/mt352.c index 3c82909ea..7e29a25c1 100644 --- a/linux/drivers/media/dvb/frontends/mt352.c +++ b/linux/drivers/media/dvb/frontends/mt352.c @@ -68,16 +68,16 @@ static int mt352_single_write(struct dvb_frontend *fe, u8 reg, u8 val) printk("mt352_write() to reg %x failed (err = %d)!\n", reg, err); return err; } - return 0; + return 0; } int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen) { int err,i; for (i=0; i < ilen-1; i++) - if ((err = mt352_single_write(fe,ibuf[0]+i,ibuf[i+1]))) + if ((err = mt352_single_write(fe,ibuf[0]+i,ibuf[i+1]))) return err; - + return 0; } @@ -108,7 +108,7 @@ int mt352_read(struct dvb_frontend *fe, u8 reg) { return mt352_read_register(fe->demodulator_priv,reg); } - + static int mt352_sleep(struct dvb_frontend* fe) { static u8 mt352_softdown[] = { CLOCK_CTL, 0x20, 0x08 }; diff --git a/linux/drivers/media/dvb/frontends/nxt2002.c b/linux/drivers/media/dvb/frontends/nxt2002.c index 55a4a5961..ff3b261fd 100644 --- a/linux/drivers/media/dvb/frontends/nxt2002.c +++ b/linux/drivers/media/dvb/frontends/nxt2002.c @@ -1,5 +1,5 @@ /* - Support for B2C2/BBTI Technisat Air2PC - ATSC + Support for B2C2/BBTI Technisat Air2PC - ATSC Copyright (C) 2004 Taylor Jacob <rtjacob@earthlink.net> @@ -59,7 +59,7 @@ static int i2c_writebytes (struct nxt2002_state* state, u8 reg, u8 *buf, u8 len) u8 buf2 [256],x; int err; struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf2, .len = len + 1 }; - + buf2[0] = reg; for (x = 0 ; x < len ; x++) buf2[x+1] = buf[x]; @@ -91,12 +91,12 @@ static u8 i2c_readbytes (struct nxt2002_state* state, u8 reg, u8* buf, u8 len) return 0; } -static u16 nxt2002_crc(u16 crc, u8 c) +static u16 nxt2002_crc(u16 crc, u8 c) { u8 i; u16 input = (u16) c & 0xFF; - + input<<=8; for(i=0 ;i<8 ;i++) { if((crc ^ input) & 0x8000) @@ -130,7 +130,7 @@ static int nxt2002_writereg_multibyte (struct nxt2002_state* state, u8 reg, u8* if ((buf & 0x02) == 0) return 0; - + dprintk("Error writing multireg register %02X\n",reg); return 0; @@ -162,16 +162,16 @@ static void nxt2002_microcontroller_stop (struct nxt2002_state* state) buf[0] = 0x80; i2c_writebytes(state,0x22,buf,1); - while (counter < 20) { + while (counter < 20) { i2c_readbytes(state,0x31,buf,1); - if (buf[0] & 0x40) + if (buf[0] & 0x40) return; msleep(10); counter++; } dprintk("Timeout waiting for micro to stop.. This is ok after firmware upload\n"); - return; + return; } static void nxt2002_microcontroller_start (struct nxt2002_state* state) @@ -211,7 +211,7 @@ static int nxt2002_writetuner (struct nxt2002_state* state, u8* data) /* write UC Opmode to begin transfer */ buf = 0x80; i2c_writebytes(state,0x21,&buf,1); - + while (count < 20) { i2c_readbytes(state,0x21,&buf,1); if ((buf & 0x80)== 0x00) @@ -243,7 +243,7 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; u8 buf[256],written = 0,chunkpos = 0; - u16 rambase,position,crc = 0; + u16 rambase,position,crc = 0; dprintk("%s\n", __FUNCTION__); dprintk("Firmware is %d bytes\n",fw->size); @@ -251,7 +251,6 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware /* Get the RAM base for this nxt2002 */ i2c_readbytes(state,0x10,buf,1); - if (buf[0] & 0x10) rambase = 0x1000; else @@ -263,7 +262,6 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware buf[0] = 0x80; i2c_writebytes(state,0x2B,buf,1); - for (position = 0; position < fw->size ; position++) { if (written == 0) { crc = 0; @@ -274,7 +272,7 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware /* write starting address */ i2c_writebytes(state,0x29,buf,3); } - written++; + written++; chunkpos++; if ((written % 4) == 0) @@ -282,7 +280,6 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware crc = nxt2002_crc(crc,fw->data[position]); - if ((written == 255) || (position+1 == fw->size)) { /* write remaining bytes of firmware */ i2c_writebytes(state, chunkpos+4-(written %4), @@ -290,7 +287,7 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware written %4); buf[0] = crc << 8; buf[1] = crc & 0xFF; - + /* write crc */ i2c_writebytes(state,0x2C,buf,2); @@ -309,24 +306,23 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware return 0; }; - static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; u32 freq = 0; - u16 tunerfreq = 0; + u16 tunerfreq = 0; u8 buf[4]; - freq = 44000 + ( p->frequency / 1000 ); + freq = 44000 + ( p->frequency / 1000 ); dprintk("freq = %d p->frequency = %d\n",freq,p->frequency); tunerfreq = freq * 24/4000; - + buf[0] = (tunerfreq >> 8) & 0x7F; buf[1] = (tunerfreq & 0xFF); - + if (p->frequency <= 214000000) { buf[2] = 0x84 + (0x06 << 3); buf[3] = (p->frequency <= 172000000) ? 0x01 : 0x02; @@ -337,7 +333,7 @@ static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe, buf[2] = 0x84 + (0x0E << 3); buf[3] = 0x08; } else { - buf[2] = 0x84 + (0x0F << 3); + buf[2] = 0x84 + (0x0F << 3); buf[3] = 0x02; } @@ -347,8 +343,6 @@ static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe, /* reset the agc now that tuning has been completed */ nxt2002_agc_reset(state); - - /* set target power level */ switch (p->u.vsb.modulation) { case QAM_64: @@ -449,7 +443,7 @@ static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe, nxt2002_microcontroller_start(state); - /* adjacent channel detection should be done here, but I don't + /* adjacent channel detection should be done here, but I don't have any stations with this need so I cannot test it */ return 0; @@ -466,7 +460,7 @@ static int nxt2002_read_status(struct dvb_frontend* fe, fe_status_t* status) *status |= FE_HAS_SIGNAL; *status |= FE_HAS_CARRIER; *status |= FE_HAS_VITERBI; - *status |= FE_HAS_SYNC; + *status |= FE_HAS_SYNC; *status |= FE_HAS_LOCK; } return 0; @@ -477,10 +471,10 @@ static int nxt2002_read_ber(struct dvb_frontend* fe, u32* ber) struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; u8 b[3]; - nxt2002_readreg_multibyte(state,0xE6,b,3); + nxt2002_readreg_multibyte(state,0xE6,b,3); *ber = ((b[0] << 8) + b[1]) * 8; - + return 0; } @@ -495,7 +489,7 @@ static int nxt2002_read_signal_strength(struct dvb_frontend* fe, u16* strength) i2c_writebytes(state,0xA1,b,1); /* get multreg val */ - nxt2002_readreg_multibyte(state,0xA6,b,2); + nxt2002_readreg_multibyte(state,0xA6,b,2); temp = (b[0] << 8) | b[1]; *strength = ((0x7FFF - temp) & 0x0FFF) * 16; @@ -516,7 +510,7 @@ static int nxt2002_read_snr(struct dvb_frontend* fe, u16* snr) i2c_writebytes(state,0xA1,b,1); /* get multreg val from 0xA6 */ - nxt2002_readreg_multibyte(state,0xA6,b,2); + nxt2002_readreg_multibyte(state,0xA6,b,2); temp = (b[0] << 8) | b[1]; temp2 = 0x7FFF - temp; @@ -542,9 +536,8 @@ static int nxt2002_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) { struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; u8 b[3]; - - nxt2002_readreg_multibyte(state,0xE6,b,3); + nxt2002_readreg_multibyte(state,0xE6,b,3); *ucblocks = b[2]; return 0; @@ -582,7 +575,7 @@ static int nxt2002_init(struct dvb_frontend* fe) /* Put the micro into reset */ nxt2002_microcontroller_stop(state); - + /* ensure transfer is complete */ buf[0]=0; i2c_writebytes(state,0x2B,buf,1); @@ -597,7 +590,7 @@ static int nxt2002_init(struct dvb_frontend* fe) i2c_writebytes(state,0x08,buf,1); /* write agc sdm configure */ - buf[0] = 0xF1; + buf[0] = 0xF1; i2c_writebytes(state,0x57,buf,1); /* write mod output format */ @@ -654,11 +647,11 @@ struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config, /* Check the first 5 registers to ensure this a revision we can handle */ i2c_readbytes(state, 0x00, buf, 5); - if (buf[0] != 0x04) goto error; /* device id */ - if (buf[1] != 0x02) goto error; /* fab id */ - if (buf[2] != 0x11) goto error; /* month */ - if (buf[3] != 0x20) goto error; /* year msb */ - if (buf[4] != 0x00) goto error; /* year lsb */ + if (buf[0] != 0x04) goto error; /* device id */ + if (buf[1] != 0x02) goto error; /* fab id */ + if (buf[2] != 0x11) goto error; /* month */ + if (buf[3] != 0x20) goto error; /* year msb */ + if (buf[4] != 0x00) goto error; /* year lsb */ /* create dvb_frontend */ state->frontend.ops = &state->ops; @@ -678,7 +671,7 @@ static struct dvb_frontend_ops nxt2002_ops = { .frequency_min = 54000000, .frequency_max = 860000000, /* stepsize is just a guess */ - .frequency_stepsize = 166666, + .frequency_stepsize = 166666, .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_8VSB | FE_CAN_QAM_64 | FE_CAN_QAM_256 diff --git a/linux/drivers/media/dvb/frontends/nxt2002.h b/linux/drivers/media/dvb/frontends/nxt2002.h index a177d5e6b..462301f57 100644 --- a/linux/drivers/media/dvb/frontends/nxt2002.h +++ b/linux/drivers/media/dvb/frontends/nxt2002.h @@ -18,6 +18,6 @@ struct nxt2002_config }; extern struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config, - struct i2c_adapter* i2c); + struct i2c_adapter* i2c); #endif // NXT2002_H diff --git a/linux/drivers/media/dvb/frontends/nxt6000.c b/linux/drivers/media/dvb/frontends/nxt6000.c index c0fa123e9..9708d4732 100644 --- a/linux/drivers/media/dvb/frontends/nxt6000.c +++ b/linux/drivers/media/dvb/frontends/nxt6000.c @@ -32,16 +32,11 @@ struct nxt6000_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct nxt6000_config* config; - struct dvb_frontend frontend; - }; static int debug = 0; @@ -424,16 +419,6 @@ static void nxt6000_dump_status(struct nxt6000_state *state) printk("\n"); } - - - - - - - - - - static int nxt6000_read_status(struct dvb_frontend* fe, fe_status_t* status) { u8 core_status; @@ -474,7 +459,6 @@ static int nxt6000_init(struct dvb_frontend* fe) return 0; } - static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *param) { struct nxt6000_state* state = (struct nxt6000_state*) fe->demodulator_priv; @@ -496,7 +480,6 @@ static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par return 0; } - static void nxt6000_release(struct dvb_frontend* fe) { struct nxt6000_state* state = (struct nxt6000_state*) fe->demodulator_priv; diff --git a/linux/drivers/media/dvb/frontends/sp8870.c b/linux/drivers/media/dvb/frontends/sp8870.c index 72338d461..538cb03ee 100644 --- a/linux/drivers/media/dvb/frontends/sp8870.c +++ b/linux/drivers/media/dvb/frontends/sp8870.c @@ -130,7 +130,7 @@ static int sp8870_firmware_upload (struct sp8870_state* state, const struct firm msg.flags = 0; msg.buf = tx_buf; msg.len = tx_len + 2; - if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) { + if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) { printk("%s: firmware upload failed!\n", __FUNCTION__); printk ("%s: i2c error (err == %i)\n", __FUNCTION__, err); return err; diff --git a/linux/drivers/media/dvb/frontends/sp887x.c b/linux/drivers/media/dvb/frontends/sp887x.c index 5f7aee97a..f34c010d0 100644 --- a/linux/drivers/media/dvb/frontends/sp887x.c +++ b/linux/drivers/media/dvb/frontends/sp887x.c @@ -20,13 +20,9 @@ struct sp887x_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - const struct sp887x_config* config; - struct dvb_frontend frontend; /* demodulator private data */ @@ -345,19 +341,6 @@ static void sp887x_correct_offsets (struct sp887x_state* state, sp887x_writereg(state, 0x30a, frequency_shift & 0xfff); } - - - - - - - - - - - - - static int sp887x_setup_frontend_parameters (struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { diff --git a/linux/drivers/media/dvb/frontends/stv0297.c b/linux/drivers/media/dvb/frontends/stv0297.c index e1e0b5e19..65255113f 100644 --- a/linux/drivers/media/dvb/frontends/stv0297.c +++ b/linux/drivers/media/dvb/frontends/stv0297.c @@ -29,13 +29,9 @@ #include "stv0297.h" struct stv0297_state { - struct i2c_adapter *i2c; - struct dvb_frontend_ops ops; - const struct stv0297_config *config; - struct dvb_frontend frontend; unsigned long base_freq; @@ -367,18 +363,6 @@ static int stv0297_set_inversion(struct stv0297_state *state, fe_spectral_invers return 0; } - - - - - - - - - - - - int stv0297_enable_plli2c(struct dvb_frontend *fe) { struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; diff --git a/linux/drivers/media/dvb/frontends/stv0299.c b/linux/drivers/media/dvb/frontends/stv0299.c index bbe24fc47..a468f8804 100644 --- a/linux/drivers/media/dvb/frontends/stv0299.c +++ b/linux/drivers/media/dvb/frontends/stv0299.c @@ -54,13 +54,9 @@ #include "stv0299.h" struct stv0299_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - const struct stv0299_config* config; - struct dvb_frontend frontend; u8 initialised:1; @@ -102,7 +98,6 @@ int stv0299_writereg (struct dvb_frontend* fe, u8 reg, u8 data) return stv0299_writeregI(state, reg, data); } - static u8 stv0299_readreg (struct stv0299_state* state, u8 reg) { int ret; @@ -120,7 +115,6 @@ static u8 stv0299_readreg (struct stv0299_state* state, u8 reg) return b1[0]; } - static int stv0299_readregs (struct stv0299_state* state, u8 reg1, u8 *b, u8 len) { int ret; @@ -135,7 +129,6 @@ static int stv0299_readregs (struct stv0299_state* state, u8 reg1, u8 *b, u8 len return ret == 2 ? 0 : ret; } - static int stv0299_set_FEC (struct stv0299_state* state, fe_code_rate_t fec) { dprintk ("%s\n", __FUNCTION__); @@ -172,7 +165,6 @@ static int stv0299_set_FEC (struct stv0299_state* state, fe_code_rate_t fec) } } - static fe_code_rate_t stv0299_get_fec (struct stv0299_state* state) { static fe_code_rate_t fec_tab [] = { FEC_2_3, FEC_3_4, FEC_5_6, @@ -190,7 +182,6 @@ static fe_code_rate_t stv0299_get_fec (struct stv0299_state* state) return fec_tab [index]; } - static int stv0299_wait_diseqc_fifo (struct stv0299_state* state, int timeout) { unsigned long start = jiffies; @@ -208,7 +199,6 @@ static int stv0299_wait_diseqc_fifo (struct stv0299_state* state, int timeout) return 0; } - static int stv0299_wait_diseqc_idle (struct stv0299_state* state, int timeout) { unsigned long start = jiffies; @@ -244,7 +234,6 @@ static int stv0299_set_symbolrate (struct dvb_frontend* fe, u32 srate) return state->config->set_symbol_rate(fe, srate, ratio); } - static int stv0299_get_symbolrate (struct stv0299_state* state) { u32 Mclk = state->config->mclk / 4096L; @@ -277,19 +266,6 @@ static int stv0299_get_symbolrate (struct stv0299_state* state) return srate; } - - - - - - - - - - - - - static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *m) { @@ -321,7 +297,6 @@ static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, return 0; } - static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) { struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; @@ -349,7 +324,6 @@ static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t return 0; } - static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) { struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; @@ -372,7 +346,6 @@ static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) } } - static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) { struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; @@ -412,7 +385,6 @@ static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltag }; } - static int stv0299_send_legacy_dish_cmd(struct dvb_frontend* fe, u32 cmd) { u8 last = 1; @@ -433,9 +405,7 @@ static int stv0299_send_legacy_dish_cmd(struct dvb_frontend* fe, u32 cmd) for (i=0; i<9; i++) { if((cmd & 0x01) != last) { - stv0299_set_voltage(fe, - last ? SEC_VOLTAGE_13 : - SEC_VOLTAGE_18); + stv0299_set_voltage(fe, last ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18); last = (last) ? 0 : 1; } @@ -448,7 +418,6 @@ static int stv0299_send_legacy_dish_cmd(struct dvb_frontend* fe, u32 cmd) return 0; } - static int stv0299_init (struct dvb_frontend* fe) { struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; @@ -468,7 +437,6 @@ static int stv0299_init (struct dvb_frontend* fe) return 0; } - static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status) { struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; diff --git a/linux/drivers/media/dvb/frontends/tda10021.c b/linux/drivers/media/dvb/frontends/tda10021.c index 72da8b69e..8bbcec71d 100644 --- a/linux/drivers/media/dvb/frontends/tda10021.c +++ b/linux/drivers/media/dvb/frontends/tda10021.c @@ -1,4 +1,4 @@ -/* +/* TDA10021 - Single Chip Cable Channel Receiver driver module used on the the Siemens DVB-C cards @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ +*/ #include <linux/config.h> #include <linux/delay.h> @@ -35,20 +35,16 @@ struct tda10021_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct tda10021_config* config; - struct dvb_frontend frontend; u8 pwm; u8 reg0; }; - + #if 0 #define dprintk(x...) printk(x) @@ -70,9 +66,9 @@ static u8 tda10021_inittab[0x40]= { 0x73, 0x6a, 0x23, 0x0a, 0x02, 0x37, 0x77, 0x1a, 0x37, 0x6a, 0x17, 0x8a, 0x1e, 0x86, 0x43, 0x40, - 0xb8, 0x3f, 0xa1, 0x00, 0xcd, 0x01, 0x00, 0xff, + 0xb8, 0x3f, 0xa1, 0x00, 0xcd, 0x01, 0x00, 0xff, 0x11, 0x00, 0x7c, 0x31, 0x30, 0x20, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x33, 0x11, 0x0d, 0x95, 0x08, 0x58, 0x00, 0x00, 0x80, 0x00, 0x80, 0xff, 0x00, 0x00, 0x04, 0x2d, 0x2f, 0xff, 0x00, 0x00, 0x00, 0x00, @@ -94,7 +90,6 @@ static int tda10021_writereg (struct tda10021_state* state, u8 reg, u8 data) return (ret != 1) ? -EREMOTEIO : 0; } - static u8 tda10021_readreg (struct tda10021_state* state, u8 reg) { u8 b0 [] = { reg }; @@ -115,7 +110,7 @@ static int lock_tuner(struct tda10021_state* state) { u8 buf[2] = { 0x0f, tda10021_inittab[0x0f] | 0x80 }; struct i2c_msg msg = {.addr=state->config->demod_address, .flags=0, .buf=buf, .len=2}; - + if(i2c_transfer(state->i2c, &msg, 1) != 1) { printk("tda10021: lock tuner fails\n"); @@ -129,7 +124,7 @@ static int unlock_tuner(struct tda10021_state* state) { u8 buf[2] = { 0x0f, tda10021_inittab[0x0f] & 0x7f }; struct i2c_msg msg_post={.addr=state->config->demod_address, .flags=0, .buf=buf, .len=2}; - + if(i2c_transfer(state->i2c, &msg_post, 1) != 1) { printk("tda10021: unlock tuner fails\n"); @@ -142,12 +137,12 @@ static int tda10021_setup_reg0 (struct tda10021_state* state, u8 reg0, fe_spectral_inversion_t inversion) { reg0 |= state->reg0 & 0x63; - + if (INVERSION_ON == inversion) ENABLE_INVERSION(reg0); else if (INVERSION_OFF == inversion) DISABLE_INVERSION(reg0); - + tda10021_writereg (state, 0x00, reg0 & 0xfe); tda10021_writereg (state, 0x00, reg0 | 0x01); @@ -157,13 +152,13 @@ static int tda10021_setup_reg0 (struct tda10021_state* state, u8 reg0, static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate) { - s32 BDR; + s32 BDR; s32 BDRI; s16 SFIL=0; u16 NDEC = 0; u32 tmp, ratio; - if (symbolrate > XIN/2) + if (symbolrate > XIN/2) symbolrate = XIN/2; if (symbolrate < 500000) symbolrate = 500000; @@ -171,7 +166,7 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate if (symbolrate < XIN/16) NDEC = 1; if (symbolrate < XIN/32) NDEC = 2; if (symbolrate < XIN/64) NDEC = 3; - + if (symbolrate < (u32)(XIN/12.3)) SFIL = 1; if (symbolrate < (u32)(XIN/16)) SFIL = 0; if (symbolrate < (u32)(XIN/24.6)) SFIL = 1; @@ -179,22 +174,22 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate if (symbolrate < (u32)(XIN/49.2)) SFIL = 1; if (symbolrate < (u32)(XIN/64)) SFIL = 0; if (symbolrate < (u32)(XIN/98.4)) SFIL = 1; - + symbolrate <<= NDEC; ratio = (symbolrate << 4) / FIN; tmp = ((symbolrate << 4) % FIN) << 8; ratio = (ratio << 8) + tmp / FIN; tmp = (tmp % FIN) << 8; ratio = (ratio << 8) + (tmp + FIN/2) / FIN; - + BDR = ratio; BDRI = (((XIN << 5) / symbolrate) + 1) / 2; - - if (BDRI > 0xFF) + + if (BDRI > 0xFF) BDRI = 0xFF; - + SFIL = (SFIL << 4) | tda10021_inittab[0x0E]; - + NDEC = (NDEC << 6) | tda10021_inittab[0x03]; tda10021_writereg (state, 0x03, NDEC); @@ -208,20 +203,11 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate return 0; } - - - - - - - - - static int tda10021_init (struct dvb_frontend *fe) { struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; int i; - + dprintk("DVB: TDA10021(%d): init chip\n", fe->adapter->num); //tda10021_writereg (fe, 0, 0); @@ -230,13 +216,13 @@ static int tda10021_init (struct dvb_frontend *fe) tda10021_writereg (state, i, tda10021_inittab[i]); tda10021_writereg (state, 0x34, state->pwm); - + //Comment by markus //0x2A[3-0] == PDIV -> P multiplaying factor (P=PDIV+1)(default 0) //0x2A[4] == BYPPLL -> Power down mode (default 1) //0x2A[5] == LCK -> PLL Lock Flag //0x2A[6] == POLAXIN -> Polarity of the input reference clock (default 0) - + //Activate PLL tda10021_writereg(state, 0x2a, tda10021_inittab[0x2a] & 0xef); @@ -255,7 +241,7 @@ static int tda10021_set_parameters (struct dvb_frontend *fe, struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; //table for QAM4-QAM256 ready QAM4 QAM16 QAM32 QAM64 QAM128 QAM256 - //CONF + //CONF static const u8 reg0x00 [] = { 0x14, 0x00, 0x04, 0x08, 0x0c, 0x10 }; //AGCREF value static const u8 reg0x01 [] = { 0x78, 0x8c, 0x8c, 0x6a, 0x78, 0x5c }; @@ -265,7 +251,7 @@ static int tda10021_set_parameters (struct dvb_frontend *fe, static const u8 reg0x08 [] = { 0x8c, 0xa2, 0x74, 0x43, 0x34, 0x23 }; //AREF static const u8 reg0x09 [] = { 0x96, 0x91, 0x96, 0x6a, 0x7e, 0x6b }; - + int qam = p->u.qam.modulation; if (qam < 0 || qam > 5) @@ -320,8 +306,8 @@ static int tda10021_read_ber(struct dvb_frontend* fe, u32* ber) struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; u32 _ber = tda10021_readreg(state, 0x14) | - (tda10021_readreg(state, 0x15) << 8) | - ((tda10021_readreg(state, 0x16) & 0x0f) << 16); + (tda10021_readreg(state, 0x15) << 8) | + ((tda10021_readreg(state, 0x16) & 0x0f) << 16); *ber = 10 * _ber; return 0; @@ -367,7 +353,7 @@ static int tda10021_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; int sync; s8 afc = 0; - + sync = tda10021_readreg(state, 0x11); afc = tda10021_readreg(state, 0x19); if (verbose) { @@ -454,7 +440,7 @@ static struct dvb_frontend_ops tda10021_ops = { #endif .caps = 0x400 | //FE_CAN_QAM_4 FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 | - FE_CAN_QAM_128 | FE_CAN_QAM_256 | + FE_CAN_QAM_128 | FE_CAN_QAM_256 | FE_CAN_FEC_AUTO }, diff --git a/linux/drivers/media/dvb/frontends/tda10021.h b/linux/drivers/media/dvb/frontends/tda10021.h index fd9a5b9f8..7d6a51ce2 100644 --- a/linux/drivers/media/dvb/frontends/tda10021.h +++ b/linux/drivers/media/dvb/frontends/tda10021.h @@ -1,4 +1,4 @@ -/* +/* TDA10021 - Single Chip Cable Channel Receiver driver module used on the the Siemens DVB-C cards @@ -37,7 +37,6 @@ struct tda10021_config }; extern struct dvb_frontend* tda10021_attach(const struct tda10021_config* config, - struct i2c_adapter* i2c, - u8 pwm); + struct i2c_adapter* i2c, u8 pwm); #endif // TDA10021_H diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c index 47c90d6e0..0860e895a 100644 --- a/linux/drivers/media/dvb/frontends/tda1004x.c +++ b/linux/drivers/media/dvb/frontends/tda1004x.c @@ -39,19 +39,14 @@ #define TDA1004X_DEMOD_TDA10046 1 -struct tda1004x_state -{ +struct tda1004x_state { struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - const struct tda1004x_config* config; - struct dvb_frontend frontend; /* private demod data */ u8 initialised:1; - u8 demod_type; }; @@ -347,7 +342,6 @@ static int tda1004x_check_upload_ok(struct tda1004x_state *state, u8 dspVersion) return 0; } - static int tda10045_fwupload(struct dvb_frontend* fe) { struct tda1004x_state* state = fe->demodulator_priv; @@ -363,7 +357,7 @@ static int tda10045_fwupload(struct dvb_frontend* fe) ret = state->config->request_firmware(fe, &fw, TDA10045_DEFAULT_FIRMWARE); if (ret) { printk("tda1004x: no firmware upload (timeout or file not found?)\n"); - return ret; + return ret; } /* reset chip */ @@ -407,7 +401,7 @@ static int tda10046_fwupload(struct dvb_frontend* fe) ret = state->config->request_firmware(fe, &fw, TDA10046_DEFAULT_FIRMWARE); if (ret) { printk("tda1004x: no firmware upload (timeout or file not found?)\n"); - return ret; + return ret; } /* set parameters */ @@ -476,23 +470,6 @@ static int tda1004x_decode_fec(int tdafec) return -1; } - - - - - - - - - - - - - - - - - int tda1004x_write_byte(struct dvb_frontend* fe, int reg, int data) { struct tda1004x_state* state = fe->demodulator_priv; diff --git a/linux/drivers/media/dvb/frontends/tda8083.c b/linux/drivers/media/dvb/frontends/tda8083.c index 03c4366e1..db6624b9f 100644 --- a/linux/drivers/media/dvb/frontends/tda8083.c +++ b/linux/drivers/media/dvb/frontends/tda8083.c @@ -35,14 +35,10 @@ struct tda8083_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct tda8083_config* config; - struct dvb_frontend frontend; }; @@ -78,7 +74,6 @@ static int tda8083_writereg (struct tda8083_state* state, u8 reg, u8 data) return (ret != 1) ? -1 : 0; } - static int tda8083_readregs (struct tda8083_state* state, u8 reg1, u8 *b, u8 len) { int ret; @@ -94,7 +89,6 @@ static int tda8083_readregs (struct tda8083_state* state, u8 reg1, u8 *b, u8 len return ret == 2 ? 0 : -1; } - static inline u8 tda8083_readreg (struct tda8083_state* state, u8 reg) { u8 val; @@ -104,8 +98,6 @@ static inline u8 tda8083_readreg (struct tda8083_state* state, u8 reg) return val; } - - static int tda8083_set_inversion (struct tda8083_state* state, fe_spectral_inversion_t inversion) { /* XXX FIXME: implement other modes than FEC_AUTO */ @@ -115,7 +107,6 @@ static int tda8083_set_inversion (struct tda8083_state* state, fe_spectral_inver return -EINVAL; } - static int tda8083_set_fec (struct tda8083_state* state, fe_code_rate_t fec) { if (fec == FEC_AUTO) @@ -127,7 +118,6 @@ static int tda8083_set_fec (struct tda8083_state* state, fe_code_rate_t fec) return -EINVAL; } - static fe_code_rate_t tda8083_get_fec (struct tda8083_state* state) { u8 index; @@ -139,7 +129,6 @@ static fe_code_rate_t tda8083_get_fec (struct tda8083_state* state) return fec_tab [index]; } - static int tda8083_set_symbolrate (struct tda8083_state* state, u32 srate) { u32 ratio; @@ -179,7 +168,6 @@ static int tda8083_set_symbolrate (struct tda8083_state* state, u32 srate) return 1; } - static void tda8083_wait_diseqc_fifo (struct tda8083_state* state, int timeout) { unsigned long start = jiffies; @@ -205,7 +193,6 @@ static int tda8083_set_tone (struct tda8083_state* state, fe_sec_tone_mode_t ton }; } - static int tda8083_set_voltage (struct tda8083_state* state, fe_sec_voltage_t voltage) { switch (voltage) { @@ -236,27 +223,6 @@ static int tda8083_send_diseqc_burst (struct tda8083_state* state, fe_sec_mini_c return 0; } - - - - - - - - - - - - - - - - - - - - - static int tda8083_send_diseqc_msg (struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *m) { @@ -475,9 +441,9 @@ static struct dvb_frontend_ops tda8083_ops = { .read_snr = tda8083_read_snr, .diseqc_send_master_cmd = tda8083_send_diseqc_msg, - .diseqc_send_burst = tda8083_diseqc_send_burst, - .set_tone = tda8083_diseqc_set_tone, - .set_voltage = tda8083_diseqc_set_voltage, + .diseqc_send_burst = tda8083_diseqc_send_burst, + .set_tone = tda8083_diseqc_set_tone, + .set_voltage = tda8083_diseqc_set_voltage, }; module_param(debug, int, 0644); diff --git a/linux/drivers/media/dvb/frontends/tda80xx.c b/linux/drivers/media/dvb/frontends/tda80xx.c index 5b8828b27..3d552c34f 100644 --- a/linux/drivers/media/dvb/frontends/tda80xx.c +++ b/linux/drivers/media/dvb/frontends/tda80xx.c @@ -204,8 +204,8 @@ static int tda80xx_set_parameters(struct tda80xx_state* state, * r = k * clk / symbol_rate * * k: 2^21 for caa 0..3, - * 2^20 for caa 4..5, - * 2^19 for caa 6..7 + * 2^20 for caa 4..5, + * 2^19 for caa 6..7 */ if (symbol_rate <= (clk * 3) / 32) k = (1 << 19); @@ -422,7 +422,7 @@ static int tda8044_init(struct dvb_frontend* fe) tda80xx_write(state, 0x00, tda8044_inittab_post, sizeof(tda8044_inittab_post)); if (state->config->pll_init) { - tda80xx_writereg(state, 0x1c, 0x80); + tda80xx_writereg(state, 0x1c, 0x80); state->config->pll_init(fe); tda80xx_writereg(state, 0x1c, 0x00); } @@ -437,7 +437,7 @@ static int tda8083_init(struct dvb_frontend* fe) tda80xx_write(state, 0x00, tda8083_inittab, sizeof(tda8083_inittab)); if (state->config->pll_init) { - tda80xx_writereg(state, 0x1c, 0x80); + tda80xx_writereg(state, 0x1c, 0x80); state->config->pll_init(fe); tda80xx_writereg(state, 0x1c, 0x00); } @@ -445,21 +445,6 @@ static int tda8083_init(struct dvb_frontend* fe) return 0; } - - - - - - - - - - - - - - - static int tda80xx_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage) { struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; @@ -492,7 +477,7 @@ static int tda80xx_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) static int tda80xx_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd) { - struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; + struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; if (cmd->msg_len > 6) return -EINVAL; @@ -536,7 +521,7 @@ static int tda80xx_sleep(struct dvb_frontend* fe) static int tda80xx_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { - struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; + struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; tda80xx_writereg(state, 0x1c, 0x80); state->config->pll_set(fe, p); @@ -735,9 +720,9 @@ static struct dvb_frontend_ops tda80xx_ops = { .read_ucblocks = tda80xx_read_ucblocks, .diseqc_send_master_cmd = tda80xx_send_diseqc_msg, - .diseqc_send_burst = tda80xx_send_diseqc_burst, - .set_tone = tda80xx_set_tone, - .set_voltage = tda80xx_set_voltage, + .diseqc_send_burst = tda80xx_send_diseqc_burst, + .set_tone = tda80xx_set_tone, + .set_voltage = tda80xx_set_voltage, }; module_param(debug, int, 0644); diff --git a/linux/drivers/media/dvb/frontends/ves1820.c b/linux/drivers/media/dvb/frontends/ves1820.c index acd340ad8..62945ef1f 100644 --- a/linux/drivers/media/dvb/frontends/ves1820.c +++ b/linux/drivers/media/dvb/frontends/ves1820.c @@ -34,14 +34,10 @@ struct ves1820_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct ves1820_config* config; - struct dvb_frontend frontend; /* private demodulator data */ @@ -97,7 +93,6 @@ static u8 ves1820_readreg(struct ves1820_state *state, u8 reg) return b1[0]; } - static int ves1820_setup_reg0(struct ves1820_state *state, u8 reg0, fe_spectral_inversion_t inversion) { reg0 |= state->reg0 & 0x62; @@ -105,10 +100,8 @@ static int ves1820_setup_reg0(struct ves1820_state *state, u8 reg0, fe_spectral_ if (INVERSION_ON == inversion) { if (!state->config->invert) reg0 |= 0x20; else reg0 &= ~0x20; - } else if (INVERSION_OFF == inversion) { - - if (!state->config->invert) reg0 &= ~0x20; + if (!state->config->invert) reg0 &= ~0x20; else reg0 |= 0x20; } @@ -198,18 +191,6 @@ static int ves1820_set_symbolrate(struct ves1820_state *state, u32 symbolrate) return 0; } - - - - - - - - - - - - static int ves1820_init(struct dvb_frontend* fe) { struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; diff --git a/linux/drivers/media/dvb/frontends/ves1820.h b/linux/drivers/media/dvb/frontends/ves1820.h index 8739fec48..355f130b1 100644 --- a/linux/drivers/media/dvb/frontends/ves1820.h +++ b/linux/drivers/media/dvb/frontends/ves1820.h @@ -46,7 +46,6 @@ struct ves1820_config }; extern struct dvb_frontend* ves1820_attach(const struct ves1820_config* config, - struct i2c_adapter* i2c, - u8 pwm); + struct i2c_adapter* i2c, u8 pwm); #endif // VES1820_H diff --git a/linux/drivers/media/dvb/frontends/ves1x93.c b/linux/drivers/media/dvb/frontends/ves1x93.c index 1c511ef6b..b97861c5a 100644 --- a/linux/drivers/media/dvb/frontends/ves1x93.c +++ b/linux/drivers/media/dvb/frontends/ves1x93.c @@ -35,14 +35,10 @@ struct ves1x93_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct ves1x93_config* config; - struct dvb_frontend frontend; /* previous uncorrected block counter */ @@ -69,7 +65,6 @@ static u8 init_1893_tab [] = { 0x00, 0x55, 0x00, 0x00, 0x7f, 0x00 }; - static u8 init_1993_tab [] = { 0x00, 0x9c, 0x35, 0x80, 0x6a, 0x09, 0x72, 0x8c, 0x09, 0x6b, 0x00, 0x00, 0x4c, 0x08, 0x00, 0x00, @@ -89,7 +84,6 @@ static u8 init_1893_wtab[] = 1,1,1,0,1,1 }; - static u8 init_1993_wtab[] = { 1,1,1,1,1,1,1,1, 1,1,0,0,1,1,0,0, @@ -112,7 +106,6 @@ static int ves1x93_writereg (struct ves1x93_state* state, u8 reg, u8 data) return 0; } - static u8 ves1x93_readreg (struct ves1x93_state* state, u8 reg) { int ret; @@ -163,7 +156,6 @@ static int ves1x93_set_inversion (struct ves1x93_state* state, fe_spectral_inver return ves1x93_writereg (state, 0x0c, (state->init_1x93_tab[0x0c] & 0x3f) | val); } - static int ves1x93_set_fec (struct ves1x93_state* state, fe_code_rate_t fec) { if (fec == FEC_AUTO) @@ -174,13 +166,11 @@ static int ves1x93_set_fec (struct ves1x93_state* state, fe_code_rate_t fec) return ves1x93_writereg (state, 0x0d, fec - FEC_1_2); } - static fe_code_rate_t ves1x93_get_fec (struct ves1x93_state* state) { return FEC_1_2 + ((ves1x93_readreg (state, 0x0d) >> 4) & 0x7); } - static int ves1x93_set_symbolrate (struct ves1x93_state* state, u32 srate) { u32 BDR; @@ -256,7 +246,7 @@ static int ves1x93_set_symbolrate (struct ves1x93_state* state, u32 srate) AGCR = state->init_1x93_tab[0x05]; if (state->config->invert_pwm) AGCR |= 0x20; - + if (srate < 6000000) AGCR |= 0x80; else @@ -271,20 +261,6 @@ static int ves1x93_set_symbolrate (struct ves1x93_state* state, u32 srate) return 0; } - - - - - - - - - - - - - - static int ves1x93_init (struct dvb_frontend* fe) { struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; @@ -349,6 +325,7 @@ static int ves1x93_read_status(struct dvb_frontend* fe, fe_status_t* status) } *status = 0; + if (sync & 1) *status |= FE_HAS_SIGNAL; @@ -367,7 +344,6 @@ static int ves1x93_read_status(struct dvb_frontend* fe, fe_status_t* status) return 0; } - static int ves1x93_read_ber(struct dvb_frontend* fe, u32* ber) { struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; diff --git a/linux/drivers/media/dvb/ttpci/av7110.h b/linux/drivers/media/dvb/ttpci/av7110.h index 46aab89eb..09bc74ce2 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.h +++ b/linux/drivers/media/dvb/ttpci/av7110.h @@ -281,4 +281,3 @@ extern int av7110_init_v4l(struct av7110 *av7110); extern int av7110_exit_v4l(struct av7110 *av7110); #endif /* _AV7110_H_ */ - diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.c b/linux/drivers/media/dvb/ttpci/av7110_hw.c index 8c0a1611f..b90a61248 100644 --- a/linux/drivers/media/dvb/ttpci/av7110_hw.c +++ b/linux/drivers/media/dvb/ttpci/av7110_hw.c @@ -95,7 +95,7 @@ u32 av7110_debiread(struct av7110 *av7110, u32 config, int addr, int count) printk("%s: wait_for_debi_done #2 failed\n", __FUNCTION__); return 0; } - + result = saa7146_read(dev, DEBI_AD); result &= (0xffffffffUL >> ((4 - count) * 8)); return result; @@ -314,7 +314,7 @@ int av7110_wait_msgstate(struct av7110 *av7110, u16 flags) msleep(50); return 0; } - + /* new firmware */ start = jiffies; for (;;) { diff --git a/linux/drivers/media/dvb/ttpci/budget-patch.c b/linux/drivers/media/dvb/ttpci/budget-patch.c index 866f149cc..dc45a3ded 100644 --- a/linux/drivers/media/dvb/ttpci/budget-patch.c +++ b/linux/drivers/media/dvb/ttpci/budget-patch.c @@ -13,19 +13,19 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Or, point your browser to http://www.gnu.org/copyleft/gpl.html - * + * * * the project's page is at http://www.linuxtv.org/dvb/ */ @@ -55,7 +55,7 @@ static struct pci_device_id pci_tbl[] = { /* those lines are for budget-patch to be tried ** on a true budget card and observe the ** behaviour of VSYNC generated by rps1. -** this code was shamelessly copy/pasted from budget.c +** this code was shamelessly copy/pasted from budget.c */ static void gpio_Set22K (struct budget *budget, int state) { @@ -123,7 +123,7 @@ static int SendDiSEqCMsg (struct budget *budget, int len, u8 *msg, unsigned long return 0; } -/* shamelessly copy/pasted from budget.c +/* shamelessly copy/pasted from budget.c */ static int budget_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) { @@ -173,12 +173,12 @@ static int budget_av7110_send_fw_cmd(struct budget_patch *budget, u16* buf, int { ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2*i, 2, (u32) buf[i], 0,0); msleep(5); - } + } if (length) ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2, 2, (u32) buf[1], 0,0); else ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2, 2, 0, 0,0); - msleep(5); + msleep(5); ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND, 2, (u32) buf[0], 0,0); msleep(5); return 0; @@ -187,7 +187,7 @@ static int budget_av7110_send_fw_cmd(struct budget_patch *budget, u16* buf, int static void av7110_set22k(struct budget_patch *budget, int state) { u16 buf[2] = {( COMTYPE_AUDIODAC << 8) | (state ? ON22K : OFF22K), 0}; - + dprintk(2, "budget: %p\n", budget); budget_av7110_send_fw_cmd(budget, buf, 2); } @@ -210,7 +210,7 @@ static int av7110_send_diseqc_msg(struct budget_patch *budget, int len, u8 *msg, buf[3]=burst ? 0x01 : 0x00; else buf[3]=0xffff; - + for (i=0; i<len; i++) buf[i+4]=msg[i]; @@ -412,11 +412,11 @@ static struct tda8083_config grundig_29504_451_config = { }; static void frontend_init(struct budget_patch* budget) -{ +{ switch(budget->dev->pci->subsystem_device) { case 0x0000: // Hauppauge/TT WinTV DVB-S rev1.X case 0x1013: // SATELCO Multimedia PCI - + // try the ALPS BSRV2 first of all budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap); if (budget->dvb_frontend) { @@ -498,7 +498,7 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte saa7146_write(dev, CLIP_FORMAT_CTRL, 0); // r78 // Set HPS prescaler for port B input saa7146_write(dev, HPS_CTRL, (1<<30) | (0<<29) | (1<<28) | (0<<12) ); - saa7146_write(dev, MC2, + saa7146_write(dev, MC2, 0 * (MASK_08 | MASK_24) | // BRS control 0 * (MASK_09 | MASK_25) | // a 0 * (MASK_10 | MASK_26) | // b @@ -512,15 +512,15 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte // RPS1 timeout disable saa7146_write(dev, RPS_TOV1, 0); - // code for autodetection + // code for autodetection // will wait for VBI_B event (vertical blank at port B) // and will reset GPIO3 after VBI_B is detected. // (GPIO3 should be raised high by CPU to - // test if GPIO3 will generate vertical blank signal + // test if GPIO3 will generate vertical blank signal // in budget patch GPIO3 is connected to VSYNC_B count = 0; #if 0 - WRITE_RPS1(cpu_to_le32(CMD_UPLOAD | + WRITE_RPS1(cpu_to_le32(CMD_UPLOAD | MASK_10 | MASK_09 | MASK_08 | MASK_06 | MASK_05 | MASK_04 | MASK_03 | MASK_02 )); #endif WRITE_RPS1(cpu_to_le32(CMD_PAUSE | EVT_VBI_B)); @@ -557,7 +557,7 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); mdelay(150); - + if( (saa7146_read(dev, GPIO_CTRL) & 0x10000000) == 0) detected = 1; @@ -570,51 +570,51 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte if(detected == 0) printk("budget-patch not detected or saa7146 in non-default state.\n" "try enabling ressetting of 7146 with MASK_31 in MC1 register\n"); - + else printk("BUDGET-PATCH DETECTED.\n"); /* OLD (Original design by Roberto Deza): -** This code will setup the SAA7146_RPS1 to generate a square -** wave on GPIO3, changing when a field (TS_HEIGHT/2 "lines" of -** TS_WIDTH packets) has been acquired on SAA7146_D1B video port; -** then, this GPIO3 output which is connected to the D1B_VSYNC -** input, will trigger the acquisition of the alternate field +** This code will setup the SAA7146_RPS1 to generate a square +** wave on GPIO3, changing when a field (TS_HEIGHT/2 "lines" of +** TS_WIDTH packets) has been acquired on SAA7146_D1B video port; +** then, this GPIO3 output which is connected to the D1B_VSYNC +** input, will trigger the acquisition of the alternate field ** and so on. -** Currently, the TT_budget / WinTV_Nova cards have two ICs -** (74HCT4040, LVC74) for the generation of this VSYNC signal, +** Currently, the TT_budget / WinTV_Nova cards have two ICs +** (74HCT4040, LVC74) for the generation of this VSYNC signal, ** which seems that can be done perfectly without this :-)). -*/ +*/ /* New design (By Emard) ** this rps1 code will copy internal HS event to GPIO3 pin. ** GPIO3 is in budget-patch hardware connectd to port B VSYNC ** HS is an internal event of 7146, accessible with RPS -** and temporarily raised high every n lines +** and temporarily raised high every n lines ** (n in defined in the RPS_THRESH1 counter threshold) ** I think HS is raised high on the beginning of the n-th line ** and remains high until this n-th line that triggered ** it is completely received. When the receiption of n-th line ** ends, HS is lowered. -** To transmit data over DMA, 7146 needs changing state at -** port B VSYNC pin. Any changing of port B VSYNC will +** To transmit data over DMA, 7146 needs changing state at +** port B VSYNC pin. Any changing of port B VSYNC will ** cause some DMA data transfer, with more or less packets loss. -** It depends on the phase and frequency of VSYNC and +** It depends on the phase and frequency of VSYNC and ** the way of 7146 is instructed to trigger on port B (defined ** in DD1_INIT register, 3rd nibble from the right valid ** numbers are 0-7, see datasheet) ** -** The correct triggering can minimize packet loss, +** The correct triggering can minimize packet loss, ** dvbtraffic should give this stable bandwidths: ** 22k transponder = 33814 kbit/s ** 27.5k transponder = 38045 kbit/s -** by experiment it is found that the best results -** (stable bandwidths and almost no packet loss) -** are obtained using DD1_INIT triggering number 2 -** (Va at rising edge of VS Fa = HS x VS-failing forced toggle) +** by experiment it is found that the best results +** (stable bandwidths and almost no packet loss) +** are obtained using DD1_INIT triggering number 2 +** (Va at rising edge of VS Fa = HS x VS-failing forced toggle) ** and a VSYNC phase that occurs in the middle of DMA transfer ** (about byte 188*512=96256 in the DMA window). ** @@ -625,20 +625,20 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte ** increment. That's how the 7146 is programmed to do event ** counting in this budget-patch.c ** I *think* HPS setting has something to do with the phase -** of HS but I cant be 100% sure in that. +** of HS but I cant be 100% sure in that. ** hardware debug note: a working budget card (including budget patch) ** with vpeirq() interrupt setup in mode "0x90" (every 64K) will ** generate 3 interrupts per 25-Hz DMA frame of 2*188*512 bytes ** and that means 3*25=75 Hz of interrupt freqency, as seen by -** watch cat /proc/interrupts +** watch cat /proc/interrupts ** ** If this frequency is 3x lower (and data received in the DMA ** buffer don't start with 0x47, but in the middle of packets, ** whose lengths appear to be like 188 292 188 104 etc. -** this means VSYNC line is not connected in the hardware. +** this means VSYNC line is not connected in the hardware. ** (check soldering pcb and pins) -** The same behaviour of missing VSYNC can be duplicated on budget +** The same behaviour of missing VSYNC can be duplicated on budget ** cards, by seting DD1_INIT trigger mode 7 in 3rd nibble. */ @@ -681,14 +681,14 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte // low 16 bits are set to TS_WIDTH bytes (TS_WIDTH=2*188 //,then RPS_THRESH1 // should be set to trigger every TS_HEIGHT (512) lines. - // + // saa7146_write(dev, RPS_THRESH1, (TS_HEIGHT*1) | MASK_12 ); - + // saa7146_write(dev, RPS_THRESH0, ((TS_HEIGHT/2)<<16) |MASK_28| (TS_HEIGHT/2) |MASK_12 ); // Enable RPS1 (rFC p33) saa7146_write(dev, MC1, (MASK_13 | MASK_29)); - + if (!(budget = kmalloc (sizeof(struct budget_patch), GFP_KERNEL))) return -ENOMEM; @@ -722,20 +722,20 @@ static int budget_patch_detach (struct saa7146_dev* dev) return err; } -static int __init budget_patch_init(void) +static int __init budget_patch_init(void) { return saa7146_register_extension(&budget_extension); } static void __exit budget_patch_exit(void) { - saa7146_unregister_extension(&budget_extension); + saa7146_unregister_extension(&budget_extension); } static struct saa7146_extension budget_extension = { .name = "budget_patch dvb\0", .flags = 0, - + .module = THIS_MODULE, .pci_tbl = pci_tbl, .attach = budget_patch_attach, @@ -752,4 +752,3 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Emard, Roberto Deza, Holger Waechtler, Michael Hunold, others"); MODULE_DESCRIPTION("Driver for full TS modified DVB-S SAA7146+AV7110 " "based so-called Budget Patch cards"); - diff --git a/linux/drivers/media/dvb/ttpci/budget.c b/linux/drivers/media/dvb/ttpci/budget.c index c2a8b8cb9..5e6a10f4a 100644 --- a/linux/drivers/media/dvb/ttpci/budget.c +++ b/linux/drivers/media/dvb/ttpci/budget.c @@ -1,35 +1,35 @@ /* - * budget.c: driver for the SAA7146 based Budget DVB cards + * budget.c: driver for the SAA7146 based Budget DVB cards * - * Compiled from various sources by Michael Hunold <michael@mihu.de> + * Compiled from various sources by Michael Hunold <michael@mihu.de> * * Copyright (C) 2002 Ralph Metzler <rjkm@metzlerbros.de> * - * Copyright (C) 1999-2002 Ralph Metzler + * Copyright (C) 1999-2002 Ralph Metzler * & Marcus Metzler for convergence integrated media GmbH * * 26feb2004 Support for FS Activy Card (Grundig tuner) by * Michael Dreher <michael@5dot1.de>, * Oliver Endriss <o.endriss@gmx.de> and * Andreas 'randy' Weinberger - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Or, point your browser to http://www.gnu.org/copyleft/gpl.html - * + * * * the project's page is at http://www.linuxtv.org/dvb/ */ @@ -204,7 +204,7 @@ static int alps_bsrv2_pll_set(struct dvb_frontend* fe, struct dvb_frontend_param return 0; } -static struct ves1x93_config alps_bsrv2_config = +static struct ves1x93_config alps_bsrv2_config = { .demod_address = 0x08, .xin = 90100000UL, @@ -358,7 +358,7 @@ static int grundig_29504_401_pll_set(struct dvb_frontend* fe, struct dvb_fronten if (params->frequency < 175000000) band_select = 0x0e; else if (params->frequency < 470000000) band_select = 0x05; else band_select = 0x03; - + data[0] = (div >> 8) & 0x7f; data[1] = div & 0xff; data[2] = ((div >> 10) & 0x60) | cfg; @@ -409,7 +409,7 @@ static u8 read_pwm(struct budget* budget) } static void frontend_init(struct budget *budget) -{ +{ switch(budget->dev->pci->subsystem_device) { case 0x1003: // Hauppauge/TT Nova budget (stv0299/ALPS BSRU6(tsa5059) OR ves1893/ALPS BSRV2(sp5659)) case 0x1013: @@ -432,24 +432,24 @@ static void frontend_init(struct budget *budget) } break; - case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659)) + case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659)) budget->dvb_frontend = ves1820_attach(&alps_tdbe2_config, &budget->i2c_adap, read_pwm(budget)); if (budget->dvb_frontend) break; break; - case 0x1005: // Hauppauge/TT Nova-T budget (L64781/Grundig 29504-401(tsa5060)) + case 0x1005: // Hauppauge/TT Nova-T budget (L64781/Grundig 29504-401(tsa5060)) budget->dvb_frontend = l64781_attach(&grundig_29504_401_config, &budget->i2c_adap); if (budget->dvb_frontend) break; break; case 0x4f60: // Fujitsu Siemens Activy Budget-S PCI rev AL (stv0299/ALPS BSRU6(tsa5059)) - budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); + budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); if (budget->dvb_frontend) { budget->dvb_frontend->ops->set_voltage = siemens_budget_set_voltage; break; - } + } break; case 0x4f61: // Fujitsu Siemens Activy Budget-S PCI rev GR (tda8083/Grundig 29504-451(tsa5522)) @@ -514,7 +514,7 @@ static int budget_detach (struct saa7146_dev* dev) kfree (budget); dev->ext_priv = NULL; - + return err; } @@ -543,8 +543,8 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); static struct saa7146_extension budget_extension = { .name = "budget dvb\0", - .flags = 0, - + .flags = 0, + .module = THIS_MODULE, .pci_tbl = pci_tbl, .attach = budget_attach, @@ -552,16 +552,16 @@ static struct saa7146_extension budget_extension = { .irq_mask = MASK_10, .irq_func = ttpci_budget_irq10_handler, -}; +}; -static int __init budget_init(void) +static int __init budget_init(void) { return saa7146_register_extension(&budget_extension); } static void __exit budget_exit(void) { - saa7146_unregister_extension(&budget_extension); + saa7146_unregister_extension(&budget_extension); } module_init(budget_init); @@ -571,4 +571,3 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Ralph Metzler, Marcus Metzler, Michael Hunold, others"); MODULE_DESCRIPTION("driver for the SAA7146 based so-called " "budget PCI DVB cards by Siemens, Technotrend, Hauppauge"); - diff --git a/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c b/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c index 602071868..e9a8457b0 100644 --- a/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c +++ b/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c @@ -144,4 +144,3 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Ralph Metzler, Marcus Metzler, others"); MODULE_DESCRIPTION("Decode dvb_net MAC address from EEPROM of PCI DVB cards " "made by Siemens, Technotrend, Hauppauge"); - diff --git a/linux/drivers/media/dvb/ttusb-dec/Kconfig b/linux/drivers/media/dvb/ttusb-dec/Kconfig index 00e07707e..c334526af 100644 --- a/linux/drivers/media/dvb/ttusb-dec/Kconfig +++ b/linux/drivers/media/dvb/ttusb-dec/Kconfig @@ -10,11 +10,11 @@ config DVB_TTUSB_DEC Even if these devices have a MPEG decoder built in, they transmit only compressed MPEG data over the USB bus, so you need - an external software decoder to watch TV on your computer. + an external software decoder to watch TV on your computer. This driver needs external firmware. Please use the commands "<kerneldir>/Documentation/dvb/get_dvb_firmware dec2000t", - "<kerneldir>/Documentation/dvb/get_dvb_firmware dec2540t", + "<kerneldir>/Documentation/dvb/get_dvb_firmware dec2540t", "<kerneldir>/Documentation/dvb/get_dvb_firmware dec3000s", download/extract them, and then copy them to /usr/lib/hotplug/firmware. diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c index b3286691b..8d7d7c30b 100644 --- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c @@ -152,7 +152,7 @@ struct ttusb_dec { struct dvb_demux_filter *video_filter; struct list_head filter_info_list; spinlock_t filter_info_list_lock; - + struct input_dev rc_input_dev; int active; /* Loaded successfully */ @@ -171,9 +171,9 @@ struct filter_info { }; const uint16_t rc_keys[] = { - KEY_POWER, - KEY_MUTE, - KEY_1, + KEY_POWER, + KEY_MUTE, + KEY_1, KEY_2, KEY_3, KEY_4, @@ -207,7 +207,7 @@ static void ttusb_dec_handle_irq( struct urb *urb, struct pt_regs *regs) struct ttusb_dec * dec = urb->context; char *buffer = dec->irq_buffer; int retval; - + switch(urb->status) { case 0: /*success*/ break; @@ -221,17 +221,17 @@ static void ttusb_dec_handle_irq( struct urb *urb, struct pt_regs *regs) return; default: dprintk("%s:nonzero status received: %d\n", - __FUNCTION__,urb->status); + __FUNCTION__,urb->status); goto exit; } - if( (buffer[0] == 0x1) && (buffer[2] == 0x15) ) { + if( (buffer[0] == 0x1) && (buffer[2] == 0x15) ) { /* IR - Event */ /* this is an fact a bit too simple implementation; * the box also reports a keyrepeat signal - * (with buffer[3] == 0x40) in an intervall of ~100ms. + * (with buffer[3] == 0x40) in an intervall of ~100ms. * But to handle this correctly we had to imlemenent some - * kind of timer which signals a 'key up' event if no + * kind of timer which signals a 'key up' event if no * keyrepeat signal is recieved for lets say 200ms. * this should/could be added later ... * for now lets report each signal as a key down and up*/ @@ -1186,19 +1186,19 @@ static void ttusb_init_rc( struct ttusb_dec *dec) { u8 b[] = { 0x00, 0x01 }; int i; - + init_input_dev(&dec->rc_input_dev); - - dec->rc_input_dev.name = "ttusb_dec remote control"; + + dec->rc_input_dev.name = "ttusb_dec remote control"; dec->rc_input_dev.evbit[0] = BIT(EV_KEY); dec->rc_input_dev.keycodesize = sizeof(unsigned char); dec->rc_input_dev.keycodemax = KEY_MAX; - + for (i = 0; i < sizeof(rc_keys)/sizeof(rc_keys[0]); i++) set_bit(rc_keys[i], dec->rc_input_dev.keybit); - + input_register_device(&dec->rc_input_dev); - + if(usb_submit_urb(dec->irq_urb,GFP_KERNEL)) { printk("%s: usb_submit_urb failed\n",__FUNCTION__); } @@ -1233,14 +1233,14 @@ static int ttusb_dec_init_usb(struct ttusb_dec *dec) dec->irq_urb = usb_alloc_urb(0, GFP_KERNEL); if(!dec->irq_urb) { return -ENOMEM; - } - dec->irq_buffer = usb_buffer_alloc(dec->udev,IRQ_PACKET_SIZE, + } + dec->irq_buffer = usb_buffer_alloc(dec->udev,IRQ_PACKET_SIZE, SLAB_ATOMIC, &dec->irq_dma_handle); if(!dec->irq_buffer) { return -ENOMEM; } usb_fill_int_urb(dec->irq_urb, dec->udev,dec->irq_pipe, - dec->irq_buffer, IRQ_PACKET_SIZE, + dec->irq_buffer, IRQ_PACKET_SIZE, ttusb_dec_handle_irq, dec, 1); dec->irq_urb->transfer_dma = dec->irq_dma_handle; dec->irq_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; @@ -1516,11 +1516,11 @@ static void ttusb_dec_exit_usb(struct ttusb_dec *dec) * As the irq is submitted after the interface is changed, * this is the best method i figured out. * Any other possibilities?*/ - if(dec->interface == TTUSB_DEC_INTERFACE_IN) + if(dec->interface == TTUSB_DEC_INTERFACE_IN) usb_kill_urb(dec->irq_urb); - + usb_free_urb(dec->irq_urb); - + usb_buffer_free(dec->udev,IRQ_PACKET_SIZE, dec->irq_buffer, dec->irq_dma_handle); } @@ -1605,7 +1605,7 @@ static int ttusb_dec_probe(struct usb_interface *intf, dec->udev = udev; - if (ttusb_dec_init_usb(dec)) + if (ttusb_dec_init_usb(dec)) return 0; if (ttusb_dec_init_stb(dec)) { ttusb_dec_exit_usb(dec); @@ -1733,4 +1733,3 @@ MODULE_AUTHOR("Alex Woods <linux-dvb@giblets.org>"); MODULE_DESCRIPTION(DRIVER_NAME); MODULE_LICENSE("GPL"); MODULE_DEVICE_TABLE(usb, ttusb_dec_table); - diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusbdecfe.c b/linux/drivers/media/dvb/ttusb-dec/ttusbdecfe.c index fbadb67db..ff0e5212a 100644 --- a/linux/drivers/media/dvb/ttusb-dec/ttusbdecfe.c +++ b/linux/drivers/media/dvb/ttusb-dec/ttusbdecfe.c @@ -47,7 +47,7 @@ static int ttusbdecfe_read_status(struct dvb_frontend* fe, fe_status_t* status) return 0; } - + static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv; @@ -104,7 +104,7 @@ static int ttusbdecfe_dvbs_diseqc_send_master_cmd(struct dvb_frontend* fe, struc u8 b[] = { 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - + memcpy(&b[4], cmd->msg, cmd->msg_len); state->config->send_command(fe, 0x72, diff --git a/linux/include/linux/dvb/audio.h b/linux/include/linux/dvb/audio.h index 58956c3bb..cc314443f 100644 --- a/linux/include/linux/dvb/audio.h +++ b/linux/include/linux/dvb/audio.h @@ -1,9 +1,9 @@ -/* +/* * audio.h * * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de> * & Marcus Metzler <marcus@convergence.de> - for convergence integrated media GmbH + * for convergence integrated media GmbH * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Lesser Public License @@ -32,35 +32,35 @@ typedef enum { - AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */ - AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */ + AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */ + AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */ } audio_stream_source_t; -typedef enum { - AUDIO_STOPPED, /* Device is stopped */ - AUDIO_PLAYING, /* Device is currently playing */ - AUDIO_PAUSED /* Device is paused */ +typedef enum { + AUDIO_STOPPED, /* Device is stopped */ + AUDIO_PLAYING, /* Device is currently playing */ + AUDIO_PAUSED /* Device is paused */ } audio_play_state_t; typedef enum { AUDIO_STEREO, - AUDIO_MONO_LEFT, - AUDIO_MONO_RIGHT + AUDIO_MONO_LEFT, + AUDIO_MONO_RIGHT } audio_channel_select_t; -typedef struct audio_mixer { +typedef struct audio_mixer { unsigned int volume_left; unsigned int volume_right; // what else do we need? bass, pass-through, ... } audio_mixer_t; -typedef struct audio_status { +typedef struct audio_status { int AV_sync_state; /* sync audio and video? */ - int mute_state; /* audio is muted */ + int mute_state; /* audio is muted */ audio_play_state_t play_state; /* current playback state */ audio_stream_source_t stream_source; /* current stream source */ audio_channel_select_t channel_select; /* currently selected channel */ @@ -88,7 +88,7 @@ typedef uint16_t audio_attributes_t; /* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */ /* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */ /* 2- 0 number of audio channels (n+1 channels) */ - + /* for GET_CAPABILITIES and SET_FORMAT, the latter should only set one bit */ #define AUDIO_CAP_DTS 1 @@ -101,7 +101,7 @@ typedef uint16_t audio_attributes_t; #define AUDIO_CAP_SDDS 128 #define AUDIO_CAP_AC3 256 -#define AUDIO_STOP _IO('o', 1) +#define AUDIO_STOP _IO('o', 1) #define AUDIO_PLAY _IO('o', 2) #define AUDIO_PAUSE _IO('o', 3) #define AUDIO_CONTINUE _IO('o', 4) @@ -122,4 +122,3 @@ typedef uint16_t audio_attributes_t; #define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t) #endif /* _DVBAUDIO_H_ */ - diff --git a/linux/include/linux/dvb/ca.h b/linux/include/linux/dvb/ca.h index 026e5c35c..558af0cc7 100644 --- a/linux/include/linux/dvb/ca.h +++ b/linux/include/linux/dvb/ca.h @@ -1,9 +1,9 @@ -/* +/* * ca.h * * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de> * & Marcus Metzler <marcus@convergence.de> - for convergence integrated media GmbH + * for convergence integrated media GmbH * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Lesser Public License @@ -88,4 +88,3 @@ typedef struct ca_pid { #define CA_SET_PID _IOW('o', 135, ca_pid_t) #endif - diff --git a/linux/include/linux/dvb/dmx.h b/linux/include/linux/dvb/dmx.h index 62e621770..ce3f829da 100644 --- a/linux/include/linux/dvb/dmx.h +++ b/linux/include/linux/dvb/dmx.h @@ -3,7 +3,7 @@ * * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de> * & Ralph Metzler <ralph@convergence.de> - for convergence integrated media GmbH + * for convergence integrated media GmbH * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -112,10 +112,10 @@ typedef struct dmx_filter struct dmx_sct_filter_params { - __u16 pid; + __u16 pid; dmx_filter_t filter; - __u32 timeout; - __u32 flags; + __u32 timeout; + __u32 flags; #define DMX_CHECK_CRC 1 #define DMX_ONESHOT 2 #define DMX_IMMEDIATE_START 4 @@ -125,11 +125,11 @@ struct dmx_sct_filter_params struct dmx_pes_filter_params { - __u16 pid; + __u16 pid; dmx_input_t input; dmx_output_t output; dmx_pes_type_t pes_type; - __u32 flags; + __u32 flags; }; @@ -145,7 +145,7 @@ struct dmx_event typedef struct dmx_caps { __u32 caps; - int num_decoders; + int num_decoders; } dmx_caps_t; typedef enum { @@ -166,7 +166,7 @@ struct dmx_stc { }; -#define DMX_START _IO('o', 41) +#define DMX_START _IO('o', 41) #define DMX_STOP _IO('o', 42) #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) #define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params) @@ -178,4 +178,3 @@ struct dmx_stc { #define DMX_GET_STC _IOWR('o', 50, struct dmx_stc) #endif /*_DVBDMX_H_*/ - diff --git a/linux/include/linux/dvb/frontend.h b/linux/include/linux/dvb/frontend.h index 96de31eba..d41df7047 100644 --- a/linux/include/linux/dvb/frontend.h +++ b/linux/include/linux/dvb/frontend.h @@ -265,4 +265,3 @@ struct dvb_frontend_event { #define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */ #endif /*_DVBFRONTEND_H_*/ - diff --git a/linux/include/linux/dvb/net.h b/linux/include/linux/dvb/net.h index f9ec12062..5be474bf0 100644 --- a/linux/include/linux/dvb/net.h +++ b/linux/include/linux/dvb/net.h @@ -3,7 +3,7 @@ * * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de> * & Ralph Metzler <ralph@convergence.de> - for convergence integrated media GmbH + * for convergence integrated media GmbH * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -30,7 +30,7 @@ struct dvb_net_if { __u16 pid; __u16 if_num; - __u8 feedtype; + __u8 feedtype; #define DVB_NET_FEEDTYPE_MPE 0 /* multi protocol encapsulation */ #define DVB_NET_FEEDTYPE_ULE 1 /* ultra lightweight encapsulation */ }; diff --git a/linux/include/linux/dvb/osd.h b/linux/include/linux/dvb/osd.h index e91bbf375..0e1973d54 100644 --- a/linux/include/linux/dvb/osd.h +++ b/linux/include/linux/dvb/osd.h @@ -1,9 +1,9 @@ -/* +/* * osd.h * * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de> * & Marcus Metzler <marcus@convergence.de> - for convergence integrated media GmbH + * for convergence integrated media GmbH * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Lesser Public License @@ -93,7 +93,7 @@ typedef enum { // TODO: remove "test" in final version OSD_Text, // (x0,y0,size,color,text) OSD_SetWindow, // (x0) set window with number 0<x0<8 as current - OSD_MoveWindow, // move current window to (x0, y0) + OSD_MoveWindow, // move current window to (x0, y0) OSD_OpenRaw, // Open other types of OSD windows } OSD_Command; @@ -142,4 +142,3 @@ typedef struct osd_cap_s { #define OSD_GET_CAPABILITY _IOR('o', 161, osd_cap_t) #endif - diff --git a/linux/include/linux/dvb/version.h b/linux/include/linux/dvb/version.h index 624c40e5d..6183c9c48 100644 --- a/linux/include/linux/dvb/version.h +++ b/linux/include/linux/dvb/version.h @@ -27,4 +27,3 @@ #define DVB_API_VERSION_MINOR 1 #endif /*_DVBVERSION_H_*/ - diff --git a/linux/include/linux/dvb/video.h b/linux/include/linux/dvb/video.h index b11458978..941045e9a 100644 --- a/linux/include/linux/dvb/video.h +++ b/linux/include/linux/dvb/video.h @@ -1,9 +1,9 @@ -/* +/* * video.h * * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de> * & Ralph Metzler <ralph@convergence.de> - for convergence integrated media GmbH + * for convergence integrated media GmbH * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -42,18 +42,18 @@ typedef enum { typedef enum { - VIDEO_SYSTEM_PAL, - VIDEO_SYSTEM_NTSC, - VIDEO_SYSTEM_PALN, - VIDEO_SYSTEM_PALNc, - VIDEO_SYSTEM_PALM, - VIDEO_SYSTEM_NTSC60, + VIDEO_SYSTEM_PAL, + VIDEO_SYSTEM_NTSC, + VIDEO_SYSTEM_PALN, + VIDEO_SYSTEM_PALNc, + VIDEO_SYSTEM_PALM, + VIDEO_SYSTEM_NTSC60, VIDEO_SYSTEM_PAL60, VIDEO_SYSTEM_PALM60 } video_system_t; -typedef enum { +typedef enum { VIDEO_PAN_SCAN, /* use pan and scan format */ VIDEO_LETTER_BOX, /* use letterbox format */ VIDEO_CENTER_CUT_OUT /* use center cut out format */ @@ -66,22 +66,22 @@ typedef struct { } video_size_t; typedef enum { - VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */ - VIDEO_SOURCE_MEMORY /* If this source is selected, the stream - comes from the user through the write - system call */ + VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */ + VIDEO_SOURCE_MEMORY /* If this source is selected, the stream + comes from the user through the write + system call */ } video_stream_source_t; typedef enum { - VIDEO_STOPPED, /* Video is stopped */ - VIDEO_PLAYING, /* Video is currently playing */ - VIDEO_FREEZED /* Video is freezed */ -} video_play_state_t; + VIDEO_STOPPED, /* Video is stopped */ + VIDEO_PLAYING, /* Video is currently playing */ + VIDEO_FREEZED /* Video is freezed */ +} video_play_state_t; -struct video_event { - int32_t type; +struct video_event { + int32_t type; #define VIDEO_EVENT_SIZE_CHANGED 1 #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 time_t timestamp; @@ -92,9 +92,9 @@ struct video_event { }; -struct video_status { +struct video_status { int video_blank; /* blank video on freeze? */ - video_play_state_t play_state; /* current state of playback */ + video_play_state_t play_state; /* current state of playback */ video_stream_source_t stream_source; /* current source (demux/memory) */ video_format_t video_format; /* current aspect ratio of stream*/ video_displayformat_t display_format;/* selected cropping mode */ @@ -103,11 +103,11 @@ struct video_status { struct video_still_picture { char __user *iFrame; /* pointer to a single iframe in memory */ - int32_t size; + int32_t size; }; -typedef +typedef struct video_highlight { int active; /* 1=show highlight, 0=hide highlight */ uint8_t contrast1; /* 7- 4 Pattern pixel contrast */ @@ -118,7 +118,7 @@ struct video_highlight { /* 3- 0 Background pixel color */ uint8_t color2; /* 7- 4 Emphasis pixel-2 color */ /* 3- 0 Emphasis pixel-1 color */ - uint32_t ypos; /* 23-22 auto action mode */ + uint32_t ypos; /* 23-22 auto action mode */ /* 21-12 start y */ /* 9- 0 end y */ uint32_t xpos; /* 23-22 button color number */ @@ -160,21 +160,21 @@ typedef uint16_t video_attributes_t; /* bit definitions for capabilities: */ /* can the hardware decode MPEG1 and/or MPEG2? */ -#define VIDEO_CAP_MPEG1 1 +#define VIDEO_CAP_MPEG1 1 #define VIDEO_CAP_MPEG2 2 /* can you send a system and/or program stream to video device? - (you still have to open the video and the audio device but only + (you still have to open the video and the audio device but only send the stream to the video device) */ #define VIDEO_CAP_SYS 4 #define VIDEO_CAP_PROG 8 -/* can the driver also handle SPU, NAVI and CSS encoded data? +/* can the driver also handle SPU, NAVI and CSS encoded data? (CSS API is not present yet) */ #define VIDEO_CAP_SPU 16 #define VIDEO_CAP_NAVI 32 #define VIDEO_CAP_CSS 64 -#define VIDEO_STOP _IO('o', 21) +#define VIDEO_STOP _IO('o', 21) #define VIDEO_PLAY _IO('o', 22) #define VIDEO_FREEZE _IO('o', 23) #define VIDEO_CONTINUE _IO('o', 24) @@ -201,4 +201,3 @@ typedef uint16_t video_attributes_t; #define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int) #endif /*_DVBVIDEO_H_*/ - diff --git a/linux/include/media/saa7146.h b/linux/include/media/saa7146.h index 2265e8f45..43b85afc6 100644 --- a/linux/include/media/saa7146.h +++ b/linux/include/media/saa7146.h @@ -77,7 +77,7 @@ struct saa7146_vv; /* saa7146 page table */ struct saa7146_pgtable { unsigned int size; - u32 *cpu; + u32 *cpu; dma_addr_t dma; /* used for offsets for u,v planes for planar capture modes */ unsigned long offset; @@ -105,20 +105,20 @@ struct saa7146_extension #define SAA7146_USE_I2C_IRQ 0x1 #define SAA7146_I2C_SHORT_DELAY 0x2 int flags; - + /* pairs of subvendor and subdevice ids for supported devices, last entry 0xffff, 0xfff */ struct module *module; struct pci_driver driver; struct pci_device_id *pci_tbl; - + /* extension functions */ int (*probe)(struct saa7146_dev *); int (*attach)(struct saa7146_dev *, struct saa7146_pci_extension_data *); int (*detach)(struct saa7146_dev*); u32 irq_mask; /* mask to indicate, which irq-events are handled by the extension */ - void (*irq_func)(struct saa7146_dev*, u32* irq_mask); + void (*irq_func)(struct saa7146_dev*, u32* irq_mask); }; struct saa7146_dma @@ -134,8 +134,8 @@ struct saa7146_dev struct list_head item; /* different device locks */ - spinlock_t slock; - struct semaphore lock; + spinlock_t slock; + struct semaphore lock; unsigned char __iomem *mem; /* pointer to mapped IO memory */ int revision; /* chip revision; needed for bug-workarounds*/ @@ -144,8 +144,8 @@ struct saa7146_dev char name[32]; struct pci_dev *pci; u32 int_todo; - spinlock_t int_slock; - + spinlock_t int_slock; + /* extension handling */ struct saa7146_extension *ext; /* indicates if handled by extension */ void *ext_priv; /* pointer for extension private use (most likely some private data) */ @@ -161,7 +161,7 @@ struct saa7146_dev struct saa7146_dma d_i2c; /* pointer to i2c memory */ wait_queue_head_t i2c_wq; int i2c_op; - + /* memories */ struct saa7146_dma d_rps0; struct saa7146_dma d_rps1; @@ -190,8 +190,8 @@ int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); /* some i2c constants */ #define SAA7146_I2C_TIMEOUT 100 /* i2c-timeout-value in ms */ -#define SAA7146_I2C_RETRIES 3 /* how many times shall we retry an i2c-operation? */ -#define SAA7146_I2C_DELAY 5 /* time we wait after certain i2c-operations */ +#define SAA7146_I2C_RETRIES 3 /* how many times shall we retry an i2c-operation? */ +#define SAA7146_I2C_DELAY 5 /* time we wait after certain i2c-operations */ /* unsorted defines */ #define ME1 0x0000000800 @@ -284,7 +284,7 @@ int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); #define MASK_W1 0xffff0000 /* Mask value for word 1 */ #define MASK_PA 0xfffffffc /* Mask value for physical address */ -#define MASK_PR 0xfffffffe /* Mask value for protection register */ +#define MASK_PR 0xfffffffe /* Mask value for protection register */ #define MASK_ER 0xffffffff /* Mask value for the entire register */ #define MASK_NONE 0x00000000 /* No mask */ @@ -307,7 +307,7 @@ int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); #define BASE_ODD3 0x30 /* Video DMA 3 registers */ #define BASE_EVEN3 0x34 #define PROT_ADDR3 0x38 -#define PITCH3 0x3C +#define PITCH3 0x3C #define BASE_PAGE3 0x40 /* Video DMA 3 base page */ #define NUM_LINE_BYTE3 0x44 @@ -335,15 +335,15 @@ int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); #define DEBI_CONFIG 0x7C #define DEBI_COMMAND 0x80 #define DEBI_PAGE 0x84 -#define DEBI_AD 0x88 +#define DEBI_AD 0x88 -#define I2C_TRANSFER 0x8C -#define I2C_STATUS 0x90 +#define I2C_TRANSFER 0x8C +#define I2C_STATUS 0x90 #define BASE_A1_IN 0x94 /* Audio 1 input DMA */ #define PROT_A1_IN 0x98 #define PAGE_A1_IN 0x9C - + #define BASE_A1_OUT 0xA0 /* Audio 1 output DMA */ #define PROT_A1_OUT 0xA4 #define PAGE_A1_OUT 0xA8 @@ -383,12 +383,12 @@ int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); #define RPS_ADDR0 0x104 /* RPS task 0 address register */ #define RPS_ADDR1 0x108 /* RPS task 1 address register */ -#define ISR 0x10C /* Interrupt status register */ +#define ISR 0x10C /* Interrupt status register */ #define PSR 0x110 /* Primary status register */ #define SSR 0x114 /* Secondary status register */ #define EC1R 0x118 /* Event counter set 1 register */ -#define EC2R 0x11C /* Event counter set 2 register */ +#define EC2R 0x11C /* Event counter set 2 register */ #define PCI_VDP1 0x120 /* Video DMA pointer of FIFO 1 */ #define PCI_VDP2 0x124 /* Video DMA pointer of FIFO 2 */ @@ -462,4 +462,3 @@ int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); #define SAA7146_I2C_BUS_BIT_RATE_60 (0x300) #endif - diff --git a/linux/include/media/saa7146_vv.h b/linux/include/media/saa7146_vv.h index 1b9f4dbd3..f3aa24f81 100644 --- a/linux/include/media/saa7146_vv.h +++ b/linux/include/media/saa7146_vv.h @@ -31,7 +31,7 @@ struct saa7146_video_dma { struct saa7146_format { char *name; - u32 pixelformat; + u32 pixelformat; u32 trans; u8 depth; u8 flags; @@ -45,10 +45,10 @@ struct saa7146_standard int v_offset; /* number of lines of vertical offset before processing */ int v_field; /* number of lines in a field for HPS to process */ - + int h_offset; /* horizontal offset of processing window */ int h_pixels; /* number of horizontal pixels to process */ - + int v_max_out; int h_max_out; }; @@ -90,7 +90,7 @@ struct saa7146_fh { /* video overlay */ struct saa7146_overlay ov; - + /* video capture */ struct videobuf_queue video_q; struct v4l2_pix_format video_fmt; @@ -127,11 +127,11 @@ struct saa7146_vv struct saa7146_format *ov_fmt; struct saa7146_overlay *ov_data; struct saa7146_fh *ov_suspend; - + /* video capture */ struct saa7146_dmaqueue video_q; enum v4l2_field last_field; - + /* common: fixme? shouldn't this be in saa7146_fh? (this leads to a more complicated question: shall the driver store the different settings (for example S_INPUT) for every open @@ -139,11 +139,11 @@ struct saa7146_vv all opens? currently, we do the latter, like all other drivers do... */ struct saa7146_standard *standard; - + int vflip; - int hflip; - int current_hps_source; - int current_hps_sync; + int hflip; + int current_hps_source; + int current_hps_sync; struct saa7146_dma d_clipping; /* pointer to clipping memory */ @@ -157,7 +157,7 @@ struct saa7146_vv struct saa7146_extension_ioctls { unsigned int cmd; - int flags; + int flags; }; /* flags */ @@ -166,16 +166,16 @@ struct saa7146_extension_ioctls struct saa7146_ext_vv { /* informations about the video capabilities of the device */ - int inputs; - int audios; + int inputs; + int audios; u32 capabilities; - int flags; + int flags; /* additionally supported transmission standards */ struct saa7146_standard *stds; int num_stds; int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *); - + struct saa7146_extension_ioctls *ioctls; int (*ioctl)(struct saa7146_fh*, unsigned int cmd, void *arg); }; @@ -264,7 +264,7 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits); /* misc defines */ #define SAA7146_NO_SWAP (0x0) -#define SAA7146_TWO_BYTE_SWAP (0x1) +#define SAA7146_TWO_BYTE_SWAP (0x1) #define SAA7146_FOUR_BYTE_SWAP (0x2) #endif |