blob: 493380b2c05fd1b6756ad9edb711c4992125f5e7 [file] [log] [blame]
Bruce Losureff3eb552005-04-25 13:12:02 -07001/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (c) 2005 Silicon Graphics, Inc. All rights reserved.
7 */
8
9#include <linux/module.h>
10#include <linux/kernel.h>
Bruce Losureff3eb552005-04-25 13:12:02 -070011#include <linux/slab.h>
12#include <linux/spinlock.h>
13#include <linux/proc_fs.h>
Randy Dunlapa9415642006-01-11 12:17:48 -080014#include <linux/capability.h>
Bruce Losureff3eb552005-04-25 13:12:02 -070015#include <linux/device.h>
16#include <linux/delay.h>
Jack Steiner21517a52005-07-07 09:14:00 -070017#include <asm/system.h>
Bruce Losureff3eb552005-04-25 13:12:02 -070018#include <asm/uaccess.h>
19#include <asm/sn/sn_sal.h>
20#include <asm/sn/addrs.h>
21#include <asm/sn/io.h>
22#include <asm/sn/types.h>
23#include <asm/sn/shubio.h>
24#include <asm/sn/tiocx.h>
Bruce Losurece0a3952005-04-25 19:41:00 -070025#include <asm/sn/l1.h>
26#include <asm/sn/module.h>
Bruce Losureff3eb552005-04-25 13:12:02 -070027#include "tio.h"
28#include "xtalk/xwidgetdev.h"
29#include "xtalk/hubdev.h"
30
31#define CX_DEV_NONE 0
32#define DEVICE_NAME "tiocx"
33#define WIDGET_ID 0
34#define TIOCX_DEBUG 0
35
36#if TIOCX_DEBUG
37#define DBG(fmt...) printk(KERN_ALERT fmt)
38#else
39#define DBG(fmt...)
40#endif
41
42struct device_attribute dev_attr_cxdev_control;
43
44/**
45 * tiocx_match - Try to match driver id list with device.
46 * @dev: device pointer
47 * @drv: driver pointer
48 *
49 * Returns 1 if match, 0 otherwise.
50 */
51static int tiocx_match(struct device *dev, struct device_driver *drv)
52{
53 struct cx_dev *cx_dev = to_cx_dev(dev);
54 struct cx_drv *cx_drv = to_cx_driver(drv);
55 const struct cx_device_id *ids = cx_drv->id_table;
56
57 if (!ids)
58 return 0;
59
60 while (ids->part_num) {
61 if (ids->part_num == cx_dev->cx_id.part_num)
62 return 1;
63 ids++;
64 }
65 return 0;
66
67}
68
Paul Jackson6d20b032005-11-25 20:04:26 -080069static int tiocx_uevent(struct device *dev, char **envp, int num_envp,
Bruce Losureff3eb552005-04-25 13:12:02 -070070 char *buffer, int buffer_size)
71{
72 return -ENODEV;
73}
74
75static void tiocx_bus_release(struct device *dev)
76{
77 kfree(to_cx_dev(dev));
78}
79
Bruce Losureff3eb552005-04-25 13:12:02 -070080/**
81 * cx_device_match - Find cx_device in the id table.
82 * @ids: id table from driver
83 * @cx_device: part/mfg id for the device
84 *
85 */
86static const struct cx_device_id *cx_device_match(const struct cx_device_id
87 *ids,
88 struct cx_dev *cx_device)
89{
90 /*
91 * NOTES: We may want to check for CX_ANY_ID too.
92 * Do we want to match against nasid too?
93 * CX_DEV_NONE == 0, if the driver tries to register for
94 * part/mfg == 0 we should return no-match (NULL) here.
95 */
96 while (ids->part_num && ids->mfg_num) {
97 if (ids->part_num == cx_device->cx_id.part_num &&
98 ids->mfg_num == cx_device->cx_id.mfg_num)
99 return ids;
100 ids++;
101 }
102
103 return NULL;
104}
105
106/**
107 * cx_device_probe - Look for matching device.
108 * Call driver probe routine if found.
109 * @cx_driver: driver table (cx_drv struct) from driver
110 * @cx_device: part/mfg id for the device
111 */
112static int cx_device_probe(struct device *dev)
113{
114 const struct cx_device_id *id;
115 struct cx_drv *cx_drv = to_cx_driver(dev->driver);
116 struct cx_dev *cx_dev = to_cx_dev(dev);
117 int error = 0;
118
119 if (!cx_dev->driver && cx_drv->probe) {
120 id = cx_device_match(cx_drv->id_table, cx_dev);
121 if (id) {
122 if ((error = cx_drv->probe(cx_dev, id)) < 0)
123 return error;
124 else
125 cx_dev->driver = cx_drv;
126 }
127 }
128
129 return error;
130}
131
132/**
133 * cx_driver_remove - Remove driver from device struct.
134 * @dev: device
135 */
136static int cx_driver_remove(struct device *dev)
137{
138 struct cx_dev *cx_dev = to_cx_dev(dev);
139 struct cx_drv *cx_drv = cx_dev->driver;
140 if (cx_drv->remove)
141 cx_drv->remove(cx_dev);
142 cx_dev->driver = NULL;
143 return 0;
144}
145
Russell King83dfb8b2006-01-05 14:34:06 +0000146struct bus_type tiocx_bus_type = {
147 .name = "tiocx",
148 .match = tiocx_match,
149 .uevent = tiocx_uevent,
150 .probe = cx_device_probe,
151 .remove = cx_driver_remove,
152};
153
Bruce Losureff3eb552005-04-25 13:12:02 -0700154/**
155 * cx_driver_register - Register the driver.
156 * @cx_driver: driver table (cx_drv struct) from driver
157 *
158 * Called from the driver init routine to register a driver.
159 * The cx_drv struct contains the driver name, a pointer to
160 * a table of part/mfg numbers and a pointer to the driver's
161 * probe/attach routine.
162 */
163int cx_driver_register(struct cx_drv *cx_driver)
164{
165 cx_driver->driver.name = cx_driver->name;
166 cx_driver->driver.bus = &tiocx_bus_type;
Bruce Losureff3eb552005-04-25 13:12:02 -0700167
168 return driver_register(&cx_driver->driver);
169}
170
171/**
172 * cx_driver_unregister - Unregister the driver.
173 * @cx_driver: driver table (cx_drv struct) from driver
174 */
175int cx_driver_unregister(struct cx_drv *cx_driver)
176{
177 driver_unregister(&cx_driver->driver);
178 return 0;
179}
180
181/**
182 * cx_device_register - Register a device.
183 * @nasid: device's nasid
184 * @part_num: device's part number
185 * @mfg_num: device's manufacturer number
186 * @hubdev: hub info associated with this device
Bruce Losure25732ad2005-09-02 15:16:35 -0500187 * @bt: board type of the device
Bruce Losureff3eb552005-04-25 13:12:02 -0700188 *
189 */
190int
191cx_device_register(nasid_t nasid, int part_num, int mfg_num,
Bruce Losure25732ad2005-09-02 15:16:35 -0500192 struct hubdev_info *hubdev, int bt)
Bruce Losureff3eb552005-04-25 13:12:02 -0700193{
194 struct cx_dev *cx_dev;
195
Pekka Enbergf96cb1f2005-09-06 15:18:31 -0700196 cx_dev = kzalloc(sizeof(struct cx_dev), GFP_KERNEL);
Bruce Losureff3eb552005-04-25 13:12:02 -0700197 DBG("cx_dev= 0x%p\n", cx_dev);
198 if (cx_dev == NULL)
199 return -ENOMEM;
200
201 cx_dev->cx_id.part_num = part_num;
202 cx_dev->cx_id.mfg_num = mfg_num;
203 cx_dev->cx_id.nasid = nasid;
204 cx_dev->hubdev = hubdev;
Bruce Losure25732ad2005-09-02 15:16:35 -0500205 cx_dev->bt = bt;
Bruce Losureff3eb552005-04-25 13:12:02 -0700206
207 cx_dev->dev.parent = NULL;
208 cx_dev->dev.bus = &tiocx_bus_type;
209 cx_dev->dev.release = tiocx_bus_release;
Bruce Losurec1ffb6a2005-05-24 08:30:00 -0700210 snprintf(cx_dev->dev.bus_id, BUS_ID_SIZE, "%d",
211 cx_dev->cx_id.nasid);
Bruce Losureff3eb552005-04-25 13:12:02 -0700212 device_register(&cx_dev->dev);
213 get_device(&cx_dev->dev);
214
215 device_create_file(&cx_dev->dev, &dev_attr_cxdev_control);
216
217 return 0;
218}
219
220/**
221 * cx_device_unregister - Unregister a device.
222 * @cx_dev: part/mfg id for the device
223 */
224int cx_device_unregister(struct cx_dev *cx_dev)
225{
226 put_device(&cx_dev->dev);
227 device_unregister(&cx_dev->dev);
228 return 0;
229}
230
231/**
232 * cx_device_reload - Reload the device.
233 * @nasid: device's nasid
234 * @part_num: device's part number
235 * @mfg_num: device's manufacturer number
236 *
237 * Remove the device associated with 'nasid' from device list and then
238 * call device-register with the given part/mfg numbers.
239 */
240static int cx_device_reload(struct cx_dev *cx_dev)
241{
Bruce Losureff3eb552005-04-25 13:12:02 -0700242 cx_device_unregister(cx_dev);
243 return cx_device_register(cx_dev->cx_id.nasid, cx_dev->cx_id.part_num,
Bruce Losure25732ad2005-09-02 15:16:35 -0500244 cx_dev->cx_id.mfg_num, cx_dev->hubdev,
245 cx_dev->bt);
Bruce Losureff3eb552005-04-25 13:12:02 -0700246}
247
Prarit Bhargava53493dc2006-01-16 19:54:40 -0800248static inline u64 tiocx_intr_alloc(nasid_t nasid, int widget,
Bruce Losureff3eb552005-04-25 13:12:02 -0700249 u64 sn_irq_info,
250 int req_irq, nasid_t req_nasid,
251 int req_slice)
252{
253 struct ia64_sal_retval rv;
254 rv.status = 0;
255 rv.v0 = 0;
256
257 ia64_sal_oemcall_nolock(&rv, SN_SAL_IOIF_INTERRUPT,
258 SAL_INTR_ALLOC, nasid,
259 widget, sn_irq_info, req_irq,
260 req_nasid, req_slice);
261 return rv.status;
262}
263
264static inline void tiocx_intr_free(nasid_t nasid, int widget,
265 struct sn_irq_info *sn_irq_info)
266{
267 struct ia64_sal_retval rv;
268 rv.status = 0;
269 rv.v0 = 0;
270
271 ia64_sal_oemcall_nolock(&rv, SN_SAL_IOIF_INTERRUPT,
272 SAL_INTR_FREE, nasid,
273 widget, sn_irq_info->irq_irq,
274 sn_irq_info->irq_cookie, 0, 0);
275}
276
277struct sn_irq_info *tiocx_irq_alloc(nasid_t nasid, int widget, int irq,
278 nasid_t req_nasid, int slice)
279{
280 struct sn_irq_info *sn_irq_info;
281 int status;
282 int sn_irq_size = sizeof(struct sn_irq_info);
283
284 if ((nasid & 1) == 0)
285 return NULL;
286
Jes Sorensen8ed9b2c2006-02-13 05:29:57 -0500287 sn_irq_info = kzalloc(sn_irq_size, GFP_KERNEL);
Bruce Losureff3eb552005-04-25 13:12:02 -0700288 if (sn_irq_info == NULL)
289 return NULL;
290
Bruce Losureff3eb552005-04-25 13:12:02 -0700291 status = tiocx_intr_alloc(nasid, widget, __pa(sn_irq_info), irq,
292 req_nasid, slice);
293 if (status) {
294 kfree(sn_irq_info);
295 return NULL;
296 } else {
297 return sn_irq_info;
298 }
299}
300
301void tiocx_irq_free(struct sn_irq_info *sn_irq_info)
302{
Prarit Bhargava53493dc2006-01-16 19:54:40 -0800303 u64 bridge = (u64) sn_irq_info->irq_bridge;
Bruce Losureff3eb552005-04-25 13:12:02 -0700304 nasid_t nasid = NASID_GET(bridge);
305 int widget;
306
307 if (nasid & 1) {
308 widget = TIO_SWIN_WIDGETNUM(bridge);
309 tiocx_intr_free(nasid, widget, sn_irq_info);
310 kfree(sn_irq_info);
311 }
312}
313
Prarit Bhargava53493dc2006-01-16 19:54:40 -0800314u64 tiocx_dma_addr(u64 addr)
Bruce Losureff3eb552005-04-25 13:12:02 -0700315{
316 return PHYS_TO_TIODMA(addr);
317}
318
Prarit Bhargava53493dc2006-01-16 19:54:40 -0800319u64 tiocx_swin_base(int nasid)
Bruce Losureff3eb552005-04-25 13:12:02 -0700320{
321 return TIO_SWIN_BASE(nasid, TIOCX_CORELET);
322}
323
324EXPORT_SYMBOL(cx_driver_register);
325EXPORT_SYMBOL(cx_driver_unregister);
326EXPORT_SYMBOL(cx_device_register);
327EXPORT_SYMBOL(cx_device_unregister);
328EXPORT_SYMBOL(tiocx_irq_alloc);
329EXPORT_SYMBOL(tiocx_irq_free);
330EXPORT_SYMBOL(tiocx_bus_type);
331EXPORT_SYMBOL(tiocx_dma_addr);
332EXPORT_SYMBOL(tiocx_swin_base);
333
Bruce Losureff3eb552005-04-25 13:12:02 -0700334static void tio_conveyor_set(nasid_t nasid, int enable_flag)
335{
Prarit Bhargava53493dc2006-01-16 19:54:40 -0800336 u64 ice_frz;
337 u64 disable_cb = (1ull << 61);
Bruce Losureff3eb552005-04-25 13:12:02 -0700338
339 if (!(nasid & 1))
340 return;
341
342 ice_frz = REMOTE_HUB_L(nasid, TIO_ICE_FRZ_CFG);
343 if (enable_flag) {
344 if (!(ice_frz & disable_cb)) /* already enabled */
345 return;
346 ice_frz &= ~disable_cb;
347 } else {
348 if (ice_frz & disable_cb) /* already disabled */
349 return;
350 ice_frz |= disable_cb;
351 }
352 DBG(KERN_ALERT "TIO_ICE_FRZ_CFG= 0x%lx\n", ice_frz);
353 REMOTE_HUB_S(nasid, TIO_ICE_FRZ_CFG, ice_frz);
354}
355
356#define tio_conveyor_enable(nasid) tio_conveyor_set(nasid, 1)
357#define tio_conveyor_disable(nasid) tio_conveyor_set(nasid, 0)
358
359static void tio_corelet_reset(nasid_t nasid, int corelet)
360{
361 if (!(nasid & 1))
362 return;
363
364 REMOTE_HUB_S(nasid, TIO_ICE_PMI_TX_CFG, 1 << corelet);
365 udelay(2000);
366 REMOTE_HUB_S(nasid, TIO_ICE_PMI_TX_CFG, 0);
367 udelay(2000);
368}
369
Bruce Losure25732ad2005-09-02 15:16:35 -0500370static int is_fpga_tio(int nasid, int *bt)
Bruce Losurece0a3952005-04-25 19:41:00 -0700371{
Prarit Bhargavaf90aa8c2006-03-08 13:30:18 -0500372 u16 ioboard_type;
373 s64 rc;
Bruce Losurece0a3952005-04-25 19:41:00 -0700374
Prarit Bhargavaf90aa8c2006-03-08 13:30:18 -0500375 rc = ia64_sn_sysctl_ioboard_get(nasid, &ioboard_type);
376 if (rc) {
377 printk(KERN_WARNING "ia64_sn_sysctl_ioboard_get failed: %ld\n",
378 rc);
379 return 0;
380 }
Bruce Losurece0a3952005-04-25 19:41:00 -0700381
Bruce Losure25732ad2005-09-02 15:16:35 -0500382 switch (ioboard_type) {
Bruce Losurece0a3952005-04-25 19:41:00 -0700383 case L1_BRICKTYPE_SA:
384 case L1_BRICKTYPE_ATHENA:
Bruce Losure25732ad2005-09-02 15:16:35 -0500385 case L1_BOARDTYPE_DAYTONA:
386 *bt = ioboard_type;
Bruce Losurece0a3952005-04-25 19:41:00 -0700387 return 1;
388 }
Bruce Losure25732ad2005-09-02 15:16:35 -0500389
Bruce Losurece0a3952005-04-25 19:41:00 -0700390 return 0;
391}
392
393static int bitstream_loaded(nasid_t nasid)
Bruce Losureff3eb552005-04-25 13:12:02 -0700394{
Prarit Bhargava53493dc2006-01-16 19:54:40 -0800395 u64 cx_credits;
Bruce Losureff3eb552005-04-25 13:12:02 -0700396
397 cx_credits = REMOTE_HUB_L(nasid, TIO_ICE_PMI_TX_DYN_CREDIT_STAT_CB3);
398 cx_credits &= TIO_ICE_PMI_TX_DYN_CREDIT_STAT_CB3_CREDIT_CNT_MASK;
399 DBG("cx_credits= 0x%lx\n", cx_credits);
400
401 return (cx_credits == 0xf) ? 1 : 0;
402}
403
404static int tiocx_reload(struct cx_dev *cx_dev)
405{
406 int part_num = CX_DEV_NONE;
407 int mfg_num = CX_DEV_NONE;
408 nasid_t nasid = cx_dev->cx_id.nasid;
409
Bruce Losurece0a3952005-04-25 19:41:00 -0700410 if (bitstream_loaded(nasid)) {
Prarit Bhargava53493dc2006-01-16 19:54:40 -0800411 u64 cx_id;
Bruce Losure25732ad2005-09-02 15:16:35 -0500412 int rv;
Bruce Losureff3eb552005-04-25 13:12:02 -0700413
Bruce Losure25732ad2005-09-02 15:16:35 -0500414 rv = ia64_sn_sysctl_tio_clock_reset(nasid);
415 if (rv) {
416 printk(KERN_ALERT "CX port JTAG reset failed.\n");
417 } else {
Prarit Bhargava53493dc2006-01-16 19:54:40 -0800418 cx_id = *(volatile u64 *)
Bruce Losure25732ad2005-09-02 15:16:35 -0500419 (TIO_SWIN_BASE(nasid, TIOCX_CORELET) +
Bruce Losureff3eb552005-04-25 13:12:02 -0700420 WIDGET_ID);
Bruce Losure25732ad2005-09-02 15:16:35 -0500421 part_num = XWIDGET_PART_NUM(cx_id);
422 mfg_num = XWIDGET_MFG_NUM(cx_id);
423 DBG("part= 0x%x, mfg= 0x%x\n", part_num, mfg_num);
424 /* just ignore it if it's a CE */
425 if (part_num == TIO_CE_ASIC_PARTNUM)
426 return 0;
427 }
Bruce Losureff3eb552005-04-25 13:12:02 -0700428 }
429
430 cx_dev->cx_id.part_num = part_num;
431 cx_dev->cx_id.mfg_num = mfg_num;
432
433 /*
434 * Delete old device and register the new one. It's ok if
435 * part_num/mfg_num == CX_DEV_NONE. We want to register
436 * devices in the table even if a bitstream isn't loaded.
437 * That allows use to see that a bitstream isn't loaded via
438 * TIOCX_IOCTL_DEV_LIST.
439 */
440 return cx_device_reload(cx_dev);
441}
442
Yani Ioannouff381d22005-05-17 06:40:51 -0400443static ssize_t show_cxdev_control(struct device *dev, struct device_attribute *attr, char *buf)
Bruce Losureff3eb552005-04-25 13:12:02 -0700444{
445 struct cx_dev *cx_dev = to_cx_dev(dev);
446
Bruce Losure25732ad2005-09-02 15:16:35 -0500447 return sprintf(buf, "0x%x 0x%x 0x%x 0x%x\n",
Bruce Losureff3eb552005-04-25 13:12:02 -0700448 cx_dev->cx_id.nasid,
Bruce Losurece0a3952005-04-25 19:41:00 -0700449 cx_dev->cx_id.part_num, cx_dev->cx_id.mfg_num,
Bruce Losure25732ad2005-09-02 15:16:35 -0500450 cx_dev->bt);
Bruce Losureff3eb552005-04-25 13:12:02 -0700451}
452
Yani Ioannouff381d22005-05-17 06:40:51 -0400453static ssize_t store_cxdev_control(struct device *dev, struct device_attribute *attr, const char *buf,
Bruce Losureff3eb552005-04-25 13:12:02 -0700454 size_t count)
455{
456 int n;
457 struct cx_dev *cx_dev = to_cx_dev(dev);
458
459 if (!capable(CAP_SYS_ADMIN))
460 return -EPERM;
461
462 if (count <= 0)
463 return 0;
464
465 n = simple_strtoul(buf, NULL, 0);
466
467 switch (n) {
468 case 1:
Bruce Losurec1ffb6a2005-05-24 08:30:00 -0700469 tio_corelet_reset(cx_dev->cx_id.nasid, TIOCX_CORELET);
470 tiocx_reload(cx_dev);
471 break;
472 case 2:
Bruce Losureff3eb552005-04-25 13:12:02 -0700473 tiocx_reload(cx_dev);
474 break;
475 case 3:
476 tio_corelet_reset(cx_dev->cx_id.nasid, TIOCX_CORELET);
477 break;
478 default:
479 break;
480 }
481
482 return count;
483}
484
485DEVICE_ATTR(cxdev_control, 0644, show_cxdev_control, store_cxdev_control);
486
487static int __init tiocx_init(void)
488{
489 cnodeid_t cnodeid;
490 int found_tiocx_device = 0;
491
Jack Steiner21517a52005-07-07 09:14:00 -0700492 if (!ia64_platform_is("sn2"))
Bjorn Helgaas6c5e6212006-03-03 15:33:47 -0700493 return 0;
Jack Steiner21517a52005-07-07 09:14:00 -0700494
Bruce Losureff3eb552005-04-25 13:12:02 -0700495 bus_register(&tiocx_bus_type);
496
Jack Steiner24ee0a62005-09-12 12:15:43 -0500497 for (cnodeid = 0; cnodeid < num_cnodes; cnodeid++) {
Bruce Losureff3eb552005-04-25 13:12:02 -0700498 nasid_t nasid;
Bruce Losure25732ad2005-09-02 15:16:35 -0500499 int bt;
Bruce Losureff3eb552005-04-25 13:12:02 -0700500
Jack Steiner24ee0a62005-09-12 12:15:43 -0500501 nasid = cnodeid_to_nasid(cnodeid);
Bruce Losureff3eb552005-04-25 13:12:02 -0700502
Bruce Losure25732ad2005-09-02 15:16:35 -0500503 if ((nasid & 0x1) && is_fpga_tio(nasid, &bt)) {
Bruce Losureff3eb552005-04-25 13:12:02 -0700504 struct hubdev_info *hubdev;
Bruce Losureff3eb552005-04-25 13:12:02 -0700505 struct xwidget_info *widgetp;
506
507 DBG("Found TIO at nasid 0x%x\n", nasid);
508
509 hubdev =
510 (struct hubdev_info *)(NODEPDA(cnodeid)->pdinfo);
Bruce Losureff3eb552005-04-25 13:12:02 -0700511
512 widgetp = &hubdev->hdi_xwidget_info[TIOCX_CORELET];
513
514 /* The CE hangs off of the CX port but is not an FPGA */
515 if (widgetp->xwi_hwid.part_num == TIO_CE_ASIC_PARTNUM)
516 continue;
517
518 tio_corelet_reset(nasid, TIOCX_CORELET);
519 tio_conveyor_enable(nasid);
520
521 if (cx_device_register
522 (nasid, widgetp->xwi_hwid.part_num,
Bruce Losure25732ad2005-09-02 15:16:35 -0500523 widgetp->xwi_hwid.mfg_num, hubdev, bt) < 0)
Bruce Losureff3eb552005-04-25 13:12:02 -0700524 return -ENXIO;
525 else
526 found_tiocx_device++;
527 }
528 }
529
530 /* It's ok if we find zero devices. */
531 DBG("found_tiocx_device= %d\n", found_tiocx_device);
532
533 return 0;
534}
535
Patrick Mochel66234152005-04-28 17:11:52 -0700536static int cx_remove_device(struct device * dev, void * data)
537{
538 struct cx_dev *cx_dev = to_cx_dev(dev);
539 device_remove_file(dev, &dev_attr_cxdev_control);
540 cx_device_unregister(cx_dev);
541 return 0;
542}
543
Bruce Losureff3eb552005-04-25 13:12:02 -0700544static void __exit tiocx_exit(void)
545{
Bruce Losureff3eb552005-04-25 13:12:02 -0700546 DBG("tiocx_exit\n");
547
548 /*
549 * Unregister devices.
550 */
Patrick Mochel66234152005-04-28 17:11:52 -0700551 bus_for_each_dev(&tiocx_bus_type, NULL, NULL, cx_remove_device);
Bruce Losureff3eb552005-04-25 13:12:02 -0700552 bus_unregister(&tiocx_bus_type);
553}
554
John Keller8ea60912006-10-04 16:49:25 -0500555fs_initcall(tiocx_init);
Bruce Losureff3eb552005-04-25 13:12:02 -0700556module_exit(tiocx_exit);
557
558/************************************************************************
559 * Module licensing and description
560 ************************************************************************/
561MODULE_LICENSE("GPL");
562MODULE_AUTHOR("Bruce Losure <blosure@sgi.com>");
563MODULE_DESCRIPTION("TIOCX module");
564MODULE_SUPPORTED_DEVICE(DEVICE_NAME);