diff options
author | Spencer E. Olson <olsonse@umich.edu> | 2018-09-19 10:51:05 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-09 15:27:47 +0200 |
commit | 3ad53c40902005c50122be34e2b60dd763314180 (patch) | |
tree | 7004ce13f2e2e62631d0d236af8f4d789030c70a /drivers | |
parent | 51fd3673838396844f15de0e906be5333bfbbc8d (diff) | |
download | linux-3ad53c40902005c50122be34e2b60dd763314180.tar.bz2 |
staging: comedi: ni_pcidio: implement INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS
Adds implementation of the new INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS
instruction. This patch also adds data for this implementation, based on
spec sheets from NI.
Signed-off-by: Spencer E. Olson <olsonse@umich.edu>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_pcidio.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c b/drivers/staging/comedi/drivers/ni_pcidio.c index 6692af5ff79b..b9a0dc6eac44 100644 --- a/drivers/staging/comedi/drivers/ni_pcidio.c +++ b/drivers/staging/comedi/drivers/ni_pcidio.c @@ -260,18 +260,22 @@ enum nidio_boardid { struct nidio_board { const char *name; unsigned int uses_firmware:1; + unsigned int dio_speed; }; static const struct nidio_board nidio_boards[] = { [BOARD_PCIDIO_32HS] = { .name = "pci-dio-32hs", + .dio_speed = 50, }, [BOARD_PXI6533] = { .name = "pxi-6533", + .dio_speed = 50, }, [BOARD_PCI6534] = { .name = "pci-6534", .uses_firmware = 1, + .dio_speed = 50, }, }; @@ -467,6 +471,15 @@ static int ni_pcidio_insn_config(struct comedi_device *dev, { int ret; + if (data[0] == INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS) { + const struct nidio_board *board = dev->board_ptr; + + /* we don't care about actual channels */ + data[1] = board->dio_speed; + data[2] = 0; + return 0; + } + ret = comedi_dio_insn_config(dev, s, insn, data, 0); if (ret) return ret; |