PATCH[1/3]: comedi : submissions of contec_fit.c driver to staging/comedi/drivers

2017-05-22 Thread Dan Naughton
Adding new driver to drivers/staging/comedi/drivers for contec_fit.c
for CONTEC F&eIT modules

Signed off by dan.naugh...@dtx.com

diff -ruN linux.bak/drivers/staging/comedi/drivers/contec_fit.c
linux/drivers/staging/comedi/drivers/contec_fit.c
--- linux.bak/drivers/staging/comedi/drivers/contec_fit.c
1969-12-31 18:00:00.0 -0600
+++ linux/drivers/staging/comedi/drivers/contec_fit.c2017-05-20
15:02:03.715167366 -0500
@@ -0,0 +1,908 @@
+/*
+comedi/drivers/contec_fit.c
+
+COMEDI - Linux Control and Measurement Device Interface
+Copyright (C) 2000 David A. Schleef 
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+/*
+Driver: contec_fit
+Description: Contec F&eIT series modules
+Devices: [Contec] DAI12-4(FIT)GY (contec_fit), ADI16-4(FIT)GY, DIO-8/8(FIT)GY
+Author: Contec Co., Ltd.
+Updated: Thu, 18 May 2017 14:30:00 +0900
+Status: works
+
+Configuration Options:
+  [0] - DeviceID of module (optional)
+  If DeviceID is not specified, DeviceID 0 will be used.
+*/
+
+#include 
+#include 
+#include "../comedidev.h"
+#include 
+
+typedef struct {
+struct task_struct *fit_kthread;
+} contec_fit_private;
+
+#define devpriv ((contec_fit_private *)dev->private)
+
+static int contec_attach(struct comedi_device * dev, struct
comedi_devconfig * it);
+static void contec_detach(struct comedi_device * dev);
+static struct comedi_driver driver_contec = {
+  .driver_name= "contec_fit",
+  .module= THIS_MODULE,
+  .attach= contec_attach,
+  .detach= contec_detach,
+};
+
+/* Classic digital IO */
+static int contec_ai_insn_read(struct comedi_device * dev, struct
comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data);
+static int contec_ao_insn_write(struct comedi_device * dev, struct
comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data);
+static int contec_di_insn_bits(struct comedi_device * dev, struct
comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data);
+static int contec_do_insn_bits(struct comedi_device * dev, struct
comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data);
+
+staticint contec_ai_cmdtest(struct comedi_device * dev, struct
comedi_subdevice * s, struct comedi_cmd * cmd);
+static int contec_ai_cmd(struct comedi_device * dev, struct
comedi_subdevice * s);
+static int contec_ai_sampling_thread(void * context_dev);
+static int contec_ai_cancel(struct comedi_device * dev, struct
comedi_subdevice * s);
+
+staticint contec_ao_cmdtest(struct comedi_device * dev, struct
comedi_subdevice * s, struct comedi_cmd * cmd);
+static int contec_ao_cmd(struct comedi_device * dev, struct
comedi_subdevice * s);
+static int contec_ao_sampling_thread(void * context_dev);
+static int contec_ao_cancel(struct comedi_device * dev, struct
comedi_subdevice * s);
+static int contec_ao_cmd_inttrig(struct comedi_device *dev, struct
comedi_subdevice *s, unsigned int trignum);
+
+static void contec_check_sampling_clock(unsigned int *sampling_clock,
unsigned int *channel_num, int flags);
+
+//START ADDRESS
+#define ADDRESS_BASE0x0800
+#define ADDRESS_PER_ID0x1000
+
+//CONTEC FIT SIZE
+#define CONTEC_FIT_SIZE0x20
+
+//COMMON IO
+#define IO_PRODUCT_CATEGORY0x00
+#define IO_PRODUCT_ID_NUMBER0x01
+#define IO_COMMAND_DATA0x18
+#define IO_SETUP_DATA00x1C
+#define IO_SETUP_DATA10x1D
+#define IO_SETUP_DATA20x1E
+#define IO_SETUP_DATA30x1F
+
+//DAI12-4(FIT)GY IO
+#define IO_DAI124_OUTPUTDATA_LOWER0x10
+#define IO_DAI124_OUTPUTDATA_UPPER0x11
+#define IO_DAI124_CHANNELDATA0x12
+#define IO_DAI124_STATUS0x16
+
+//ADI16-4(FIT)GY IO
+#define IO_ADI164_INPUTDATA_LOWER0x10
+#define IO_ADI164_INPUTDATA_UPPER0x11
+#define IO_ADI164_CHANNELDATA0x12
+#define IO_ADI164_STATUS00x16
+#define IO_ADI164_STATUS10x17
+
+//DIO-8/8(FIT)GY IO
+#define IO_DIO88_INPUT00x10
+#define IO_DIO88_OUTPUT00x14
+
+//DAI12-4(FIT)GY COMMAND
+#define COMMAND_DAI124_INIT0x00

