aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/kpc2000/kpc2000/kp2000_module.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-19 20:42:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-20 23:04:58 +0200
commit7dc7967fc39af81191558f63eeaf3d2b83899b1c (patch)
treeed3a6b846d8fb6e914dcec329f2afc02568f3617 /drivers/staging/kpc2000/kpc2000/kp2000_module.c
parentStaging: rtlwifi: Replace return type (diff)
downloadlinux-dev-7dc7967fc39af81191558f63eeaf3d2b83899b1c.tar.xz
linux-dev-7dc7967fc39af81191558f63eeaf3d2b83899b1c.zip
staging: kpc2000: add initial set of Daktronics drivers
These drivers have been outside of the kernel tree since the 2.x days, and it's time to bring them into the tree so they can get properly cleaned up. This first dump of drivers is based on a tarball Matt gave to me, minus an odd "dma" driver that I could not get to build at all. I renamed a few files, added the proper SPDX lines to it, added Kconfig entries and tied it into the kernel build. I also fixed up a number of initial obvious kernel build warnings, but left the odd bitfield warning that gcc is spitting out, as I'm not quite sure what to do about that. There's loads of low-hanging coding style cleanups in here for people to start attacking, as well as the more obvious logic and api cleanups as well. Cc: Matt Sickler <Matt.Sickler@daktronics.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/kpc2000/kpc2000/kp2000_module.c')
-rw-r--r--drivers/staging/kpc2000/kpc2000/kp2000_module.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/drivers/staging/kpc2000/kpc2000/kp2000_module.c b/drivers/staging/kpc2000/kpc2000/kp2000_module.c
new file mode 100644
index 000000000000..661b0b74ed66
--- /dev/null
+++ b/drivers/staging/kpc2000/kpc2000/kp2000_module.c
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: GPL-2.0+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/types.h>
+#include <linux/export.h>
+#include <linux/slab.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+#include <linux/io.h>
+#include <linux/mfd/core.h>
+#include <linux/platform_device.h>
+#include <linux/ioport.h>
+#include "pcie.h"
+
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Lee.Brooke@Daktronics.com, Matt.Sickler@Daktronics.com");
+MODULE_SOFTDEP("pre: uio post: kpc_nwl_dma kpc_i2c kpc_spi");
+
+struct class *kpc_uio_class;
+ATTRIBUTE_GROUPS(kpc_uio_class);
+
+static const struct pci_device_id kp2000_pci_device_ids[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_DAKTRONICS, PCI_DEVICE_ID_DAKTRONICS) },
+ { PCI_DEVICE(PCI_VENDOR_ID_DAKTRONICS, PCI_DEVICE_ID_DAKTRONICS_KADOKA_P2KR0) },
+ { 0, }
+};
+MODULE_DEVICE_TABLE(pci, kp2000_pci_device_ids);
+
+static struct pci_driver kp2000_driver_inst = {
+ .name = "kp2000_pcie",
+ .id_table = kp2000_pci_device_ids,
+ .probe = kp2000_pcie_probe,
+ .remove = kp2000_pcie_remove
+};
+
+
+static int __init kp2000_pcie_init(void)
+{
+ kpc_uio_class = class_create(THIS_MODULE, "kpc_uio");
+ if (IS_ERR(kpc_uio_class))
+ return PTR_ERR(kpc_uio_class);
+
+ kpc_uio_class->dev_groups = kpc_uio_class_groups;
+ return pci_register_driver(&kp2000_driver_inst);
+}
+module_init(kp2000_pcie_init);
+
+static void __exit kp2000_pcie_exit(void)
+{
+ pci_unregister_driver(&kp2000_driver_inst);
+ class_destroy(kpc_uio_class);
+}
+module_exit(kp2000_pcie_exit);