Skip to content

Commit

Permalink
staging: kpc2000: add initial set of Daktronics drivers
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Apr 20, 2019
1 parent f59232a commit 7dc7967
Show file tree
Hide file tree
Showing 20 changed files with 2,793 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,6 @@ source "drivers/staging/erofs/Kconfig"

source "drivers/staging/fieldbus/Kconfig"

source "drivers/staging/kpc2000/Kconfig"

endif # STAGING
1 change: 1 addition & 0 deletions drivers/staging/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ obj-$(CONFIG_STAGING_GASKET_FRAMEWORK) += gasket/
obj-$(CONFIG_XIL_AXIS_FIFO) += axis-fifo/
obj-$(CONFIG_EROFS_FS) += erofs/
obj-$(CONFIG_FIELDBUS_DEV) += fieldbus/
obj-$(CONFIG_KPC2000) += kpc2000/
46 changes: 46 additions & 0 deletions drivers/staging/kpc2000/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SPDX-License-Identifier: GPL-2.0

config KPC2000
bool "Daktronics KPC Device support"
depends on PCI
help
Select this if you wish to use the Daktronics KPC PCI devices

If unsure, say N.

config KPC2000_CORE
tristate "Daktronics KPC PCI UIO device"
depends on KPC2000
help
Say Y here if you wish to support the Daktronics KPC PCI
device in UIO mode.

To compile this driver as a module, choose M here: the module
will be called kpc2000

If unsure, say N.

config KPC2000_SPI
tristate "Kaktronics KPC SPI device"
depends on KPC2000 && SPI
help
Say Y here if you wish to support the Daktronics KPC PCI
device in SPI mode.

To compile this driver as a module, choose M here: the module
will be called kpc2000_spi

If unsure, say N.

config KPC2000_I2C
tristate "Kaktronics KPC I2C device"
depends on KPC2000 && I2C
help
Say Y here if you wish to support the Daktronics KPC PCI
device in I2C mode.

To compile this driver as a module, choose M here: the module
will be called kpc2000_i2c

If unsure, say N.

5 changes: 5 additions & 0 deletions drivers/staging/kpc2000/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: GPL-2.0

obj-$(CONFIG_KPC2000) += kpc2000/
obj-$(CONFIG_KPC2000_I2C) += kpc_i2c/
obj-$(CONFIG_KPC2000_SPI) += kpc_spi/
8 changes: 8 additions & 0 deletions drivers/staging/kpc2000/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- the kpc_spi driver doesn't seem to let multiple transactions (to different instances of the core) happen in parallel...
- The kpc_i2c driver is a hot mess, it should probably be cleaned up a ton. It functions against current hardware though.
- pcard->card_num in kp2000_pcie_probe() is a global variable and needs atomic / locking / something better.
- probe_core_uio() probably needs error handling
- the loop in kp2000_probe_cores() that uses probe_core_uio() also probably needs error handling
- would be nice if the AIO fileops in kpc_dma could be made to work
- probably want to add a CONFIG_ option to control compilation of the AIO functions
- if the AIO fileops in kpc_dma start working, next would be making iov_count > 1 work too
23 changes: 23 additions & 0 deletions drivers/staging/kpc2000/kpc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* SPDX-License-Identifier: GPL-2.0+ */
#ifndef KPC_H_
#define KPC_H_

/* ***** Driver Names ***** */
#define KP_DRIVER_NAME_KP2000 "kp2000"
#define KP_DRIVER_NAME_INVALID "kpc_invalid"
#define KP_DRIVER_NAME_DMA_CONTROLLER "kpc_nwl_dma"
#define KP_DRIVER_NAME_UIO "uio_pdrv_genirq"
#define KP_DRIVER_NAME_I2C "kpc_i2c"
#define KP_DRIVER_NAME_SPI "kpc_spi"

struct kpc_core_device_platdata {
u32 card_id;
u32 build_version;
u32 hardware_revision;
u64 ssid;
u64 ddna;
};

#define PCI_DEVICE_ID_DAKTRONICS_KADOKA_P2KR0 0x4b03

#endif /* KPC_H_ */
4 changes: 4 additions & 0 deletions drivers/staging/kpc2000/kpc2000/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: GPL-2.0

obj-m := kpc2000.o
kpc2000-objs += kp2000_module.o core.o cell_probe.o fileops.o
Loading

0 comments on commit 7dc7967

Please sign in to comment.