PATCH[2/3]: comedi : modify Kconfig to include contec_fit.c driver in staging/comedi

2017-05-22 Thread Dan Naughton
Modified Kconfig in drivers/staging/comedi to include contec_fit.c

Signed off by dan.naugh...@dtx.com

diff -ruN linux.bak/drivers/staging/comedi/Kconfig
linux/drivers/staging/comedi/Kconfig
--- linux.bak/drivers/staging/comedi/Kconfig2017-05-05
10:16:32.948968889 -0500
+++ linux/drivers/staging/comedi/Kconfig2017-05-20 16:06:32.704221635 -0500
@@ -847,6 +847,15 @@
   To compile this driver as a module, choose M here: the module will be
   called contec_pci_dio.

+config COMEDI_CONTEC_FIT
+tristate "CONTEC FeIT modules"
+---help---
+Enable support for CONTEC FeIT modules
+
+To compile this driver as a module, chose M here: the module will be
+called contec_fit
+
+
 config COMEDI_DAS08_PCI
 tristate "DAS-08 PCI support"
 select COMEDI_DAS08
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


PATCH[3/3]: comedi : modify Makefile to include contec_fit.c driver in staging/comedi/drivers

2017-05-22 Thread Dan Naughton
modified Makefile in /drivers/staging/comedi/drivers to include
contec_fit.c module


Signed off by dan.naugh...@dtx.com

diff -ruN linux.bak/drivers/staging/comedi/drivers/Makefile
linux/drivers/staging/comedi/drivers/Makefile
--- linux.bak/drivers/staging/comedi/drivers/Makefile2017-05-05
10:09:26.246553440 -0500
+++ linux/drivers/staging/comedi/drivers/Makefile2017-05-20
16:34:34.707081106 -0500
@@ -89,6 +89,7 @@
 obj-$(CONFIG_COMEDI_AMPLC_PCI224)+= amplc_pci224.o
 obj-$(CONFIG_COMEDI_AMPLC_PCI230)+= amplc_pci230.o
 obj-$(CONFIG_COMEDI_CONTEC_PCI_DIO)+= contec_pci_dio.o
+obj-$(CONFIG_COMEDI_CONTEC_FIT)+= contec_fit.o
 obj-$(CONFIG_COMEDI_DAS08_PCI)+= das08_pci.o
 obj-$(CONFIG_COMEDI_DT3000)+= dt3000.o
 obj-$(CONFIG_COMEDI_DYNA_PCI10XX)+= dyna_pci10xx.o
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


comedi contec_fit.c patch - please disregard - I will resend

2017-05-22 Thread Dan Naughton
Please disregard the last patch submissions [3] for including the
contec_fit.c driver.  The line wrapping was incorrect, and the patch
should be a single patch - not three - to add the driver.

Sorry for the mistake.

Dan
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel