gth.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. /*
  2. * Intel(R) Trace Hub Global Trace Hub
  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/io.h>
  20. #include <linux/mm.h>
  21. #include <linux/slab.h>
  22. #include <linux/bitmap.h>
  23. #include "intel_th.h"
  24. #include "gth.h"
  25. struct gth_device;
  26. /**
  27. * struct gth_output - GTH view on an output port
  28. * @gth: backlink to the GTH device
  29. * @output: link to output device's output descriptor
  30. * @index: output port number
  31. * @port_type: one of GTH_* port type values
  32. * @master: bitmap of masters configured for this output
  33. */
  34. struct gth_output {
  35. struct gth_device *gth;
  36. struct intel_th_output *output;
  37. unsigned int index;
  38. unsigned int port_type;
  39. DECLARE_BITMAP(master, TH_CONFIGURABLE_MASTERS + 1);
  40. };
  41. /**
  42. * struct gth_device - GTH device
  43. * @dev: driver core's device
  44. * @base: register window base address
  45. * @output_group: attributes describing output ports
  46. * @master_group: attributes describing master assignments
  47. * @output: output ports
  48. * @master: master/output port assignments
  49. * @gth_lock: serializes accesses to GTH bits
  50. */
  51. struct gth_device {
  52. struct device *dev;
  53. void __iomem *base;
  54. struct attribute_group output_group;
  55. struct attribute_group master_group;
  56. struct gth_output output[TH_POSSIBLE_OUTPUTS];
  57. signed char master[TH_CONFIGURABLE_MASTERS + 1];
  58. spinlock_t gth_lock;
  59. };
  60. static void gth_output_set(struct gth_device *gth, int port,
  61. unsigned int config)
  62. {
  63. unsigned long reg = port & 4 ? REG_GTH_GTHOPT1 : REG_GTH_GTHOPT0;
  64. u32 val;
  65. int shift = (port & 3) * 8;
  66. val = ioread32(gth->base + reg);
  67. val &= ~(0xff << shift);
  68. val |= config << shift;
  69. iowrite32(val, gth->base + reg);
  70. }
  71. static unsigned int gth_output_get(struct gth_device *gth, int port)
  72. {
  73. unsigned long reg = port & 4 ? REG_GTH_GTHOPT1 : REG_GTH_GTHOPT0;
  74. u32 val;
  75. int shift = (port & 3) * 8;
  76. val = ioread32(gth->base + reg);
  77. val &= 0xff << shift;
  78. val >>= shift;
  79. return val;
  80. }
  81. static void gth_smcfreq_set(struct gth_device *gth, int port,
  82. unsigned int freq)
  83. {
  84. unsigned long reg = REG_GTH_SMCR0 + ((port / 2) * 4);
  85. int shift = (port & 1) * 16;
  86. u32 val;
  87. val = ioread32(gth->base + reg);
  88. val &= ~(0xffff << shift);
  89. val |= freq << shift;
  90. iowrite32(val, gth->base + reg);
  91. }
  92. static unsigned int gth_smcfreq_get(struct gth_device *gth, int port)
  93. {
  94. unsigned long reg = REG_GTH_SMCR0 + ((port / 2) * 4);
  95. int shift = (port & 1) * 16;
  96. u32 val;
  97. val = ioread32(gth->base + reg);
  98. val &= 0xffff << shift;
  99. val >>= shift;
  100. return val;
  101. }
  102. /*
  103. * "masters" attribute group
  104. */
  105. struct master_attribute {
  106. struct device_attribute attr;
  107. struct gth_device *gth;
  108. unsigned int master;
  109. };
  110. static void
  111. gth_master_set(struct gth_device *gth, unsigned int master, int port)
  112. {
  113. unsigned int reg = REG_GTH_SWDEST0 + ((master >> 1) & ~3u);
  114. unsigned int shift = (master & 0x7) * 4;
  115. u32 val;
  116. if (master >= 256) {
  117. reg = REG_GTH_GSWTDEST;
  118. shift = 0;
  119. }
  120. val = ioread32(gth->base + reg);
  121. val &= ~(0xf << shift);
  122. if (port >= 0)
  123. val |= (0x8 | port) << shift;
  124. iowrite32(val, gth->base + reg);
  125. }
  126. /*static int gth_master_get(struct gth_device *gth, unsigned int master)
  127. {
  128. unsigned int reg = REG_GTH_SWDEST0 + ((master >> 1) & ~3u);
  129. unsigned int shift = (master & 0x7) * 4;
  130. u32 val;
  131. if (master >= 256) {
  132. reg = REG_GTH_GSWTDEST;
  133. shift = 0;
  134. }
  135. val = ioread32(gth->base + reg);
  136. val &= (0xf << shift);
  137. val >>= shift;
  138. return val ? val & 0x7 : -1;
  139. }*/
  140. static ssize_t master_attr_show(struct device *dev,
  141. struct device_attribute *attr,
  142. char *buf)
  143. {
  144. struct master_attribute *ma =
  145. container_of(attr, struct master_attribute, attr);
  146. struct gth_device *gth = ma->gth;
  147. size_t count;
  148. int port;
  149. spin_lock(&gth->gth_lock);
  150. port = gth->master[ma->master];
  151. spin_unlock(&gth->gth_lock);
  152. if (port >= 0)
  153. count = snprintf(buf, PAGE_SIZE, "%x\n", port);
  154. else
  155. count = snprintf(buf, PAGE_SIZE, "disabled\n");
  156. return count;
  157. }
  158. static ssize_t master_attr_store(struct device *dev,
  159. struct device_attribute *attr,
  160. const char *buf, size_t count)
  161. {
  162. struct master_attribute *ma =
  163. container_of(attr, struct master_attribute, attr);
  164. struct gth_device *gth = ma->gth;
  165. int old_port, port;
  166. if (kstrtoint(buf, 10, &port) < 0)
  167. return -EINVAL;
  168. if (port >= TH_POSSIBLE_OUTPUTS || port < -1)
  169. return -EINVAL;
  170. spin_lock(&gth->gth_lock);
  171. /* disconnect from the previous output port, if any */
  172. old_port = gth->master[ma->master];
  173. if (old_port >= 0) {
  174. gth->master[ma->master] = -1;
  175. clear_bit(ma->master, gth->output[old_port].master);
  176. if (gth->output[old_port].output->active)
  177. gth_master_set(gth, ma->master, -1);
  178. }
  179. /* connect to the new output port, if any */
  180. if (port >= 0) {
  181. /* check if there's a driver for this port */
  182. if (!gth->output[port].output) {
  183. count = -ENODEV;
  184. goto unlock;
  185. }
  186. set_bit(ma->master, gth->output[port].master);
  187. /* if the port is active, program this setting */
  188. if (gth->output[port].output->active)
  189. gth_master_set(gth, ma->master, port);
  190. }
  191. gth->master[ma->master] = port;
  192. unlock:
  193. spin_unlock(&gth->gth_lock);
  194. return count;
  195. }
  196. struct output_attribute {
  197. struct device_attribute attr;
  198. struct gth_device *gth;
  199. unsigned int port;
  200. unsigned int parm;
  201. };
  202. #define OUTPUT_PARM(_name, _mask, _r, _w, _what) \
  203. [TH_OUTPUT_PARM(_name)] = { .name = __stringify(_name), \
  204. .get = gth_ ## _what ## _get, \
  205. .set = gth_ ## _what ## _set, \
  206. .mask = (_mask), \
  207. .readable = (_r), \
  208. .writable = (_w) }
  209. static const struct output_parm {
  210. const char *name;
  211. unsigned int (*get)(struct gth_device *gth, int port);
  212. void (*set)(struct gth_device *gth, int port,
  213. unsigned int val);
  214. unsigned int mask;
  215. unsigned int readable : 1,
  216. writable : 1;
  217. } output_parms[] = {
  218. OUTPUT_PARM(port, 0x7, 1, 0, output),
  219. OUTPUT_PARM(null, BIT(3), 1, 1, output),
  220. OUTPUT_PARM(drop, BIT(4), 1, 1, output),
  221. OUTPUT_PARM(reset, BIT(5), 1, 0, output),
  222. OUTPUT_PARM(flush, BIT(7), 0, 1, output),
  223. OUTPUT_PARM(smcfreq, 0xffff, 1, 1, smcfreq),
  224. };
  225. static void
  226. gth_output_parm_set(struct gth_device *gth, int port, unsigned int parm,
  227. unsigned int val)
  228. {
  229. unsigned int config = output_parms[parm].get(gth, port);
  230. unsigned int mask = output_parms[parm].mask;
  231. unsigned int shift = __ffs(mask);
  232. config &= ~mask;
  233. config |= (val << shift) & mask;
  234. output_parms[parm].set(gth, port, config);
  235. }
  236. static unsigned int
  237. gth_output_parm_get(struct gth_device *gth, int port, unsigned int parm)
  238. {
  239. unsigned int config = output_parms[parm].get(gth, port);
  240. unsigned int mask = output_parms[parm].mask;
  241. unsigned int shift = __ffs(mask);
  242. config &= mask;
  243. config >>= shift;
  244. return config;
  245. }
  246. /*
  247. * Reset outputs and sources
  248. */
  249. static int intel_th_gth_reset(struct gth_device *gth)
  250. {
  251. u32 scratchpad;
  252. int port, i;
  253. scratchpad = ioread32(gth->base + REG_GTH_SCRPD0);
  254. if (scratchpad & SCRPD_DEBUGGER_IN_USE)
  255. return -EBUSY;
  256. /* output ports */
  257. for (port = 0; port < 8; port++) {
  258. if (gth_output_parm_get(gth, port, TH_OUTPUT_PARM(port)) ==
  259. GTH_NONE)
  260. continue;
  261. gth_output_set(gth, port, 0);
  262. gth_smcfreq_set(gth, port, 16);
  263. }
  264. /* disable overrides */
  265. iowrite32(0, gth->base + REG_GTH_DESTOVR);
  266. /* masters swdest_0~31 and gswdest */
  267. for (i = 0; i < 33; i++)
  268. iowrite32(0, gth->base + REG_GTH_SWDEST0 + i * 4);
  269. /* sources */
  270. iowrite32(0, gth->base + REG_GTH_SCR);
  271. iowrite32(0xfc, gth->base + REG_GTH_SCR2);
  272. return 0;
  273. }
  274. /*
  275. * "outputs" attribute group
  276. */
  277. static ssize_t output_attr_show(struct device *dev,
  278. struct device_attribute *attr,
  279. char *buf)
  280. {
  281. struct output_attribute *oa =
  282. container_of(attr, struct output_attribute, attr);
  283. struct gth_device *gth = oa->gth;
  284. size_t count;
  285. spin_lock(&gth->gth_lock);
  286. count = snprintf(buf, PAGE_SIZE, "%x\n",
  287. gth_output_parm_get(gth, oa->port, oa->parm));
  288. spin_unlock(&gth->gth_lock);
  289. return count;
  290. }
  291. static ssize_t output_attr_store(struct device *dev,
  292. struct device_attribute *attr,
  293. const char *buf, size_t count)
  294. {
  295. struct output_attribute *oa =
  296. container_of(attr, struct output_attribute, attr);
  297. struct gth_device *gth = oa->gth;
  298. unsigned int config;
  299. if (kstrtouint(buf, 16, &config) < 0)
  300. return -EINVAL;
  301. spin_lock(&gth->gth_lock);
  302. gth_output_parm_set(gth, oa->port, oa->parm, config);
  303. spin_unlock(&gth->gth_lock);
  304. return count;
  305. }
  306. static int intel_th_master_attributes(struct gth_device *gth)
  307. {
  308. struct master_attribute *master_attrs;
  309. struct attribute **attrs;
  310. int i, nattrs = TH_CONFIGURABLE_MASTERS + 2;
  311. attrs = devm_kcalloc(gth->dev, nattrs, sizeof(void *), GFP_KERNEL);
  312. if (!attrs)
  313. return -ENOMEM;
  314. master_attrs = devm_kcalloc(gth->dev, nattrs,
  315. sizeof(struct master_attribute),
  316. GFP_KERNEL);
  317. if (!master_attrs)
  318. return -ENOMEM;
  319. for (i = 0; i < TH_CONFIGURABLE_MASTERS + 1; i++) {
  320. char *name;
  321. name = devm_kasprintf(gth->dev, GFP_KERNEL, "%d%s", i,
  322. i == TH_CONFIGURABLE_MASTERS ? "+" : "");
  323. if (!name)
  324. return -ENOMEM;
  325. master_attrs[i].attr.attr.name = name;
  326. master_attrs[i].attr.attr.mode = S_IRUGO | S_IWUSR;
  327. master_attrs[i].attr.show = master_attr_show;
  328. master_attrs[i].attr.store = master_attr_store;
  329. sysfs_attr_init(&master_attrs[i].attr.attr);
  330. attrs[i] = &master_attrs[i].attr.attr;
  331. master_attrs[i].gth = gth;
  332. master_attrs[i].master = i;
  333. }
  334. gth->master_group.name = "masters";
  335. gth->master_group.attrs = attrs;
  336. return sysfs_create_group(&gth->dev->kobj, &gth->master_group);
  337. }
  338. static int intel_th_output_attributes(struct gth_device *gth)
  339. {
  340. struct output_attribute *out_attrs;
  341. struct attribute **attrs;
  342. int i, j, nouts = TH_POSSIBLE_OUTPUTS;
  343. int nparms = ARRAY_SIZE(output_parms);
  344. int nattrs = nouts * nparms + 1;
  345. attrs = devm_kcalloc(gth->dev, nattrs, sizeof(void *), GFP_KERNEL);
  346. if (!attrs)
  347. return -ENOMEM;
  348. out_attrs = devm_kcalloc(gth->dev, nattrs,
  349. sizeof(struct output_attribute),
  350. GFP_KERNEL);
  351. if (!out_attrs)
  352. return -ENOMEM;
  353. for (i = 0; i < nouts; i++) {
  354. for (j = 0; j < nparms; j++) {
  355. unsigned int idx = i * nparms + j;
  356. char *name;
  357. name = devm_kasprintf(gth->dev, GFP_KERNEL, "%d_%s", i,
  358. output_parms[j].name);
  359. if (!name)
  360. return -ENOMEM;
  361. out_attrs[idx].attr.attr.name = name;
  362. if (output_parms[j].readable) {
  363. out_attrs[idx].attr.attr.mode |= S_IRUGO;
  364. out_attrs[idx].attr.show = output_attr_show;
  365. }
  366. if (output_parms[j].writable) {
  367. out_attrs[idx].attr.attr.mode |= S_IWUSR;
  368. out_attrs[idx].attr.store = output_attr_store;
  369. }
  370. sysfs_attr_init(&out_attrs[idx].attr.attr);
  371. attrs[idx] = &out_attrs[idx].attr.attr;
  372. out_attrs[idx].gth = gth;
  373. out_attrs[idx].port = i;
  374. out_attrs[idx].parm = j;
  375. }
  376. }
  377. gth->output_group.name = "outputs";
  378. gth->output_group.attrs = attrs;
  379. return sysfs_create_group(&gth->dev->kobj, &gth->output_group);
  380. }
  381. /**
  382. * intel_th_gth_disable() - enable tracing to an output device
  383. * @thdev: GTH device
  384. * @output: output device's descriptor
  385. *
  386. * This will deconfigure all masters set to output to this device,
  387. * disable tracing using force storeEn off signal and wait for the
  388. * "pipeline empty" bit for corresponding output port.
  389. */
  390. static void intel_th_gth_disable(struct intel_th_device *thdev,
  391. struct intel_th_output *output)
  392. {
  393. struct gth_device *gth = dev_get_drvdata(&thdev->dev);
  394. unsigned long count;
  395. int master;
  396. u32 reg;
  397. spin_lock(&gth->gth_lock);
  398. output->active = false;
  399. for_each_set_bit(master, gth->output[output->port].master,
  400. TH_CONFIGURABLE_MASTERS) {
  401. gth_master_set(gth, master, -1);
  402. }
  403. spin_unlock(&gth->gth_lock);
  404. iowrite32(0, gth->base + REG_GTH_SCR);
  405. iowrite32(0xfd, gth->base + REG_GTH_SCR2);
  406. /* wait on pipeline empty for the given port */
  407. for (reg = 0, count = GTH_PLE_WAITLOOP_DEPTH;
  408. count && !(reg & BIT(output->port)); count--) {
  409. reg = ioread32(gth->base + REG_GTH_STAT);
  410. cpu_relax();
  411. }
  412. /* clear force capture done for next captures */
  413. iowrite32(0xfc, gth->base + REG_GTH_SCR2);
  414. if (!count)
  415. dev_dbg(&thdev->dev, "timeout waiting for GTH[%d] PLE\n",
  416. output->port);
  417. }
  418. /**
  419. * intel_th_gth_enable() - enable tracing to an output device
  420. * @thdev: GTH device
  421. * @output: output device's descriptor
  422. *
  423. * This will configure all masters set to output to this device and
  424. * enable tracing using force storeEn signal.
  425. */
  426. static void intel_th_gth_enable(struct intel_th_device *thdev,
  427. struct intel_th_output *output)
  428. {
  429. struct gth_device *gth = dev_get_drvdata(&thdev->dev);
  430. u32 scr = 0xfc0000;
  431. int master;
  432. spin_lock(&gth->gth_lock);
  433. for_each_set_bit(master, gth->output[output->port].master,
  434. TH_CONFIGURABLE_MASTERS + 1) {
  435. gth_master_set(gth, master, output->port);
  436. }
  437. if (output->multiblock)
  438. scr |= 0xff;
  439. output->active = true;
  440. spin_unlock(&gth->gth_lock);
  441. iowrite32(scr, gth->base + REG_GTH_SCR);
  442. iowrite32(0, gth->base + REG_GTH_SCR2);
  443. }
  444. /**
  445. * intel_th_gth_assign() - assign output device to a GTH output port
  446. * @thdev: GTH device
  447. * @othdev: output device
  448. *
  449. * This will match a given output device parameters against present
  450. * output ports on the GTH and fill out relevant bits in output device's
  451. * descriptor.
  452. *
  453. * Return: 0 on success, -errno on error.
  454. */
  455. static int intel_th_gth_assign(struct intel_th_device *thdev,
  456. struct intel_th_device *othdev)
  457. {
  458. struct gth_device *gth = dev_get_drvdata(&thdev->dev);
  459. int i, id;
  460. if (othdev->type != INTEL_TH_OUTPUT)
  461. return -EINVAL;
  462. for (i = 0, id = 0; i < TH_POSSIBLE_OUTPUTS; i++) {
  463. if (gth->output[i].port_type != othdev->output.type)
  464. continue;
  465. if (othdev->id == -1 || othdev->id == id)
  466. goto found;
  467. id++;
  468. }
  469. return -ENOENT;
  470. found:
  471. spin_lock(&gth->gth_lock);
  472. othdev->output.port = i;
  473. othdev->output.active = false;
  474. gth->output[i].output = &othdev->output;
  475. spin_unlock(&gth->gth_lock);
  476. return 0;
  477. }
  478. /**
  479. * intel_th_gth_unassign() - deassociate an output device from its output port
  480. * @thdev: GTH device
  481. * @othdev: output device
  482. */
  483. static void intel_th_gth_unassign(struct intel_th_device *thdev,
  484. struct intel_th_device *othdev)
  485. {
  486. struct gth_device *gth = dev_get_drvdata(&thdev->dev);
  487. int port = othdev->output.port;
  488. int master;
  489. spin_lock(&gth->gth_lock);
  490. othdev->output.port = -1;
  491. othdev->output.active = false;
  492. gth->output[port].output = NULL;
  493. for (master = 0; master < TH_CONFIGURABLE_MASTERS; master++)
  494. if (gth->master[master] == port)
  495. gth->master[master] = -1;
  496. spin_unlock(&gth->gth_lock);
  497. }
  498. static int
  499. intel_th_gth_set_output(struct intel_th_device *thdev, unsigned int master)
  500. {
  501. struct gth_device *gth = dev_get_drvdata(&thdev->dev);
  502. int port = 0; /* FIXME: make default output configurable */
  503. /*
  504. * everything above TH_CONFIGURABLE_MASTERS is controlled by the
  505. * same register
  506. */
  507. if (master > TH_CONFIGURABLE_MASTERS)
  508. master = TH_CONFIGURABLE_MASTERS;
  509. spin_lock(&gth->gth_lock);
  510. if (gth->master[master] == -1) {
  511. set_bit(master, gth->output[port].master);
  512. gth->master[master] = port;
  513. }
  514. spin_unlock(&gth->gth_lock);
  515. return 0;
  516. }
  517. static int intel_th_gth_probe(struct intel_th_device *thdev)
  518. {
  519. struct device *dev = &thdev->dev;
  520. struct gth_device *gth;
  521. struct resource *res;
  522. void __iomem *base;
  523. int i, ret;
  524. res = intel_th_device_get_resource(thdev, IORESOURCE_MEM, 0);
  525. if (!res)
  526. return -ENODEV;
  527. base = devm_ioremap(dev, res->start, resource_size(res));
  528. if (!base)
  529. return -ENOMEM;
  530. gth = devm_kzalloc(dev, sizeof(*gth), GFP_KERNEL);
  531. if (!gth)
  532. return -ENOMEM;
  533. gth->dev = dev;
  534. gth->base = base;
  535. spin_lock_init(&gth->gth_lock);
  536. ret = intel_th_gth_reset(gth);
  537. if (ret)
  538. return ret;
  539. for (i = 0; i < TH_CONFIGURABLE_MASTERS + 1; i++)
  540. gth->master[i] = -1;
  541. for (i = 0; i < TH_POSSIBLE_OUTPUTS; i++) {
  542. gth->output[i].gth = gth;
  543. gth->output[i].index = i;
  544. gth->output[i].port_type =
  545. gth_output_parm_get(gth, i, TH_OUTPUT_PARM(port));
  546. }
  547. if (intel_th_output_attributes(gth) ||
  548. intel_th_master_attributes(gth)) {
  549. pr_warn("Can't initialize sysfs attributes\n");
  550. if (gth->output_group.attrs)
  551. sysfs_remove_group(&gth->dev->kobj, &gth->output_group);
  552. return -ENOMEM;
  553. }
  554. dev_set_drvdata(dev, gth);
  555. return 0;
  556. }
  557. static void intel_th_gth_remove(struct intel_th_device *thdev)
  558. {
  559. struct gth_device *gth = dev_get_drvdata(&thdev->dev);
  560. sysfs_remove_group(&gth->dev->kobj, &gth->output_group);
  561. sysfs_remove_group(&gth->dev->kobj, &gth->master_group);
  562. }
  563. static struct intel_th_driver intel_th_gth_driver = {
  564. .probe = intel_th_gth_probe,
  565. .remove = intel_th_gth_remove,
  566. .assign = intel_th_gth_assign,
  567. .unassign = intel_th_gth_unassign,
  568. .set_output = intel_th_gth_set_output,
  569. .enable = intel_th_gth_enable,
  570. .disable = intel_th_gth_disable,
  571. .driver = {
  572. .name = "gth",
  573. .owner = THIS_MODULE,
  574. },
  575. };
  576. module_driver(intel_th_gth_driver,
  577. intel_th_driver_register,
  578. intel_th_driver_unregister);
  579. MODULE_ALIAS("intel_th_switch");
  580. MODULE_LICENSE("GPL v2");
  581. MODULE_DESCRIPTION("Intel(R) Trace Hub Global Trace Hub driver");
  582. MODULE_AUTHOR("Alexander Shishkin <alexander.shishkin@linux.intel.com>");