The patch number 13873 was added via Jean-Francois Moine <moin...@free.fr>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <linux-me...@vger.kernel.org>

------

merge: v4l-dvb


---

 linux/drivers/media/dvb/dvb-usb/cxusb.c         |    3 
 linux/drivers/media/dvb/frontends/atbm8830.c    |    8 -
 linux/drivers/media/dvb/siano/sms-cards.c       |    1 
 linux/drivers/media/dvb/siano/smsdvb.c          |   83 +++++++++++++-
 linux/drivers/media/video/cx23885/cx23885-dvb.c |    6 +
 v4l/scripts/checkpatch.pl                       |   94 +++++++++++-----
 6 files changed, 159 insertions(+), 36 deletions(-)

diff -r ffe9eaea7ab6 -r ac3e520a01e1 linux/drivers/media/dvb/dvb-usb/cxusb.c
--- a/linux/drivers/media/dvb/dvb-usb/cxusb.c   Sun Dec 20 16:31:28 2009 +0100
+++ b/linux/drivers/media/dvb/dvb-usb/cxusb.c   Wed Dec 23 08:48:18 2009 +0100
@@ -1187,6 +1187,9 @@
        .osc_clk_freq = 30400, /* in kHz */
        .if_freq = 0, /* zero IF */
        .zif_swap_iq = 1,
+       .agc_min = 0x2E,
+       .agc_max = 0x90,
+       .agc_hold_loop = 0,
 };
 
 static int cxusb_mygica_d689_frontend_attach(struct dvb_usb_adapter *adap)
diff -r ffe9eaea7ab6 -r ac3e520a01e1 
linux/drivers/media/dvb/frontends/atbm8830.c
--- a/linux/drivers/media/dvb/frontends/atbm8830.c      Sun Dec 20 16:31:28 
2009 +0100
+++ b/linux/drivers/media/dvb/frontends/atbm8830.c      Wed Dec 23 08:48:18 
2009 +0100
@@ -170,17 +170,19 @@
        return 0;
 }
 
-#if 0
 static int set_agc_config(struct atbm_state *priv,
        u8 min, u8 max, u8 hold_loop)
 {
+       /* no effect if both min and max are zero */
+       if (!min && !max)
+           return 0;
+
        atbm8830_write_reg(priv, REG_AGC_MIN, min);
        atbm8830_write_reg(priv, REG_AGC_MAX, max);
        atbm8830_write_reg(priv, REG_AGC_HOLD_LOOP, hold_loop);
 
        return 0;
 }
-#endif
 
 static int set_static_channel_mode(struct atbm_state *priv)
 {
@@ -238,11 +240,9 @@
        /*Set IF frequency*/
        set_if_freq(priv, cfg->if_freq);
 
-#if 0
        /*Set AGC Config*/
        set_agc_config(priv, cfg->agc_min, cfg->agc_max,
                cfg->agc_hold_loop);
-#endif
 
        /*Set static channel mode*/
        set_static_channel_mode(priv);
diff -r ffe9eaea7ab6 -r ac3e520a01e1 linux/drivers/media/dvb/siano/sms-cards.c
--- a/linux/drivers/media/dvb/siano/sms-cards.c Sun Dec 20 16:31:28 2009 +0100
+++ b/linux/drivers/media/dvb/siano/sms-cards.c Wed Dec 23 08:48:18 2009 +0100
@@ -62,6 +62,7 @@
        [SMS1XXX_BOARD_HAUPPAUGE_WINDHAM] = {
                .name   = "Hauppauge WinTV MiniStick",
                .type   = SMS_NOVA_B0,
+               .fw[DEVICE_MODE_ISDBT_BDA] = "sms1xxx-hcw-55xxx-isdbt-02.fw",
                .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw",
                .board_cfg.leds_power = 26,
                .board_cfg.led0 = 27,
diff -r ffe9eaea7ab6 -r ac3e520a01e1 linux/drivers/media/dvb/siano/smsdvb.c
--- a/linux/drivers/media/dvb/siano/smsdvb.c    Sun Dec 20 16:31:28 2009 +0100
+++ b/linux/drivers/media/dvb/siano/smsdvb.c    Wed Dec 23 08:48:18 2009 +0100
@@ -134,6 +134,7 @@
                break;
 
        case MSG_SMS_RF_TUNE_RES:
+       case MSG_SMS_ISDBT_TUNE_RES:
                complete(&client->tune_done);
                break;
 
@@ -413,8 +414,8 @@
        return 0;
 }
 
-static int smsdvb_set_frontend(struct dvb_frontend *fe,
-                              struct dvb_frontend_parameters *fep)
+static int smsdvb_dvbt_set_frontend(struct dvb_frontend *fe,
+                                   struct dvb_frontend_parameters *fep)
 {
        struct smsdvb_client_t *client =
                container_of(fe, struct smsdvb_client_t, frontend);
@@ -473,6 +474,80 @@
                                           &client->tune_done);
 }
 
