core.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. /*
  2. * Intel(R) Trace Hub driver core
  3. *
  4. * Copyright (C) 2014-2015 Intel Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. */
  15. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  16. #include <linux/types.h>
  17. #include <linux/module.h>
  18. #include <linux/device.h>
  19. #include <linux/sysfs.h>
  20. #include <linux/kdev_t.h>
  21. #include <linux/debugfs.h>
  22. #include <linux/idr.h>
  23. #include <linux/pci.h>
  24. #include <linux/dma-mapping.h>
  25. #include "intel_th.h"
  26. #include "debug.h"
  27. static DEFINE_IDA(intel_th_ida);
  28. static int intel_th_match(struct device *dev, struct device_driver *driver)
  29. {
  30. struct intel_th_driver *thdrv = to_intel_th_driver(driver);
  31. struct intel_th_device *thdev = to_intel_th_device(dev);
  32. if (thdev->type == INTEL_TH_SWITCH &&
  33. (!thdrv->enable || !thdrv->disable))
  34. return 0;
  35. return !strcmp(thdev->name, driver->name);
  36. }
  37. static int intel_th_child_remove(struct device *dev, void *data)
  38. {
  39. device_release_driver(dev);
  40. return 0;
  41. }
  42. static int intel_th_probe(struct device *dev)
  43. {
  44. struct intel_th_driver *thdrv = to_intel_th_driver(dev->driver);
  45. struct intel_th_device *thdev = to_intel_th_device(dev);
  46. struct intel_th_driver *hubdrv;
  47. struct intel_th_device *hub = NULL;
  48. int ret;
  49. if (thdev->type == INTEL_TH_SWITCH)
  50. hub = thdev;
  51. else if (dev->parent)
  52. hub = to_intel_th_device(dev->parent);
  53. if (!hub || !hub->dev.driver)
  54. return -EPROBE_DEFER;
  55. hubdrv = to_intel_th_driver(hub->dev.driver);
  56. ret = thdrv->probe(to_intel_th_device(dev));
  57. if (ret)
  58. return ret;
  59. if (thdev->type == INTEL_TH_OUTPUT &&
  60. !intel_th_output_assigned(thdev))
  61. ret = hubdrv->assign(hub, thdev);
  62. return ret;
  63. }
  64. static int intel_th_remove(struct device *dev)
  65. {
  66. struct intel_th_driver *thdrv = to_intel_th_driver(dev->driver);
  67. struct intel_th_device *thdev = to_intel_th_device(dev);
  68. struct intel_th_device *hub = to_intel_th_device(dev->parent);
  69. int err;
  70. if (thdev->type == INTEL_TH_SWITCH) {
  71. err = device_for_each_child(dev, thdev, intel_th_child_remove);
  72. if (err)
  73. return err;
  74. }
  75. thdrv->remove(thdev);
  76. if (intel_th_output_assigned(thdev)) {
  77. struct intel_th_driver *hubdrv =
  78. to_intel_th_driver(dev->parent->driver);
  79. if (hub->dev.driver)
  80. hubdrv->unassign(hub, thdev);
  81. }
  82. return 0;
  83. }
  84. static struct bus_type intel_th_bus = {
  85. .name = "intel_th",
  86. .dev_attrs = NULL,
  87. .match = intel_th_match,
  88. .probe = intel_th_probe,
  89. .remove = intel_th_remove,
  90. };
  91. static void intel_th_device_free(struct intel_th_device *thdev);
  92. static void intel_th_device_release(struct device *dev)
  93. {
  94. intel_th_device_free(to_intel_th_device(dev));
  95. }
  96. static struct device_type intel_th_source_device_type = {
  97. .name = "intel_th_source_device",
  98. .release = intel_th_device_release,
  99. };
  100. static char *intel_th_output_devnode(struct device *dev, umode_t *mode,
  101. kuid_t *uid, kgid_t *gid)
  102. {
  103. struct intel_th_device *thdev = to_intel_th_device(dev);
  104. char *node;
  105. if (thdev->id >= 0)
  106. node = kasprintf(GFP_KERNEL, "intel_th%d/%s%d", 0, thdev->name,
  107. thdev->id);
  108. else
  109. node = kasprintf(GFP_KERNEL, "intel_th%d/%s", 0, thdev->name);
  110. return node;
  111. }
  112. static ssize_t port_show(struct device *dev, struct device_attribute *attr,
  113. char *buf)
  114. {
  115. struct intel_th_device *thdev = to_intel_th_device(dev);
  116. if (thdev->output.port >= 0)
  117. return scnprintf(buf, PAGE_SIZE, "%u\n", thdev->output.port);
  118. return scnprintf(buf, PAGE_SIZE, "unassigned\n");
  119. }
  120. static DEVICE_ATTR_RO(port);
  121. static int intel_th_output_activate(struct intel_th_device *thdev)
  122. {
  123. struct intel_th_driver *thdrv = to_intel_th_driver(thdev->dev.driver);
  124. if (thdrv->activate)
  125. return thdrv->activate(thdev);
  126. intel_th_trace_enable(thdev);
  127. return 0;
  128. }
  129. static void intel_th_output_deactivate(struct intel_th_device *thdev)
  130. {
  131. struct intel_th_driver *thdrv = to_intel_th_driver(thdev->dev.driver);
  132. if (thdrv->deactivate)
  133. thdrv->deactivate(thdev);
  134. else
  135. intel_th_trace_disable(thdev);
  136. }
  137. static ssize_t active_show(struct device *dev, struct device_attribute *attr,
  138. char *buf)
  139. {
  140. struct intel_th_device *thdev = to_intel_th_device(dev);
  141. return scnprintf(buf, PAGE_SIZE, "%d\n", thdev->output.active);
  142. }
  143. static ssize_t active_store(struct device *dev, struct device_attribute *attr,
  144. const char *buf, size_t size)
  145. {
  146. struct intel_th_device *thdev = to_intel_th_device(dev);
  147. unsigned long val;
  148. int ret;
  149. ret = kstrtoul(buf, 10, &val);
  150. if (ret)
  151. return ret;
  152. if (!!val != thdev->output.active) {
  153. if (val)
  154. ret = intel_th_output_activate(thdev);
  155. else
  156. intel_th_output_deactivate(thdev);
  157. }
  158. return ret ? ret : size;
  159. }
  160. static DEVICE_ATTR_RW(active);
  161. static struct attribute *intel_th_output_attrs[] = {
  162. &dev_attr_port.attr,
  163. &dev_attr_active.attr,
  164. NULL,
  165. };
  166. ATTRIBUTE_GROUPS(intel_th_output);
  167. static struct device_type intel_th_output_device_type = {
  168. .name = "intel_th_output_device",
  169. .groups = intel_th_output_groups,
  170. .release = intel_th_device_release,
  171. .devnode = intel_th_output_devnode,
  172. };
  173. static struct device_type intel_th_switch_device_type = {
  174. .name = "intel_th_switch_device",
  175. .release = intel_th_device_release,
  176. };
  177. static struct device_type *intel_th_device_type[] = {
  178. [INTEL_TH_SOURCE] = &intel_th_source_device_type,
  179. [INTEL_TH_OUTPUT] = &intel_th_output_device_type,
  180. [INTEL_TH_SWITCH] = &intel_th_switch_device_type,
  181. };
  182. int intel_th_driver_register(struct intel_th_driver *thdrv)
  183. {
  184. if (!thdrv->probe || !thdrv->remove)
  185. return -EINVAL;
  186. thdrv->driver.bus = &intel_th_bus;
  187. return driver_register(&thdrv->driver);
  188. }
  189. EXPORT_SYMBOL_GPL(intel_th_driver_register);
  190. void intel_th_driver_unregister(struct intel_th_driver *thdrv)
  191. {
  192. driver_unregister(&thdrv->driver);
  193. }
  194. EXPORT_SYMBOL_GPL(intel_th_driver_unregister);
  195. static struct intel_th_device *
  196. intel_th_device_alloc(struct intel_th *th, unsigned int type, const char *name,
  197. int id)
  198. {
  199. struct device *parent;
  200. struct intel_th_device *thdev;
  201. if (type == INTEL_TH_SWITCH)
  202. parent = th->dev;
  203. else
  204. parent = &th->hub->dev;
  205. thdev = kzalloc(sizeof(*thdev) + strlen(name) + 1, GFP_KERNEL);
  206. if (!thdev)
  207. return NULL;
  208. thdev->id = id;
  209. thdev->type = type;
  210. strcpy(thdev->name, name);
  211. device_initialize(&thdev->dev);
  212. thdev->dev.bus = &intel_th_bus;
  213. thdev->dev.type = intel_th_device_type[type];
  214. thdev->dev.parent = parent;
  215. thdev->dev.dma_mask = parent->dma_mask;
  216. thdev->dev.dma_parms = parent->dma_parms;
  217. dma_set_coherent_mask(&thdev->dev, parent->coherent_dma_mask);
  218. if (id >= 0)
  219. dev_set_name(&thdev->dev, "%d-%s%d", th->id, name, id);
  220. else
  221. dev_set_name(&thdev->dev, "%d-%s", th->id, name);
  222. return thdev;
  223. }
  224. static int intel_th_device_add_resources(struct intel_th_device *thdev,
  225. struct resource *res, int nres)
  226. {
  227. struct resource *r;
  228. r = kmemdup(res, sizeof(*res) * nres, GFP_KERNEL);
  229. if (!r)
  230. return -ENOMEM;
  231. thdev->resource = r;
  232. thdev->num_resources = nres;
  233. return 0;
  234. }
  235. static void intel_th_device_remove(struct intel_th_device *thdev)
  236. {
  237. device_del(&thdev->dev);
  238. put_device(&thdev->dev);
  239. }
  240. static void intel_th_device_free(struct intel_th_device *thdev)
  241. {
  242. kfree(thdev->resource);
  243. kfree(thdev);
  244. }
  245. /*
  246. * Intel(R) Trace Hub subdevices
  247. */
  248. static struct intel_th_subdevice {
  249. const char *name;
  250. struct resource res[3];
  251. unsigned nres;
  252. unsigned type;
  253. unsigned otype;
  254. int id;
  255. } intel_th_subdevices[TH_SUBDEVICE_MAX] = {
  256. {
  257. .nres = 1,
  258. .res = {
  259. {
  260. .start = REG_GTH_OFFSET,
  261. .end = REG_GTH_OFFSET + REG_GTH_LENGTH - 1,
  262. .flags = IORESOURCE_MEM,
  263. },
  264. },
  265. .name = "gth",
  266. .type = INTEL_TH_SWITCH,
  267. .id = -1,
  268. },
  269. {
  270. .nres = 2,
  271. .res = {
  272. {
  273. .start = REG_MSU_OFFSET,
  274. .end = REG_MSU_OFFSET + REG_MSU_LENGTH - 1,
  275. .flags = IORESOURCE_MEM,
  276. },
  277. {
  278. .start = BUF_MSU_OFFSET,
  279. .end = BUF_MSU_OFFSET + BUF_MSU_LENGTH - 1,
  280. .flags = IORESOURCE_MEM,
  281. },
  282. },
  283. .name = "msc",
  284. .id = 0,
  285. .type = INTEL_TH_OUTPUT,
  286. .otype = GTH_MSU,
  287. },
  288. {
  289. .nres = 2,
  290. .res = {
  291. {
  292. .start = REG_MSU_OFFSET,
  293. .end = REG_MSU_OFFSET + REG_MSU_LENGTH - 1,
  294. .flags = IORESOURCE_MEM,
  295. },
  296. {
  297. .start = BUF_MSU_OFFSET,
  298. .end = BUF_MSU_OFFSET + BUF_MSU_LENGTH - 1,
  299. .flags = IORESOURCE_MEM,
  300. },
  301. },
  302. .name = "msc",
  303. .id = 1,
  304. .type = INTEL_TH_OUTPUT,
  305. .otype = GTH_MSU,
  306. },
  307. {
  308. .nres = 2,
  309. .res = {
  310. {
  311. .start = REG_STH_OFFSET,
  312. .end = REG_STH_OFFSET + REG_STH_LENGTH - 1,
  313. .flags = IORESOURCE_MEM,
  314. },
  315. {
  316. .start = TH_MMIO_SW,
  317. .end = 0,
  318. .flags = IORESOURCE_MEM,
  319. },
  320. },
  321. .id = -1,
  322. .name = "sth",
  323. .type = INTEL_TH_SOURCE,
  324. },
  325. {
  326. .nres = 1,
  327. .res = {
  328. {
  329. .start = REG_PTI_OFFSET,
  330. .end = REG_PTI_OFFSET + REG_PTI_LENGTH - 1,
  331. .flags = IORESOURCE_MEM,
  332. },
  333. },
  334. .id = -1,
  335. .name = "pti",
  336. .type = INTEL_TH_OUTPUT,
  337. .otype = GTH_PTI,
  338. },
  339. {
  340. .nres = 1,
  341. .res = {
  342. {
  343. .start = REG_DCIH_OFFSET,
  344. .end = REG_DCIH_OFFSET + REG_DCIH_LENGTH - 1,
  345. .flags = IORESOURCE_MEM,
  346. },
  347. },
  348. .id = -1,
  349. .name = "dcih",
  350. .type = INTEL_TH_OUTPUT,
  351. },
  352. };
  353. #ifdef CONFIG_MODULES
  354. static void __intel_th_request_hub_module(struct work_struct *work)
  355. {
  356. struct intel_th *th = container_of(work, struct intel_th,
  357. request_module_work);
  358. request_module("intel_th_%s", th->hub->name);
  359. }
  360. static int intel_th_request_hub_module(struct intel_th *th)
  361. {
  362. INIT_WORK(&th->request_module_work, __intel_th_request_hub_module);
  363. schedule_work(&th->request_module_work);
  364. return 0;
  365. }
  366. static void intel_th_request_hub_module_flush(struct intel_th *th)
  367. {
  368. flush_work(&th->request_module_work);
  369. }
  370. #else
  371. static inline int intel_th_request_hub_module(struct intel_th *th)
  372. {
  373. return -EINVAL;
  374. }
  375. static inline void intel_th_request_hub_module_flush(struct intel_th *th)
  376. {
  377. }
  378. #endif /* CONFIG_MODULES */
  379. static int intel_th_populate(struct intel_th *th, struct resource *devres,
  380. unsigned int ndevres, int irq)
  381. {
  382. struct resource res[3];
  383. unsigned int req = 0;
  384. int i, err;
  385. /* create devices for each intel_th_subdevice */
  386. for (i = 0; i < ARRAY_SIZE(intel_th_subdevices); i++) {
  387. struct intel_th_subdevice *subdev = &intel_th_subdevices[i];
  388. struct intel_th_device *thdev;
  389. int r;
  390. thdev = intel_th_device_alloc(th, subdev->type, subdev->name,
  391. subdev->id);
  392. if (!thdev) {
  393. err = -ENOMEM;
  394. goto kill_subdevs;
  395. }
  396. memcpy(res, subdev->res,
  397. sizeof(struct resource) * subdev->nres);
  398. for (r = 0; r < subdev->nres; r++) {
  399. int bar = TH_MMIO_CONFIG;
  400. /*
  401. * Take .end == 0 to mean 'take the whole bar',
  402. * .start then tells us which bar it is. Default to
  403. * TH_MMIO_CONFIG.
  404. */
  405. if (!res[r].end && res[r].flags == IORESOURCE_MEM) {
  406. bar = res[r].start;
  407. res[r].start = 0;
  408. res[r].end = resource_size(&devres[bar]) - 1;
  409. }
  410. if (res[r].flags & IORESOURCE_MEM) {
  411. res[r].start += devres[bar].start;
  412. res[r].end += devres[bar].start;
  413. dev_dbg(th->dev, "%s:%d @ %pR\n",
  414. subdev->name, r, &res[r]);
  415. } else if (res[r].flags & IORESOURCE_IRQ) {
  416. res[r].start = irq;
  417. }
  418. }
  419. err = intel_th_device_add_resources(thdev, res, subdev->nres);
  420. if (err) {
  421. put_device(&thdev->dev);
  422. goto kill_subdevs;
  423. }
  424. if (subdev->type == INTEL_TH_OUTPUT) {
  425. thdev->dev.devt = MKDEV(th->major, i);
  426. thdev->output.type = subdev->otype;
  427. thdev->output.port = -1;
  428. }
  429. err = device_add(&thdev->dev);
  430. if (err) {
  431. put_device(&thdev->dev);
  432. goto kill_subdevs;
  433. }
  434. /* need switch driver to be loaded to enumerate the rest */
  435. if (subdev->type == INTEL_TH_SWITCH && !req) {
  436. th->hub = thdev;
  437. err = intel_th_request_hub_module(th);
  438. if (!err)
  439. req++;
  440. }
  441. th->thdev[i] = thdev;
  442. }
  443. return 0;
  444. kill_subdevs:
  445. for (i-- ; i >= 0; i--)
  446. intel_th_device_remove(th->thdev[i]);
  447. return err;
  448. }
  449. static int match_devt(struct device *dev, void *data)
  450. {
  451. dev_t devt = (dev_t)(unsigned long)data;
  452. return dev->devt == devt;
  453. }
  454. static int intel_th_output_open(struct inode *inode, struct file *file)
  455. {
  456. const struct file_operations *fops;
  457. struct intel_th_driver *thdrv;
  458. struct device *dev;
  459. int err;
  460. dev = bus_find_device(&intel_th_bus, NULL,
  461. (void *)(unsigned long)inode->i_rdev,
  462. match_devt);
  463. if (!dev || !dev->driver)
  464. return -ENODEV;
  465. thdrv = to_intel_th_driver(dev->driver);
  466. fops = fops_get(thdrv->fops);
  467. if (!fops)
  468. return -ENODEV;
  469. replace_fops(file, fops);
  470. file->private_data = to_intel_th_device(dev);
  471. if (file->f_op->open) {
  472. err = file->f_op->open(inode, file);
  473. return err;
  474. }
  475. return 0;
  476. }
  477. static const struct file_operations intel_th_output_fops = {
  478. .open = intel_th_output_open,
  479. .llseek = noop_llseek,
  480. };
  481. /**
  482. * intel_th_alloc() - allocate a new Intel TH device and its subdevices
  483. * @dev: parent device
  484. * @devres: parent's resources
  485. * @ndevres: number of resources
  486. * @irq: irq number
  487. */
  488. struct intel_th *
  489. intel_th_alloc(struct device *dev, struct resource *devres,
  490. unsigned int ndevres, int irq)
  491. {
  492. struct intel_th *th;
  493. int err;
  494. th = kzalloc(sizeof(*th), GFP_KERNEL);
  495. if (!th)
  496. return ERR_PTR(-ENOMEM);
  497. th->id = ida_simple_get(&intel_th_ida, 0, 0, GFP_KERNEL);
  498. if (th->id < 0) {
  499. err = th->id;
  500. goto err_alloc;
  501. }
  502. th->major = __register_chrdev(0, 0, TH_POSSIBLE_OUTPUTS,
  503. "intel_th/output", &intel_th_output_fops);
  504. if (th->major < 0) {
  505. err = th->major;
  506. goto err_ida;
  507. }
  508. th->dev = dev;
  509. err = intel_th_populate(th, devres, ndevres, irq);
  510. if (err)
  511. goto err_chrdev;
  512. return th;
  513. err_chrdev:
  514. __unregister_chrdev(th->major, 0, TH_POSSIBLE_OUTPUTS,
  515. "intel_th/output");
  516. err_ida:
  517. ida_simple_remove(&intel_th_ida, th->id);
  518. err_alloc:
  519. kfree(th);
  520. return ERR_PTR(err);
  521. }
  522. EXPORT_SYMBOL_GPL(intel_th_alloc);
  523. void intel_th_free(struct intel_th *th)
  524. {
  525. int i;
  526. intel_th_request_hub_module_flush(th);
  527. for (i = 0; i < TH_SUBDEVICE_MAX; i++)
  528. if (th->thdev[i] != th->hub)
  529. intel_th_device_remove(th->thdev[i]);
  530. intel_th_device_remove(th->hub);
  531. __unregister_chrdev(th->major, 0, TH_POSSIBLE_OUTPUTS,
  532. "intel_th/output");
  533. ida_simple_remove(&intel_th_ida, th->id);
  534. kfree(th);
  535. }
  536. EXPORT_SYMBOL_GPL(intel_th_free);
  537. /**
  538. * intel_th_trace_enable() - enable tracing for an output device
  539. * @thdev: output device that requests tracing be enabled
  540. */
  541. int intel_th_trace_enable(struct intel_th_device *thdev)
  542. {
  543. struct intel_th_device *hub = to_intel_th_device(thdev->dev.parent);
  544. struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver);
  545. if (WARN_ON_ONCE(hub->type != INTEL_TH_SWITCH))
  546. return -EINVAL;
  547. if (WARN_ON_ONCE(thdev->type != INTEL_TH_OUTPUT))
  548. return -EINVAL;
  549. hubdrv->enable(hub, &thdev->output);
  550. return 0;
  551. }
  552. EXPORT_SYMBOL_GPL(intel_th_trace_enable);
  553. /**
  554. * intel_th_trace_disable() - disable tracing for an output device
  555. * @thdev: output device that requests tracing be disabled
  556. */
  557. int intel_th_trace_disable(struct intel_th_device *thdev)
  558. {
  559. struct intel_th_device *hub = to_intel_th_device(thdev->dev.parent);
  560. struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver);
  561. WARN_ON_ONCE(hub->type != INTEL_TH_SWITCH);
  562. if (WARN_ON_ONCE(thdev->type != INTEL_TH_OUTPUT))
  563. return -EINVAL;
  564. hubdrv->disable(hub, &thdev->output);
  565. return 0;
  566. }
  567. EXPORT_SYMBOL_GPL(intel_th_trace_disable);
  568. int intel_th_set_output(struct intel_th_device *thdev,
  569. unsigned int master)
  570. {
  571. struct intel_th_device *hub = to_intel_th_device(thdev->dev.parent);
  572. struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver);
  573. if (!hubdrv->set_output)
  574. return -ENOTSUPP;
  575. return hubdrv->set_output(hub, master);
  576. }
  577. EXPORT_SYMBOL_GPL(intel_th_set_output);
  578. static int __init intel_th_init(void)
  579. {
  580. intel_th_debug_init();
  581. return bus_register(&intel_th_bus);
  582. }
  583. subsys_initcall(intel_th_init);
  584. static void __exit intel_th_exit(void)
  585. {
  586. intel_th_debug_done();
  587. bus_unregister(&intel_th_bus);
  588. }
  589. module_exit(intel_th_exit);
  590. MODULE_LICENSE("GPL v2");
  591. MODULE_DESCRIPTION("Intel(R) Trace Hub controller driver");
  592. MODULE_AUTHOR("Alexander Shishkin <alexander.shishkin@linux.intel.com>");