Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (6866): msp3400: CodingStyle cleanups

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
d52c7385 35df38c0

+195 -138
+97 -70
drivers/media/video/msp3400-driver.c
··· 42 42 * 43 43 * You should have received a copy of the GNU General Public License 44 44 * along with this program; if not, write to the Free Software 45 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 45 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 46 + * 02110-1301, USA. 46 47 */ 47 48 48 49 ··· 73 72 int msp_once; /* no continous stereo monitoring */ 74 73 int msp_amsound; /* hard-wire AM sound at 6.5 Hz (france), 75 74 the autoscan seems work well only with FM... */ 76 - int msp_standard = 1; /* Override auto detect of audio msp_standard, if needed. */ 75 + int msp_standard = 1; /* Override auto detect of audio msp_standard, 76 + if needed. */ 77 77 int msp_dolby; 78 78 79 79 int msp_stereo_thresh = 0x190; /* a2 threshold for stereo/bilingual ··· 84 82 module_param(opmode, int, 0444); 85 83 86 84 /* read-write */ 87 - module_param_named(once,msp_once, bool, 0644); 88 - module_param_named(debug,msp_debug, int, 0644); 89 - module_param_named(stereo_threshold,msp_stereo_thresh, int, 0644); 90 - module_param_named(standard,msp_standard, int, 0644); 91 - module_param_named(amsound,msp_amsound, bool, 0644); 92 - module_param_named(dolby,msp_dolby, bool, 0644); 85 + module_param_named(once, msp_once, bool, 0644); 86 + module_param_named(debug, msp_debug, int, 0644); 87 + module_param_named(stereo_threshold, msp_stereo_thresh, int, 0644); 88 + module_param_named(standard, msp_standard, int, 0644); 89 + module_param_named(amsound, msp_amsound, bool, 0644); 90 + module_param_named(dolby, msp_dolby, bool, 0644); 93 91 94 92 MODULE_PARM_DESC(opmode, "Forces a MSP3400 opmode. 0=Manual, 1=Autodetect, 2=Autodetect and autoselect"); 95 93 MODULE_PARM_DESC(once, "No continuous stereo monitoring"); ··· 163 161 schedule_timeout_interruptible(msecs_to_jiffies(10)); 164 162 } 165 163 if (err == 3) { 166 - v4l_warn(client, "giving up, resetting chip. Sound will go off, sorry folks :-|\n"); 164 + v4l_warn(client, "resetting chip, sound will go off.\n"); 167 165 msp_reset(client); 168 166 return -1; 169 167 } 170 168 retval = read[0] << 8 | read[1]; 171 - v4l_dbg(3, msp_debug, client, "msp_read(0x%x, 0x%x): 0x%x\n", dev, addr, retval); 169 + v4l_dbg(3, msp_debug, client, "msp_read(0x%x, 0x%x): 0x%x\n", 170 + dev, addr, retval); 172 171 return retval; 173 172 } 174 173 ··· 194 191 buffer[3] = val >> 8; 195 192 buffer[4] = val & 0xff; 196 193 197 - v4l_dbg(3, msp_debug, client, "msp_write(0x%x, 0x%x, 0x%x)\n", dev, addr, val); 194 + v4l_dbg(3, msp_debug, client, "msp_write(0x%x, 0x%x, 0x%x)\n", 195 + dev, addr, val); 198 196 for (err = 0; err < 3; err++) { 199 197 if (i2c_master_send(client, buffer, 5) == 5) 200 198 break; ··· 204 200 schedule_timeout_interruptible(msecs_to_jiffies(10)); 205 201 } 206 202 if (err == 3) { 207 - v4l_warn(client, "giving up, resetting chip. Sound will go off, sorry folks :-|\n"); 203 + v4l_warn(client, "resetting chip, sound will go off.\n"); 208 204 msp_reset(client); 209 205 return -1; 210 206 } ··· 278 274 state->acb = 0xf60; /* Mute Input and SCART 1 Output */ 279 275 280 276 v4l_dbg(1, msp_debug, client, "scart switch: %s => %d (ACB=0x%04x)\n", 281 - scart_names[in], out, state->acb); 277 + scart_names[in], out, state->acb); 282 278 msp_write_dsp(client, 0x13, state->acb); 283 279 284 280 /* Sets I2S speed 0 = 1.024 Mbps, 1 = 2.048 Mbps */ ··· 297 293 val = (state->volume * 0x7f / 65535) << 8; 298 294 299 295 v4l_dbg(1, msp_debug, client, "mute=%s scanning=%s volume=%d\n", 300 - state->muted ? "on" : "off", state->scan_in_progress ? "yes" : "no", 296 + state->muted ? "on" : "off", 297 + state->scan_in_progress ? "yes" : "no", 301 298 state->volume); 302 299 303 300 msp_write_dsp(client, 0x0000, val); ··· 687 682 v4l_dbg(1, msp_debug, client, "Setting I2S speed to %d\n", *a); 688 683 689 684 switch (*a) { 690 - case 1024000: 691 - state->i2s_mode = 0; 692 - break; 693 - case 2048000: 694 - state->i2s_mode = 1; 695 - break; 696 - default: 697 - return -EINVAL; 685 + case 1024000: 686 + state->i2s_mode = 0; 687 + break; 688 + case 2048000: 689 + state->i2s_mode = 1; 690 + break; 691 + default: 692 + return -EINVAL; 698 693 } 699 694 break; 700 695 } ··· 704 699 struct v4l2_queryctrl *qc = arg; 705 700 706 701 switch (qc->id) { 707 - case V4L2_CID_AUDIO_VOLUME: 708 - case V4L2_CID_AUDIO_MUTE: 709 - return v4l2_ctrl_query_fill_std(qc); 710 - default: 711 - break; 702 + case V4L2_CID_AUDIO_VOLUME: 703 + case V4L2_CID_AUDIO_MUTE: 704 + return v4l2_ctrl_query_fill_std(qc); 705 + default: 706 + break; 712 707 } 713 708 if (!state->has_sound_processing) 714 709 return -EINVAL; 715 710 switch (qc->id) { 716 - case V4L2_CID_AUDIO_LOUDNESS: 717 - case V4L2_CID_AUDIO_BALANCE: 718 - case V4L2_CID_AUDIO_BASS: 719 - case V4L2_CID_AUDIO_TREBLE: 720 - return v4l2_ctrl_query_fill_std(qc); 721 - default: 722 - return -EINVAL; 711 + case V4L2_CID_AUDIO_LOUDNESS: 712 + case V4L2_CID_AUDIO_BALANCE: 713 + case V4L2_CID_AUDIO_BASS: 714 + case V4L2_CID_AUDIO_TREBLE: 715 + return v4l2_ctrl_query_fill_std(qc); 716 + default: 717 + return -EINVAL; 723 718 } 724 719 } 725 720 ··· 741 736 state->volume, state->muted ? " (muted)" : ""); 742 737 if (state->has_sound_processing) { 743 738 v4l_info(client, "Audio: balance %d bass %d treble %d loudness %s\n", 744 - state->balance, state->bass, state->treble, 739 + state->balance, state->bass, 740 + state->treble, 745 741 state->loudness ? "on" : "off"); 746 742 } 747 743 switch (state->mode) { 748 744 case MSP_MODE_AM_DETECT: p = "AM (for carrier detect)"; break; 749 745 case MSP_MODE_FM_RADIO: p = "FM Radio"; break; 750 - case MSP_MODE_FM_TERRA: p = "Terrestial FM-mono + FM-stereo"; break; 746 + case MSP_MODE_FM_TERRA: p = "Terrestial FM-mono/stereo"; break; 751 747 case MSP_MODE_FM_SAT: p = "Satellite FM-mono"; break; 752 748 case MSP_MODE_FM_NICAM1: p = "NICAM/FM (B/G, D/K)"; break; 753 749 case MSP_MODE_FM_NICAM2: p = "NICAM/FM (I)"; break; ··· 779 773 } 780 774 781 775 case VIDIOC_G_CHIP_IDENT: 782 - return v4l2_chip_ident_i2c_client(client, arg, state->ident, (state->rev1 << 16) | state->rev2); 776 + return v4l2_chip_ident_i2c_client(client, arg, state->ident, 777 + (state->rev1 << 16) | state->rev2); 783 778 784 779 default: 785 780 /* unknown */ ··· 823 816 } 824 817 825 818 state = kzalloc(sizeof(*state), GFP_KERNEL); 826 - if (!state) { 819 + if (!state) 827 820 return -ENOMEM; 828 - } 829 821 830 822 i2c_set_clientdata(client, state); 831 823 ··· 846 840 state->rev1 = msp_read_dsp(client, 0x1e); 847 841 if (state->rev1 != -1) 848 842 state->rev2 = msp_read_dsp(client, 0x1f); 849 - v4l_dbg(1, msp_debug, client, "rev1=0x%04x, rev2=0x%04x\n", state->rev1, state->rev2); 843 + v4l_dbg(1, msp_debug, client, "rev1=0x%04x, rev2=0x%04x\n", 844 + state->rev1, state->rev2); 850 845 if (state->rev1 == -1 || (state->rev1 == 0 && state->rev2 == 0)) { 851 - v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n"); 846 + v4l_dbg(1, msp_debug, client, 847 + "not an msp3400 (cannot read chip version)\n"); 852 848 kfree(state); 853 849 return -ENODEV; 854 850 } ··· 868 860 msp_family, msp_product, 869 861 msp_revision, msp_hard, msp_rom); 870 862 /* Rev B=2, C=3, D=4, G=7 */ 871 - state->ident = msp_family * 10000 + 4000 + msp_product * 10 + msp_revision - '@'; 863 + state->ident = msp_family * 10000 + 4000 + msp_product * 10 + 864 + msp_revision - '@'; 872 865 873 866 /* Has NICAM support: all mspx41x and mspx45x products have NICAM */ 874 - state->has_nicam = msp_prod_hi == 1 || msp_prod_hi == 5; 867 + state->has_nicam = 868 + msp_prod_hi == 1 || msp_prod_hi == 5; 875 869 /* Has radio support: was added with revision G */ 876 - state->has_radio = msp_revision >= 'G'; 870 + state->has_radio = 871 + msp_revision >= 'G'; 877 872 /* Has headphones output: not for stripped down products */ 878 - state->has_headphones = msp_prod_lo < 5; 873 + state->has_headphones = 874 + msp_prod_lo < 5; 879 875 /* Has scart2 input: not in stripped down products of the '3' family */ 880 - state->has_scart2 = msp_family >= 4 || msp_prod_lo < 7; 876 + state->has_scart2 = 877 + msp_family >= 4 || msp_prod_lo < 7; 881 878 /* Has scart3 input: not in stripped down products of the '3' family */ 882 - state->has_scart3 = msp_family >= 4 || msp_prod_lo < 5; 879 + state->has_scart3 = 880 + msp_family >= 4 || msp_prod_lo < 5; 883 881 /* Has scart4 input: not in pre D revisions, not in stripped D revs */ 884 - state->has_scart4 = msp_family >= 4 || (msp_revision >= 'D' && msp_prod_lo < 5); 885 - /* Has scart2 output: not in stripped down products of the '3' family */ 886 - state->has_scart2_out = msp_family >= 4 || msp_prod_lo < 5; 882 + state->has_scart4 = 883 + msp_family >= 4 || (msp_revision >= 'D' && msp_prod_lo < 5); 884 + /* Has scart2 output: not in stripped down products of 885 + * the '3' family */ 886 + state->has_scart2_out = 887 + msp_family >= 4 || msp_prod_lo < 5; 887 888 /* Has scart2 a volume control? Not in pre-D revisions. */ 888 - state->has_scart2_out_volume = msp_revision > 'C' && state->has_scart2_out; 889 + state->has_scart2_out_volume = 890 + msp_revision > 'C' && state->has_scart2_out; 889 891 /* Has a configurable i2s out? */ 890 - state->has_i2s_conf = msp_revision >= 'G' && msp_prod_lo < 7; 891 - /* Has subwoofer output: not in pre-D revs and not in stripped down products */ 892 - state->has_subwoofer = msp_revision >= 'D' && msp_prod_lo < 5; 893 - /* Has soundprocessing (bass/treble/balance/loudness/equalizer): not in 894 - stripped down products */ 895 - state->has_sound_processing = msp_prod_lo < 7; 892 + state->has_i2s_conf = 893 + msp_revision >= 'G' && msp_prod_lo < 7; 894 + /* Has subwoofer output: not in pre-D revs and not in stripped down 895 + * products */ 896 + state->has_subwoofer = 897 + msp_revision >= 'D' && msp_prod_lo < 5; 898 + /* Has soundprocessing (bass/treble/balance/loudness/equalizer): 899 + * not in stripped down products */ 900 + state->has_sound_processing = 901 + msp_prod_lo < 7; 896 902 /* Has Virtual Dolby Surround: only in msp34x1 */ 897 - state->has_virtual_dolby_surround = msp_revision == 'G' && msp_prod_lo == 1; 903 + state->has_virtual_dolby_surround = 904 + msp_revision == 'G' && msp_prod_lo == 1; 898 905 /* Has Virtual Dolby Surround & Dolby Pro Logic: only in msp34x2 */ 899 - state->has_dolby_pro_logic = msp_revision == 'G' && msp_prod_lo == 2; 900 - /* The msp343xG supports BTSC only and cannot do Automatic Standard Detection. */ 901 - state->force_btsc = msp_family == 3 && msp_revision == 'G' && msp_prod_hi == 3; 906 + state->has_dolby_pro_logic = 907 + msp_revision == 'G' && msp_prod_lo == 2; 908 + /* The msp343xG supports BTSC only and cannot do Automatic Standard 909 + * Detection. */ 910 + state->force_btsc = 911 + msp_family == 3 && msp_revision == 'G' && msp_prod_hi == 3; 902 912 903 913 state->opmode = opmode; 904 914 if (state->opmode == OPMODE_AUTO) { ··· 931 905 } 932 906 933 907 /* hello world :-) */ 934 - v4l_info(client, "%s found @ 0x%x (%s)\n", client->name, client->addr << 1, client->adapter->name); 908 + v4l_info(client, "%s found @ 0x%x (%s)\n", client->name, 909 + client->addr << 1, client->adapter->name); 935 910 v4l_info(client, "%s ", client->name); 936 911 if (state->has_nicam && state->has_radio) 937 - printk("supports nicam and radio, "); 912 + printk(KERN_CONT "supports nicam and radio, "); 938 913 else if (state->has_nicam) 939 - printk("supports nicam, "); 914 + printk(KERN_CONT "supports nicam, "); 940 915 else if (state->has_radio) 941 - printk("supports radio, "); 942 - printk("mode is "); 916 + printk(KERN_CONT "supports radio, "); 917 + printk(KERN_CONT "mode is "); 943 918 944 919 /* version-specific initialization */ 945 920 switch (state->opmode) { 946 921 case OPMODE_MANUAL: 947 - printk("manual"); 922 + printk(KERN_CONT "manual"); 948 923 thread_func = msp3400c_thread; 949 924 break; 950 925 case OPMODE_AUTODETECT: 951 - printk("autodetect"); 926 + printk(KERN_CONT "autodetect"); 952 927 thread_func = msp3410d_thread; 953 928 break; 954 929 case OPMODE_AUTOSELECT: 955 - printk("autodetect and autoselect"); 930 + printk(KERN_CONT "autodetect and autoselect"); 956 931 thread_func = msp34xxg_thread; 957 932 break; 958 933 } 959 - printk("\n"); 934 + printk(KERN_CONT "\n"); 960 935 961 936 /* startup control thread if needed */ 962 937 if (thread_func) {
+98 -68
drivers/media/video/msp3400-kthreads.c
··· 15 15 * 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 + * 02110-1301, USA. 19 20 */ 20 21 21 22 ··· 79 78 {75, 19, 36, 35, 39, 40}, 80 79 MSP_CARRIER(5.5), MSP_CARRIER(5.5), 81 80 0x00d0, 0x0500, 0x0020, 0x3000 82 - },{ /* AM (for carrier detect / msp3410) */ 81 + }, { /* AM (for carrier detect / msp3410) */ 83 82 {-1, -1, -8, 2, 59, 126}, 84 83 {-1, -1, -8, 2, 59, 126}, 85 84 MSP_CARRIER(5.5), MSP_CARRIER(5.5), 86 85 0x00d0, 0x0100, 0x0020, 0x3000 87 - },{ /* FM Radio */ 86 + }, { /* FM Radio */ 88 87 {-8, -8, 4, 6, 78, 107}, 89 88 {-8, -8, 4, 6, 78, 107}, 90 89 MSP_CARRIER(10.7), MSP_CARRIER(10.7), 91 90 0x00d0, 0x0480, 0x0020, 0x3000 92 - },{ /* Terrestial FM-mono + FM-stereo */ 91 + }, { /* Terrestial FM-mono + FM-stereo */ 93 92 {3, 18, 27, 48, 66, 72}, 94 93 {3, 18, 27, 48, 66, 72}, 95 94 MSP_CARRIER(5.5), MSP_CARRIER(5.5), 96 95 0x00d0, 0x0480, 0x0030, 0x3000 97 - },{ /* Sat FM-mono */ 96 + }, { /* Sat FM-mono */ 98 97 { 1, 9, 14, 24, 33, 37}, 99 98 { 3, 18, 27, 48, 66, 72}, 100 99 MSP_CARRIER(6.5), MSP_CARRIER(6.5), 101 100 0x00c6, 0x0480, 0x0000, 0x3000 102 - },{ /* NICAM/FM -- B/G (5.5/5.85), D/K (6.5/5.85) */ 101 + }, { /* NICAM/FM -- B/G (5.5/5.85), D/K (6.5/5.85) */ 103 102 {-2, -8, -10, 10, 50, 86}, 104 103 {3, 18, 27, 48, 66, 72}, 105 104 MSP_CARRIER(5.5), MSP_CARRIER(5.5), 106 105 0x00d0, 0x0040, 0x0120, 0x3000 107 - },{ /* NICAM/FM -- I (6.0/6.552) */ 106 + }, { /* NICAM/FM -- I (6.0/6.552) */ 108 107 {2, 4, -6, -4, 40, 94}, 109 108 {3, 18, 27, 48, 66, 72}, 110 109 MSP_CARRIER(6.0), MSP_CARRIER(6.0), 111 110 0x00d0, 0x0040, 0x0120, 0x3000 112 - },{ /* NICAM/AM -- L (6.5/5.85) */ 111 + }, { /* NICAM/AM -- L (6.5/5.85) */ 113 112 {-2, -8, -10, 10, 50, 86}, 114 113 {-4, -12, -9, 23, 79, 126}, 115 114 MSP_CARRIER(6.5), MSP_CARRIER(6.5), ··· 225 224 nor do they support stereo BTSC. */ 226 225 static void msp3400c_set_audmode(struct i2c_client *client) 227 226 { 228 - static char *strmode[] = { "mono", "stereo", "lang2", "lang1", "lang1+lang2" }; 227 + static char *strmode[] = { 228 + "mono", "stereo", "lang2", "lang1", "lang1+lang2" 229 + }; 229 230 struct msp_state *state = i2c_get_clientdata(client); 230 231 char *modestr = (state->audmode >= 0 && state->audmode < 5) ? 231 232 strmode[state->audmode] : "unknown"; ··· 301 298 case MSP_MODE_FM_NICAM1: 302 299 case MSP_MODE_FM_NICAM2: 303 300 case MSP_MODE_AM_NICAM: 304 - v4l_dbg(1, msp_debug, client, "NICAM set_audmode: %s\n",modestr); 301 + v4l_dbg(1, msp_debug, client, 302 + "NICAM set_audmode: %s\n", modestr); 305 303 if (state->nicam_on) 306 304 src = 0x0100; /* NICAM */ 307 305 break; 308 306 case MSP_MODE_BTSC: 309 - v4l_dbg(1, msp_debug, client, "BTSC set_audmode: %s\n",modestr); 307 + v4l_dbg(1, msp_debug, client, 308 + "BTSC set_audmode: %s\n", modestr); 310 309 break; 311 310 case MSP_MODE_EXTERN: 312 - v4l_dbg(1, msp_debug, client, "extern set_audmode: %s\n",modestr); 311 + v4l_dbg(1, msp_debug, client, 312 + "extern set_audmode: %s\n", modestr); 313 313 src = 0x0200; /* SCART */ 314 314 break; 315 315 case MSP_MODE_FM_RADIO: 316 - v4l_dbg(1, msp_debug, client, "FM-Radio set_audmode: %s\n",modestr); 316 + v4l_dbg(1, msp_debug, client, 317 + "FM-Radio set_audmode: %s\n", modestr); 317 318 break; 318 319 default: 319 320 v4l_dbg(1, msp_debug, client, "mono set_audmode\n"); ··· 349 342 src |= 0x0010; 350 343 break; 351 344 } 352 - v4l_dbg(1, msp_debug, client, "set_audmode final source/matrix = 0x%x\n", src); 345 + v4l_dbg(1, msp_debug, client, 346 + "set_audmode final source/matrix = 0x%x\n", src); 353 347 354 348 msp_set_source(client, src); 355 349 } ··· 359 351 { 360 352 struct msp_state *state = i2c_get_clientdata(client); 361 353 362 - if (state->main == state->second) { 363 - v4l_dbg(1, msp_debug, client, "mono sound carrier: %d.%03d MHz\n", 364 - state->main / 910000, (state->main / 910) % 1000); 365 - } else { 366 - v4l_dbg(1, msp_debug, client, "main sound carrier: %d.%03d MHz\n", 367 - state->main / 910000, (state->main / 910) % 1000); 368 - } 354 + if (state->main == state->second) 355 + v4l_dbg(1, msp_debug, client, 356 + "mono sound carrier: %d.%03d MHz\n", 357 + state->main / 910000, (state->main / 910) % 1000); 358 + else 359 + v4l_dbg(1, msp_debug, client, 360 + "main sound carrier: %d.%03d MHz\n", 361 + state->main / 910000, (state->main / 910) % 1000); 369 362 if (state->mode == MSP_MODE_FM_NICAM1 || state->mode == MSP_MODE_FM_NICAM2) 370 - v4l_dbg(1, msp_debug, client, "NICAM/FM carrier : %d.%03d MHz\n", 371 - state->second / 910000, (state->second/910) % 1000); 363 + v4l_dbg(1, msp_debug, client, 364 + "NICAM/FM carrier : %d.%03d MHz\n", 365 + state->second / 910000, (state->second/910) % 1000); 372 366 if (state->mode == MSP_MODE_AM_NICAM) 373 - v4l_dbg(1, msp_debug, client, "NICAM/AM carrier : %d.%03d MHz\n", 374 - state->second / 910000, (state->second / 910) % 1000); 367 + v4l_dbg(1, msp_debug, client, 368 + "NICAM/AM carrier : %d.%03d MHz\n", 369 + state->second / 910000, (state->second / 910) % 1000); 375 370 if (state->mode == MSP_MODE_FM_TERRA && state->main != state->second) { 376 - v4l_dbg(1, msp_debug, client, "FM-stereo carrier : %d.%03d MHz\n", 377 - state->second / 910000, (state->second / 910) % 1000); 371 + v4l_dbg(1, msp_debug, client, 372 + "FM-stereo carrier : %d.%03d MHz\n", 373 + state->second / 910000, (state->second / 910) % 1000); 378 374 } 379 375 } 380 376 ··· 397 385 val = msp_read_dsp(client, 0x18); 398 386 if (val > 32767) 399 387 val -= 65536; 400 - v4l_dbg(2, msp_debug, client, "stereo detect register: %d\n", val); 388 + v4l_dbg(2, msp_debug, client, 389 + "stereo detect register: %d\n", val); 401 390 if (val > 8192) { 402 391 rxsubchans = V4L2_TUNER_SUB_STEREO; 403 392 } else if (val < -4096) { ··· 443 430 } 444 431 if (rxsubchans != state->rxsubchans) { 445 432 update = 1; 446 - v4l_dbg(1, msp_debug, client, "watch: rxsubchans %02x => %02x\n", 433 + v4l_dbg(1, msp_debug, client, 434 + "watch: rxsubchans %02x => %02x\n", 447 435 state->rxsubchans, rxsubchans); 448 436 state->rxsubchans = rxsubchans; 449 437 } ··· 466 452 { 467 453 struct msp_state *state = i2c_get_clientdata(client); 468 454 469 - if (msp_detect_stereo(client)) { 455 + if (msp_detect_stereo(client)) 470 456 msp_set_audmode(client); 471 - } 472 457 473 458 if (msp_once) 474 459 state->watch_stereo = 0; ··· 478 465 struct i2c_client *client = data; 479 466 struct msp_state *state = i2c_get_clientdata(client); 480 467 struct msp3400c_carrier_detect *cd; 481 - int count, max1, max2, val1, val2, val, this; 468 + int count, max1, max2, val1, val2, val, i; 482 469 483 470 484 471 v4l_dbg(1, msp_debug, client, "msp3400 daemon started\n"); ··· 488 475 msp_sleep(state, -1); 489 476 v4l_dbg(2, msp_debug, client, "msp3400 thread: wakeup\n"); 490 477 491 - restart: 478 + restart: 492 479 v4l_dbg(2, msp_debug, client, "thread: restart scan\n"); 493 480 state->restart = 0; 494 481 if (kthread_should_stop()) ··· 496 483 497 484 if (state->radio || MSP_MODE_EXTERN == state->mode) { 498 485 /* no carrier scan, just unmute */ 499 - v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n"); 486 + v4l_dbg(1, msp_debug, client, 487 + "thread: no carrier scan\n"); 500 488 state->scan_in_progress = 0; 501 489 msp_set_audio(client); 502 490 continue; ··· 528 514 v4l_dbg(1, msp_debug, client, "AM sound override\n"); 529 515 } 530 516 531 - for (this = 0; this < count; this++) { 532 - msp3400c_set_carrier(client, cd[this].cdo, cd[this].cdo); 533 - if (msp_sleep(state,100)) 517 + for (i = 0; i < count; i++) { 518 + msp3400c_set_carrier(client, cd[i].cdo, cd[i].cdo); 519 + if (msp_sleep(state, 100)) 534 520 goto restart; 535 521 val = msp_read_dsp(client, 0x1b); 536 522 if (val > 32767) 537 523 val -= 65536; 538 524 if (val1 < val) 539 - val1 = val, max1 = this; 540 - v4l_dbg(1, msp_debug, client, "carrier1 val: %5d / %s\n", val,cd[this].name); 525 + val1 = val, max1 = i; 526 + v4l_dbg(1, msp_debug, client, 527 + "carrier1 val: %5d / %s\n", val, cd[i].name); 541 528 } 542 529 543 530 /* carrier detect pass #2 -- second (stereo) carrier */ ··· 565 550 count = 0; 566 551 max2 = 0; 567 552 } 568 - for (this = 0; this < count; this++) { 569 - msp3400c_set_carrier(client, cd[this].cdo, cd[this].cdo); 570 - if (msp_sleep(state,100)) 553 + for (i = 0; i < count; i++) { 554 + msp3400c_set_carrier(client, cd[i].cdo, cd[i].cdo); 555 + if (msp_sleep(state, 100)) 571 556 goto restart; 572 557 val = msp_read_dsp(client, 0x1b); 573 558 if (val > 32767) 574 559 val -= 65536; 575 560 if (val2 < val) 576 - val2 = val, max2 = this; 577 - v4l_dbg(1, msp_debug, client, "carrier2 val: %5d / %s\n", val,cd[this].name); 561 + val2 = val, max2 = i; 562 + v4l_dbg(1, msp_debug, client, 563 + "carrier2 val: %5d / %s\n", val, cd[i].name); 578 564 } 579 565 580 566 /* program the msp3400 according to the results */ ··· 627 611 break; 628 612 case 0: /* 4.5 */ 629 613 default: 630 - no_second: 614 + no_second: 631 615 state->second = msp3400c_carrier_detect_main[max1].cdo; 632 616 msp3400c_set_mode(client, MSP_MODE_FM_TERRA); 633 617 break; ··· 648 632 while (state->watch_stereo) { 649 633 if (msp_sleep(state, count ? 1000 : 5000)) 650 634 goto restart; 651 - if (count) count--; 635 + if (count) 636 + count--; 652 637 watch_stereo(client); 653 638 } 654 639 } ··· 668 651 set_freezable(); 669 652 for (;;) { 670 653 v4l_dbg(2, msp_debug, client, "msp3410 thread: sleep\n"); 671 - msp_sleep(state,-1); 654 + msp_sleep(state, -1); 672 655 v4l_dbg(2, msp_debug, client, "msp3410 thread: wakeup\n"); 673 656 674 - restart: 657 + restart: 675 658 v4l_dbg(2, msp_debug, client, "thread: restart scan\n"); 676 659 state->restart = 0; 677 660 if (kthread_should_stop()) ··· 679 662 680 663 if (state->mode == MSP_MODE_EXTERN) { 681 664 /* no carrier scan needed, just unmute */ 682 - v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n"); 665 + v4l_dbg(1, msp_debug, client, 666 + "thread: no carrier scan\n"); 683 667 state->scan_in_progress = 0; 684 668 msp_set_audio(client); 685 669 continue; ··· 691 673 msp_set_audio(client); 692 674 693 675 /* start autodetect. Note: autodetect is not supported for 694 - NTSC-M and radio, hence we force the standard in those cases. */ 676 + NTSC-M and radio, hence we force the standard in those 677 + cases. */ 695 678 if (state->radio) 696 679 std = 0x40; 697 680 else ··· 705 686 goto restart; 706 687 707 688 if (msp_debug) 708 - v4l_dbg(2, msp_debug, client, "setting standard: %s (0x%04x)\n", 709 - msp_standard_std_name(std), std); 689 + v4l_dbg(2, msp_debug, client, 690 + "setting standard: %s (0x%04x)\n", 691 + msp_standard_std_name(std), std); 710 692 711 693 if (std != 1) { 712 694 /* programmed some specific mode */ ··· 723 703 val = msp_read_dem(client, 0x7e); 724 704 if (val < 0x07ff) 725 705 break; 726 - v4l_dbg(2, msp_debug, client, "detection still in progress\n"); 706 + v4l_dbg(2, msp_debug, client, 707 + "detection still in progress\n"); 727 708 } 728 709 } 729 710 for (i = 0; msp_stdlist[i].name != NULL; i++) ··· 737 716 state->std = val; 738 717 state->rxsubchans = V4L2_TUNER_SUB_MONO; 739 718 740 - if (msp_amsound && !state->radio && (state->v4l2_std & V4L2_STD_SECAM) && 741 - (val != 0x0009)) { 719 + if (msp_amsound && !state->radio && 720 + (state->v4l2_std & V4L2_STD_SECAM) && (val != 0x0009)) { 742 721 /* autodetection has failed, let backup */ 743 722 v4l_dbg(1, msp_debug, client, "autodetection failed," 744 723 " switching to backup standard: %s (0x%04x)\n", 745 - msp_stdlist[8].name ? msp_stdlist[8].name : "unknown",val); 724 + msp_stdlist[8].name ? 725 + msp_stdlist[8].name : "unknown", val); 746 726 state->std = val = 0x0009; 747 727 msp_write_dem(client, 0x20, val); 748 728 } ··· 808 786 while (state->watch_stereo) { 809 787 if (msp_sleep(state, count ? 1000 : 5000)) 810 788 goto restart; 811 - if (count) count--; 789 + if (count) 790 + count--; 812 791 watch_stereo(client); 813 792 } 814 793 } ··· 895 872 else 896 873 source = (in << 8) | matrix; 897 874 898 - v4l_dbg(1, msp_debug, client, "set source to %d (0x%x) for output %02x\n", 899 - in, source, reg); 875 + v4l_dbg(1, msp_debug, client, 876 + "set source to %d (0x%x) for output %02x\n", in, source, reg); 900 877 msp_write_dsp(client, reg, source); 901 878 } 902 879 ··· 971 948 msp_sleep(state, -1); 972 949 v4l_dbg(2, msp_debug, client, "msp34xxg thread: wakeup\n"); 973 950 974 - restart: 951 + restart: 975 952 v4l_dbg(1, msp_debug, client, "thread: restart scan\n"); 976 953 state->restart = 0; 977 954 if (kthread_should_stop()) ··· 979 956 980 957 if (state->mode == MSP_MODE_EXTERN) { 981 958 /* no carrier scan needed, just unmute */ 982 - v4l_dbg(1, msp_debug, client, "thread: no carrier scan\n"); 959 + v4l_dbg(1, msp_debug, client, 960 + "thread: no carrier scan\n"); 983 961 state->scan_in_progress = 0; 984 962 msp_set_audio(client); 985 963 continue; ··· 996 972 goto unmute; 997 973 998 974 /* watch autodetect */ 999 - v4l_dbg(1, msp_debug, client, "started autodetect, waiting for result\n"); 975 + v4l_dbg(1, msp_debug, client, 976 + "started autodetect, waiting for result\n"); 1000 977 for (i = 0; i < 10; i++) { 1001 978 if (msp_sleep(state, 100)) 1002 979 goto restart; ··· 1008 983 state->std = val; 1009 984 break; 1010 985 } 1011 - v4l_dbg(2, msp_debug, client, "detection still in progress\n"); 986 + v4l_dbg(2, msp_debug, client, 987 + "detection still in progress\n"); 1012 988 } 1013 989 if (state->std == 1) { 1014 - v4l_dbg(1, msp_debug, client, "detection still in progress after 10 tries. giving up.\n"); 990 + v4l_dbg(1, msp_debug, client, 991 + "detection still in progress after 10 tries. giving up.\n"); 1015 992 continue; 1016 993 } 1017 994 1018 - unmute: 1019 - v4l_dbg(1, msp_debug, client, "detected standard: %s (0x%04x)\n", 995 + unmute: 996 + v4l_dbg(1, msp_debug, client, 997 + "detected standard: %s (0x%04x)\n", 1020 998 msp_standard_std_name(state->std), state->std); 1021 999 1022 1000 if (state->std == 9) { ··· 1074 1046 if (state->std == 0x20) 1075 1047 state->rxsubchans |= V4L2_TUNER_SUB_SAP; 1076 1048 else 1077 - state->rxsubchans = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2; 1049 + state->rxsubchans = 1050 + V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2; 1078 1051 } 1079 - v4l_dbg(1, msp_debug, client, "status=0x%x, stereo=%d, bilingual=%d -> rxsubchans=%d\n", 1052 + v4l_dbg(1, msp_debug, client, 1053 + "status=0x%x, stereo=%d, bilingual=%d -> rxsubchans=%d\n", 1080 1054 status, is_stereo, is_bilingual, state->rxsubchans); 1081 1055 return (oldrx != state->rxsubchans); 1082 1056 }