acpi_pnp.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. /*
  2. * ACPI support for PNP bus type
  3. *
  4. * Copyright (C) 2014, Intel Corporation
  5. * Authors: Zhang Rui <rui.zhang@intel.com>
  6. * Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/acpi.h>
  13. #include <linux/module.h>
  14. #include <linux/ctype.h>
  15. static const struct acpi_device_id acpi_pnp_device_ids[] = {
  16. /* pata_isapnp */
  17. {"PNP0600"}, /* Generic ESDI/IDE/ATA compatible hard disk controller */
  18. /* floppy */
  19. {"PNP0700"},
  20. /* tpm_inf_pnp */
  21. {"IFX0101"}, /* Infineon TPMs */
  22. {"IFX0102"}, /* Infineon TPMs */
  23. /*tpm_tis */
  24. {"PNP0C31"}, /* TPM */
  25. {"ATM1200"}, /* Atmel */
  26. {"IFX0102"}, /* Infineon */
  27. {"BCM0101"}, /* Broadcom */
  28. {"BCM0102"}, /* Broadcom */
  29. {"NSC1200"}, /* National */
  30. {"ICO0102"}, /* Intel */
  31. /* ide */
  32. {"PNP0600"}, /* Generic ESDI/IDE/ATA compatible hard disk controller */
  33. /* ns558 */
  34. {"ASB16fd"}, /* AdLib NSC16 */
  35. {"AZT3001"}, /* AZT1008 */
  36. {"CDC0001"}, /* Opl3-SAx */
  37. {"CSC0001"}, /* CS4232 */
  38. {"CSC000f"}, /* CS4236 */
  39. {"CSC0101"}, /* CS4327 */
  40. {"CTL7001"}, /* SB16 */
  41. {"CTL7002"}, /* AWE64 */
  42. {"CTL7005"}, /* Vibra16 */
  43. {"ENS2020"}, /* SoundscapeVIVO */
  44. {"ESS0001"}, /* ES1869 */
  45. {"ESS0005"}, /* ES1878 */
  46. {"ESS6880"}, /* ES688 */
  47. {"IBM0012"}, /* CS4232 */
  48. {"OPT0001"}, /* OPTi Audio16 */
  49. {"YMH0006"}, /* Opl3-SA */
  50. {"YMH0022"}, /* Opl3-SAx */
  51. {"PNPb02f"}, /* Generic */
  52. /* i8042 kbd */
  53. {"PNP0300"},
  54. {"PNP0301"},
  55. {"PNP0302"},
  56. {"PNP0303"},
  57. {"PNP0304"},
  58. {"PNP0305"},
  59. {"PNP0306"},
  60. {"PNP0309"},
  61. {"PNP030a"},
  62. {"PNP030b"},
  63. {"PNP0320"},
  64. {"PNP0343"},
  65. {"PNP0344"},
  66. {"PNP0345"},
  67. {"CPQA0D7"},
  68. /* i8042 aux */
  69. {"AUI0200"},
  70. {"FJC6000"},
  71. {"FJC6001"},
  72. {"PNP0f03"},
  73. {"PNP0f0b"},
  74. {"PNP0f0e"},
  75. {"PNP0f12"},
  76. {"PNP0f13"},
  77. {"PNP0f19"},
  78. {"PNP0f1c"},
  79. {"SYN0801"},
  80. /* fcpnp */
  81. {"AVM0900"},
  82. /* radio-cadet */
  83. {"MSM0c24"}, /* ADS Cadet AM/FM Radio Card */
  84. /* radio-gemtek */
  85. {"ADS7183"}, /* AOpen FX-3D/Pro Radio */
  86. /* radio-sf16fmr2 */
  87. {"MFRad13"}, /* tuner subdevice of SF16-FMD2 */
  88. /* ene_ir */
  89. {"ENE0100"},
  90. {"ENE0200"},
  91. {"ENE0201"},
  92. {"ENE0202"},
  93. /* fintek-cir */
  94. {"FIT0002"}, /* CIR */
  95. /* ite-cir */
  96. {"ITE8704"}, /* Default model */
  97. {"ITE8713"}, /* CIR found in EEEBox 1501U */
  98. {"ITE8708"}, /* Bridged IT8512 */
  99. {"ITE8709"}, /* SRAM-Bridged IT8512 */
  100. /* nuvoton-cir */
  101. {"WEC0530"}, /* CIR */
  102. {"NTN0530"}, /* CIR for new chip's pnp id */
  103. /* Winbond CIR */
  104. {"WEC1022"},
  105. /* wbsd */
  106. {"WEC0517"},
  107. {"WEC0518"},
  108. /* Winbond CIR */
  109. {"TCM5090"}, /* 3Com Etherlink III (TP) */
  110. {"TCM5091"}, /* 3Com Etherlink III */
  111. {"TCM5094"}, /* 3Com Etherlink III (combo) */
  112. {"TCM5095"}, /* 3Com Etherlink III (TPO) */
  113. {"TCM5098"}, /* 3Com Etherlink III (TPC) */
  114. {"PNP80f7"}, /* 3Com Etherlink III compatible */
  115. {"PNP80f8"}, /* 3Com Etherlink III compatible */
  116. /* nsc-ircc */
  117. {"NSC6001"},
  118. {"HWPC224"},
  119. {"IBM0071"},
  120. /* smsc-ircc2 */
  121. {"SMCf010"},
  122. /* sb1000 */
  123. {"GIC1000"},
  124. /* parport_pc */
  125. {"PNP0400"}, /* Standard LPT Printer Port */
  126. {"PNP0401"}, /* ECP Printer Port */
  127. /* apple-gmux */
  128. {"APP000B"},
  129. /* system */
  130. {"PNP0c02"}, /* General ID for reserving resources */
  131. {"PNP0c01"}, /* memory controller */
  132. /* rtc_cmos */
  133. {"PNP0b00"},
  134. {"PNP0b01"},
  135. {"PNP0b02"},
  136. /* c6xdigio */
  137. {"PNP0400"}, /* Standard LPT Printer Port */
  138. {"PNP0401"}, /* ECP Printer Port */
  139. /* ni_atmio.c */
  140. {"NIC1900"},
  141. {"NIC2400"},
  142. {"NIC2500"},
  143. {"NIC2600"},
  144. {"NIC2700"},
  145. /* serial */
  146. {"AAC000F"}, /* Archtek America Corp. Archtek SmartLink Modem 3334BT Plug & Play */
  147. {"ADC0001"}, /* Anchor Datacomm BV. SXPro 144 External Data Fax Modem Plug & Play */
  148. {"ADC0002"}, /* SXPro 288 External Data Fax Modem Plug & Play */
  149. {"AEI0250"}, /* PROLiNK 1456VH ISA PnP K56flex Fax Modem */
  150. {"AEI1240"}, /* Actiontec ISA PNP 56K X2 Fax Modem */
  151. {"AKY1021"}, /* Rockwell 56K ACF II Fax+Data+Voice Modem */
  152. {"ALI5123"}, /* ALi Fast Infrared Controller */
  153. {"AZT4001"}, /* AZT3005 PnP SOUND DEVICE */
  154. {"BDP3336"}, /* Best Data Products Inc. Smart One 336F PnP Modem */
  155. {"BRI0A49"}, /* Boca Complete Ofc Communicator 14.4 Data-FAX */
  156. {"BRI1400"}, /* Boca Research 33,600 ACF Modem */
  157. {"BRI3400"}, /* Boca 33.6 Kbps Internal FD34FSVD */
  158. {"BRI0A49"}, /* Boca 33.6 Kbps Internal FD34FSVD */
  159. {"BDP3336"}, /* Best Data Products Inc. Smart One 336F PnP Modem */
  160. {"CPI4050"}, /* Computer Peripherals Inc. EuroViVa CommCenter-33.6 SP PnP */
  161. {"CTL3001"}, /* Creative Labs Phone Blaster 28.8 DSVD PnP Voice */
  162. {"CTL3011"}, /* Creative Labs Modem Blaster 28.8 DSVD PnP Voice */
  163. {"DAV0336"}, /* Davicom ISA 33.6K Modem */
  164. {"DMB1032"}, /* Creative Modem Blaster Flash56 DI5601-1 */
  165. {"DMB2001"}, /* Creative Modem Blaster V.90 DI5660 */
  166. {"ETT0002"}, /* E-Tech CyberBULLET PC56RVP */
  167. {"FUJ0202"}, /* Fujitsu 33600 PnP-I2 R Plug & Play */
  168. {"FUJ0205"}, /* Fujitsu FMV-FX431 Plug & Play */
  169. {"FUJ0206"}, /* Fujitsu 33600 PnP-I4 R Plug & Play */
  170. {"FUJ0209"}, /* Fujitsu Fax Voice 33600 PNP-I5 R Plug & Play */
  171. {"GVC000F"}, /* Archtek SmartLink Modem 3334BT Plug & Play */
  172. {"GVC0303"}, /* Archtek SmartLink Modem 3334BRV 33.6K Data Fax Voice */
  173. {"HAY0001"}, /* Hayes Optima 288 V.34-V.FC + FAX + Voice Plug & Play */
  174. {"HAY000C"}, /* Hayes Optima 336 V.34 + FAX + Voice PnP */
  175. {"HAY000D"}, /* Hayes Optima 336B V.34 + FAX + Voice PnP */
  176. {"HAY5670"}, /* Hayes Accura 56K Ext Fax Modem PnP */
  177. {"HAY5674"}, /* Hayes Accura 56K Ext Fax Modem PnP */
  178. {"HAY5675"}, /* Hayes Accura 56K Fax Modem PnP */
  179. {"HAYF000"}, /* Hayes 288, V.34 + FAX */
  180. {"HAYF001"}, /* Hayes Optima 288 V.34 + FAX + Voice, Plug & Play */
  181. {"IBM0033"}, /* IBM Thinkpad 701 Internal Modem Voice */
  182. {"PNP4972"}, /* Intermec CV60 touchscreen port */
  183. {"IXDC801"}, /* Intertex 28k8 33k6 Voice EXT PnP */
  184. {"IXDC901"}, /* Intertex 33k6 56k Voice EXT PnP */
  185. {"IXDD801"}, /* Intertex 28k8 33k6 Voice SP EXT PnP */
  186. {"IXDD901"}, /* Intertex 33k6 56k Voice SP EXT PnP */
  187. {"IXDF401"}, /* Intertex 28k8 33k6 Voice SP INT PnP */
  188. {"IXDF801"}, /* Intertex 28k8 33k6 Voice SP EXT PnP */
  189. {"IXDF901"}, /* Intertex 33k6 56k Voice SP EXT PnP */
  190. {"KOR4522"}, /* KORTEX 28800 Externe PnP */
  191. {"KORF661"}, /* KXPro 33.6 Vocal ASVD PnP */
  192. {"LAS4040"}, /* LASAT Internet 33600 PnP */
  193. {"LAS4540"}, /* Lasat Safire 560 PnP */
  194. {"LAS5440"}, /* Lasat Safire 336 PnP */
  195. {"MNP0281"}, /* Microcom TravelPorte FAST V.34 Plug & Play */
  196. {"MNP0336"}, /* Microcom DeskPorte V.34 FAST or FAST+ Plug & Play */
  197. {"MNP0339"}, /* Microcom DeskPorte FAST EP 28.8 Plug & Play */
  198. {"MNP0342"}, /* Microcom DeskPorte 28.8P Plug & Play */
  199. {"MNP0500"}, /* Microcom DeskPorte FAST ES 28.8 Plug & Play */
  200. {"MNP0501"}, /* Microcom DeskPorte FAST ES 28.8 Plug & Play */
  201. {"MNP0502"}, /* Microcom DeskPorte 28.8S Internal Plug & Play */
  202. {"MOT1105"}, /* Motorola BitSURFR Plug & Play */
  203. {"MOT1111"}, /* Motorola TA210 Plug & Play */
  204. {"MOT1114"}, /* Motorola HMTA 200 (ISDN) Plug & Play */
  205. {"MOT1115"}, /* Motorola BitSURFR Plug & Play */
  206. {"MOT1190"}, /* Motorola Lifestyle 28.8 Internal */
  207. {"MOT1501"}, /* Motorola V.3400 Plug & Play */
  208. {"MOT1502"}, /* Motorola Lifestyle 28.8 V.34 Plug & Play */
  209. {"MOT1505"}, /* Motorola Power 28.8 V.34 Plug & Play */
  210. {"MOT1509"}, /* Motorola ModemSURFR External 28.8 Plug & Play */
  211. {"MOT150A"}, /* Motorola Premier 33.6 Desktop Plug & Play */
  212. {"MOT150F"}, /* Motorola VoiceSURFR 56K External PnP */
  213. {"MOT1510"}, /* Motorola ModemSURFR 56K External PnP */
  214. {"MOT1550"}, /* Motorola ModemSURFR 56K Internal PnP */
  215. {"MOT1560"}, /* Motorola ModemSURFR Internal 28.8 Plug & Play */
  216. {"MOT1580"}, /* Motorola Premier 33.6 Internal Plug & Play */
  217. {"MOT15B0"}, /* Motorola OnlineSURFR 28.8 Internal Plug & Play */
  218. {"MOT15F0"}, /* Motorola VoiceSURFR 56K Internal PnP */
  219. {"MVX00A1"}, /* Deskline K56 Phone System PnP */
  220. {"MVX00F2"}, /* PC Rider K56 Phone System PnP */
  221. {"nEC8241"}, /* NEC 98NOTE SPEAKER PHONE FAX MODEM(33600bps) */
  222. {"PMC2430"}, /* Pace 56 Voice Internal Plug & Play Modem */
  223. {"PNP0500"}, /* Generic standard PC COM port */
  224. {"PNP0501"}, /* Generic 16550A-compatible COM port */
  225. {"PNPC000"}, /* Compaq 14400 Modem */
  226. {"PNPC001"}, /* Compaq 2400/9600 Modem */
  227. {"PNPC031"}, /* Dial-Up Networking Serial Cable between 2 PCs */
  228. {"PNPC032"}, /* Dial-Up Networking Parallel Cable between 2 PCs */
  229. {"PNPC100"}, /* Standard 9600 bps Modem */
  230. {"PNPC101"}, /* Standard 14400 bps Modem */
  231. {"PNPC102"}, /* Standard 28800 bps Modem */
  232. {"PNPC103"}, /* Standard Modem */
  233. {"PNPC104"}, /* Standard 9600 bps Modem */
  234. {"PNPC105"}, /* Standard 14400 bps Modem */
  235. {"PNPC106"}, /* Standard 28800 bps Modem */
  236. {"PNPC107"}, /* Standard Modem */
  237. {"PNPC108"}, /* Standard 9600 bps Modem */
  238. {"PNPC109"}, /* Standard 14400 bps Modem */
  239. {"PNPC10A"}, /* Standard 28800 bps Modem */
  240. {"PNPC10B"}, /* Standard Modem */
  241. {"PNPC10C"}, /* Standard 9600 bps Modem */
  242. {"PNPC10D"}, /* Standard 14400 bps Modem */
  243. {"PNPC10E"}, /* Standard 28800 bps Modem */
  244. {"PNPC10F"}, /* Standard Modem */
  245. {"PNP2000"}, /* Standard PCMCIA Card Modem */
  246. {"ROK0030"}, /* Rockwell 33.6 DPF Internal PnP, Modular Technology 33.6 Internal PnP */
  247. {"ROK0100"}, /* KORTEX 14400 Externe PnP */
  248. {"ROK4120"}, /* Rockwell 28.8 */
  249. {"ROK4920"}, /* Viking 28.8 INTERNAL Fax+Data+Voice PnP */
  250. {"RSS00A0"}, /* Rockwell 33.6 DPF External PnP, BT Prologue 33.6 External PnP, Modular Technology 33.6 External PnP */
  251. {"RSS0262"}, /* Viking 56K FAX INT */
  252. {"RSS0250"}, /* K56 par,VV,Voice,Speakphone,AudioSpan,PnP */
  253. {"SUP1310"}, /* SupraExpress 28.8 Data/Fax PnP modem */
  254. {"SUP1381"}, /* SupraExpress 336i PnP Voice Modem */
  255. {"SUP1421"}, /* SupraExpress 33.6 Data/Fax PnP modem */
  256. {"SUP1590"}, /* SupraExpress 33.6 Data/Fax PnP modem */
  257. {"SUP1620"}, /* SupraExpress 336i Sp ASVD */
  258. {"SUP1760"}, /* SupraExpress 33.6 Data/Fax PnP modem */
  259. {"SUP2171"}, /* SupraExpress 56i Sp Intl */
  260. {"TEX0011"}, /* Phoebe Micro 33.6 Data Fax 1433VQH Plug & Play */
  261. {"UAC000F"}, /* Archtek SmartLink Modem 3334BT Plug & Play */
  262. {"USR0000"}, /* 3Com Corp. Gateway Telepath IIvi 33.6 */
  263. {"USR0002"}, /* U.S. Robotics Sporster 33.6K Fax INT PnP */
  264. {"USR0004"}, /* Sportster Vi 14.4 PnP FAX Voicemail */
  265. {"USR0006"}, /* U.S. Robotics 33.6K Voice INT PnP */
  266. {"USR0007"}, /* U.S. Robotics 33.6K Voice EXT PnP */
  267. {"USR0009"}, /* U.S. Robotics Courier V.Everything INT PnP */
  268. {"USR2002"}, /* U.S. Robotics 33.6K Voice INT PnP */
  269. {"USR2070"}, /* U.S. Robotics 56K Voice INT PnP */
  270. {"USR2080"}, /* U.S. Robotics 56K Voice EXT PnP */
  271. {"USR3031"}, /* U.S. Robotics 56K FAX INT */
  272. {"USR3050"}, /* U.S. Robotics 56K FAX INT */
  273. {"USR3070"}, /* U.S. Robotics 56K Voice INT PnP */
  274. {"USR3080"}, /* U.S. Robotics 56K Voice EXT PnP */
  275. {"USR3090"}, /* U.S. Robotics 56K Voice INT PnP */
  276. {"USR9100"}, /* U.S. Robotics 56K Message */
  277. {"USR9160"}, /* U.S. Robotics 56K FAX EXT PnP */
  278. {"USR9170"}, /* U.S. Robotics 56K FAX INT PnP */
  279. {"USR9180"}, /* U.S. Robotics 56K Voice EXT PnP */
  280. {"USR9190"}, /* U.S. Robotics 56K Voice INT PnP */
  281. {"WACFXXX"}, /* Wacom tablets */
  282. {"FPI2002"}, /* Compaq touchscreen */
  283. {"FUJ02B2"}, /* Fujitsu Stylistic touchscreens */
  284. {"FUJ02B3"},
  285. {"FUJ02B4"}, /* Fujitsu Stylistic LT touchscreens */
  286. {"FUJ02B6"}, /* Passive Fujitsu Stylistic touchscreens */
  287. {"FUJ02B7"},
  288. {"FUJ02B8"},
  289. {"FUJ02B9"},
  290. {"FUJ02BC"},
  291. {"FUJ02E5"}, /* Fujitsu Wacom Tablet PC device */
  292. {"FUJ02E6"}, /* Fujitsu P-series tablet PC device */
  293. {"FUJ02E7"}, /* Fujitsu Wacom 2FGT Tablet PC device */
  294. {"FUJ02E9"}, /* Fujitsu Wacom 1FGT Tablet PC device */
  295. {"LTS0001"}, /* LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in disguise) */
  296. {"WCI0003"}, /* Rockwell's (PORALiNK) 33600 INT PNP */
  297. {"WEC1022"}, /* Winbond CIR port, should not be probed. We should keep track of it to prevent the legacy serial driver from probing it */
  298. /* scl200wdt */
  299. {"NSC0800"}, /* National Semiconductor PC87307/PC97307 watchdog component */
  300. /* mpu401 */
  301. {"PNPb006"},
  302. /* cs423x-pnpbios */
  303. {"CSC0100"},
  304. {"CSC0103"},
  305. {"CSC0110"},
  306. {"CSC0000"},
  307. {"GIM0100"}, /* Guillemot Turtlebeach something appears to be cs4232 compatible */
  308. /* es18xx-pnpbios */
  309. {"ESS1869"},
  310. {"ESS1879"},
  311. /* snd-opl3sa2-pnpbios */
  312. {"YMH0021"},
  313. {"NMX2210"}, /* Gateway Solo 2500 */
  314. {""},
  315. };
  316. static bool matching_id(const char *idstr, const char *list_id)
  317. {
  318. int i;
  319. if (memcmp(idstr, list_id, 3))
  320. return false;
  321. for (i = 3; i < 7; i++) {
  322. char c = toupper(idstr[i]);
  323. if (!isxdigit(c)
  324. || (list_id[i] != 'X' && c != toupper(list_id[i])))
  325. return false;
  326. }
  327. return true;
  328. }
  329. static bool acpi_pnp_match(const char *idstr, const struct acpi_device_id **matchid)
  330. {
  331. const struct acpi_device_id *devid;
  332. for (devid = acpi_pnp_device_ids; devid->id[0]; devid++)
  333. if (matching_id(idstr, (char *)devid->id)) {
  334. if (matchid)
  335. *matchid = devid;
  336. return true;
  337. }
  338. return false;
  339. }
  340. static int acpi_pnp_attach(struct acpi_device *adev,
  341. const struct acpi_device_id *id)
  342. {
  343. return 1;
  344. }
  345. static struct acpi_scan_handler acpi_pnp_handler = {
  346. .ids = acpi_pnp_device_ids,
  347. .match = acpi_pnp_match,
  348. .attach = acpi_pnp_attach,
  349. };
  350. /*
  351. * For CMOS RTC devices, the PNP ACPI scan handler does not work, because
  352. * there is a CMOS RTC ACPI scan handler installed already, so we need to
  353. * check those devices and enumerate them to the PNP bus directly.
  354. */
  355. static int is_cmos_rtc_device(struct acpi_device *adev)
  356. {
  357. struct acpi_device_id ids[] = {
  358. { "PNP0B00" },
  359. { "PNP0B01" },
  360. { "PNP0B02" },
  361. {""},
  362. };
  363. return !acpi_match_device_ids(adev, ids);
  364. }
  365. bool acpi_is_pnp_device(struct acpi_device *adev)
  366. {
  367. return adev->handler == &acpi_pnp_handler || is_cmos_rtc_device(adev);
  368. }
  369. EXPORT_SYMBOL_GPL(acpi_is_pnp_device);
  370. void __init acpi_pnp_init(void)
  371. {
  372. acpi_scan_add_handler(&acpi_pnp_handler);
  373. }