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

[media] cx88: convert it to use pr_foo() macros

Instead of calling printk() directly, use pr_foo()
macros, as suggested at the Kernel's coding style.

Please notice that a conversion to dev_foo() is not trivial,
as several parts on this driver uses pr_cont().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Mauro Carvalho Chehab and committed by
Mauro Carvalho Chehab
65bc2fe8 3b0cb24f

+311 -343
+10 -16
drivers/media/pci/cx88/cx88-alsa.c
··· 24 24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 25 */ 26 26 27 + #include "cx88.h" 28 + #include "cx88-reg.h" 29 + 27 30 #include <linux/module.h> 28 31 #include <linux/init.h> 29 32 #include <linux/device.h> ··· 45 42 #include <sound/tlv.h> 46 43 #include <media/i2c/wm8775.h> 47 44 48 - #include "cx88.h" 49 - #include "cx88-reg.h" 50 - 51 45 #define dprintk(level, fmt, arg...) do { \ 52 46 if (debug + 1 > level) \ 53 - printk(KERN_INFO "%s/1: " fmt, chip->core->name , ## arg);\ 54 - } while(0) 55 - 56 - #define dprintk_core(level, fmt, arg...) do { \ 57 - if (debug + 1 > level) \ 58 - printk(KERN_DEBUG "%s/1: " fmt, chip->core->name , ## arg);\ 59 - } while(0) 47 + printk(KERN_DEBUG pr_fmt("%s: alsa: " fmt), \ 48 + chip->core->name, ##arg); \ 49 + } while (0) 60 50 61 51 /**************************************************************************** 62 52 Data type declarations - Can be moded to a header file later ··· 226 230 return; 227 231 cx_write(MO_AUD_INTSTAT, status); 228 232 if (debug > 1 || (status & mask & ~0xff)) 229 - cx88_print_irqbits(core->name, "irq aud", 233 + cx88_print_irqbits("irq aud", 230 234 cx88_aud_irqs, ARRAY_SIZE(cx88_aud_irqs), 231 235 status, mask); 232 236 /* risc op code error */ 233 237 if (status & AUD_INT_OPC_ERR) { 234 - printk(KERN_WARNING "%s/1: Audio risc op code error\n",core->name); 238 + pr_warn("Audio risc op code error\n"); 235 239 cx_clear(MO_AUD_DMACNTRL, 0x11); 236 240 cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH25]); 237 241 } ··· 275 279 } 276 280 277 281 if (MAX_IRQ_LOOP == loop) { 278 - printk(KERN_ERR 279 - "%s/1: IRQ loop detected, disabling interrupts\n", 280 - core->name); 282 + pr_err("IRQ loop detected, disabling interrupts\n"); 281 283 cx_clear(MO_PCI_INTMSK, PCI_INT_AUDINT); 282 284 } 283 285 ··· 417 423 int err; 418 424 419 425 if (!chip) { 420 - printk(KERN_ERR "BUG: cx88 can't find device struct. Can't proceed with open\n"); 426 + pr_err("BUG: cx88 can't find device struct. Can't proceed with open\n"); 421 427 return -ENODEV; 422 428 } 423 429
+15 -16
drivers/media/pci/cx88/cx88-blackbird.c
··· 26 26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 27 27 */ 28 28 29 + #include "cx88.h" 30 + 29 31 #include <linux/module.h> 30 32 #include <linux/init.h> 31 33 #include <linux/slab.h> ··· 40 38 #include <media/v4l2-event.h> 41 39 #include <media/drv-intf/cx2341x.h> 42 40 43 - #include "cx88.h" 44 - 45 41 MODULE_DESCRIPTION("driver for cx2388x/cx23416 based mpeg encoder cards"); 46 42 MODULE_AUTHOR("Jelle Foks <jelle@foks.us>, Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); 47 43 MODULE_LICENSE("GPL"); ··· 49 49 module_param(debug,int,0644); 50 50 MODULE_PARM_DESC(debug,"enable debug messages [blackbird]"); 51 51 52 - #define dprintk(level, fmt, arg...) do { \ 53 - if (debug + 1 > level) \ 54 - printk(KERN_DEBUG "%s/2-bb: " fmt, dev->core->name , ## arg); \ 55 - } while(0) 52 + #define dprintk(level, fmt, arg...) do { \ 53 + if (debug + 1 > level) \ 54 + printk(KERN_DEBUG pr_fmt("%s: blackbird:" fmt), \ 55 + __func__, ##arg); \ 56 + } while (0) 56 57 57 58 /* ------------------------------------------------------------------ */ 58 59 ··· 447 446 448 447 if (retval != 0) { 449 448 pr_err("Hotplug firmware request failed (%s).\n", 450 - CX2341X_FIRM_ENC_FILENAME); 449 + CX2341X_FIRM_ENC_FILENAME); 451 450 pr_err("Please fix your hotplug setup, the board will not work without firmware loaded!\n"); 452 451 return -EIO; 453 452 } 454 453 455 454 if (firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) { 456 455 pr_err("Firmware size mismatch (have %zd, expected %d)\n", 457 - firmware->size, BLACKBIRD_FIRM_IMAGE_SIZE); 456 + firmware->size, BLACKBIRD_FIRM_IMAGE_SIZE); 458 457 release_firmware(firmware); 459 458 return -EINVAL; 460 459 } ··· 1119 1118 dev->mpeg_dev.queue = &dev->vb2_mpegq; 1120 1119 err = video_register_device(&dev->mpeg_dev, VFL_TYPE_GRABBER, -1); 1121 1120 if (err < 0) { 1122 - printk(KERN_INFO "%s/2: can't register mpeg device\n", 1123 - dev->core->name); 1121 + pr_info("can't register mpeg device\n"); 1124 1122 return err; 1125 1123 } 1126 - printk(KERN_INFO "%s/2: registered device %s [mpeg]\n", 1127 - dev->core->name, video_device_node_name(&dev->mpeg_dev)); 1124 + pr_info("registered device %s [mpeg]\n", 1125 + video_device_node_name(&dev->mpeg_dev)); 1128 1126 return 0; 1129 1127 } 1130 1128 ··· 1158 1158 v4l2_ctrl_add_handler(&dev->cxhdl.hdl, &core->video_hdl, NULL); 1159 1159 1160 1160 /* blackbird stuff */ 1161 - printk("%s/2: cx23416 based mpeg encoder (blackbird reference design)\n", 1162 - core->name); 1161 + pr_info("cx23416 based mpeg encoder (blackbird reference design)\n"); 1163 1162 host_setup(dev->core); 1164 1163 1165 1164 blackbird_initialize_codec(dev); ··· 1218 1219 1219 1220 static int __init blackbird_init(void) 1220 1221 { 1221 - printk(KERN_INFO "cx2388x blackbird driver version %s loaded\n", 1222 - CX88_VERSION); 1222 + pr_info("cx2388x blackbird driver version %s loaded\n", 1223 + CX88_VERSION); 1223 1224 return cx8802_register_driver(&cx8802_blackbird_driver); 1224 1225 } 1225 1226
+41 -62
drivers/media/pci/cx88/cx88-cards.c
··· 20 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 21 */ 22 22 23 + #include "cx88.h" 24 + #include "tea5767.h" 25 + #include "xc4000.h" 26 + 23 27 #include <linux/init.h> 24 28 #include <linux/module.h> 25 29 #include <linux/pci.h> 26 30 #include <linux/delay.h> 27 31 #include <linux/slab.h> 28 - 29 - #include "cx88.h" 30 - #include "tea5767.h" 31 - #include "xc4000.h" 32 32 33 33 static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 34 34 static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; ··· 50 50 module_param(disable_ir, int, 0444); 51 51 MODULE_PARM_DESC(disable_ir, "Disable IR support"); 52 52 53 - #define info_printk(core, fmt, arg...) \ 54 - printk(KERN_INFO "%s: " fmt, core->name , ## arg) 55 - 56 - #define warn_printk(core, fmt, arg...) \ 57 - printk(KERN_WARNING "%s: " fmt, core->name , ## arg) 58 - 59 - #define err_printk(core, fmt, arg...) \ 60 - printk(KERN_ERR "%s: " fmt, core->name , ## arg) 61 - 62 53 #define dprintk(level,fmt, arg...) do { \ 63 54 if (cx88_core_debug >= level) \ 64 - printk(KERN_DEBUG "%s: " fmt, core->name , ## arg); \ 65 - } while(0) 55 + printk(KERN_DEBUG pr_fmt("%s: core:" fmt), \ 56 + __func__, ##arg); \ 57 + } while (0) 66 58 67 59 68 60 /* ------------------------------------------------------------------ */ ··· 2821 2829 if (eeprom_data[4] != 0x7d || 2822 2830 eeprom_data[5] != 0x10 || 2823 2831 eeprom_data[7] != 0x66) { 2824 - warn_printk(core, "Leadtek eeprom invalid.\n"); 2832 + pr_warn("Leadtek eeprom invalid.\n"); 2825 2833 return; 2826 2834 } 2827 2835 ··· 2839 2847 break; 2840 2848 } 2841 2849 2842 - info_printk(core, "Leadtek Winfast 2000XP Expert config: tuner=%d, eeprom[0]=0x%02x\n", 2843 - core->board.tuner_type, eeprom_data[0]); 2850 + pr_info("Leadtek Winfast 2000XP Expert config: tuner=%d, eeprom[0]=0x%02x\n", 2851 + core->board.tuner_type, eeprom_data[0]); 2844 2852 } 2845 2853 2846 2854 static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data) ··· 2896 2904 cx_set(MO_GP0_IO, 0x008989FF); 2897 2905 break; 2898 2906 default: 2899 - warn_printk(core, "warning: unknown hauppauge model #%d\n", 2900 - tv.model); 2907 + pr_warn("warning: unknown hauppauge model #%d\n", tv.model); 2901 2908 break; 2902 2909 } 2903 2910 2904 - info_printk(core, "hauppauge eeprom: model=%d\n", tv.model); 2911 + pr_info("hauppauge eeprom: model=%d\n", tv.model); 2905 2912 } 2906 2913 2907 2914 /* ----------------------------------------------------------------------- */ ··· 2946 2955 const char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner)) 2947 2956 ? gdi_tuner[eeprom_data[0x0d]].name : NULL; 2948 2957 2949 - info_printk(core, "GDI: tuner=%s\n", name ? name : "unknown"); 2958 + pr_info("GDI: tuner=%s\n", name ? name : "unknown"); 2950 2959 if (NULL == name) 2951 2960 return; 2952 2961 core->board.tuner_type = gdi_tuner[eeprom_data[0x0d]].id; ··· 3097 3106 msg.len = (i != 12 ? 5 : 2); 3098 3107 err = i2c_transfer(&core->i2c_adap, &msg, 1); 3099 3108 if (err != 1) { 3100 - warn_printk(core, "dvico_fusionhdtv_hybrid_init buf %d failed (err = %d)!\n", 3101 - i, err); 3109 + pr_warn("dvico_fusionhdtv_hybrid_init buf %d failed (err = %d)!\n", 3110 + i, err); 3102 3111 return; 3103 3112 } 3104 3113 } ··· 3220 3229 struct cx88_core *core; 3221 3230 3222 3231 if (!i2c_algo) { 3223 - printk(KERN_ERR "cx88: Error - i2c private data undefined.\n"); 3232 + pr_err("Error - i2c private data undefined.\n"); 3224 3233 return -EINVAL; 3225 3234 } 3226 3235 3227 3236 core = i2c_algo->data; 3228 3237 3229 3238 if (!core) { 3230 - printk(KERN_ERR "cx88: Error - device struct undefined.\n"); 3239 + pr_err("Error - device struct undefined.\n"); 3231 3240 return -EINVAL; 3232 3241 } 3233 3242 ··· 3245 3254 dprintk(1, "Calling XC5000 callback\n"); 3246 3255 return cx88_xc5000_tuner_callback(core, command, arg); 3247 3256 } 3248 - err_printk(core, "Error: Calling callback for tuner %d\n", 3249 - core->board.tuner_type); 3257 + pr_err("Error: Calling callback for tuner %d\n", 3258 + core->board.tuner_type); 3250 3259 return -EINVAL; 3251 3260 } 3252 3261 EXPORT_SYMBOL(cx88_tuner_callback); ··· 3259 3268 3260 3269 if (0 == pci->subsystem_vendor && 3261 3270 0 == pci->subsystem_device) { 3262 - printk(KERN_ERR 3263 - "%s: Your board has no valid PCI Subsystem ID and thus can't\n" 3264 - "%s: be autodetected. Please pass card=<n> insmod option to\n" 3265 - "%s: workaround that. Redirect complaints to the vendor of\n" 3266 - "%s: the TV card. Best regards,\n" 3267 - "%s: -- tux\n", 3268 - core->name,core->name,core->name,core->name,core->name); 3271 + pr_err("Your board has no valid PCI Subsystem ID and thus can't\n"); 3272 + pr_err("be autodetected. Please pass card=<n> insmod option to\n"); 3273 + pr_err("workaround that. Redirect complaints to the vendor of\n"); 3274 + pr_err("the TV card\n"); 3269 3275 } else { 3270 - printk(KERN_ERR 3271 - "%s: Your board isn't known (yet) to the driver. You can\n" 3272 - "%s: try to pick one of the existing card configs via\n" 3273 - "%s: card=<n> insmod option. Updating to the latest\n" 3274 - "%s: version might help as well.\n", 3275 - core->name,core->name,core->name,core->name); 3276 + pr_err("Your board isn't known (yet) to the driver. You can\n"); 3277 + pr_err("try to pick one of the existing card configs via\n"); 3278 + pr_err("card=<n> insmod option. Updating to the latest\n"); 3279 + pr_err("version might help as well.\n"); 3276 3280 } 3277 - err_printk(core, "Here is a list of valid choices for the card=<n> insmod option:\n"); 3281 + pr_err("Here is a list of valid choices for the card=<n> insmod option:\n"); 3278 3282 for (i = 0; i < ARRAY_SIZE(cx88_boards); i++) 3279 - printk(KERN_ERR "%s: card=%d -> %s\n", 3280 - core->name, i, cx88_boards[i].name); 3283 + pr_err(" card=%d -> %s\n", i, cx88_boards[i].name); 3281 3284 } 3282 3285 3283 3286 static void cx88_card_setup_pre_i2c(struct cx88_core *core) ··· 3493 3508 for (i = 0; i < ARRAY_SIZE(buffer); i++) 3494 3509 if (2 != i2c_master_send(&core->i2c_client, 3495 3510 buffer[i],2)) 3496 - warn_printk(core, "Unable to enable tuner(%i).\n", 3497 - i); 3511 + pr_warn("Unable to enable tuner(%i).\n", 3512 + i); 3498 3513 } 3499 3514 break; 3500 3515 case CX88_BOARD_MSI_TVANYWHERE_MASTER: ··· 3593 3608 3594 3609 /* check pci quirks */ 3595 3610 if (pci_pci_problems & PCIPCI_TRITON) { 3596 - printk(KERN_INFO "%s: quirk: PCIPCI_TRITON -- set TBFX\n", 3597 - name); 3611 + pr_info("quirk: PCIPCI_TRITON -- set TBFX\n"); 3598 3612 ctrl |= CX88X_EN_TBFX; 3599 3613 } 3600 3614 if (pci_pci_problems & PCIPCI_NATOMA) { 3601 - printk(KERN_INFO "%s: quirk: PCIPCI_NATOMA -- set TBFX\n", 3602 - name); 3615 + pr_info("quirk: PCIPCI_NATOMA -- set TBFX\n"); 3603 3616 ctrl |= CX88X_EN_TBFX; 3604 3617 } 3605 3618 if (pci_pci_problems & PCIPCI_VIAETBF) { 3606 - printk(KERN_INFO "%s: quirk: PCIPCI_VIAETBF -- set TBFX\n", 3607 - name); 3619 + pr_info("quirk: PCIPCI_VIAETBF -- set TBFX\n"); 3608 3620 ctrl |= CX88X_EN_TBFX; 3609 3621 } 3610 3622 if (pci_pci_problems & PCIPCI_VSFX) { 3611 - printk(KERN_INFO "%s: quirk: PCIPCI_VSFX -- set VSFX\n", 3612 - name); 3623 + pr_info("quirk: PCIPCI_VSFX -- set VSFX\n"); 3613 3624 ctrl |= CX88X_EN_VSFX; 3614 3625 } 3615 3626 #ifdef PCIPCI_ALIMAGIK 3616 3627 if (pci_pci_problems & PCIPCI_ALIMAGIK) { 3617 - printk(KERN_INFO "%s: quirk: PCIPCI_ALIMAGIK -- latency fixup\n", 3618 - name); 3628 + pr_info("quirk: PCIPCI_ALIMAGIK -- latency fixup\n"); 3619 3629 lat = 0x0A; 3620 3630 } 3621 3631 #endif ··· 3626 3646 pci_write_config_byte(pci, CX88X_DEVCTRL, value); 3627 3647 } 3628 3648 if (UNSET != lat) { 3629 - printk(KERN_INFO "%s: setting pci latency timer to %d\n", 3630 - name, latency); 3649 + pr_info("setting pci latency timer to %d\n", 3650 + latency); 3631 3651 pci_write_config_byte(pci, PCI_LATENCY_TIMER, latency); 3632 3652 } 3633 3653 return 0; ··· 3639 3659 pci_resource_len(pci,0), 3640 3660 core->name)) 3641 3661 return 0; 3642 - printk(KERN_ERR 3643 - "%s/%d: Can't get MMIO memory @ 0x%llx, subsystem: %04x:%04x\n", 3644 - core->name, PCI_FUNC(pci->devfn), 3662 + pr_err("func %d: Can't get MMIO memory @ 0x%llx, subsystem: %04x:%04x\n", 3663 + PCI_FUNC(pci->devfn), 3645 3664 (unsigned long long)pci_resource_start(pci, 0), 3646 3665 pci->subsystem_vendor, pci->subsystem_device); 3647 3666 return -EBUSY; ··· 3734 3755 if (!core->board.num_frontends && (core->board.mpeg & CX88_MPEG_DVB)) 3735 3756 core->board.num_frontends = 1; 3736 3757 3737 - info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s], frontend(s): %d\n", 3758 + pr_info("subsystem: %04x:%04x, board: %s [card=%d,%s], frontend(s): %d\n", 3738 3759 pci->subsystem_vendor, pci->subsystem_device, core->board.name, 3739 3760 core->boardnr, card[core->nr] == core->boardnr ? 3740 3761 "insmod option" : "autodetected",
+65 -61
drivers/media/pci/cx88/cx88-core.c
··· 25 25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 26 26 */ 27 27 28 + #include "cx88.h" 29 + 28 30 #include <linux/init.h> 29 31 #include <linux/list.h> 30 32 #include <linux/module.h> ··· 40 38 #include <linux/videodev2.h> 41 39 #include <linux/mutex.h> 42 40 43 - #include "cx88.h" 44 41 #include <media/v4l2-common.h> 45 42 #include <media/v4l2-ioctl.h> 46 43 ··· 61 60 module_param(nocomb,int,0644); 62 61 MODULE_PARM_DESC(nocomb,"disable comb filter"); 63 62 64 - #define dprintk(level,fmt, arg...) do { \ 65 - if (cx88_core_debug >= level) \ 66 - printk(KERN_DEBUG "%s: " fmt, core->name , ## arg); \ 67 - } while(0) 63 + #define dprintk0(fmt, arg...) \ 64 + printk(KERN_DEBUG pr_fmt("%s: core:" fmt), \ 65 + __func__, ##arg) \ 66 + 67 + #define dprintk(level, fmt, arg...) do { \ 68 + if (cx88_core_debug >= level) \ 69 + printk(KERN_DEBUG pr_fmt("%s: core:" fmt), \ 70 + __func__, ##arg); \ 71 + } while (0) 68 72 69 73 static unsigned int cx88_devcount; 70 74 static LIST_HEAD(cx88_devlist); ··· 369 363 cx_write(ch->cnt1_reg, (bpl >> 3) -1); 370 364 cx_write(ch->cnt2_reg, (lines*16) >> 3); 371 365 372 - dprintk(2,"sram setup %s: bpl=%d lines=%d\n", ch->name, bpl, lines); 366 + dprintk(2, "sram setup %s: bpl=%d lines=%d\n", ch->name, bpl, lines); 373 367 return 0; 374 368 } 375 369 ··· 405 399 }; 406 400 int i; 407 401 408 - printk(KERN_DEBUG "0x%08x [ %s", risc, 402 + dprintk0("0x%08x [ %s", risc, 409 403 instr[risc >> 28] ? instr[risc >> 28] : "INVALID"); 410 404 for (i = ARRAY_SIZE(bits)-1; i >= 0; i--) 411 405 if (risc & (1 << (i + 12))) 412 - printk(KERN_CONT " %s", bits[i]); 413 - printk(KERN_CONT " count=%d ]\n", risc & 0xfff); 406 + pr_cont(" %s", bits[i]); 407 + pr_cont(" count=%d ]\n", risc & 0xfff); 414 408 return incr[risc >> 28] ? incr[risc >> 28] : 1; 415 409 } 416 410 ··· 434 428 u32 risc; 435 429 unsigned int i,j,n; 436 430 437 - printk(KERN_DEBUG "%s: %s - dma channel status dump\n", 438 - core->name,ch->name); 431 + dprintk0("%s - dma channel status dump\n", 432 + ch->name); 439 433 for (i = 0; i < ARRAY_SIZE(name); i++) 440 - printk(KERN_DEBUG "%s: cmds: %-12s: 0x%08x\n", 441 - core->name,name[i], 442 - cx_read(ch->cmds_start + 4*i)); 434 + dprintk0(" cmds: %-12s: 0x%08x\n", 435 + name[i], 436 + cx_read(ch->cmds_start + 4*i)); 443 437 for (n = 1, i = 0; i < 4; i++) { 444 438 risc = cx_read(ch->cmds_start + 4 * (i+11)); 445 - printk(KERN_CONT "%s: risc%d: ", core->name, i); 439 + pr_cont(" risc%d: ", i); 446 440 if (--n) 447 - printk(KERN_CONT "0x%08x [ arg #%d ]\n", risc, n); 441 + pr_cont("0x%08x [ arg #%d ]\n", risc, n); 448 442 else 449 443 n = cx88_risc_decode(risc); 450 444 } 451 445 for (i = 0; i < 16; i += n) { 452 446 risc = cx_read(ch->ctrl_start + 4 * i); 453 - printk(KERN_DEBUG "%s: iq %x: ", core->name, i); 447 + dprintk0(" iq %x: ", i); 454 448 n = cx88_risc_decode(risc); 455 449 for (j = 1; j < n; j++) { 456 450 risc = cx_read(ch->ctrl_start + 4 * (i+j)); 457 - printk(KERN_CONT "%s: iq %x: 0x%08x [ arg #%d ]\n", 458 - core->name, i+j, risc, j); 451 + pr_cont(" iq %x: 0x%08x [ arg #%d ]\n", 452 + i + j, risc, j); 459 453 } 460 454 } 461 455 462 - printk(KERN_DEBUG "%s: fifo: 0x%08x -> 0x%x\n", 463 - core->name, ch->fifo_start, ch->fifo_start+ch->fifo_size); 464 - printk(KERN_DEBUG "%s: ctrl: 0x%08x -> 0x%x\n", 465 - core->name, ch->ctrl_start, ch->ctrl_start+6*16); 466 - printk(KERN_DEBUG "%s: ptr1_reg: 0x%08x\n", 467 - core->name,cx_read(ch->ptr1_reg)); 468 - printk(KERN_DEBUG "%s: ptr2_reg: 0x%08x\n", 469 - core->name,cx_read(ch->ptr2_reg)); 470 - printk(KERN_DEBUG "%s: cnt1_reg: 0x%08x\n", 471 - core->name,cx_read(ch->cnt1_reg)); 472 - printk(KERN_DEBUG "%s: cnt2_reg: 0x%08x\n", 473 - core->name,cx_read(ch->cnt2_reg)); 456 + dprintk0("fifo: 0x%08x -> 0x%x\n", 457 + ch->fifo_start, ch->fifo_start+ch->fifo_size); 458 + dprintk0("ctrl: 0x%08x -> 0x%x\n", 459 + ch->ctrl_start, ch->ctrl_start + 6 * 16); 460 + dprintk0(" ptr1_reg: 0x%08x\n", cx_read(ch->ptr1_reg)); 461 + dprintk0(" ptr2_reg: 0x%08x\n", cx_read(ch->ptr2_reg)); 462 + dprintk0(" cnt1_reg: 0x%08x\n", cx_read(ch->cnt1_reg)); 463 + dprintk0(" cnt2_reg: 0x%08x\n", cx_read(ch->cnt2_reg)); 474 464 } 475 465 476 466 static const char *cx88_pci_irqs[32] = { ··· 476 474 "i2c", "i2c_rack", "ir_smp", "gpio0", "gpio1" 477 475 }; 478 476 479 - void cx88_print_irqbits(const char *name, const char *tag, const char *strings[], 477 + void cx88_print_irqbits(const char *tag, const char *strings[], 480 478 int len, u32 bits, u32 mask) 481 479 { 482 480 unsigned int i; 483 481 484 - printk(KERN_DEBUG "%s: %s [0x%x]", name, tag, bits); 482 + dprintk0("%s [0x%x]", tag, bits); 485 483 for (i = 0; i < len; i++) { 486 484 if (!(bits & (1 << i))) 487 485 continue; 488 486 if (strings[i]) 489 - printk(KERN_CONT " %s", strings[i]); 487 + pr_cont(" %s", strings[i]); 490 488 else 491 - printk(KERN_CONT " %d", i); 489 + pr_cont(" %d", i); 492 490 if (!(mask & (1 << i))) 493 491 continue; 494 - printk(KERN_CONT "*"); 492 + pr_cont("*"); 495 493 } 496 - printk(KERN_CONT "\n"); 494 + pr_cont("\n"); 497 495 } 498 496 499 497 /* ------------------------------------------------------------------ */ ··· 507 505 handled++; 508 506 } 509 507 if (!handled) 510 - cx88_print_irqbits(core->name, "irq pci", 508 + cx88_print_irqbits("irq pci", 511 509 cx88_pci_irqs, ARRAY_SIZE(cx88_pci_irqs), 512 510 status, core->pci_irqmask); 513 511 return handled; ··· 553 551 554 552 int cx88_reset(struct cx88_core *core) 555 553 { 556 - dprintk(1,"%s\n",__func__); 554 + dprintk(1, ""); 557 555 cx88_shutdown(core); 558 556 559 557 /* clear irq status */ ··· 665 663 unsigned int sheight = norm_maxh(core->tvnorm); 666 664 u32 value; 667 665 668 - dprintk(1,"set_scale: %dx%d [%s%s,%s]\n", width, height, 666 + dprintk(1, "set_scale: %dx%d [%s%s,%s]\n", width, height, 669 667 V4L2_FIELD_HAS_TOP(field) ? "T" : "", 670 668 V4L2_FIELD_HAS_BOTTOM(field) ? "B" : "", 671 669 v4l2_norm_to_name(core->tvnorm)); ··· 677 675 value &= 0x3fe; 678 676 cx_write(MO_HDELAY_EVEN, value); 679 677 cx_write(MO_HDELAY_ODD, value); 680 - dprintk(1,"set_scale: hdelay 0x%04x (width %d)\n", value,swidth); 678 + dprintk(1, "set_scale: hdelay 0x%04x (width %d)\n", value, swidth); 681 679 682 680 value = (swidth * 4096 / width) - 4096; 683 681 cx_write(MO_HSCALE_EVEN, value); 684 682 cx_write(MO_HSCALE_ODD, value); 685 - dprintk(1,"set_scale: hscale 0x%04x\n", value); 683 + dprintk(1, "set_scale: hscale 0x%04x\n", value); 686 684 687 685 cx_write(MO_HACTIVE_EVEN, width); 688 686 cx_write(MO_HACTIVE_ODD, width); 689 - dprintk(1,"set_scale: hactive 0x%04x\n", width); 687 + dprintk(1, "set_scale: hactive 0x%04x\n", width); 690 688 691 689 // recalc V scale Register (delay is constant) 692 690 cx_write(MO_VDELAY_EVEN, norm_vdelay(core->tvnorm)); 693 691 cx_write(MO_VDELAY_ODD, norm_vdelay(core->tvnorm)); 694 - dprintk(1,"set_scale: vdelay 0x%04x\n", norm_vdelay(core->tvnorm)); 692 + dprintk(1, "set_scale: vdelay 0x%04x\n", norm_vdelay(core->tvnorm)); 695 693 696 694 value = (0x10000 - (sheight * 512 / height - 512)) & 0x1fff; 697 695 cx_write(MO_VSCALE_EVEN, value); 698 696 cx_write(MO_VSCALE_ODD, value); 699 - dprintk(1,"set_scale: vscale 0x%04x\n", value); 697 + dprintk(1, "set_scale: vscale 0x%04x\n", value); 700 698 701 699 cx_write(MO_VACTIVE_EVEN, sheight); 702 700 cx_write(MO_VACTIVE_ODD, sheight); 703 - dprintk(1,"set_scale: vactive 0x%04x\n", sheight); 701 + dprintk(1, "set_scale: vactive 0x%04x\n", sheight); 704 702 705 703 // setup filters 706 704 value = 0; ··· 722 720 723 721 cx_andor(MO_FILTER_EVEN, 0x7ffc7f, value); /* preserve PEAKEN, PSEL */ 724 722 cx_andor(MO_FILTER_ODD, 0x7ffc7f, value); 725 - dprintk(1,"set_scale: filter 0x%04x\n", value); 723 + dprintk(1, "set_scale: filter 0x%04x\n", value); 726 724 727 725 return 0; 728 726 } ··· 745 743 do_div(pll,xtal); 746 744 reg = (pll & 0x3ffffff) | (pre[prescale] << 26); 747 745 if (((reg >> 20) & 0x3f) < 14) { 748 - printk("%s/0: pll out of range\n",core->name); 746 + pr_err("pll out of range\n"); 749 747 return -1; 750 748 } 751 749 752 - dprintk(1,"set_pll: MO_PLL_REG 0x%08x [old=0x%08x,freq=%d]\n", 750 + dprintk(1, "set_pll: MO_PLL_REG 0x%08x [old=0x%08x,freq=%d]\n", 753 751 reg, cx_read(MO_PLL_REG), ofreq); 754 752 cx_write(MO_PLL_REG, reg); 755 753 for (i = 0; i < 100; i++) { ··· 759 757 prescale,ofreq); 760 758 return 0; 761 759 } 762 - dprintk(1,"pll not locked yet, waiting ...\n"); 760 + dprintk(1, "pll not locked yet, waiting ...\n"); 763 761 msleep(10); 764 762 } 765 - dprintk(1,"pll NOT locked [pre=%d,ofreq=%d]\n",prescale,ofreq); 763 + dprintk(1, "pll NOT locked [pre=%d,ofreq=%d]\n", prescale, ofreq); 766 764 return -1; 767 765 } 768 766 ··· 838 836 core->tvaudio = WW_EIAJ; 839 837 840 838 } else { 841 - printk("%s/0: tvaudio support needs work for this tv norm [%s], sorry\n", 842 - core->name, v4l2_norm_to_name(core->tvnorm)); 839 + pr_info("tvaudio support needs work for this tv norm [%s], sorry\n", 840 + v4l2_norm_to_name(core->tvnorm)); 843 841 core->tvaudio = WW_NONE; 844 842 return 0; 845 843 } ··· 914 912 cxoformat = 0x181f0008; 915 913 } 916 914 917 - dprintk(1,"set_tvnorm: \"%s\" fsc8=%d adc=%d vdec=%d db/dr=%d/%d\n", 915 + dprintk(1, "set_tvnorm: \"%s\" fsc8=%d adc=%d vdec=%d db/dr=%d/%d\n", 918 916 v4l2_norm_to_name(core->tvnorm), fsc8, adc_clock, vdec_clock, 919 917 step_db, step_dr); 920 918 set_pll(core,2,vdec_clock); 921 919 922 - dprintk(1,"set_tvnorm: MO_INPUT_FORMAT 0x%08x [old=0x%08x]\n", 920 + dprintk(1, "set_tvnorm: MO_INPUT_FORMAT 0x%08x [old=0x%08x]\n", 923 921 cxiformat, cx_read(MO_INPUT_FORMAT) & 0x0f); 924 922 /* Chroma AGC must be disabled if SECAM is used, we enable it 925 923 by default on PAL and NTSC */ ··· 927 925 norm & V4L2_STD_SECAM ? cxiformat : cxiformat | 0x400); 928 926 929 927 // FIXME: as-is from DScaler 930 - dprintk(1,"set_tvnorm: MO_OUTPUT_FORMAT 0x%08x [old=0x%08x]\n", 928 + dprintk(1, "set_tvnorm: MO_OUTPUT_FORMAT 0x%08x [old=0x%08x]\n", 931 929 cxoformat, cx_read(MO_OUTPUT_FORMAT)); 932 930 cx_write(MO_OUTPUT_FORMAT, cxoformat); 933 931 934 932 // MO_SCONV_REG = adc clock / video dec clock * 2^17 935 933 tmp64 = adc_clock * (u64)(1 << 17); 936 934 do_div(tmp64, vdec_clock); 937 - dprintk(1,"set_tvnorm: MO_SCONV_REG 0x%08x [old=0x%08x]\n", 935 + dprintk(1, "set_tvnorm: MO_SCONV_REG 0x%08x [old=0x%08x]\n", 938 936 (u32)tmp64, cx_read(MO_SCONV_REG)); 939 937 cx_write(MO_SCONV_REG, (u32)tmp64); 940 938 941 939 // MO_SUB_STEP = 8 * fsc / video dec clock * 2^22 942 940 tmp64 = step_db * (u64)(1 << 22); 943 941 do_div(tmp64, vdec_clock); 944 - dprintk(1,"set_tvnorm: MO_SUB_STEP 0x%08x [old=0x%08x]\n", 942 + dprintk(1, "set_tvnorm: MO_SUB_STEP 0x%08x [old=0x%08x]\n", 945 943 (u32)tmp64, cx_read(MO_SUB_STEP)); 946 944 cx_write(MO_SUB_STEP, (u32)tmp64); 947 945 948 946 // MO_SUB_STEP_DR = 8 * 4406250 / video dec clock * 2^22 949 947 tmp64 = step_dr * (u64)(1 << 22); 950 948 do_div(tmp64, vdec_clock); 951 - dprintk(1,"set_tvnorm: MO_SUB_STEP_DR 0x%08x [old=0x%08x]\n", 949 + dprintk(1, "set_tvnorm: MO_SUB_STEP_DR 0x%08x [old=0x%08x]\n", 952 950 (u32)tmp64, cx_read(MO_SUB_STEP_DR)); 953 951 cx_write(MO_SUB_STEP_DR, (u32)tmp64); 954 952 955 953 // bdelay + agcdelay 956 954 bdelay = vdec_clock * 65 / 20000000 + 21; 957 955 agcdelay = vdec_clock * 68 / 20000000 + 15; 958 - dprintk(1,"set_tvnorm: MO_AGC_BURST 0x%08x [old=0x%08x,bdelay=%d,agcdelay=%d]\n", 956 + dprintk(1, 957 + "set_tvnorm: MO_AGC_BURST 0x%08x [old=0x%08x,bdelay=%d,agcdelay=%d]\n", 959 958 (bdelay << 8) | agcdelay, cx_read(MO_AGC_BURST), bdelay, agcdelay); 960 959 cx_write(MO_AGC_BURST, (bdelay << 8) | agcdelay); 961 960 ··· 964 961 tmp64 = norm_htotal(norm) * (u64)vdec_clock; 965 962 do_div(tmp64, fsc8); 966 963 htotal = (u32)tmp64; 967 - dprintk(1,"set_tvnorm: MO_HTOTAL 0x%08x [old=0x%08x,htotal=%d]\n", 964 + dprintk(1, 965 + "set_tvnorm: MO_HTOTAL 0x%08x [old=0x%08x,htotal=%d]\n", 968 966 htotal, cx_read(MO_HTOTAL), (u32)tmp64); 969 967 cx_andor(MO_HTOTAL, 0x07ff, htotal); 970 968
+10 -7
drivers/media/pci/cx88/cx88-dsp.c
··· 19 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 20 */ 21 21 22 + #include "cx88.h" 23 + #include "cx88-reg.h" 24 + 22 25 #include <linux/slab.h> 23 26 #include <linux/kernel.h> 24 27 #include <linux/module.h> 25 28 #include <linux/jiffies.h> 26 29 #include <asm/div64.h> 27 - 28 - #include "cx88.h" 29 - #include "cx88-reg.h" 30 30 31 31 #define INT_PI ((s32)(3.141592653589 * 32768.0)) 32 32 ··· 71 71 module_param(dsp_debug, int, 0644); 72 72 MODULE_PARM_DESC(dsp_debug, "enable audio dsp debug messages"); 73 73 74 - #define dprintk(level, fmt, arg...) if (dsp_debug >= level) \ 75 - printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg) 74 + #define dprintk(level, fmt, arg...) do { \ 75 + if (dsp_debug >= level) \ 76 + printk(KERN_DEBUG pr_fmt("%s: dsp:" fmt), \ 77 + __func__, ##arg); \ 78 + } while (0) 76 79 77 80 static s32 int_cos(u32 x) 78 81 { ··· 179 176 dual_freq = FREQ_EIAJ_DUAL; 180 177 break; 181 178 default: 182 - printk(KERN_WARNING "%s/0: unsupported audio mode %d for %s\n", 183 - core->name, core->tvaudio, __func__); 179 + pr_warn("unsupported audio mode %d for %s\n", 180 + core->tvaudio, __func__); 184 181 return UNSET; 185 182 } 186 183
+27 -34
drivers/media/pci/cx88/cx88-dvb.c
··· 21 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 22 */ 23 23 24 + #include "cx88.h" 25 + #include "dvb-pll.h" 26 + 24 27 #include <linux/module.h> 25 28 #include <linux/init.h> 26 29 #include <linux/device.h> ··· 32 29 #include <linux/file.h> 33 30 #include <linux/suspend.h> 34 31 35 - #include "cx88.h" 36 - #include "dvb-pll.h" 37 32 #include <media/v4l2-common.h> 38 33 39 34 #include "mt352.h" ··· 78 77 79 78 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 80 79 81 - #define dprintk(level,fmt, arg...) if (debug >= level) \ 82 - printk(KERN_DEBUG "%s/2-dvb: " fmt, core->name, ## arg) 80 + #define dprintk(level, fmt, arg...) do { \ 81 + if (debug >= level) \ 82 + printk(KERN_DEBUG pr_fmt("%s: dvb:" fmt), \ 83 + __func__, ##arg); \ 84 + } while (0) 83 85 84 86 /* ------------------------------------------------------------------ */ 85 87 ··· 182 178 183 179 fe_id = vb2_dvb_find_frontend(&dev->frontends, fe); 184 180 if (!fe_id) { 185 - printk(KERN_ERR "%s() No frontend found\n", __func__); 181 + pr_err("%s() No frontend found\n", __func__); 186 182 return -EINVAL; 187 183 } 188 184 ··· 629 625 return -EINVAL; 630 626 631 627 if (!fe0->dvb.frontend) { 632 - printk(KERN_ERR "%s/2: dvb frontend not attached. Can't attach xc3028\n", 633 - dev->core->name); 628 + pr_err("dvb frontend not attached. Can't attach xc3028\n"); 634 629 return -EINVAL; 635 630 } 636 631 ··· 642 639 643 640 fe = dvb_attach(xc2028_attach, fe0->dvb.frontend, &cfg); 644 641 if (!fe) { 645 - printk(KERN_ERR "%s/2: xc3028 attach failed\n", 646 - dev->core->name); 642 + pr_err("xc3028 attach failed\n"); 647 643 dvb_frontend_detach(fe0->dvb.frontend); 648 644 dvb_unregister_frontend(fe0->dvb.frontend); 649 645 fe0->dvb.frontend = NULL; 650 646 return -EINVAL; 651 647 } 652 648 653 - printk(KERN_INFO "%s/2: xc3028 attached\n", 654 - dev->core->name); 649 + pr_info("xc3028 attached\n"); 655 650 656 651 return 0; 657 652 } ··· 665 664 return -EINVAL; 666 665 667 666 if (!fe0->dvb.frontend) { 668 - printk(KERN_ERR "%s/2: dvb frontend not attached. Can't attach xc4000\n", 669 - dev->core->name); 667 + pr_err("dvb frontend not attached. Can't attach xc4000\n"); 670 668 return -EINVAL; 671 669 } 672 670 673 671 fe = dvb_attach(xc4000_attach, fe0->dvb.frontend, &dev->core->i2c_adap, 674 672 cfg); 675 673 if (!fe) { 676 - printk(KERN_ERR "%s/2: xc4000 attach failed\n", 677 - dev->core->name); 674 + pr_err("xc4000 attach failed\n"); 678 675 dvb_frontend_detach(fe0->dvb.frontend); 679 676 dvb_unregister_frontend(fe0->dvb.frontend); 680 677 fe0->dvb.frontend = NULL; 681 678 return -EINVAL; 682 679 } 683 680 684 - printk(KERN_INFO "%s/2: xc4000 attached\n", dev->core->name); 681 + pr_info("xc4000 attached\n"); 685 682 686 683 return 0; 687 684 } ··· 797 798 if (!core->board.num_frontends) 798 799 return -ENODEV; 799 800 800 - printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__, 801 - core->board.num_frontends); 801 + pr_info("%s: allocating %d frontend(s)\n", __func__, 802 + core->board.num_frontends); 802 803 for (i = 1; i <= core->board.num_frontends; i++) { 803 804 fe = vb2_dvb_alloc_frontend(&dev->frontends, i); 804 805 if (!fe) { 805 - printk(KERN_ERR "%s() failed to alloc\n", __func__); 806 + pr_err("%s() failed to alloc\n", __func__); 806 807 vb2_dvb_dealloc_frontends(&dev->frontends); 807 808 return -ENOMEM; 808 809 } ··· 1006 1007 int res = -EINVAL; 1007 1008 1008 1009 if (0 != core->i2c_rc) { 1009 - printk(KERN_ERR "%s/2: no i2c-bus available, cannot attach dvb drivers\n", core->name); 1010 + pr_err("no i2c-bus available, cannot attach dvb drivers\n"); 1010 1011 goto frontend_detach; 1011 1012 } 1012 1013 ··· 1181 1182 goto frontend_detach; 1182 1183 } 1183 1184 #else 1184 - printk(KERN_ERR "%s/2: built without vp3054 support\n", 1185 - core->name); 1185 + pr_err("built without vp3054 support\n"); 1186 1186 #endif 1187 1187 break; 1188 1188 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID: ··· 1613 1615 break; 1614 1616 1615 1617 default: 1616 - printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", 1617 - core->name); 1618 + pr_err("The frontend of your DVB/ATSC card isn't supported yet\n"); 1618 1619 break; 1619 1620 } 1620 1621 1621 1622 if ( (NULL == fe0->dvb.frontend) || (fe1 && NULL == fe1->dvb.frontend) ) { 1622 - printk(KERN_ERR 1623 - "%s/2: frontend initialization failed\n", 1624 - core->name); 1623 + pr_err("frontend initialization failed\n"); 1625 1624 goto frontend_detach; 1626 1625 } 1627 1626 /* define general-purpose callback pointer */ ··· 1757 1762 goto fail_core; 1758 1763 1759 1764 /* dvb stuff */ 1760 - printk(KERN_INFO "%s/2: cx2388x based DVB/ATSC card\n", core->name); 1765 + pr_info("cx2388x based DVB/ATSC card\n"); 1761 1766 dev->ts_gen_cntrl = 0x0c; 1762 1767 1763 1768 err = cx8802_alloc_frontends(dev); ··· 1769 1774 1770 1775 fe = vb2_dvb_get_frontend(&core->dvbdev->frontends, i); 1771 1776 if (fe == NULL) { 1772 - printk(KERN_ERR "%s() failed to get frontend(%d)\n", 1773 - __func__, i); 1777 + pr_err("%s() failed to get frontend(%d)\n", 1778 + __func__, i); 1774 1779 err = -ENODEV; 1775 1780 goto fail_probe; 1776 1781 } ··· 1798 1803 err = dvb_register(dev); 1799 1804 if (err) 1800 1805 /* frontends/adapter de-allocated in dvb_register */ 1801 - printk(KERN_ERR "%s/2: dvb_register failed (err = %d)\n", 1802 - core->name, err); 1806 + pr_err("dvb_register failed (err = %d)\n", err); 1803 1807 return err; 1804 1808 fail_probe: 1805 1809 vb2_dvb_dealloc_frontends(&core->dvbdev->frontends); ··· 1833 1839 1834 1840 static int __init dvb_init(void) 1835 1841 { 1836 - printk(KERN_INFO "cx88/2: cx2388x dvb driver version %s loaded\n", 1837 - CX88_VERSION); 1842 + pr_info("cx2388x dvb driver version %s loaded\n", CX88_VERSION); 1838 1843 return cx8802_register_driver(&cx8802_dvb_driver); 1839 1844 } 1840 1845
+11 -8
drivers/media/pci/cx88/cx88-i2c.c
··· 27 27 28 28 */ 29 29 30 + #include "cx88.h" 31 + 30 32 #include <linux/module.h> 31 33 #include <linux/init.h> 32 34 33 35 #include <asm/io.h> 34 36 35 - #include "cx88.h" 36 37 #include <media/v4l2-common.h> 37 38 38 39 static unsigned int i2c_debug; ··· 48 47 module_param(i2c_udelay, int, 0644); 49 48 MODULE_PARM_DESC(i2c_udelay, "i2c delay at insmod time, in usecs (should be 5 or higher). Lower value means higher bus speed."); 50 49 51 - #define dprintk(level,fmt, arg...) if (i2c_debug >= level) \ 52 - printk(KERN_DEBUG "%s: " fmt, core->name , ## arg) 50 + #define dprintk(level, fmt, arg...) do { \ 51 + if (i2c_debug >= level) \ 52 + printk(KERN_DEBUG pr_fmt("%s: i2c:" fmt), \ 53 + __func__, ##arg); \ 54 + } while (0) 53 55 54 56 /* ----------------------------------------------------------------------- */ 55 57 ··· 130 126 rc = i2c_master_recv(c,&buf,0); 131 127 if (rc < 0) 132 128 continue; 133 - printk("%s: i2c scan: found device @ 0x%x [%s]\n", 134 - name, i << 1, i2c_devs[i] ? i2c_devs[i] : "???"); 129 + pr_info("i2c scan: found device @ 0x%x [%s]\n", 130 + i << 1, i2c_devs[i] ? i2c_devs[i] : "???"); 135 131 } 136 132 } 137 133 ··· 170 166 case CX88_BOARD_HAUPPAUGE_HVR1300: 171 167 case CX88_BOARD_HAUPPAUGE_HVR3000: 172 168 case CX88_BOARD_HAUPPAUGE_HVR4000: 173 - printk("%s: i2c init: enabling analog demod on HVR1300/3000/4000 tuner\n", 174 - core->name); 169 + pr_info("i2c init: enabling analog demod on HVR1300/3000/4000 tuner\n"); 175 170 i2c_transfer(core->i2c_client.adapter, &tuner_msg, 1); 176 171 break; 177 172 default: ··· 179 176 if (i2c_scan) 180 177 do_i2c_scan(core->name,&core->i2c_client); 181 178 } else 182 - printk("%s: i2c register FAILED\n", core->name); 179 + pr_err("i2c register FAILED\n"); 183 180 184 181 return core->i2c_rc; 185 182 }
+2 -1
drivers/media/pci/cx88/cx88-input.c
··· 22 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 23 */ 24 24 25 + #include "cx88.h" 26 + 25 27 #include <linux/init.h> 26 28 #include <linux/hrtimer.h> 27 29 #include <linux/pci.h> 28 30 #include <linux/slab.h> 29 31 #include <linux/module.h> 30 32 31 - #include "cx88.h" 32 33 #include <media/rc-core.h> 33 34 34 35 #define MODULE_NAME "cx88xx"
+68 -85
drivers/media/pci/cx88/cx88-mpeg.c
··· 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 */ 24 24 25 + #include "cx88.h" 26 + 25 27 #include <linux/module.h> 26 28 #include <linux/slab.h> 27 29 #include <linux/init.h> ··· 31 29 #include <linux/dma-mapping.h> 32 30 #include <linux/interrupt.h> 33 31 #include <asm/delay.h> 34 - 35 - #include "cx88.h" 36 32 37 33 /* ------------------------------------------------------------------ */ 38 34 ··· 45 45 module_param(debug,int,0644); 46 46 MODULE_PARM_DESC(debug,"enable debug messages [mpeg]"); 47 47 48 - #define dprintk(level, fmt, arg...) do { \ 49 - if (debug + 1 > level) \ 50 - printk(KERN_DEBUG "%s/2-mpeg: " fmt, dev->core->name, ## arg); \ 51 - } while(0) 52 - 53 - #define mpeg_dbg(level, fmt, arg...) do { \ 54 - if (debug + 1 > level) \ 55 - printk(KERN_DEBUG "%s/2-mpeg: " fmt, core->name, ## arg); \ 56 - } while(0) 48 + #define dprintk(level, fmt, arg...) do { \ 49 + if (debug + 1 > level) \ 50 + printk(KERN_DEBUG pr_fmt("%s: mpeg:" fmt), \ 51 + __func__, ##arg); \ 52 + } while (0) 57 53 58 54 #if defined(CONFIG_MODULES) && defined(MODULE) 59 55 static void request_module_async(struct work_struct *work) ··· 88 92 { 89 93 struct cx88_core *core = dev->core; 90 94 91 - dprintk(1, "cx8802_start_dma w: %d, h: %d, f: %d\n", 95 + dprintk(1, "w: %d, h: %d, f: %d\n", 92 96 core->width, core->height, core->field); 93 97 94 98 /* setup fifo + format */ ··· 101 105 /* FIXME: this needs a review. 102 106 * also: move to cx88-blackbird + cx88-dvb source files? */ 103 107 104 - dprintk( 1, "core->active_type_id = 0x%08x\n", core->active_type_id); 108 + dprintk(1, "core->active_type_id = 0x%08x\n", core->active_type_id); 105 109 106 110 if ( (core->active_type_id == CX88_MPEG_DVB) && 107 111 (core->board.mpeg & CX88_MPEG_DVB) ) { 108 112 109 - dprintk( 1, "cx8802_start_dma doing .dvb\n"); 113 + dprintk(1, "cx8802_start_dma doing .dvb\n"); 110 114 /* negedge driven & software reset */ 111 115 cx_write(TS_GEN_CNTRL, 0x0040 | dev->ts_gen_cntrl); 112 116 udelay(100); ··· 150 154 udelay(100); 151 155 } else if ( (core->active_type_id == CX88_MPEG_BLACKBIRD) && 152 156 (core->board.mpeg & CX88_MPEG_BLACKBIRD) ) { 153 - dprintk( 1, "cx8802_start_dma doing .blackbird\n"); 157 + dprintk(1, "cx8802_start_dma doing .blackbird\n"); 154 158 cx_write(MO_PINMUX_IO, 0x88); /* enable MPEG parallel IO */ 155 159 156 160 cx_write(TS_GEN_CNTRL, 0x46); /* punctured clock TS & posedge driven & software reset */ ··· 162 166 cx_write(TS_GEN_CNTRL, 0x06); /* punctured clock TS & posedge driven */ 163 167 udelay(100); 164 168 } else { 165 - printk( "%s() Failed. Unsupported value in .mpeg (0x%08x)\n", __func__, 166 - core->board.mpeg ); 169 + pr_err("%s() Failed. Unsupported value in .mpeg (0x%08x)\n", 170 + __func__, core->board.mpeg); 167 171 return -EINVAL; 168 172 } 169 173 ··· 172 176 q->count = 0; 173 177 174 178 /* enable irqs */ 175 - dprintk( 1, "setting the interrupt mask\n" ); 179 + dprintk(1, "setting the interrupt mask\n"); 176 180 cx_set(MO_PCI_INTMSK, core->pci_irqmask | PCI_INT_TSINT); 177 181 cx_set(MO_TS_INTMSK, 0x1f0011); 178 182 ··· 185 189 static int cx8802_stop_dma(struct cx8802_dev *dev) 186 190 { 187 191 struct cx88_core *core = dev->core; 188 - dprintk( 1, "cx8802_stop_dma\n" ); 192 + dprintk(1, "\n"); 189 193 190 194 /* stop dma */ 191 195 cx_clear(MO_TS_DMACNTRL, 0x11); ··· 204 208 { 205 209 struct cx88_buffer *buf; 206 210 207 - dprintk( 1, "cx8802_restart_queue\n" ); 211 + dprintk(1, "\n"); 208 212 if (list_empty(&q->active)) 209 213 return 0; 210 214 ··· 245 249 struct cx88_buffer *prev; 246 250 struct cx88_dmaqueue *cx88q = &dev->mpegq; 247 251 248 - dprintk( 1, "cx8802_buf_queue\n" ); 252 + dprintk(1, "\n"); 249 253 /* add jump to start */ 250 254 buf->risc.cpu[1] = cpu_to_le32(buf->risc.dma + 8); 251 255 buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_CNT_INC); 252 256 buf->risc.jmp[1] = cpu_to_le32(buf->risc.dma + 8); 253 257 254 258 if (list_empty(&cx88q->active)) { 255 - dprintk( 1, "queue is empty - first active\n" ); 259 + dprintk(1, "queue is empty - first active\n"); 256 260 list_add_tail(&buf->list, &cx88q->active); 257 261 dprintk(1,"[%p/%d] %s - first active\n", 258 262 buf, buf->vb.vb2_buf.index, __func__); 259 263 260 264 } else { 261 265 buf->risc.cpu[0] |= cpu_to_le32(RISC_IRQ1); 262 - dprintk( 1, "queue is not empty - append to active\n" ); 266 + dprintk(1, "queue is not empty - append to active\n"); 263 267 prev = list_entry(cx88q->active.prev, struct cx88_buffer, list); 264 268 list_add_tail(&buf->list, &cx88q->active); 265 269 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 266 - dprintk( 1, "[%p/%d] %s - append to active\n", 270 + dprintk(1, "[%p/%d] %s - append to active\n", 267 271 buf, buf->vb.vb2_buf.index, __func__); 268 272 } 269 273 } ··· 287 291 288 292 void cx8802_cancel_buffers(struct cx8802_dev *dev) 289 293 { 290 - dprintk( 1, "cx8802_cancel_buffers" ); 294 + dprintk(1, "\n"); 291 295 cx8802_stop_dma(dev); 292 296 do_cancel_buffers(dev); 293 297 } ··· 306 310 struct cx88_core *core = dev->core; 307 311 u32 status, mask, count; 308 312 309 - dprintk( 1, "cx8802_mpeg_irq\n" ); 313 + dprintk(1, "\n"); 310 314 status = cx_read(MO_TS_INTSTAT); 311 315 mask = cx_read(MO_TS_INTMSK); 312 316 if (0 == (status & mask)) ··· 315 319 cx_write(MO_TS_INTSTAT, status); 316 320 317 321 if (debug || (status & mask & ~0xff)) 318 - cx88_print_irqbits(core->name, "irq mpeg ", 322 + cx88_print_irqbits("irq mpeg ", 319 323 cx88_mpeg_irqs, ARRAY_SIZE(cx88_mpeg_irqs), 320 324 status, mask); 321 325 322 326 /* risc op code error */ 323 327 if (status & (1 << 16)) { 324 - printk(KERN_WARNING "%s: mpeg risc op code error\n",core->name); 328 + pr_warn("mpeg risc op code error\n"); 325 329 cx_clear(MO_TS_DMACNTRL, 0x11); 326 330 cx88_sram_channel_dump(dev->core, &cx88_sram_channels[SRAM_CH28]); 327 331 } 328 332 329 333 /* risc1 y */ 330 334 if (status & 0x01) { 331 - dprintk( 1, "wake up\n" ); 335 + dprintk(1, "wake up\n"); 332 336 spin_lock(&dev->slock); 333 337 count = cx_read(MO_TS_GPCNT); 334 338 cx88_wakeup(dev->core, &dev->mpegq, count); ··· 337 341 338 342 /* other general errors */ 339 343 if (status & 0x1f0100) { 340 - dprintk( 0, "general errors: 0x%08x\n", status & 0x1f0100 ); 344 + dprintk(0, "general errors: 0x%08x\n", status & 0x1f0100); 341 345 spin_lock(&dev->slock); 342 346 cx8802_stop_dma(dev); 343 347 spin_unlock(&dev->slock); ··· 358 362 (core->pci_irqmask | PCI_INT_TSINT); 359 363 if (0 == status) 360 364 goto out; 361 - dprintk( 1, "cx8802_irq\n" ); 362 - dprintk( 1, " loop: %d/%d\n", loop, MAX_IRQ_LOOP ); 363 - dprintk( 1, " status: %d\n", status ); 365 + dprintk(1, "cx8802_irq\n"); 366 + dprintk(1, " loop: %d/%d\n", loop, MAX_IRQ_LOOP); 367 + dprintk(1, " status: %d\n", status); 364 368 handled = 1; 365 369 cx_write(MO_PCI_INTSTAT, status); 366 370 ··· 370 374 cx8802_mpeg_irq(dev); 371 375 } 372 376 if (MAX_IRQ_LOOP == loop) { 373 - dprintk( 0, "clearing mask\n" ); 374 - printk(KERN_WARNING "%s/0: irq loop -- clearing mask\n", 375 - core->name); 377 + dprintk(0, "clearing mask\n"); 378 + pr_warn("irq loop -- clearing mask\n"); 376 379 cx_write(MO_PCI_INTMSK,0); 377 380 } 378 381 ··· 390 395 pci_set_master(dev->pci); 391 396 err = pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32)); 392 397 if (err) { 393 - printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name); 398 + pr_err("Oops: no 32bit PCI DMA ???\n"); 394 399 return -EIO; 395 400 } 396 401 397 402 dev->pci_rev = dev->pci->revision; 398 403 pci_read_config_byte(dev->pci, PCI_LATENCY_TIMER, &dev->pci_lat); 399 - printk(KERN_INFO "%s/2: found at %s, rev: %d, irq: %d, latency: %d, mmio: 0x%llx\n", 400 - dev->core->name, 401 - pci_name(dev->pci), dev->pci_rev, dev->pci->irq, 402 - dev->pci_lat,(unsigned long long)pci_resource_start(dev->pci,0)); 404 + pr_info("found at %s, rev: %d, irq: %d, latency: %d, mmio: 0x%llx\n", 405 + pci_name(dev->pci), dev->pci_rev, dev->pci->irq, 406 + dev->pci_lat, 407 + (unsigned long long)pci_resource_start(dev->pci, 0)); 403 408 404 409 /* initialize driver struct */ 405 410 spin_lock_init(&dev->slock); ··· 411 416 err = request_irq(dev->pci->irq, cx8802_irq, 412 417 IRQF_SHARED, dev->core->name, dev); 413 418 if (err < 0) { 414 - printk(KERN_ERR "%s: can't get IRQ %d\n", 415 - dev->core->name, dev->pci->irq); 419 + pr_err("can't get IRQ %d\n", dev->pci->irq); 416 420 return err; 417 421 } 418 422 cx_set(MO_PCI_INTMSK, core->pci_irqmask); ··· 423 429 424 430 static void cx8802_fini_common(struct cx8802_dev *dev) 425 431 { 426 - dprintk( 2, "cx8802_fini_common\n" ); 432 + dprintk(2, "\n"); 427 433 cx8802_stop_dma(dev); 428 434 pci_disable_device(dev->pci); 429 435 ··· 436 442 static int cx8802_suspend_common(struct pci_dev *pci_dev, pm_message_t state) 437 443 { 438 444 struct cx8802_dev *dev = pci_get_drvdata(pci_dev); 439 - struct cx88_core *core = dev->core; 440 445 unsigned long flags; 441 446 442 447 /* stop mpeg dma */ 443 448 spin_lock_irqsave(&dev->slock, flags); 444 449 if (!list_empty(&dev->mpegq.active)) { 445 - dprintk( 2, "suspend\n" ); 446 - printk("%s: suspend mpeg\n", core->name); 450 + dprintk(2, "suspend\n"); 451 + pr_info("suspend mpeg\n"); 447 452 cx8802_stop_dma(dev); 448 453 } 449 454 spin_unlock_irqrestore(&dev->slock, flags); ··· 461 468 static int cx8802_resume_common(struct pci_dev *pci_dev) 462 469 { 463 470 struct cx8802_dev *dev = pci_get_drvdata(pci_dev); 464 - struct cx88_core *core = dev->core; 465 471 unsigned long flags; 466 472 int err; 467 473 468 474 if (dev->state.disabled) { 469 475 err=pci_enable_device(pci_dev); 470 476 if (err) { 471 - printk(KERN_ERR "%s: can't enable device\n", 472 - dev->core->name); 477 + pr_err("can't enable device\n"); 473 478 return err; 474 479 } 475 480 dev->state.disabled = 0; 476 481 } 477 482 err=pci_set_power_state(pci_dev, PCI_D0); 478 483 if (err) { 479 - printk(KERN_ERR "%s: can't enable device\n", 480 - dev->core->name); 484 + pr_err("can't enable device\n"); 481 485 pci_disable_device(pci_dev); 482 486 dev->state.disabled = 1; 483 487 ··· 488 498 /* restart video+vbi capture */ 489 499 spin_lock_irqsave(&dev->slock, flags); 490 500 if (!list_empty(&dev->mpegq.active)) { 491 - printk("%s: resume mpeg\n", core->name); 501 + pr_info("resume mpeg\n"); 492 502 cx8802_restart_queue(dev,&dev->mpegq); 493 503 } 494 504 spin_unlock_irqrestore(&dev->slock, flags); ··· 540 550 drv->advise_acquire(drv); 541 551 } 542 552 543 - mpeg_dbg(1,"%s() Post acquire GPIO=%x\n", __func__, cx_read(MO_GP0_IO)); 553 + dprintk(1, "Post acquire GPIO=%x\n", cx_read(MO_GP0_IO)); 544 554 } 545 555 546 556 return 0; ··· 561 571 562 572 drv->advise_release(drv); 563 573 core->active_type_id = CX88_BOARD_NONE; 564 - mpeg_dbg(1,"%s() Post release GPIO=%x\n", __func__, cx_read(MO_GP0_IO)); 574 + dprintk(1, "Post release GPIO=%x\n", cx_read(MO_GP0_IO)); 565 575 } 566 576 567 577 return 0; ··· 595 605 struct cx8802_driver *driver; 596 606 int err, i = 0; 597 607 598 - printk(KERN_INFO 599 - "cx88/2: registering cx8802 driver, type: %s access: %s\n", 600 - drv->type_id == CX88_MPEG_DVB ? "dvb" : "blackbird", 601 - drv->hw_access == CX8802_DRVCTL_SHARED ? "shared" : "exclusive"); 608 + pr_info("registering cx8802 driver, type: %s access: %s\n", 609 + drv->type_id == CX88_MPEG_DVB ? "dvb" : "blackbird", 610 + drv->hw_access == CX8802_DRVCTL_SHARED ? "shared" : "exclusive"); 602 611 603 612 if ((err = cx8802_check_driver(drv)) != 0) { 604 - printk(KERN_ERR "cx88/2: cx8802_driver is invalid\n"); 613 + pr_err("cx8802_driver is invalid\n"); 605 614 return err; 606 615 } 607 616 608 617 mutex_lock(&cx8802_mutex); 609 618 610 619 list_for_each_entry(dev, &cx8802_devlist, devlist) { 611 - printk(KERN_INFO 612 - "%s/2: subsystem: %04x:%04x, board: %s [card=%d]\n", 613 - dev->core->name, dev->pci->subsystem_vendor, 614 - dev->pci->subsystem_device, dev->core->board.name, 615 - dev->core->boardnr); 620 + pr_info("subsystem: %04x:%04x, board: %s [card=%d]\n", 621 + dev->pci->subsystem_vendor, 622 + dev->pci->subsystem_device, dev->core->board.name, 623 + dev->core->boardnr); 616 624 617 625 /* Bring up a new struct for each driver instance */ 618 626 driver = kzalloc(sizeof(*drv),GFP_KERNEL); ··· 633 645 i++; 634 646 list_add_tail(&driver->drvlist, &dev->drvlist); 635 647 } else { 636 - printk(KERN_ERR 637 - "%s/2: cx8802 probe failed, err = %d\n", 638 - dev->core->name, err); 648 + pr_err("cx8802 probe failed, err = %d\n", err); 639 649 } 640 650 mutex_unlock(&drv->core->lock); 641 651 } ··· 650 664 struct cx8802_driver *d, *dtmp; 651 665 int err = 0; 652 666 653 - printk(KERN_INFO 654 - "cx88/2: unregistering cx8802 driver, type: %s access: %s\n", 655 - drv->type_id == CX88_MPEG_DVB ? "dvb" : "blackbird", 656 - drv->hw_access == CX8802_DRVCTL_SHARED ? "shared" : "exclusive"); 667 + pr_info("unregistering cx8802 driver, type: %s access: %s\n", 668 + drv->type_id == CX88_MPEG_DVB ? "dvb" : "blackbird", 669 + drv->hw_access == CX8802_DRVCTL_SHARED ? "shared" : "exclusive"); 657 670 658 671 mutex_lock(&cx8802_mutex); 659 672 660 673 list_for_each_entry(dev, &cx8802_devlist, devlist) { 661 - printk(KERN_INFO 662 - "%s/2: subsystem: %04x:%04x, board: %s [card=%d]\n", 663 - dev->core->name, dev->pci->subsystem_vendor, 664 - dev->pci->subsystem_device, dev->core->board.name, 665 - dev->core->boardnr); 674 + pr_info("subsystem: %04x:%04x, board: %s [card=%d]\n", 675 + dev->pci->subsystem_vendor, 676 + dev->pci->subsystem_device, dev->core->board.name, 677 + dev->core->boardnr); 666 678 667 679 mutex_lock(&dev->core->lock); 668 680 ··· 674 690 list_del(&d->drvlist); 675 691 kfree(d); 676 692 } else 677 - printk(KERN_ERR "%s/2: cx8802 driver remove failed (%d)\n", 678 - dev->core->name, err); 693 + pr_err("cx8802 driver remove failed (%d)\n", 694 + err); 679 695 } 680 696 681 697 mutex_unlock(&dev->core->lock); ··· 699 715 if (NULL == core) 700 716 return -EINVAL; 701 717 702 - printk("%s/2: cx2388x 8802 Driver Manager\n", core->name); 718 + pr_info("cx2388x 8802 Driver Manager\n"); 703 719 704 720 err = -ENODEV; 705 721 if (!core->board.mpeg) ··· 742 758 743 759 dev = pci_get_drvdata(pci_dev); 744 760 745 - dprintk( 1, "%s\n", __func__); 761 + dprintk(1, "%s\n", __func__); 746 762 747 763 flush_request_modules(dev); 748 764 ··· 752 768 struct cx8802_driver *drv, *tmp; 753 769 int err; 754 770 755 - printk(KERN_WARNING "%s/2: Trying to remove cx8802 driver while cx8802 sub-drivers still loaded?!\n", 756 - dev->core->name); 771 + pr_warn("Trying to remove cx8802 driver while cx8802 sub-drivers still loaded?!\n"); 757 772 758 773 list_for_each_entry_safe(drv, tmp, &dev->drvlist, drvlist) { 759 774 err = drv->remove(drv); 760 775 if (err == 0) { 761 776 list_del(&drv->drvlist); 762 777 } else 763 - printk(KERN_ERR "%s/2: cx8802 driver remove failed (%d)\n", 764 - dev->core->name, err); 778 + pr_err("cx8802 driver remove failed (%d)\n", 779 + err); 765 780 kfree(drv); 766 781 } 767 782 }
+8 -7
drivers/media/pci/cx88/cx88-tvaudio.c
··· 35 35 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 36 36 */ 37 37 38 + #include "cx88.h" 39 + 38 40 #include <linux/module.h> 39 41 #include <linux/errno.h> 40 42 #include <linux/freezer.h> ··· 52 50 #include <linux/delay.h> 53 51 #include <linux/kthread.h> 54 52 55 - #include "cx88.h" 56 - 57 53 static unsigned int audio_debug; 58 54 module_param(audio_debug, int, 0644); 59 55 MODULE_PARM_DESC(audio_debug, "enable debug messages [audio]"); ··· 64 64 module_param(radio_deemphasis,int,0644); 65 65 MODULE_PARM_DESC(radio_deemphasis, "Radio deemphasis time constant, 0=None, 1=50us (elsewhere), 2=75us (USA)"); 66 66 67 - #define dprintk(fmt, arg...) if (audio_debug) \ 68 - printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg) 69 - 67 + #define dprintk(fmt, arg...) do { \ 68 + if (audio_debug) \ 69 + printk(KERN_DEBUG pr_fmt("%s: tvaudio:" fmt), \ 70 + __func__, ##arg); \ 71 + } while (0) 70 72 /* ----------------------------------------------------------- */ 71 73 72 74 static const char * const aud_ctl_names[64] = { ··· 799 797 break; 800 798 case WW_NONE: 801 799 case WW_I2SPT: 802 - printk("%s/0: unknown tv audio mode [%d]\n", 803 - core->name, core->tvaudio); 800 + pr_info("unknown tv audio mode [%d]\n", core->tvaudio); 804 801 break; 805 802 } 806 803 return;
+8 -4
drivers/media/pci/cx88/cx88-vbi.c
··· 1 1 /* 2 2 */ 3 + 4 + #include "cx88.h" 5 + 3 6 #include <linux/kernel.h> 4 7 #include <linux/module.h> 5 8 #include <linux/init.h> 6 - 7 - #include "cx88.h" 8 9 9 10 static unsigned int vbi_debug; 10 11 module_param(vbi_debug,int,0644); 11 12 MODULE_PARM_DESC(vbi_debug,"enable debug messages [vbi]"); 12 13 13 - #define dprintk(level,fmt, arg...) if (vbi_debug >= level) \ 14 - printk(KERN_DEBUG "%s: " fmt, dev->core->name , ## arg) 14 + #define dprintk(level, fmt, arg...) do { \ 15 + if (vbi_debug >= level) \ 16 + printk(KERN_DEBUG pr_fmt("%s: vbi:" fmt), \ 17 + __func__, ##arg); \ 18 + } while (0) 15 19 16 20 /* ------------------------------------------------------------------ */ 17 21
+34 -37
drivers/media/pci/cx88/cx88-video.c
··· 25 25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 26 26 */ 27 27 28 + #include "cx88.h" 29 + 28 30 #include <linux/init.h> 29 31 #include <linux/list.h> 30 32 #include <linux/module.h> ··· 39 37 #include <linux/kthread.h> 40 38 #include <asm/div64.h> 41 39 42 - #include "cx88.h" 43 40 #include <media/v4l2-common.h> 44 41 #include <media/v4l2-ioctl.h> 45 42 #include <media/v4l2-event.h> ··· 71 70 module_param(irq_debug,int,0644); 72 71 MODULE_PARM_DESC(irq_debug,"enable debug messages [IRQ handler]"); 73 72 74 - #define dprintk(level,fmt, arg...) if (video_debug >= level) \ 75 - printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg) 73 + #define dprintk(level, fmt, arg...) do { \ 74 + if (video_debug >= level) \ 75 + printk(KERN_DEBUG pr_fmt("%s: video:" fmt), \ 76 + __func__, ##arg); \ 77 + } while (0) 78 + 76 79 77 80 /* ------------------------------------------------------------------- */ 78 81 /* static data */ ··· 419 414 static int restart_video_queue(struct cx8800_dev *dev, 420 415 struct cx88_dmaqueue *q) 421 416 { 422 - struct cx88_core *core = dev->core; 423 417 struct cx88_buffer *buf; 424 418 425 419 if (!list_empty(&q->active)) { ··· 517 513 struct cx8800_dev *dev = vb->vb2_queue->drv_priv; 518 514 struct cx88_buffer *buf = container_of(vbuf, struct cx88_buffer, vb); 519 515 struct cx88_buffer *prev; 520 - struct cx88_core *core = dev->core; 521 516 struct cx88_dmaqueue *q = &dev->vidq; 522 517 523 518 /* add jump to start */ ··· 1093 1090 return; 1094 1091 cx_write(MO_VID_INTSTAT, status); 1095 1092 if (irq_debug || (status & mask & ~0xff)) 1096 - cx88_print_irqbits(core->name, "irq vid", 1093 + cx88_print_irqbits("irq vid", 1097 1094 cx88_vid_irqs, ARRAY_SIZE(cx88_vid_irqs), 1098 1095 status, mask); 1099 1096 1100 1097 /* risc op code error */ 1101 1098 if (status & (1 << 16)) { 1102 - printk(KERN_WARNING "%s/0: video risc op code error\n",core->name); 1099 + pr_warn("video risc op code error\n"); 1103 1100 cx_clear(MO_VID_DMACNTRL, 0x11); 1104 1101 cx_clear(VID_CAPTURE_CONTROL, 0x06); 1105 1102 cx88_sram_channel_dump(core, &cx88_sram_channels[SRAM_CH21]); ··· 1143 1140 cx8800_vid_irq(dev); 1144 1141 } 1145 1142 if (10 == loop) { 1146 - printk(KERN_WARNING "%s/0: irq loop -- clearing mask\n", 1147 - core->name); 1143 + pr_warn("irq loop -- clearing mask\n"); 1148 1144 cx_write(MO_PCI_INTMSK,0); 1149 1145 } 1150 1146 ··· 1309 1307 /* print pci info */ 1310 1308 dev->pci_rev = pci_dev->revision; 1311 1309 pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); 1312 - printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, latency: %d, mmio: 0x%llx\n", 1313 - core->name, 1314 - pci_name(pci_dev), dev->pci_rev, pci_dev->irq, 1315 - dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0)); 1310 + pr_info("found at %s, rev: %d, irq: %d, latency: %d, mmio: 0x%llx\n", 1311 + pci_name(pci_dev), dev->pci_rev, pci_dev->irq, 1312 + dev->pci_lat, 1313 + (unsigned long long)pci_resource_start(pci_dev, 0)); 1316 1314 1317 1315 pci_set_master(pci_dev); 1318 1316 err = pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32)); 1319 1317 if (err) { 1320 - printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name); 1318 + pr_err("Oops: no 32bit PCI DMA ???\n"); 1321 1319 goto fail_core; 1322 1320 } 1323 1321 ··· 1334 1332 err = request_irq(pci_dev->irq, cx8800_irq, 1335 1333 IRQF_SHARED, core->name, dev); 1336 1334 if (err < 0) { 1337 - printk(KERN_ERR "%s/0: can't get IRQ %d\n", 1338 - core->name,pci_dev->irq); 1335 + pr_err("can't get IRQ %d\n", pci_dev->irq); 1339 1336 goto fail_core; 1340 1337 } 1341 1338 cx_set(MO_PCI_INTMSK, core->pci_irqmask); ··· 1471 1470 err = video_register_device(&dev->video_dev, VFL_TYPE_GRABBER, 1472 1471 video_nr[core->nr]); 1473 1472 if (err < 0) { 1474 - printk(KERN_ERR "%s/0: can't register video device\n", 1475 - core->name); 1473 + pr_err("can't register video device\n"); 1476 1474 goto fail_unreg; 1477 1475 } 1478 - printk(KERN_INFO "%s/0: registered device %s [v4l2]\n", 1479 - core->name, video_device_node_name(&dev->video_dev)); 1476 + pr_info("registered device %s [v4l2]\n", 1477 + video_device_node_name(&dev->video_dev)); 1480 1478 1481 1479 cx88_vdev_init(core, dev->pci, &dev->vbi_dev, 1482 1480 &cx8800_vbi_template, "vbi"); ··· 1484 1484 err = video_register_device(&dev->vbi_dev, VFL_TYPE_VBI, 1485 1485 vbi_nr[core->nr]); 1486 1486 if (err < 0) { 1487 - printk(KERN_ERR "%s/0: can't register vbi device\n", 1488 - core->name); 1487 + pr_err("can't register vbi device\n"); 1489 1488 goto fail_unreg; 1490 1489 } 1491 - printk(KERN_INFO "%s/0: registered device %s\n", 1492 - core->name, video_device_node_name(&dev->vbi_dev)); 1490 + pr_info("registered device %s\n", 1491 + video_device_node_name(&dev->vbi_dev)); 1493 1492 1494 1493 if (core->board.radio.type == CX88_RADIO) { 1495 1494 cx88_vdev_init(core, dev->pci, &dev->radio_dev, ··· 1498 1499 err = video_register_device(&dev->radio_dev, VFL_TYPE_RADIO, 1499 1500 radio_nr[core->nr]); 1500 1501 if (err < 0) { 1501 - printk(KERN_ERR "%s/0: can't register radio device\n", 1502 - core->name); 1502 + pr_err("can't register radio device\n"); 1503 1503 goto fail_unreg; 1504 1504 } 1505 - printk(KERN_INFO "%s/0: registered device %s\n", 1506 - core->name, video_device_node_name(&dev->radio_dev)); 1505 + pr_info("registered device %s\n", 1506 + video_device_node_name(&dev->radio_dev)); 1507 1507 } 1508 1508 1509 1509 /* start tvaudio thread */ ··· 1510 1512 core->kthread = kthread_run(cx88_audio_thread, core, "cx88 tvaudio"); 1511 1513 if (IS_ERR(core->kthread)) { 1512 1514 err = PTR_ERR(core->kthread); 1513 - printk(KERN_ERR "%s/0: failed to create cx88 audio thread, err=%d\n", 1514 - core->name, err); 1515 + pr_err("failed to create cx88 audio thread, err=%d\n", 1516 + err); 1515 1517 } 1516 1518 } 1517 1519 mutex_unlock(&core->lock); ··· 1569 1571 /* stop video+vbi capture */ 1570 1572 spin_lock_irqsave(&dev->slock, flags); 1571 1573 if (!list_empty(&dev->vidq.active)) { 1572 - printk("%s/0: suspend video\n", core->name); 1574 + pr_info("suspend video\n"); 1573 1575 stop_video_dma(dev); 1574 1576 } 1575 1577 if (!list_empty(&dev->vbiq.active)) { 1576 - printk("%s/0: suspend vbi\n", core->name); 1578 + pr_info("suspend vbi\n"); 1577 1579 cx8800_stop_vbi_dma(dev); 1578 1580 } 1579 1581 spin_unlock_irqrestore(&dev->slock, flags); ··· 1601 1603 if (dev->state.disabled) { 1602 1604 err=pci_enable_device(pci_dev); 1603 1605 if (err) { 1604 - printk(KERN_ERR "%s/0: can't enable device\n", 1605 - core->name); 1606 + pr_err("can't enable device\n"); 1606 1607 return err; 1607 1608 } 1608 1609 ··· 1609 1612 } 1610 1613 err= pci_set_power_state(pci_dev, PCI_D0); 1611 1614 if (err) { 1612 - printk(KERN_ERR "%s/0: can't set power state\n", core->name); 1615 + pr_err("can't set power state\n"); 1613 1616 pci_disable_device(pci_dev); 1614 1617 dev->state.disabled = 1; 1615 1618 ··· 1627 1630 /* restart video+vbi capture */ 1628 1631 spin_lock_irqsave(&dev->slock, flags); 1629 1632 if (!list_empty(&dev->vidq.active)) { 1630 - printk("%s/0: resume video\n", core->name); 1633 + pr_info("resume video\n"); 1631 1634 restart_video_queue(dev,&dev->vidq); 1632 1635 } 1633 1636 if (!list_empty(&dev->vbiq.active)) { 1634 - printk("%s/0: resume vbi\n", core->name); 1637 + pr_info("resume vbi\n"); 1635 1638 cx8800_restart_vbi_queue(dev,&dev->vbiq); 1636 1639 } 1637 1640 spin_unlock_irqrestore(&dev->slock, flags);
+4 -4
drivers/media/pci/cx88/cx88-vp3054-i2c.c
··· 22 22 23 23 */ 24 24 25 + #include "cx88.h" 26 + #include "cx88-vp3054-i2c.h" 27 + 25 28 #include <linux/module.h> 26 29 #include <linux/slab.h> 27 30 #include <linux/init.h> 28 31 29 32 #include <asm/io.h> 30 - 31 - #include "cx88.h" 32 - #include "cx88-vp3054-i2c.h" 33 33 34 34 MODULE_DESCRIPTION("driver for cx2388x VP3054 design"); 35 35 MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>"); ··· 133 133 134 134 rc = i2c_bit_add_bus(&vp3054_i2c->adap); 135 135 if (0 != rc) { 136 - printk("%s: vp3054_i2c register FAILED\n", core->name); 136 + pr_err("vp3054_i2c register FAILED\n"); 137 137 138 138 kfree(dev->vp3054); 139 139 dev->vp3054 = NULL;
+8 -1
drivers/media/pci/cx88/cx88.h
··· 19 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 20 */ 21 21 22 + #ifndef CX88_H 23 + #define CX88_H 24 + 25 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 26 + 22 27 #include <linux/pci.h> 23 28 #include <linux/i2c.h> 24 29 #include <linux/i2c-algo-bit.h> ··· 619 614 620 615 extern unsigned int cx88_core_debug; 621 616 622 - extern void cx88_print_irqbits(const char *name, const char *tag, const char *strings[], 617 + extern void cx88_print_irqbits(const char *tag, const char *strings[], 623 618 int len, u32 bits, u32 mask); 624 619 625 620 extern int cx88_core_irq(struct cx88_core *core, u32 status); ··· 743 738 int cx88_video_mux(struct cx88_core *core, unsigned int input); 744 739 void cx88_querycap(struct file *file, struct cx88_core *core, 745 740 struct v4l2_capability *cap); 741 + 742 + #endif