aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-22 13:45:29 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:45 -0400
commit0f19e65bc5dcd30f1c5d72f56f6a9a2dc01698f3 (patch)
tree0a3635fbe8d7635435f148850b222752f359d040
parentc450e50e8d6a0876431a744f1df9fdd5c2732b07 (diff)
V4L/DVB (7264): cx88-cards: always use a level on printk messages
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/cx88/cx88-cards.c71
1 files changed, 41 insertions, 30 deletions
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index fc870882ffe2..2429cfe31554 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -45,6 +45,16 @@ static unsigned int latency = UNSET;
45module_param(latency,int,0444); 45module_param(latency,int,0444);
46MODULE_PARM_DESC(latency,"pci latency timer"); 46MODULE_PARM_DESC(latency,"pci latency timer");
47 47
48#define info_printk(core, fmt, arg...) \
49 printk(KERN_INFO "%s: " fmt, core->name , ## arg)
50
51#define warn_printk(core, fmt, arg...) \
52 printk(KERN_WARNING "%s: " fmt, core->name , ## arg)
53
54#define err_printk(core, fmt, arg...) \
55 printk(KERN_ERR "%s: " fmt, core->name , ## arg)
56
57
48/* ------------------------------------------------------------------ */ 58/* ------------------------------------------------------------------ */
49/* board config info */ 59/* board config info */
50 60
@@ -1915,17 +1925,16 @@ static void leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
1915 if (eeprom_data[4] != 0x7d || 1925 if (eeprom_data[4] != 0x7d ||
1916 eeprom_data[5] != 0x10 || 1926 eeprom_data[5] != 0x10 ||
1917 eeprom_data[7] != 0x66) { 1927 eeprom_data[7] != 0x66) {
1918 printk(KERN_WARNING "%s: Leadtek eeprom invalid.\n", 1928 warn_printk(core, "Leadtek eeprom invalid.\n");
1919 core->name);
1920 return; 1929 return;
1921 } 1930 }
1922 1931
1923 core->board.tuner_type = (eeprom_data[6] == 0x13) ? 1932 core->board.tuner_type = (eeprom_data[6] == 0x13) ?
1924 TUNER_PHILIPS_FM1236_MK3 : TUNER_PHILIPS_FM1216ME_MK3; 1933 TUNER_PHILIPS_FM1236_MK3 : TUNER_PHILIPS_FM1216ME_MK3;
1925 1934
1926 printk(KERN_INFO "%s: Leadtek Winfast 2000XP Expert config: " 1935 info_printk(core, "Leadtek Winfast 2000XP Expert config: "
1927 "tuner=%d, eeprom[0]=0x%02x\n", 1936 "tuner=%d, eeprom[0]=0x%02x\n",
1928 core->name, core->board.tuner_type, eeprom_data[0]); 1937 core->board.tuner_type, eeprom_data[0]);
1929} 1938}
1930 1939
1931static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data) 1940static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
@@ -1969,13 +1978,12 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
1969 /* known */ 1978 /* known */
1970 break; 1979 break;
1971 default: 1980 default:
1972 printk("%s: warning: unknown hauppauge model #%d\n", 1981 warn_printk(core, "warning: unknown hauppauge model #%d\n",
1973 core->name, tv.model); 1982 tv.model);
1974 break; 1983 break;
1975 } 1984 }
1976 1985
1977 printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n", 1986 info_printk(core, "hauppauge eeprom: model=%d\n", tv.model);
1978 core->name, tv.model);
1979} 1987}
1980 1988
1981/* ----------------------------------------------------------------------- */ 1989/* ----------------------------------------------------------------------- */
@@ -2021,8 +2029,7 @@ static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data)
2021 char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner)) 2029 char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner))
2022 ? gdi_tuner[eeprom_data[0x0d]].name : NULL; 2030 ? gdi_tuner[eeprom_data[0x0d]].name : NULL;
2023 2031
2024 printk(KERN_INFO "%s: GDI: tuner=%s\n", core->name, 2032 info_printk(core, "GDI: tuner=%s\n", name ? name : "unknown");
2025 name ? name : "unknown");
2026 if (NULL == name) 2033 if (NULL == name)
2027 return; 2034 return;
2028 core->board.tuner_type = gdi_tuner[eeprom_data[0x0d]].id; 2035 core->board.tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
@@ -2110,7 +2117,8 @@ static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core)
2110 msg.len = (i != 12 ? 5 : 2); 2117 msg.len = (i != 12 ? 5 : 2);
2111 err = i2c_transfer(&core->i2c_adap, &msg, 1); 2118 err = i2c_transfer(&core->i2c_adap, &msg, 1);
2112 if (err != 1) { 2119 if (err != 1) {
2113 printk("dvico_fusionhdtv_hybrid_init buf %d failed (err = %d)!\n", i, err); 2120 warn_printk(core, "dvico_fusionhdtv_hybrid_init buf %d "
2121 "failed (err = %d)!\n", i, err);
2114 return; 2122 return;
2115 } 2123 }
2116 } 2124 }
@@ -2135,7 +2143,7 @@ static int cx88_xc2028_tuner_callback(void *priv, int command, int arg)
2135 case XC2028_TUNER_RESET: 2143 case XC2028_TUNER_RESET:
2136 switch (INPUT(core->input).type) { 2144 switch (INPUT(core->input).type) {
2137 case CX88_RADIO: 2145 case CX88_RADIO:
2138 printk(KERN_INFO "setting GPIO to radio!\n"); 2146 info_printk(core, "setting GPIO to radio!\n");
2139 cx_write(MO_GP0_IO, 0x4ff); 2147 cx_write(MO_GP0_IO, 0x4ff);
2140 mdelay(250); 2148 mdelay(250);
2141 cx_write(MO_GP2_IO, 0xff); 2149 cx_write(MO_GP2_IO, 0xff);
@@ -2143,7 +2151,7 @@ static int cx88_xc2028_tuner_callback(void *priv, int command, int arg)
2143 break; 2151 break;
2144 case CX88_VMUX_DVB: /* Digital TV*/ 2152 case CX88_VMUX_DVB: /* Digital TV*/
2145 default: /* Analog TV */ 2153 default: /* Analog TV */
2146 printk(KERN_INFO "setting GPIO to TV!\n"); 2154 info_printk(core, "setting GPIO to TV!\n");
2147 break; 2155 break;
2148 } 2156 }
2149 cx_write(MO_GP1_IO, 0x101010); 2157 cx_write(MO_GP1_IO, 0x101010);
@@ -2176,8 +2184,8 @@ static int cx88_xc5000_tuner_callback(void *priv, int command, int arg)
2176 cx_write(MO_SRST_IO, 1); 2184 cx_write(MO_SRST_IO, 1);
2177 return 0; 2185 return 0;
2178 } else { 2186 } else {
2179 printk(KERN_ERR 2187 err_printk(core, "xc5000: unknown tuner "
2180 "xc5000: unknown tuner callback command.\n"); 2188 "callback command.\n");
2181 return -EINVAL; 2189 return -EINVAL;
2182 } 2190 }
2183 break; 2191 break;
@@ -2192,10 +2200,14 @@ int cx88_tuner_callback(void *priv, int command, int arg)
2192 2200
2193 switch (core->board.tuner_type) { 2201 switch (core->board.tuner_type) {
2194 case TUNER_XC2028: 2202 case TUNER_XC2028:
2203 info_printk(core, "Calling XC2028/3028 callback\n");
2195 return cx88_xc2028_tuner_callback(priv, command, arg); 2204 return cx88_xc2028_tuner_callback(priv, command, arg);
2196 case TUNER_XC5000: 2205 case TUNER_XC5000:
2206 info_printk(core, "Calling XC5000 callback\n");
2197 return cx88_xc5000_tuner_callback(priv, command, arg); 2207 return cx88_xc5000_tuner_callback(priv, command, arg);
2198 } 2208 }
2209 err_printk(core, "Error: Calling callback for tuner %d\n",
2210 core->board.tuner_type);
2199 return -EINVAL; 2211 return -EINVAL;
2200} 2212}
2201EXPORT_SYMBOL(cx88_tuner_callback); 2213EXPORT_SYMBOL(cx88_tuner_callback);
@@ -2208,23 +2220,25 @@ static void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
2208 2220
2209 if (0 == pci->subsystem_vendor && 2221 if (0 == pci->subsystem_vendor &&
2210 0 == pci->subsystem_device) { 2222 0 == pci->subsystem_device) {
2211 printk("%s: Your board has no valid PCI Subsystem ID and thus can't\n" 2223 printk(KERN_ERR
2224 "%s: Your board has no valid PCI Subsystem ID and thus can't\n"
2212 "%s: be autodetected. Please pass card=<n> insmod option to\n" 2225 "%s: be autodetected. Please pass card=<n> insmod option to\n"
2213 "%s: workaround that. Redirect complaints to the vendor of\n" 2226 "%s: workaround that. Redirect complaints to the vendor of\n"
2214 "%s: the TV card. Best regards,\n" 2227 "%s: the TV card. Best regards,\n"
2215 "%s: -- tux\n", 2228 "%s: -- tux\n",
2216 core->name,core->name,core->name,core->name,core->name); 2229 core->name,core->name,core->name,core->name,core->name);
2217 } else { 2230 } else {
2218 printk("%s: Your board isn't known (yet) to the driver. You can\n" 2231 printk(KERN_ERR
2232 "%s: Your board isn't known (yet) to the driver. You can\n"
2219 "%s: try to pick one of the existing card configs via\n" 2233 "%s: try to pick one of the existing card configs via\n"
2220 "%s: card=<n> insmod option. Updating to the latest\n" 2234 "%s: card=<n> insmod option. Updating to the latest\n"
2221 "%s: version might help as well.\n", 2235 "%s: version might help as well.\n",
2222 core->name,core->name,core->name,core->name); 2236 core->name,core->name,core->name,core->name);
2223 } 2237 }
2224 printk("%s: Here is a list of valid choices for the card=<n> insmod option:\n", 2238 err_printk(core, "Here is a list of valid choices for the card=<n> "
2225 core->name); 2239 "insmod option:\n");
2226 for (i = 0; i < ARRAY_SIZE(cx88_boards); i++) 2240 for (i = 0; i < ARRAY_SIZE(cx88_boards); i++)
2227 printk("%s: card=%d -> %s\n", 2241 printk(KERN_ERR "%s: card=%d -> %s\n",
2228 core->name, i, cx88_boards[i].name); 2242 core->name, i, cx88_boards[i].name);
2229} 2243}
2230 2244
@@ -2335,10 +2349,8 @@ static void cx88_card_setup(struct cx88_core *core)
2335 for (i = 0; i < ARRAY_SIZE(buffer); i++) 2349 for (i = 0; i < ARRAY_SIZE(buffer); i++)
2336 if (2 != i2c_master_send(&core->i2c_client, 2350 if (2 != i2c_master_send(&core->i2c_client,
2337 buffer[i],2)) 2351 buffer[i],2))
2338 printk(KERN_WARNING 2352 warn_printk(core, "Unable to enable "
2339 "%s: Unable to enable " 2353 "tuner(%i).\n", i);
2340 "tuner(%i).\n",
2341 core->name, i);
2342 } 2354 }
2343 break; 2355 break;
2344 case CX88_BOARD_MSI_TVANYWHERE_MASTER: 2356 case CX88_BOARD_MSI_TVANYWHERE_MASTER:
@@ -2504,9 +2516,8 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
2504 2516
2505 memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board)); 2517 memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board));
2506 2518
2507 printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n", 2519 info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
2508 core->name,pci->subsystem_vendor, 2520 pci->subsystem_vendor, pci->subsystem_device, core->board.name,
2509 pci->subsystem_device, core->board.name,
2510 core->boardnr, card[core->nr] == core->boardnr ? 2521 core->boardnr, card[core->nr] == core->boardnr ?
2511 "insmod option" : "autodetected"); 2522 "insmod option" : "autodetected");
2512 2523
@@ -2515,8 +2526,8 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
2515 if (radio[core->nr] != UNSET) 2526 if (radio[core->nr] != UNSET)
2516 core->board.radio_type = radio[core->nr]; 2527 core->board.radio_type = radio[core->nr];
2517 2528
2518 printk(KERN_INFO "%s: TV tuner type %d, Radio tuner type %d\n", 2529 info_printk(core, "TV tuner type %d, Radio tuner type %d\n",
2519 core->name, core->board.tuner_type, core->board.radio_type); 2530 core->board.tuner_type, core->board.radio_type);
2520 2531
2521 /* init hardware */ 2532 /* init hardware */
2522 cx88_reset(core); 2533 cx88_reset(core);