8250_pnp.c 15 KB

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