+static int smsdvb_isdbt_set_frontend(struct dvb_frontend *fe,
+                                    struct dvb_frontend_parameters *fep,
+                                    u32 SegmentNumber)
+{
+       struct smsdvb_client_t *client =
+               container_of(fe, struct smsdvb_client_t, frontend);
+
+       struct {
+               struct SmsMsgHdr_ST     Msg;
+               u32             Data[4];
+       } Msg;
+
+       Msg.Msg.msgSrcId  = DVBT_BDA_CONTROL_MSG_ID;
+       Msg.Msg.msgDstId  = HIF_TASK;
+       Msg.Msg.msgFlags  = 0;
+       Msg.Msg.msgType   = MSG_SMS_ISDBT_TUNE_REQ;
+       Msg.Msg.msgLength = sizeof(Msg);
+       Msg.Data[0] = fep->frequency;
+       Msg.Data[2] = 12000000;
+       Msg.Data[3] = SegmentNumber;
+
+       sms_debug("freq %d band %d seg %d\n",
+                 fep->frequency, fep->u.ofdm.bandwidth, SegmentNumber);
+
+       switch (fep->u.ofdm.bandwidth) {
+       case BANDWIDTH_8_MHZ:
+               Msg.Data[1] = BW_ISDBT_3SEG;
+               break;
+       case BANDWIDTH_7_MHZ:
+               Msg.Data[1] = BW_ISDBT_3SEG;
+               break;
+       case BANDWIDTH_6_MHZ:
+               Msg.Data[1] = BW_ISDBT_1SEG;
+               break;
+#if 0
+       case BANDWIDTH_5_MHZ:
+               Msg.Data[1] = BW_ISDBT_1SEG;
+               break;
+#endif
+       case BANDWIDTH_AUTO:
+               return -EOPNOTSUPP;
+       default:
+               return -EINVAL;
+       }
+
+       return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg),
+                                          &client->tune_done);
+}
+
+static int smsdvb_set_frontend(struct dvb_frontend *fe,
+                              struct dvb_frontend_parameters *fep)
+{
+       struct smsdvb_client_t *client =
+               container_of(fe, struct smsdvb_client_t, frontend);
+       struct smscore_device_t *coredev = client->coredev;
+
+       switch (smscore_get_device_mode(coredev)) {
+       case DEVICE_MODE_DVBT:
+       case DEVICE_MODE_DVBT_BDA:
+               return smsdvb_dvbt_set_frontend(fe, fep);
+       case DEVICE_MODE_ISDBT:
+       case DEVICE_MODE_ISDBT_BDA:
+       {
+               u32 segmentnum;
+               /* XXX: hack - use 4 lower bits in frequency for segment num */
+               segmentnum = fep->frequency & 0x0000000f;
+               fep->frequency &= ~0x0000000f;
+               return smsdvb_isdbt_set_frontend(fe, fep, segmentnum);
+       }
+       default:
+               return -EINVAL;
+       }
+}
+
 static int smsdvb_get_frontend(struct dvb_frontend *fe,
                               struct dvb_frontend_parameters *fep)
 {
@@ -560,13 +635,13 @@
        /* device removal handled by onremove callback */
        if (!arrival)
                return 0;
-
+#if 0
        if (smscore_get_device_mode(coredev) != DEVICE_MODE_DVBT_BDA) {
                sms_err("SMS Device mode is not set for "
                        "DVB operation.");
                return 0;
        }
-
+#endif
        client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL);
        if (!client) {
                sms_err("kmalloc() failed");
diff -r ffe9eaea7ab6 -r ac3e520a01e1 
linux/drivers/media/video/cx23885/cx23885-dvb.c
--- a/linux/drivers/media/video/cx23885/cx23885-dvb.c   Sun Dec 20 16:31:28 
2009 +0100
+++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c   Wed Dec 23 08:48:18 
2009 +0100
@@ -543,6 +543,9 @@
        .osc_clk_freq = 30400, /* in kHz */
        .if_freq = 0, /* zero IF */
        .zif_swap_iq = 1,
+       .agc_min = 0x2E,
+       .agc_max = 0xFF,
+       .agc_hold_loop = 0,
 };
 
 static struct max2165_config mygic_x8558pro_max2165_cfg1 = {
@@ -559,6 +562,9 @@
        .osc_clk_freq = 30400, /* in kHz */
        .if_freq = 0, /* zero IF */
        .zif_swap_iq = 1,
+       .agc_min = 0x2E,
+       .agc_max = 0xFF,
+       .agc_hold_loop = 0,
 };
 
 static struct max2165_config mygic_x8558pro_max2165_cfg2 = {
diff -r ffe9eaea7ab6 -r ac3e520a01e1 v4l/scripts/checkpatch.pl
--- a/v4l/scripts/checkpatch.pl Sun Dec 20 16:31:28 2009 +0100
+++ b/v4l/scripts/checkpatch.pl Wed Dec 23 08:48:18 2009 +0100
@@ -2,7 +2,7 @@
 # (c) 2001, Dave Jones. <da...@redhat.com> (the file handling bit)
 # (c) 2005, Joel Schopp <jsch...@austin.ibm.com> (the ugly bit)
 # (c) 2007,2008, Andy Whitcroft <a...@uk.ibm.com> (new conditions, test suite)
-# (c) 2008, Andy Whitcroft <a...@canonical.com>
+# (c) 2008,2009, Andy Whitcroft <a...@canonical.com>
 # Licensed under the terms of the GNU GPL License version 2
 
 use strict;
@@ -10,7 +10,7 @@
 my $P = $0;
 $P =~ s...@.*/@@g;
 
-my $V = '0.29';
+my $V = '0.30';
 
 use Getopt::Long qw(:config no_auto_abbrev);
 
@@ -51,10 +51,10 @@
   --mailback                 only produce a report in case of warnings/errors
   --summary-file             include the filename in summary
   --debug KEY=[0|1]          turn on/off debugging of KEY, where KEY is one of
-                            'values', 'possible', 'type', and 'attr' (default
-                            is all off)
+                             'values', 'possible', 'type', and 'attr' (default
+                             is all off)
   --test-only=WORD           report only warnings/errors containing WORD
-                            literally
+                             literally
   -h, --help, --version      display this help and exit
 
 When FILE is - read standard input.
@@ -130,7 +130,10 @@
 
 my $emitted_corrupt = 0;
 
-our $Ident       = qr{[A-Za-z_][A-Za-z\d_]*};
+our $Ident     = qr{
+                       [A-Za-z_][A-Za-z\d_]*
+                       (?:\s*\#\#\s*[A-Za-z_][A-Za-z\d_]*)*
+               }x;
 our $Storage   = qr{extern|static|asmlinkage};
 our $Sparse    = qr{
                        __user|
@@ -997,23 +1000,25 @@
 
 sub possible {
        my ($possible, $line) = @_;
-
-       print "CHECK<$possible> ($line)\n" if ($dbg_possible > 2);
-       if ($possible !~ /(?:
+       my $notPermitted = qr{(?:
                ^(?:
                        $Modifier|
                        $Storage|
                        $Type|
-                       DEFINE_\S+|
+                       DEFINE_\S+
+               )$|
+               ^(?:
                        goto|
                        return|
                        case|
                        else|
                        asm|__asm__|
                        do
-               )$|
+               )(?:\s|$)|
                ^(?:typedef|struct|enum)\b
-           )/x) {
+           )}x;
+       warn "CHECK<$possible> ($line)\n" if ($dbg_possible > 2);
+       if ($possible !~ $notPermitted) {
                # Check for modifiers.
                $possible =~ s/\s*$Storage\s*//g;
                $possible =~ s/\s*$Sparse\s*//g;
@@ -1022,8 +1027,10 @@
                } elsif ($possible =~ /\s/) {
                        $possible =~ s/\s*$Type\s*//g;
                        for my $modifier (split(' ', $possible)) {
-                               warn "MODIFIER: $modifier ($possible) 
($line)\n" if ($dbg_possible);
-                               push(@modifierList, $modifier);
+                               if ($modifier !~ $notPermitted) {
+                                       warn "MODIFIER: $modifier ($possible) 
($line)\n" if ($dbg_possible);
+                                       push(@modifierList, $modifier);
+                               }
                        }
 
                } else {
@@ -1138,6 +1145,7 @@
        # suppression flags
        my %suppress_ifbraces;
        my %suppress_whiletrailers;
+       my %suppress_export;
 
        # Pre-scan the patch sanitizing the lines.
        # Pre-scan the patch looking for any __setup documentation.
@@ -1230,7 +1238,6 @@
                $linenr++;
 
                my $rawline = $rawlines[$linenr - 1];
-               my $hunk_line = ($realcnt != 0);
 
 #extract the line range in the file after the patch is applied
                if ($line=~/^...@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \...@\@/) {
@@ -1247,6 +1254,7 @@
 
                        %suppress_ifbraces = ();
                        %suppress_whiletrailers = ();
+                       %suppress_export = ();
                        next;
 
 # track the line number as we move through the hunk, note that
@@ -1270,6 +1278,8 @@
                        $realcnt--;
                }
 
+               my $hunk_line = ($realcnt != 0);
+
 #make up the handle for any error we report on this line
                $prefix = "$filename:$realline: " if ($emacs && $file);
                $prefix = "$filename:$linenr: " if ($emacs && !$file);
@@ -1420,13 +1430,22 @@
                }
 
 # Check for potential 'bare' types
-               my ($stat, $cond, $line_nr_next, $remain_next, $off_next);
+               my ($stat, $cond, $line_nr_next, $remain_next, $off_next,
+                   $realline_next);
                if ($realcnt && $line =~ /.\s*\S/) {
                        ($stat, $cond, $line_nr_next, $remain_next, $off_next) =
                                ctx_statement_block($linenr, $realcnt, 0);
                        $stat =~ s/\n./\n /g;
                        $cond =~ s/\n./\n /g;
 
+                       # Find the real next line.
+                       $realline_next = $line_nr_next;
+                       if (defined $realline_next &&
+                           (!defined $lines[$realline_next - 1] ||
+                            substr($lines[$realline_next - 1], $off_next) =~ 
/^\s*$/)) {
+                               $realline_next++;
+                       }
+
                        my $s = $stat;
                        $s =~ s/{.*$//s;
 
@@ -1661,8 +1680,8 @@
                }
 
 # check for initialisation to aggregates open brace on the next line
-               if ($prevline =~ /$Declare\s*$Ident\s*=\s*$/ &&
-                   $line =~ /^.\s*{/) {
+               if ($line =~ /^.\s*{/ &&
+                   $prevline =~ /(?:^|[^=])=\s*$/) {
                        ERROR("that open brace { should be on the previous 
line\n" . $hereprev);
                }
 
@@ -1687,21 +1706,40 @@
                $line =~ s@//.*@@;
                $opline =~ s@//.*@@;
 
-#EXPORT_SYMBOL should immediately follow its function closing }.
-               if (($line =~ /EXPORT_SYMBOL.*\((.*)\)/) ||
-                   ($line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) {
+# EXPORT_SYMBOL should immediately follow the thing it is exporting, consider
+# the whole statement.
+#print "APW <$lines[$realline_next - 1]>\n";
+               if (defined $realline_next &&
+                   exists $lines[$realline_next - 1] &&
+                   !defined $suppress_export{$realline_next} &&
+                   ($lines[$realline_next - 1] =~ /EXPORT_SYMBOL.*\((.*)\)/ ||
+                    $lines[$realline_next - 1] =~ 
/EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) {
                        my $name = $1;
-                       if ($prevline !~ /(?:
-                               ^.}|
+                       if ($stat !~ /(?:
+                               \n.}\s*$|
                                ^.DEFINE_$Ident\(\Q$name\E\)|
                                ^.DECLARE_$Ident\(\Q$name\E\)|
                                ^.LIST_HEAD\(\Q$name\E\)|
-                               ^.$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(|
-                               \b\Q$name\E(?:\s+$Attribute)?\s*(?:;|=|\[)
+                               
^.(?:$Storage\s+)?$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(|
+                               \b\Q$name\E(?:\s+$Attribute)*\s*(?:;|=|\[|\()
                            )/x) {
-                               WARN("EXPORT_SYMBOL(foo); should immediately 
follow its function/variable\n" . $herecurr);
+#print "FOO A<$lines[$realline_next - 1]> stat<$stat> name<$name>\n";
+                               $suppress_export{$realline_next} = 2;
+                       } else {
+                               $suppress_export{$realline_next} = 1;
                        }
                }
+               if (!defined $suppress_export{$linenr} &&
+                   $prevline =~ /^.\s*$/ &&
+                   ($line =~ /EXPORT_SYMBOL.*\((.*)\)/ ||
+                    $line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) {
+#print "FOO B <$lines[$linenr - 1]>\n";
+                       $suppress_export{$linenr} = 2;
+               }
+               if (defined $suppress_export{$linenr} &&
+                   $suppress_export{$linenr} == 2) {
+                       WARN("EXPORT_SYMBOL(foo); should immediately follow its 
function/variable\n" . $herecurr);
+               }
 
 # check for external initialisers.
                if ($line =~ 
/^.$Type\s*$Ident\s*(?:\s+$Modifier)*\s*=\s*(0|NULL|false)\s*;/) {
@@ -2004,13 +2042,13 @@
                                            ($op eq '>' &&
                                             $ca =~ /<\...@\s+$/))
                                        {
-                                               $ok = 1;
+                                               $ok = 1;
                                        }
 
                                        # Ignore ?:
                                        if (($opv eq ':O' && $ca =~ /\?$/) ||
                                            ($op eq '?' && $cc =~ /^:/)) {
-                                               $ok = 1;
+                                               $ok = 1;
                                        }
 
                                        if ($ok == 0) {


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/ac3e520a01e1186e99eb8947cbd3c301d6c1810c

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to