diff options
Diffstat (limited to 'drivers/media/pci/cx88/cx88-cards.c')
-rw-r--r-- | drivers/media/pci/cx88/cx88-cards.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/media/pci/cx88/cx88-cards.c b/drivers/media/pci/cx88/cx88-cards.c index 07b700a9ed7f..a87a0e19593e 100644 --- a/drivers/media/pci/cx88/cx88-cards.c +++ b/drivers/media/pci/cx88/cx88-cards.c | |||
@@ -59,6 +59,11 @@ MODULE_PARM_DESC(disable_ir, "Disable IR support"); | |||
59 | #define err_printk(core, fmt, arg...) \ | 59 | #define err_printk(core, fmt, arg...) \ |
60 | printk(KERN_ERR "%s: " fmt, core->name , ## arg) | 60 | printk(KERN_ERR "%s: " fmt, core->name , ## arg) |
61 | 61 | ||
62 | #define dprintk(level,fmt, arg...) do { \ | ||
63 | if (cx88_core_debug >= level) \ | ||
64 | printk(KERN_DEBUG "%s: " fmt, core->name , ## arg); \ | ||
65 | } while(0) | ||
66 | |||
62 | 67 | ||
63 | /* ------------------------------------------------------------------ */ | 68 | /* ------------------------------------------------------------------ */ |
64 | /* board config info */ | 69 | /* board config info */ |
@@ -3134,7 +3139,7 @@ static int cx88_xc2028_tuner_callback(struct cx88_core *core, | |||
3134 | case XC2028_TUNER_RESET: | 3139 | case XC2028_TUNER_RESET: |
3135 | switch (INPUT(core->input).type) { | 3140 | switch (INPUT(core->input).type) { |
3136 | case CX88_RADIO: | 3141 | case CX88_RADIO: |
3137 | info_printk(core, "setting GPIO to radio!\n"); | 3142 | dprintk(1, "setting GPIO to radio!\n"); |
3138 | cx_write(MO_GP0_IO, 0x4ff); | 3143 | cx_write(MO_GP0_IO, 0x4ff); |
3139 | mdelay(250); | 3144 | mdelay(250); |
3140 | cx_write(MO_GP2_IO, 0xff); | 3145 | cx_write(MO_GP2_IO, 0xff); |
@@ -3142,7 +3147,7 @@ static int cx88_xc2028_tuner_callback(struct cx88_core *core, | |||
3142 | break; | 3147 | break; |
3143 | case CX88_VMUX_DVB: /* Digital TV*/ | 3148 | case CX88_VMUX_DVB: /* Digital TV*/ |
3144 | default: /* Analog TV */ | 3149 | default: /* Analog TV */ |
3145 | info_printk(core, "setting GPIO to TV!\n"); | 3150 | dprintk(1, "setting GPIO to TV!\n"); |
3146 | break; | 3151 | break; |
3147 | } | 3152 | } |
3148 | cx_write(MO_GP1_IO, 0x101010); | 3153 | cx_write(MO_GP1_IO, 0x101010); |
@@ -3200,8 +3205,7 @@ static int cx88_xc5000_tuner_callback(struct cx88_core *core, | |||
3200 | not having any tuning at all. */ | 3205 | not having any tuning at all. */ |
3201 | return 0; | 3206 | return 0; |
3202 | } else { | 3207 | } else { |
3203 | err_printk(core, "xc5000: unknown tuner " | 3208 | dprintk(1, "xc5000: unknown tuner callback command.\n"); |
3204 | "callback command.\n"); | ||
3205 | return -EINVAL; | 3209 | return -EINVAL; |
3206 | } | 3210 | } |
3207 | break; | 3211 | break; |
@@ -3212,8 +3216,7 @@ static int cx88_xc5000_tuner_callback(struct cx88_core *core, | |||
3212 | cx_set(MO_GP0_IO, 0x00000010); | 3216 | cx_set(MO_GP0_IO, 0x00000010); |
3213 | return 0; | 3217 | return 0; |
3214 | } else { | 3218 | } else { |
3215 | printk(KERN_ERR | 3219 | dprintk(1, "xc5000: unknown tuner callback command.\n"); |
3216 | "xc5000: unknown tuner callback command.\n"); | ||
3217 | return -EINVAL; | 3220 | return -EINVAL; |
3218 | } | 3221 | } |
3219 | break; | 3222 | break; |
@@ -3243,13 +3246,13 @@ int cx88_tuner_callback(void *priv, int component, int command, int arg) | |||
3243 | 3246 | ||
3244 | switch (core->board.tuner_type) { | 3247 | switch (core->board.tuner_type) { |
3245 | case TUNER_XC2028: | 3248 | case TUNER_XC2028: |
3246 | info_printk(core, "Calling XC2028/3028 callback\n"); | 3249 | dprintk(1, "Calling XC2028/3028 callback\n"); |
3247 | return cx88_xc2028_tuner_callback(core, command, arg); | 3250 | return cx88_xc2028_tuner_callback(core, command, arg); |
3248 | case TUNER_XC4000: | 3251 | case TUNER_XC4000: |
3249 | info_printk(core, "Calling XC4000 callback\n"); | 3252 | dprintk(1, "Calling XC4000 callback\n"); |
3250 | return cx88_xc4000_tuner_callback(core, command, arg); | 3253 | return cx88_xc4000_tuner_callback(core, command, arg); |
3251 | case TUNER_XC5000: | 3254 | case TUNER_XC5000: |
3252 | info_printk(core, "Calling XC5000 callback\n"); | 3255 | dprintk(1, "Calling XC5000 callback\n"); |
3253 | return cx88_xc5000_tuner_callback(core, command, arg); | 3256 | return cx88_xc5000_tuner_callback(core, command, arg); |
3254 | } | 3257 | } |
3255 | err_printk(core, "Error: Calling callback for tuner %d\n", | 3258 | err_printk(core, "Error: Calling callback for tuner %d\n", |
@@ -3590,8 +3593,8 @@ static void cx88_card_setup(struct cx88_core *core) | |||
3590 | memset(&xc2028_cfg, 0, sizeof(xc2028_cfg)); | 3593 | memset(&xc2028_cfg, 0, sizeof(xc2028_cfg)); |
3591 | xc2028_cfg.tuner = TUNER_XC2028; | 3594 | xc2028_cfg.tuner = TUNER_XC2028; |
3592 | xc2028_cfg.priv = &ctl; | 3595 | xc2028_cfg.priv = &ctl; |
3593 | info_printk(core, "Asking xc2028/3028 to load firmware %s\n", | 3596 | dprintk(1, "Asking xc2028/3028 to load firmware %s\n", |
3594 | ctl.fname); | 3597 | ctl.fname); |
3595 | call_all(core, tuner, s_config, &xc2028_cfg); | 3598 | call_all(core, tuner, s_config, &xc2028_cfg); |
3596 | } | 3599 | } |
3597 | call_all(core, core, s_power, 0); | 3600 | call_all(core, core, s_power, 0); |
@@ -3760,8 +3763,8 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) | |||
3760 | if (radio[core->nr] != UNSET) | 3763 | if (radio[core->nr] != UNSET) |
3761 | core->board.radio_type = radio[core->nr]; | 3764 | core->board.radio_type = radio[core->nr]; |
3762 | 3765 | ||
3763 | info_printk(core, "TV tuner type %d, Radio tuner type %d\n", | 3766 | dprintk(1, "TV tuner type %d, Radio tuner type %d\n", |
3764 | core->board.tuner_type, core->board.radio_type); | 3767 | core->board.tuner_type, core->board.radio_type); |
3765 | 3768 | ||
3766 | /* init hardware */ | 3769 | /* init hardware */ |
3767 | cx88_reset(core); | 3770 | cx88_reset(core); |