-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Greg Kroah-Hartman
committed
Apr 20, 2019
1 parent
f59232a
commit 7dc7967
Showing
20 changed files
with
2,793 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.