8250_pnp.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Probe for 8250/16550-type ISAPNP serial ports.
  4. *
  5. * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
  6. *
  7. * Copyright (C) 2001 Russell King, All Rights Reserved.
  8. *
  9. * Ported to the Linux PnP Layer - (C) Adam Belay.
  10. */
  11. #include <linux/module.h>
  12. #include <linux/pci.h>
  13. #include <linux/pnp.h>
  14. #include <linux/string.h>
  15. #include <linux/kernel.h>
  16. #include <linux/serial_core.h>
  17. #include <linux/bitops.h>
  18. #include <asm/byteorder.h>
  19. #include "8250.h"
  20. #define UNKNOWN_DEV 0x3000
  21. #define CIR_PORT 0x0800
  22. static const struct pnp_device_id pnp_dev_table[] = {
  23. /* Archtek America Corp. */
  24. /* Archtek SmartLink Modem 3334BT Plug & Play */
  25. { "AAC000F", 0 },
  26. /* Anchor Datacomm BV */
  27. /* SXPro 144 External Data Fax Modem Plug & Play */
  28. { "ADC0001", 0 },
  29. /* SXPro 288 External Data Fax Modem Plug & Play */
  30. { "ADC0002", 0 },
  31. /* PROLiNK 1456VH ISA PnP K56flex Fax Modem */
  32. { "AEI0250", 0 },
  33. /* Actiontec ISA PNP 56K X2 Fax Modem */
  34. { "AEI1240", 0 },
  35. /* Rockwell 56K ACF II Fax+Data+Voice Modem */
  36. { "AKY1021", 0 /*SPCI_FL_NO_SHIRQ*/ },
  37. /*
  38. * ALi Fast Infrared Controller
  39. * Native driver (ali-ircc) is broken so at least
  40. * it can be used with irtty-sir.
  41. */
  42. { "ALI5123", 0 },
  43. /* AZT3005 PnP SOUND DEVICE */
  44. { "AZT4001", 0 },
  45. /* Best Data Products Inc. Smart One 336F PnP Modem */
  46. { "BDP3336", 0 },
  47. /* Boca Research */
  48. /* Boca Complete Ofc Communicator 14.4 Data-FAX */
  49. { "BRI0A49", 0 },
  50. /* Boca Research 33,600 ACF Modem */
  51. { "BRI1400", 0 },
  52. /* Boca 33.6 Kbps Internal FD34FSVD */
  53. { "BRI3400", 0 },
  54. /* Boca 33.6 Kbps Internal FD34FSVD */
  55. { "BRI0A49", 0 },
  56. /* Best Data Products Inc. Smart One 336F PnP Modem */
  57. { "BDP3336", 0 },
  58. /* Computer Peripherals Inc */
  59. /* EuroViVa CommCenter-33.6 SP PnP */
  60. { "CPI4050", 0 },
  61. /* Creative Labs */
  62. /* Creative Labs Phone Blaster 28.8 DSVD PnP Voice */
  63. { "CTL3001", 0 },
  64. /* Creative Labs Modem Blaster 28.8 DSVD PnP Voice */
  65. { "CTL3011", 0 },
  66. /* Davicom ISA 33.6K Modem */
  67. { "DAV0336", 0 },
  68. /* Creative */
  69. /* Creative Modem Blaster Flash56 DI5601-1 */
  70. { "DMB1032", 0 },
  71. /* Creative Modem Blaster V.90 DI5660 */
  72. { "DMB2001", 0 },
  73. /* E-Tech */
  74. /* E-Tech CyberBULLET PC56RVP */
  75. { "ETT0002", 0 },
  76. /* FUJITSU */
  77. /* Fujitsu 33600 PnP-I2 R Plug & Play */
  78. { "FUJ0202", 0 },
  79. /* Fujitsu FMV-FX431 Plug & Play */
  80. { "FUJ0205", 0 },
  81. /* Fujitsu 33600 PnP-I4 R Plug & Play */
  82. { "FUJ0206", 0 },
  83. /* Fujitsu Fax Voice 33600 PNP-I5 R Plug & Play */
  84. { "FUJ0209", 0 },
  85. /* Archtek America Corp. */
  86. /* Archtek SmartLink Modem 3334BT Plug & Play */
  87. { "GVC000F", 0 },
  88. /* Archtek SmartLink Modem 3334BRV 33.6K Data Fax Voice */
  89. { "GVC0303", 0 },
  90. /* Hayes */
  91. /* Hayes Optima 288 V.34-V.FC + FAX + Voice Plug & Play */
  92. { "HAY0001", 0 },
  93. /* Hayes Optima 336 V.34 + FAX + Voice PnP */
  94. { "HAY000C", 0 },
  95. /* Hayes Optima 336B V.34 + FAX + Voice PnP */
  96. { "HAY000D", 0 },
  97. /* Hayes Accura 56K Ext Fax Modem PnP */
  98. { "HAY5670", 0 },
  99. /* Hayes Accura 56K Ext Fax Modem PnP */
  100. { "HAY5674", 0 },
  101. /* Hayes Accura 56K Fax Modem PnP */
  102. { "HAY5675", 0 },
  103. /* Hayes 288, V.34 + FAX */
  104. { "HAYF000", 0 },
  105. /* Hayes Optima 288 V.34 + FAX + Voice, Plug & Play */
  106. { "HAYF001", 0 },
  107. /* IBM */
  108. /* IBM Thinkpad 701 Internal Modem Voice */
  109. { "IBM0033", 0 },
  110. /* Intermec */
  111. /* Intermec CV60 touchscreen port */
  112. { "PNP4972", 0 },
  113. /* Intertex */
  114. /* Intertex 28k8 33k6 Voice EXT PnP */
  115. { "IXDC801", 0 },
  116. /* Intertex 33k6 56k Voice EXT PnP */
  117. { "IXDC901", 0 },
  118. /* Intertex 28k8 33k6 Voice SP EXT PnP */
  119. { "IXDD801", 0 },
  120. /* Intertex 33k6 56k Voice SP EXT PnP */
  121. { "IXDD901", 0 },
  122. /* Intertex 28k8 33k6 Voice SP INT PnP */
  123. { "IXDF401", 0 },
  124. /* Intertex 28k8 33k6 Voice SP EXT PnP */
  125. { "IXDF801", 0 },
  126. /* Intertex 33k6 56k Voice SP EXT PnP */
  127. { "IXDF901", 0 },
  128. /* Kortex International */
  129. /* KORTEX 28800 Externe PnP */
  130. { "KOR4522", 0 },
  131. /* KXPro 33.6 Vocal ASVD PnP */
  132. { "KORF661", 0 },
  133. /* Lasat */
  134. /* LASAT Internet 33600 PnP */
  135. { "LAS4040", 0 },
  136. /* Lasat Safire 560 PnP */
  137. { "LAS4540", 0 },
  138. /* Lasat Safire 336 PnP */
  139. { "LAS5440", 0 },
  140. /* Microcom, Inc. */
  141. /* Microcom TravelPorte FAST V.34 Plug & Play */
  142. { "MNP0281", 0 },
  143. /* Microcom DeskPorte V.34 FAST or FAST+ Plug & Play */
  144. { "MNP0336", 0 },
  145. /* Microcom DeskPorte FAST EP 28.8 Plug & Play */
  146. { "MNP0339", 0 },
  147. /* Microcom DeskPorte 28.8P Plug & Play */
  148. { "MNP0342", 0 },
  149. /* Microcom DeskPorte FAST ES 28.8 Plug & Play */
  150. { "MNP0500", 0 },
  151. /* Microcom DeskPorte FAST ES 28.8 Plug & Play */
  152. { "MNP0501", 0 },
  153. /* Microcom DeskPorte 28.8S Internal Plug & Play */
  154. { "MNP0502", 0 },
  155. /* Motorola */
  156. /* Motorola BitSURFR Plug & Play */
  157. { "MOT1105", 0 },
  158. /* Motorola TA210 Plug & Play */
  159. { "MOT1111", 0 },
  160. /* Motorola HMTA 200 (ISDN) Plug & Play */
  161. { "MOT1114", 0 },
  162. /* Motorola BitSURFR Plug & Play */
  163. { "MOT1115", 0 },
  164. /* Motorola Lifestyle 28.8 Internal */
  165. { "MOT1190", 0 },
  166. /* Motorola V.3400 Plug & Play */
  167. { "MOT1501", 0 },
  168. /* Motorola Lifestyle 28.8 V.34 Plug & Play */
  169. { "MOT1502", 0 },
  170. /* Motorola Power 28.8 V.34 Plug & Play */
  171. { "MOT1505", 0 },
  172. /* Motorola ModemSURFR External 28.8 Plug & Play */
  173. { "MOT1509", 0 },
  174. /* Motorola Premier 33.6 Desktop Plug & Play */
  175. { "MOT150A", 0 },
  176. /* Motorola VoiceSURFR 56K External PnP */
  177. { "MOT150F", 0 },
  178. /* Motorola ModemSURFR 56K External PnP */
  179. { "MOT1510", 0 },
  180. /* Motorola ModemSURFR 56K Internal PnP */
  181. { "MOT1550", 0 },
  182. /* Motorola ModemSURFR Internal 28.8 Plug & Play */
  183. { "MOT1560", 0 },
  184. /* Motorola Premier 33.6 Internal Plug & Play */
  185. { "MOT1580", 0 },
  186. /* Motorola OnlineSURFR 28.8 Internal Plug & Play */
  187. { "MOT15B0", 0 },
  188. /* Motorola VoiceSURFR 56K Internal PnP */
  189. { "MOT15F0", 0 },
  190. /* Com 1 */
  191. /* Deskline K56 Phone System PnP */
  192. { "MVX00A1", 0 },
  193. /* PC Rider K56 Phone System PnP */
  194. { "MVX00F2", 0 },
  195. /* NEC 98NOTE SPEAKER PHONE FAX MODEM(33600bps) */
  196. { "nEC8241", 0 },
  197. /* Pace 56 Voice Internal Plug & Play Modem */
  198. { "PMC2430", 0 },
  199. /* Generic */
  200. /* Generic standard PC COM port */
  201. { "PNP0500", 0 },
  202. /* Generic 16550A-compatible COM port */
  203. { "PNP0501", 0 },
  204. /* Compaq 14400 Modem */
  205. { "PNPC000", 0 },
  206. /* Compaq 2400/9600 Modem */
  207. { "PNPC001", 0 },
  208. /* Dial-Up Networking Serial Cable between 2 PCs */
  209. { "PNPC031", 0 },
  210. /* Dial-Up Networking Parallel Cable between 2 PCs */
  211. { "PNPC032", 0 },
  212. /* Standard 9600 bps Modem */
  213. { "PNPC100", 0 },
  214. /* Standard 14400 bps Modem */
  215. { "PNPC101", 0 },
  216. /* Standard 28800 bps Modem*/
  217. { "PNPC102", 0 },
  218. /* Standard Modem*/
  219. { "PNPC103", 0 },
  220. /* Standard 9600 bps Modem*/
  221. { "PNPC104", 0 },
  222. /* Standard 14400 bps Modem*/
  223. { "PNPC105", 0 },
  224. /* Standard 28800 bps Modem*/
  225. { "PNPC106", 0 },
  226. /* Standard Modem */
  227. { "PNPC107", 0 },
  228. /* Standard 9600 bps Modem */
  229. { "PNPC108", 0 },
  230. /* Standard 14400 bps Modem */
  231. { "PNPC109", 0 },
  232. /* Standard 28800 bps Modem */
  233. { "PNPC10A", 0 },
  234. /* Standard Modem */
  235. { "PNPC10B", 0 },
  236. /* Standard 9600 bps Modem */
  237. { "PNPC10C", 0 },
  238. /* Standard 14400 bps Modem */
  239. { "PNPC10D", 0 },
  240. /* Standard 28800 bps Modem */
  241. { "PNPC10E", 0 },
  242. /* Standard Modem */
  243. { "PNPC10F", 0 },
  244. /* Standard PCMCIA Card Modem */
  245. { "PNP2000", 0 },
  246. /* Rockwell */
  247. /* Modular Technology */
  248. /* Rockwell 33.6 DPF Internal PnP */
  249. /* Modular Technology 33.6 Internal PnP */
  250. { "ROK0030", 0 },
  251. /* Kortex International */
  252. /* KORTEX 14400 Externe PnP */
  253. { "ROK0100", 0 },
  254. /* Rockwell 28.8 */
  255. { "ROK4120", 0 },
  256. /* Viking Components, Inc */
  257. /* Viking 28.8 INTERNAL Fax+Data+Voice PnP */
  258. { "ROK4920", 0 },
  259. /* Rockwell */
  260. /* British Telecom */
  261. /* Modular Technology */
  262. /* Rockwell 33.6 DPF External PnP */
  263. /* BT Prologue 33.6 External PnP */
  264. /* Modular Technology 33.6 External PnP */
  265. { "RSS00A0", 0 },
  266. /* Viking 56K FAX INT */
  267. { "RSS0262", 0 },
  268. /* K56 par,VV,Voice,Speakphone,AudioSpan,PnP */
  269. { "RSS0250", 0 },
  270. /* SupraExpress 28.8 Data/Fax PnP modem */
  271. { "SUP1310", 0 },
  272. /* SupraExpress 336i PnP Voice Modem */
  273. { "SUP1381", 0 },
  274. /* SupraExpress 33.6 Data/Fax PnP modem */
  275. { "SUP1421", 0 },
  276. /* SupraExpress 33.6 Data/Fax PnP modem */
  277. { "SUP1590", 0 },
  278. /* SupraExpress 336i Sp ASVD */
  279. { "SUP1620", 0 },
  280. /* SupraExpress 33.6 Data/Fax PnP modem */
  281. { "SUP1760", 0 },
  282. /* SupraExpress 56i Sp Intl */
  283. { "SUP2171", 0 },
  284. /* Phoebe Micro */
  285. /* Phoebe Micro 33.6 Data Fax 1433VQH Plug & Play */
  286. { "TEX0011", 0 },
  287. /* Archtek America Corp. */
  288. /* Archtek SmartLink Modem 3334BT Plug & Play */
  289. { "UAC000F", 0 },
  290. /* 3Com Corp. */
  291. /* Gateway Telepath IIvi 33.6 */
  292. { "USR0000", 0 },
  293. /* U.S. Robotics Sporster 33.6K Fax INT PnP */
  294. { "USR0002", 0 },
  295. /* Sportster Vi 14.4 PnP FAX Voicemail */
  296. { "USR0004", 0 },
  297. /* U.S. Robotics 33.6K Voice INT PnP */
  298. { "USR0006", 0 },
  299. /* U.S. Robotics 33.6K Voice EXT PnP */
  300. { "USR0007", 0 },
  301. /* U.S. Robotics Courier V.Everything INT PnP */
  302. { "USR0009", 0 },
  303. /* U.S. Robotics 33.6K Voice INT PnP */
  304. { "USR2002", 0 },
  305. /* U.S. Robotics 56K Voice INT PnP */
  306. { "USR2070", 0 },
  307. /* U.S. Robotics 56K Voice EXT PnP */
  308. { "USR2080", 0 },
  309. /* U.S. Robotics 56K FAX INT */
  310. { "USR3031", 0 },
  311. /* U.S. Robotics 56K FAX INT */
  312. { "USR3050", 0 },
  313. /* U.S. Robotics 56K Voice INT PnP */
  314. { "USR3070", 0 },
  315. /* U.S. Robotics 56K Voice EXT PnP */
  316. { "USR3080", 0 },
  317. /* U.S. Robotics 56K Voice INT PnP */
  318. { "USR3090", 0 },
  319. /* U.S. Robotics 56K Message */
  320. { "USR9100", 0 },
  321. /* U.S. Robotics 56K FAX EXT PnP*/
  322. { "USR9160", 0 },
  323. /* U.S. Robotics 56K FAX INT PnP*/
  324. { "USR9170", 0 },
  325. /* U.S. Robotics 56K Voice EXT PnP*/
  326. { "USR9180", 0 },
  327. /* U.S. Robotics 56K Voice INT PnP*/
  328. { "USR9190", 0 },
  329. /* Wacom tablets */
  330. { "WACFXXX", 0 },
  331. /* Compaq touchscreen */
  332. { "FPI2002", 0 },
  333. /* Fujitsu Stylistic touchscreens */
  334. { "FUJ02B2", 0 },
  335. { "FUJ02B3", 0 },
  336. /* Fujitsu Stylistic LT touchscreens */
  337. { "FUJ02B4", 0 },
  338. /* Passive Fujitsu Stylistic touchscreens */
  339. { "FUJ02B6", 0 },
  340. { "FUJ02B7", 0 },
  341. { "FUJ02B8", 0 },
  342. { "FUJ02B9", 0 },
  343. { "FUJ02BC", 0 },
  344. /* Fujitsu Wacom Tablet PC device */
  345. { "FUJ02E5", 0 },
  346. /* Fujitsu P-series tablet PC device */
  347. { "FUJ02E6", 0 },
  348. /* Fujitsu Wacom 2FGT Tablet PC device */
  349. { "FUJ02E7", 0 },
  350. /* Fujitsu Wacom 1FGT Tablet PC device */
  351. { "FUJ02E9", 0 },
  352. /*
  353. * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6
  354. * in disguise).
  355. */
  356. { "LTS0001", 0 },
  357. /* Rockwell's (PORALiNK) 33600 INT PNP */
  358. { "WCI0003", 0 },
  359. /* Unknown PnP modems */
  360. { "PNPCXXX", UNKNOWN_DEV },
  361. /* More unknown PnP modems */
  362. { "PNPDXXX", UNKNOWN_DEV },
  363. /*
  364. * Winbond CIR port, should not be probed. We should keep track of
  365. * it to prevent the legacy serial driver from probing it.
  366. */
  367. { "WEC1022", CIR_PORT },
  368. /*
  369. * SMSC IrCC SIR/FIR port, should not be probed by serial driver as
  370. * well so its own driver can bind to it.
  371. */
  372. { "SMCF010", CIR_PORT },
  373. { "", 0 }
  374. };
  375. MODULE_DEVICE_TABLE(pnp, pnp_dev_table);
  376. static const char *modem_names[] = {
  377. "MODEM", "Modem", "modem", "FAX", "Fax", "fax",
  378. "56K", "56k", "K56", "33.6", "28.8", "14.4",
  379. "33,600", "28,800", "14,400", "33.600", "28.800", "14.400",
  380. "33600", "28800", "14400", "V.90", "V.34", "V.32", NULL
  381. };
  382. static bool check_name(const char *name)
  383. {
  384. const char **tmp;
  385. for (tmp = modem_names; *tmp; tmp++)
  386. if (strstr(name, *tmp))
  387. return true;
  388. return false;
  389. }
  390. static bool check_resources(struct pnp_dev *dev)
  391. {
  392. static const resource_size_t base[] = {0x2f8, 0x3f8, 0x2e8, 0x3e8};
  393. unsigned int i;
  394. for (i = 0; i < ARRAY_SIZE(base); i++) {
  395. if (pnp_possible_config(dev, IORESOURCE_IO, base[i], 8))
  396. return true;
  397. }
  398. return false;
  399. }
  400. /*
  401. * Given a complete unknown PnP device, try to use some heuristics to
  402. * detect modems. Currently use such heuristic set:
  403. * - dev->name or dev->bus->name must contain "modem" substring;
  404. * - device must have only one IO region (8 byte long) with base address
  405. * 0x2e8, 0x3e8, 0x2f8 or 0x3f8.
  406. *
  407. * Such detection looks very ugly, but can detect at least some of numerous
  408. * PnP modems, alternatively we must hardcode all modems in pnp_devices[]
  409. * table.
  410. */
  411. static int serial_pnp_guess_board(struct pnp_dev *dev)
  412. {
  413. if (!(check_name(pnp_dev_name(dev)) ||
  414. (dev->card && check_name(dev->card->name))))
  415. return -ENODEV;
  416. if (check_resources(dev))
  417. return 0;
  418. return -ENODEV;
  419. }
  420. static int
  421. serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
  422. {
  423. struct uart_8250_port uart, *port;
  424. int ret, line, flags = dev_id->driver_data;
  425. if (flags & UNKNOWN_DEV) {
  426. ret = serial_pnp_guess_board(dev);
  427. if (ret < 0)
  428. return ret;
  429. }
  430. memset(&uart, 0, sizeof(uart));
  431. if (pnp_irq_valid(dev, 0))
  432. uart.port.irq = pnp_irq(dev, 0);
  433. if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) {
  434. uart.port.iobase = pnp_port_start(dev, 2);
  435. uart.port.iotype = UPIO_PORT;
  436. } else if (pnp_port_valid(dev, 0)) {
  437. uart.port.iobase = pnp_port_start(dev, 0);
  438. uart.port.iotype = UPIO_PORT;
  439. } else if (pnp_mem_valid(dev, 0)) {
  440. uart.port.mapbase = pnp_mem_start(dev, 0);
  441. uart.port.iotype = UPIO_MEM;
  442. uart.port.flags = UPF_IOREMAP;
  443. } else
  444. return -ENODEV;
  445. dev_dbg(&dev->dev,
  446. "Setup PNP port: port %lx, mem %pa, irq %d, type %d\n",
  447. uart.port.iobase, &uart.port.mapbase,
  448. uart.port.irq, uart.port.iotype);
  449. if (flags & CIR_PORT) {
  450. uart.port.flags |= UPF_FIXED_PORT | UPF_FIXED_TYPE;
  451. uart.port.type = PORT_8250_CIR;
  452. }
  453. uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
  454. if (pnp_irq_flags(dev, 0) & IORESOURCE_IRQ_SHAREABLE)
  455. uart.port.flags |= UPF_SHARE_IRQ;
  456. uart.port.uartclk = 1843200;
  457. uart.port.dev = &dev->dev;
  458. line = serial8250_register_8250_port(&uart);
  459. if (line < 0 || (flags & CIR_PORT))
  460. return -ENODEV;
  461. port = serial8250_get_port(line);
  462. if (uart_console(&port->port))
  463. dev->capabilities |= PNP_CONSOLE;
  464. pnp_set_drvdata(dev, (void *)((long)line + 1));
  465. return 0;
  466. }
  467. static void serial_pnp_remove(struct pnp_dev *dev)
  468. {
  469. long line = (long)pnp_get_drvdata(dev);
  470. dev->capabilities &= ~PNP_CONSOLE;
  471. if (line)
  472. serial8250_unregister_port(line - 1);
  473. }
  474. #ifdef CONFIG_PM
  475. static int serial_pnp_suspend(struct pnp_dev *dev, pm_message_t state)
  476. {
  477. long line = (long)pnp_get_drvdata(dev);
  478. if (!line)
  479. return -ENODEV;
  480. serial8250_suspend_port(line - 1);
  481. return 0;
  482. }
  483. static int serial_pnp_resume(struct pnp_dev *dev)
  484. {
  485. long line = (long)pnp_get_drvdata(dev);
  486. if (!line)
  487. return -ENODEV;
  488. serial8250_resume_port(line - 1);
  489. return 0;
  490. }
  491. #else
  492. #define serial_pnp_suspend NULL
  493. #define serial_pnp_resume NULL
  494. #endif /* CONFIG_PM */
  495. static struct pnp_driver serial_pnp_driver = {
  496. .name = "serial",
  497. .probe = serial_pnp_probe,
  498. .remove = serial_pnp_remove,
  499. .suspend = serial_pnp_suspend,
  500. .resume = serial_pnp_resume,
  501. .id_table = pnp_dev_table,
  502. };
  503. int serial8250_pnp_init(void)
  504. {
  505. return pnp_register_driver(&serial_pnp_driver);
  506. }
  507. void serial8250_pnp_exit(void)
  508. {
  509. pnp_unregister_driver(&serial_pnp_driver);
  510. }