4 * Copyright (C) IBM Corporation 2016
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #include <linux/crc4.h>
17 #include <linux/device.h>
18 #include <linux/fsi.h>
19 #include <linux/idr.h>
20 #include <linux/module.h>
22 #include <linux/slab.h>
23 #include <linux/bitops.h>
25 #include "fsi-master.h"
27 #define CREATE_TRACE_POINTS
28 #include <trace/events/fsi.h>
30 #define FSI_SLAVE_CONF_NEXT_MASK GENMASK(31, 31)
31 #define FSI_SLAVE_CONF_SLOTS_MASK GENMASK(23, 16)
32 #define FSI_SLAVE_CONF_SLOTS_SHIFT 16
33 #define FSI_SLAVE_CONF_VERSION_MASK GENMASK(15, 12)
34 #define FSI_SLAVE_CONF_VERSION_SHIFT 12
35 #define FSI_SLAVE_CONF_TYPE_MASK GENMASK(11, 4)
36 #define FSI_SLAVE_CONF_TYPE_SHIFT 4
37 #define FSI_SLAVE_CONF_CRC_SHIFT 4
38 #define FSI_SLAVE_CONF_CRC_MASK GENMASK(3, 0)
39 #define FSI_SLAVE_CONF_DATA_BITS 28
41 #define FSI_PEEK_BASE 0x410
43 static const int engine_page_size = 0x400;
45 #define FSI_SLAVE_BASE 0x800
48 * FSI slave engine control register offsets
50 #define FSI_SMODE 0x0 /* R/W: Mode register */
51 #define FSI_SISC 0x8 /* R/W: Interrupt condition */
52 #define FSI_SSTAT 0x14 /* R : Slave status */
53 #define FSI_LLMODE 0x100 /* R/W: Link layer mode register */
58 #define FSI_SMODE_WSC 0x80000000 /* Warm start done */
59 #define FSI_SMODE_ECRC 0x20000000 /* Hw CRC check */
60 #define FSI_SMODE_SID_SHIFT 24 /* ID shift */
61 #define FSI_SMODE_SID_MASK 3 /* ID Mask */
62 #define FSI_SMODE_ED_SHIFT 20 /* Echo delay shift */
63 #define FSI_SMODE_ED_MASK 0xf /* Echo delay mask */
64 #define FSI_SMODE_SD_SHIFT 16 /* Send delay shift */
65 #define FSI_SMODE_SD_MASK 0xf /* Send delay mask */
66 #define FSI_SMODE_LBCRR_SHIFT 8 /* Clk ratio shift */
67 #define FSI_SMODE_LBCRR_MASK 0xf /* Clk ratio mask */
72 #define FSI_LLMODE_ASYNC 0x1
74 #define FSI_SLAVE_SIZE_23b 0x800000
76 static DEFINE_IDA(master_ida);
80 struct fsi_master *master;
83 uint32_t size; /* size of slave address space */
86 #define to_fsi_master(d) container_of(d, struct fsi_master, dev)
87 #define to_fsi_slave(d) container_of(d, struct fsi_slave, dev)
89 static const int slave_retries = 2;
90 static int discard_errors;
92 static int fsi_master_read(struct fsi_master *master, int link,
93 uint8_t slave_id, uint32_t addr, void *val, size_t size);
94 static int fsi_master_write(struct fsi_master *master, int link,
95 uint8_t slave_id, uint32_t addr, const void *val, size_t size);
96 static int fsi_master_break(struct fsi_master *master, int link);
99 * fsi_device_read() / fsi_device_write() / fsi_device_peek()
101 * FSI endpoint-device support
103 * Read / write / peek accessors for a client
106 * dev: Structure passed to FSI client device drivers on probe().
107 * addr: FSI address of given device. Client should pass in its base address
108 * plus desired offset to access its register space.
109 * val: For read/peek this is the value read at the specified address. For
110 * write this is value to write to the specified address.
111 * The data in val must be FSI bus endian (big endian).
112 * size: Size in bytes of the operation. Sizes supported are 1, 2 and 4 bytes.
113 * Addresses must be aligned on size boundaries or an error will result.
115 int fsi_device_read(struct fsi_device *dev, uint32_t addr, void *val,
118 if (addr > dev->size || size > dev->size || addr > dev->size - size)
121 return fsi_slave_read(dev->slave, dev->addr + addr, val, size);
123 EXPORT_SYMBOL_GPL(fsi_device_read);
125 int fsi_device_write(struct fsi_device *dev, uint32_t addr, const void *val,
128 if (addr > dev->size || size > dev->size || addr > dev->size - size)
131 return fsi_slave_write(dev->slave, dev->addr + addr, val, size);
133 EXPORT_SYMBOL_GPL(fsi_device_write);
135 int fsi_device_peek(struct fsi_device *dev, void *val)
137 uint32_t addr = FSI_PEEK_BASE + ((dev->unit - 2) * sizeof(uint32_t));
139 return fsi_slave_read(dev->slave, addr, val, sizeof(uint32_t));
142 static void fsi_device_release(struct device *_device)
144 struct fsi_device *device = to_fsi_dev(_device);
146 of_node_put(device->dev.of_node);
150 static struct fsi_device *fsi_create_device(struct fsi_slave *slave)
152 struct fsi_device *dev;
154 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
158 dev->dev.parent = &slave->dev;
159 dev->dev.bus = &fsi_bus_type;
160 dev->dev.release = fsi_device_release;
165 /* FSI slave support */
166 static int fsi_slave_calc_addr(struct fsi_slave *slave, uint32_t *addrp,
169 uint32_t addr = *addrp;
172 if (addr > slave->size)
175 /* For 23 bit addressing, we encode the extra two bits in the slave
176 * id (and the slave's actual ID needs to be 0).
178 if (addr > 0x1fffff) {
181 id = (addr >> 21) & 0x3;
190 static int fsi_slave_report_and_clear_errors(struct fsi_slave *slave)
192 struct fsi_master *master = slave->master;
200 rc = fsi_master_read(master, link, id, FSI_SLAVE_BASE + FSI_SISC,
205 rc = fsi_master_read(master, link, id, FSI_SLAVE_BASE + FSI_SSTAT,
206 &stat, sizeof(stat));
210 dev_dbg(&slave->dev, "status: 0x%08x, sisc: 0x%08x\n",
211 be32_to_cpu(stat), be32_to_cpu(irq));
213 /* clear interrupts */
214 return fsi_master_write(master, link, id, FSI_SLAVE_BASE + FSI_SISC,
218 static int fsi_slave_set_smode(struct fsi_master *master, int link, int id);
220 static int fsi_slave_handle_error(struct fsi_slave *slave, bool write,
221 uint32_t addr, size_t size)
223 struct fsi_master *master = slave->master;
234 dev_dbg(&slave->dev, "handling error on %s to 0x%08x[%zd]",
235 write ? "write" : "read", addr, size);
237 /* try a simple clear of error conditions, which may fail if we've lost
238 * communication with the slave
240 rc = fsi_slave_report_and_clear_errors(slave);
244 /* send a TERM and retry */
246 rc = master->term(master, link, id);
248 rc = fsi_master_read(master, link, id, 0,
251 rc = fsi_slave_report_and_clear_errors(slave);
257 /* getting serious, reset the slave via BREAK */
258 rc = fsi_master_break(master, link);
262 rc = fsi_slave_set_smode(master, link, id);
266 return fsi_slave_report_and_clear_errors(slave);
269 int fsi_slave_read(struct fsi_slave *slave, uint32_t addr,
270 void *val, size_t size)
272 uint8_t id = slave->id;
275 rc = fsi_slave_calc_addr(slave, &addr, &id);
279 for (i = 0; i < slave_retries; i++) {
280 rc = fsi_master_read(slave->master, slave->link,
281 id, addr, val, size);
285 err_rc = fsi_slave_handle_error(slave, false, addr, size);
292 EXPORT_SYMBOL_GPL(fsi_slave_read);
294 int fsi_slave_write(struct fsi_slave *slave, uint32_t addr,
295 const void *val, size_t size)
297 uint8_t id = slave->id;
300 rc = fsi_slave_calc_addr(slave, &addr, &id);
304 for (i = 0; i < slave_retries; i++) {
305 rc = fsi_master_write(slave->master, slave->link,
306 id, addr, val, size);
310 err_rc = fsi_slave_handle_error(slave, true, addr, size);
317 EXPORT_SYMBOL_GPL(fsi_slave_write);
319 extern int fsi_slave_claim_range(struct fsi_slave *slave,
320 uint32_t addr, uint32_t size)
322 if (addr + size < addr)
325 if (addr + size > slave->size)
328 /* todo: check for overlapping claims */
331 EXPORT_SYMBOL_GPL(fsi_slave_claim_range);
333 extern void fsi_slave_release_range(struct fsi_slave *slave,
334 uint32_t addr, uint32_t size)
337 EXPORT_SYMBOL_GPL(fsi_slave_release_range);
339 static bool fsi_device_node_matches(struct device *dev, struct device_node *np,
340 uint32_t addr, uint32_t size)
342 unsigned int len, na, ns;
346 na = of_n_addr_cells(np);
347 ns = of_n_size_cells(np);
349 if (na != 1 || ns != 1)
352 prop = of_get_property(np, "reg", &len);
353 if (!prop || len != 8)
356 if (of_read_number(prop, 1) != addr)
359 psize = of_read_number(prop + 1, 1);
362 "node %s matches probed address, but not size (got 0x%x, expected 0x%x)",
363 of_node_full_name(np), psize, size);
369 /* Find a matching node for the slave engine at @address, using @size bytes
370 * of space. Returns NULL if not found, or a matching node with refcount
371 * already incremented.
373 static struct device_node *fsi_device_find_of_node(struct fsi_device *dev)
375 struct device_node *parent, *np;
377 parent = dev_of_node(&dev->slave->dev);
381 for_each_child_of_node(parent, np) {
382 if (fsi_device_node_matches(&dev->dev, np,
383 dev->addr, dev->size))
390 static int fsi_slave_scan(struct fsi_slave *slave)
392 uint32_t engine_addr;
399 * We keep the peek mode and slave engines for the core; so start
400 * at the third slot in the configuration table. We also need to
401 * skip the chip ID entry at the start of the address space.
403 engine_addr = engine_page_size * 3;
404 for (i = 2; i < engine_page_size / sizeof(uint32_t); i++) {
405 uint8_t slots, version, type, crc;
406 struct fsi_device *dev;
408 rc = fsi_slave_read(slave, (i + 1) * sizeof(conf),
409 &conf, sizeof(conf));
411 dev_warn(&slave->dev,
412 "error reading slave registers\n");
415 conf = be32_to_cpu(conf);
417 crc = crc4(0, conf, 32);
419 dev_warn(&slave->dev,
420 "crc error in slave register at 0x%04x\n",
425 slots = (conf & FSI_SLAVE_CONF_SLOTS_MASK)
426 >> FSI_SLAVE_CONF_SLOTS_SHIFT;
427 version = (conf & FSI_SLAVE_CONF_VERSION_MASK)
428 >> FSI_SLAVE_CONF_VERSION_SHIFT;
429 type = (conf & FSI_SLAVE_CONF_TYPE_MASK)
430 >> FSI_SLAVE_CONF_TYPE_SHIFT;
433 * Unused address areas are marked by a zero type value; this
434 * skips the defined address areas
436 if (type != 0 && slots != 0) {
439 dev = fsi_create_device(slave);
444 dev->engine_type = type;
445 dev->version = version;
447 dev->addr = engine_addr;
448 dev->size = slots * engine_page_size;
451 "engine[%i]: type %x, version %x, addr %x size %x\n",
452 dev->unit, dev->engine_type, version,
453 dev->addr, dev->size);
455 dev_set_name(&dev->dev, "%02x:%02x:%02x:%02x",
456 slave->master->idx, slave->link,
458 dev->dev.of_node = fsi_device_find_of_node(dev);
460 rc = device_register(&dev->dev);
462 dev_warn(&slave->dev, "add failed: %d\n", rc);
463 put_device(&dev->dev);
467 engine_addr += slots * engine_page_size;
469 if (!(conf & FSI_SLAVE_CONF_NEXT_MASK))
476 static ssize_t fsi_slave_sysfs_raw_read(struct file *file,
477 struct kobject *kobj, struct bin_attribute *attr, char *buf,
478 loff_t off, size_t count)
480 struct fsi_slave *slave = to_fsi_slave(kobj_to_dev(kobj));
481 size_t total_len, read_len;
487 if (off > 0xffffffff || count > 0xffffffff || off + count > 0xffffffff)
490 for (total_len = 0; total_len < count; total_len += read_len) {
491 read_len = min_t(size_t, count, 4);
492 read_len -= off & 0x3;
494 rc = fsi_slave_read(slave, off, buf + total_len, read_len);
504 static ssize_t fsi_slave_sysfs_raw_write(struct file *file,
505 struct kobject *kobj, struct bin_attribute *attr,
506 char *buf, loff_t off, size_t count)
508 struct fsi_slave *slave = to_fsi_slave(kobj_to_dev(kobj));
509 size_t total_len, write_len;
515 if (off > 0xffffffff || count > 0xffffffff || off + count > 0xffffffff)
518 for (total_len = 0; total_len < count; total_len += write_len) {
519 write_len = min_t(size_t, count, 4);
520 write_len -= off & 0x3;
522 rc = fsi_slave_write(slave, off, buf + total_len, write_len);
532 static const struct bin_attribute fsi_slave_raw_attr = {
538 .read = fsi_slave_sysfs_raw_read,
539 .write = fsi_slave_sysfs_raw_write,
542 static ssize_t fsi_slave_sysfs_term_write(struct file *file,
543 struct kobject *kobj, struct bin_attribute *attr,
544 char *buf, loff_t off, size_t count)
546 struct fsi_slave *slave = to_fsi_slave(kobj_to_dev(kobj));
547 struct fsi_master *master = slave->master;
552 master->term(master, slave->link, slave->id);
556 static const struct bin_attribute fsi_slave_term_attr = {
562 .write = fsi_slave_sysfs_term_write,
565 /* Encode slave local bus echo delay */
566 static inline uint32_t fsi_smode_echodly(int x)
568 return (x & FSI_SMODE_ED_MASK) << FSI_SMODE_ED_SHIFT;
571 /* Encode slave local bus send delay */
572 static inline uint32_t fsi_smode_senddly(int x)
574 return (x & FSI_SMODE_SD_MASK) << FSI_SMODE_SD_SHIFT;
577 /* Encode slave local bus clock rate ratio */
578 static inline uint32_t fsi_smode_lbcrr(int x)
580 return (x & FSI_SMODE_LBCRR_MASK) << FSI_SMODE_LBCRR_SHIFT;
583 /* Encode slave ID */
584 static inline uint32_t fsi_smode_sid(int x)
586 return (x & FSI_SMODE_SID_MASK) << FSI_SMODE_SID_SHIFT;
589 static uint32_t fsi_slave_smode(int id)
591 return FSI_SMODE_WSC | FSI_SMODE_ECRC
593 | fsi_smode_echodly(0xf) | fsi_smode_senddly(0xf)
594 | fsi_smode_lbcrr(0x8);
597 static int fsi_slave_set_smode(struct fsi_master *master, int link, int id)
601 /* set our smode register with the slave ID field to 0; this enables
602 * extended slave addressing
604 smode = fsi_slave_smode(id);
605 smode = cpu_to_be32(smode);
607 return fsi_master_write(master, link, id, FSI_SLAVE_BASE + FSI_SMODE,
608 &smode, sizeof(smode));
611 static void fsi_slave_release(struct device *dev)
613 struct fsi_slave *slave = to_fsi_slave(dev);
615 of_node_put(dev->of_node);
619 static bool fsi_slave_node_matches(struct device_node *np,
620 int link, uint8_t id)
622 unsigned int len, na, ns;
625 na = of_n_addr_cells(np);
626 ns = of_n_size_cells(np);
628 /* Ensure we have the correct format for addresses and sizes in
631 if (na != 2 || ns != 0)
634 prop = of_get_property(np, "reg", &len);
635 if (!prop || len != 8)
638 return (of_read_number(prop, 1) == link) &&
639 (of_read_number(prop + 1, 1) == id);
642 /* Find a matching node for the slave at (link, id). Returns NULL if none
643 * found, or a matching node with refcount already incremented.
645 static struct device_node *fsi_slave_find_of_node(struct fsi_master *master,
646 int link, uint8_t id)
648 struct device_node *parent, *np;
650 parent = dev_of_node(&master->dev);
654 for_each_child_of_node(parent, np) {
655 if (fsi_slave_node_matches(np, link, id))
662 static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id)
664 uint32_t chip_id, llmode;
665 struct fsi_slave *slave;
669 /* Currently, we only support single slaves on a link, and use the
670 * full 23-bit address range
675 rc = fsi_master_read(master, link, id, 0, &chip_id, sizeof(chip_id));
677 dev_dbg(&master->dev, "can't read slave %02x:%02x %d\n",
681 chip_id = be32_to_cpu(chip_id);
683 crc = crc4(0, chip_id, 32);
685 dev_warn(&master->dev, "slave %02x:%02x invalid chip id CRC!\n",
690 dev_dbg(&master->dev, "fsi: found chip %08x at %02x:%02x:%02x\n",
691 chip_id, master->idx, link, id);
693 rc = fsi_slave_set_smode(master, link, id);
695 dev_warn(&master->dev,
696 "can't set smode on slave:%02x:%02x %d\n",
701 /* If we're behind a master that doesn't provide a self-running bus
702 * clock, put the slave into async mode
704 if (master->flags & FSI_MASTER_FLAG_SWCLOCK) {
705 llmode = cpu_to_be32(FSI_LLMODE_ASYNC);
706 rc = fsi_master_write(master, link, id,
707 FSI_SLAVE_BASE + FSI_LLMODE,
708 &llmode, sizeof(llmode));
710 dev_warn(&master->dev,
711 "can't set llmode on slave:%02x:%02x %d\n",
715 /* We can communicate with a slave; create the slave device and
718 slave = kzalloc(sizeof(*slave), GFP_KERNEL);
722 slave->master = master;
723 slave->dev.parent = &master->dev;
724 slave->dev.of_node = fsi_slave_find_of_node(master, link, id);
725 slave->dev.release = fsi_slave_release;
728 slave->size = FSI_SLAVE_SIZE_23b;
730 dev_set_name(&slave->dev, "slave@%02x:%02x", link, id);
731 rc = device_register(&slave->dev);
733 dev_warn(&master->dev, "failed to create slave device: %d\n",
735 put_device(&slave->dev);
739 rc = device_create_bin_file(&slave->dev, &fsi_slave_raw_attr);
741 dev_warn(&slave->dev, "failed to create raw attr: %d\n", rc);
743 rc = device_create_bin_file(&slave->dev, &fsi_slave_term_attr);
745 dev_warn(&slave->dev, "failed to create term attr: %d\n", rc);
747 rc = fsi_slave_scan(slave);
749 dev_dbg(&master->dev, "failed during slave scan with: %d\n",
755 /* FSI master support */
756 static int fsi_check_access(uint32_t addr, size_t size)
761 } else if (size == 2) {
764 } else if (size != 1)
770 static int fsi_master_read(struct fsi_master *master, int link,
771 uint8_t slave_id, uint32_t addr, void *val, size_t size)
775 trace_fsi_master_read(master, link, slave_id, addr, size);
777 rc = fsi_check_access(addr, size);
779 rc = master->read(master, link, slave_id, addr, val, size);
781 trace_fsi_master_rw_result(master, link, slave_id, addr, size,
787 static int fsi_master_write(struct fsi_master *master, int link,
788 uint8_t slave_id, uint32_t addr, const void *val, size_t size)
792 trace_fsi_master_write(master, link, slave_id, addr, size, val);
794 rc = fsi_check_access(addr, size);
796 rc = master->write(master, link, slave_id, addr, val, size);
798 trace_fsi_master_rw_result(master, link, slave_id, addr, size,
804 static int fsi_master_link_enable(struct fsi_master *master, int link)
806 if (master->link_enable)
807 return master->link_enable(master, link);
813 * Issue a break command on this link
815 static int fsi_master_break(struct fsi_master *master, int link)
817 trace_fsi_master_break(master, link);
819 if (master->send_break)
820 return master->send_break(master, link);
825 static int fsi_master_scan(struct fsi_master *master)
829 for (link = 0; link < master->n_links; link++) {
830 rc = fsi_master_link_enable(master, link);
832 dev_dbg(&master->dev,
833 "enable link %d failed: %d\n", link, rc);
836 rc = fsi_master_break(master, link);
838 dev_dbg(&master->dev,
839 "break to link %d failed: %d\n", link, rc);
843 fsi_slave_init(master, link, 0);
849 static int fsi_slave_remove_device(struct device *dev, void *arg)
851 device_unregister(dev);
855 static int fsi_master_remove_slave(struct device *dev, void *arg)
857 device_for_each_child(dev, NULL, fsi_slave_remove_device);
858 device_unregister(dev);
862 static void fsi_master_unscan(struct fsi_master *master)
864 device_for_each_child(&master->dev, NULL, fsi_master_remove_slave);
867 int fsi_master_rescan(struct fsi_master *master)
869 fsi_master_unscan(master);
870 return fsi_master_scan(master);
872 EXPORT_SYMBOL_GPL(fsi_master_rescan);
874 static ssize_t master_rescan_store(struct device *dev,
875 struct device_attribute *attr, const char *buf, size_t count)
877 struct fsi_master *master = to_fsi_master(dev);
880 rc = fsi_master_rescan(master);
887 static DEVICE_ATTR(rescan, 0200, NULL, master_rescan_store);
889 static ssize_t master_break_store(struct device *dev,
890 struct device_attribute *attr, const char *buf, size_t count)
892 struct fsi_master *master = to_fsi_master(dev);
894 fsi_master_break(master, 0);
899 static DEVICE_ATTR(break, 0200, NULL, master_break_store);
901 int fsi_master_register(struct fsi_master *master)
904 struct device_node *np;
909 master->idx = ida_simple_get(&master_ida, 0, INT_MAX, GFP_KERNEL);
910 dev_set_name(&master->dev, "fsi%d", master->idx);
912 rc = device_register(&master->dev);
914 ida_simple_remove(&master_ida, master->idx);
918 rc = device_create_file(&master->dev, &dev_attr_rescan);
920 device_unregister(&master->dev);
921 ida_simple_remove(&master_ida, master->idx);
925 rc = device_create_file(&master->dev, &dev_attr_break);
927 device_unregister(&master->dev);
928 ida_simple_remove(&master_ida, master->idx);
932 np = dev_of_node(&master->dev);
933 if (!of_property_read_bool(np, "no-scan-on-init"))
934 fsi_master_scan(master);
938 EXPORT_SYMBOL_GPL(fsi_master_register);
940 void fsi_master_unregister(struct fsi_master *master)
942 if (master->idx >= 0) {
943 ida_simple_remove(&master_ida, master->idx);
947 fsi_master_unscan(master);
948 device_unregister(&master->dev);
950 EXPORT_SYMBOL_GPL(fsi_master_unregister);
952 /* FSI core & Linux bus type definitions */
954 static int fsi_bus_match(struct device *dev, struct device_driver *drv)
956 struct fsi_device *fsi_dev = to_fsi_dev(dev);
957 struct fsi_driver *fsi_drv = to_fsi_drv(drv);
958 const struct fsi_device_id *id;
960 if (!fsi_drv->id_table)
963 for (id = fsi_drv->id_table; id->engine_type; id++) {
964 if (id->engine_type != fsi_dev->engine_type)
966 if (id->version == FSI_VERSION_ANY ||
967 id->version == fsi_dev->version)
974 int fsi_driver_register(struct fsi_driver *fsi_drv)
978 if (!fsi_drv->id_table)
981 return driver_register(&fsi_drv->drv);
983 EXPORT_SYMBOL_GPL(fsi_driver_register);
985 void fsi_driver_unregister(struct fsi_driver *fsi_drv)
987 driver_unregister(&fsi_drv->drv);
989 EXPORT_SYMBOL_GPL(fsi_driver_unregister);
991 struct bus_type fsi_bus_type = {
993 .match = fsi_bus_match,
995 EXPORT_SYMBOL_GPL(fsi_bus_type);
997 static int __init fsi_init(void)
999 return bus_register(&fsi_bus_type);
1001 postcore_initcall(fsi_init);
1003 static void fsi_exit(void)
1005 bus_unregister(&fsi_bus_type);
1007 module_exit(fsi_exit);
1008 module_param(discard_errors, int, 0664);
1009 MODULE_LICENSE("GPL");
1010 MODULE_PARM_DESC(discard_errors, "Don't invoke error handling on bus accesses");