comedi: Move the main COMEDI headers

Move the main COMEDI driver headers out of "drivers/comedi/" into new
directory "include/linux/comedi/".  These are "comedidev.h",
"comedilib.h", "comedi_pci.h", "comedi_pcmcia.h", and "comedi_usb.h".
Additionally, move the user-space API header "comedi.h" into
"include/uapi/linux/" and add "WITH Linux-syscall-note" to its
SPDX-License-Identifier.

Update the "COMEDI DRIVERS" section of the MAINTAINERS file to account
for these changes.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20211117120604.117740-2-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ian Abbott
2021-11-17 12:05:59 +00:00
committed by Greg Kroah-Hartman
parent b4c80629c5
commit df0e68c1e9
146 changed files with 150 additions and 252 deletions

View File

@@ -0,0 +1,56 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* comedi_pci.h
* header file for Comedi PCI drivers
*
* COMEDI - Linux Control and Measurement Device Interface
* Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
*/
#ifndef _COMEDI_PCI_H
#define _COMEDI_PCI_H
#include <linux/pci.h>
#include <linux/comedi/comedidev.h>
/*
* PCI Vendor IDs not in <linux/pci_ids.h>
*/
#define PCI_VENDOR_ID_KOLTER 0x1001
#define PCI_VENDOR_ID_ICP 0x104c
#define PCI_VENDOR_ID_DT 0x1116
#define PCI_VENDOR_ID_IOTECH 0x1616
#define PCI_VENDOR_ID_CONTEC 0x1221
#define PCI_VENDOR_ID_RTD 0x1435
#define PCI_VENDOR_ID_HUMUSOFT 0x186c
struct pci_dev *comedi_to_pci_dev(struct comedi_device *dev);
int comedi_pci_enable(struct comedi_device *dev);
void comedi_pci_disable(struct comedi_device *dev);
void comedi_pci_detach(struct comedi_device *dev);
int comedi_pci_auto_config(struct pci_dev *pcidev, struct comedi_driver *driver,
unsigned long context);
void comedi_pci_auto_unconfig(struct pci_dev *pcidev);
int comedi_pci_driver_register(struct comedi_driver *comedi_driver,
struct pci_driver *pci_driver);
void comedi_pci_driver_unregister(struct comedi_driver *comedi_driver,
struct pci_driver *pci_driver);
/**
* module_comedi_pci_driver() - Helper macro for registering a comedi PCI driver
* @__comedi_driver: comedi_driver struct
* @__pci_driver: pci_driver struct
*
* Helper macro for comedi PCI drivers which do not do anything special
* in module init/exit. This eliminates a lot of boilerplate. Each
* module may only use this macro once, and calling it replaces
* module_init() and module_exit()
*/
#define module_comedi_pci_driver(__comedi_driver, __pci_driver) \
module_driver(__comedi_driver, comedi_pci_driver_register, \
comedi_pci_driver_unregister, &(__pci_driver))
#endif /* _COMEDI_PCI_H */

View File

@@ -0,0 +1,48 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* comedi_pcmcia.h
* header file for Comedi PCMCIA drivers
*
* COMEDI - Linux Control and Measurement Device Interface
* Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
*/
#ifndef _COMEDI_PCMCIA_H
#define _COMEDI_PCMCIA_H
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
#include <linux/comedi/comedidev.h>
struct pcmcia_device *comedi_to_pcmcia_dev(struct comedi_device *dev);
int comedi_pcmcia_enable(struct comedi_device *dev,
int (*conf_check)(struct pcmcia_device *p_dev,
void *priv_data));
void comedi_pcmcia_disable(struct comedi_device *dev);
int comedi_pcmcia_auto_config(struct pcmcia_device *link,
struct comedi_driver *driver);
void comedi_pcmcia_auto_unconfig(struct pcmcia_device *link);
int comedi_pcmcia_driver_register(struct comedi_driver *comedi_driver,
struct pcmcia_driver *pcmcia_driver);
void comedi_pcmcia_driver_unregister(struct comedi_driver *comedi_driver,
struct pcmcia_driver *pcmcia_driver);
/**
* module_comedi_pcmcia_driver() - Helper macro for registering a comedi
* PCMCIA driver
* @__comedi_driver: comedi_driver struct
* @__pcmcia_driver: pcmcia_driver struct
*
* Helper macro for comedi PCMCIA drivers which do not do anything special
* in module init/exit. This eliminates a lot of boilerplate. Each
* module may only use this macro once, and calling it replaces
* module_init() and module_exit()
*/
#define module_comedi_pcmcia_driver(__comedi_driver, __pcmcia_driver) \
module_driver(__comedi_driver, comedi_pcmcia_driver_register, \
comedi_pcmcia_driver_unregister, &(__pcmcia_driver))
#endif /* _COMEDI_PCMCIA_H */

View File

@@ -0,0 +1,41 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/* comedi_usb.h
* header file for USB Comedi drivers
*
* COMEDI - Linux Control and Measurement Device Interface
* Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
*/
#ifndef _COMEDI_USB_H
#define _COMEDI_USB_H
#include <linux/usb.h>
#include <linux/comedi/comedidev.h>
struct usb_interface *comedi_to_usb_interface(struct comedi_device *dev);
struct usb_device *comedi_to_usb_dev(struct comedi_device *dev);
int comedi_usb_auto_config(struct usb_interface *intf,
struct comedi_driver *driver, unsigned long context);
void comedi_usb_auto_unconfig(struct usb_interface *intf);
int comedi_usb_driver_register(struct comedi_driver *comedi_driver,
struct usb_driver *usb_driver);
void comedi_usb_driver_unregister(struct comedi_driver *comedi_driver,
struct usb_driver *usb_driver);
/**
* module_comedi_usb_driver() - Helper macro for registering a comedi USB driver
* @__comedi_driver: comedi_driver struct
* @__usb_driver: usb_driver struct
*
* Helper macro for comedi USB drivers which do not do anything special
* in module init/exit. This eliminates a lot of boilerplate. Each
* module may only use this macro once, and calling it replaces
* module_init() and module_exit()
*/
#define module_comedi_usb_driver(__comedi_driver, __usb_driver) \
module_driver(__comedi_driver, comedi_usb_driver_register, \
comedi_usb_driver_unregister, &(__usb_driver))
#endif /* _COMEDI_USB_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* comedilib.h
* Header file for kcomedilib
*
* COMEDI - Linux Control and Measurement Device Interface
* Copyright (C) 1998-2001 David A. Schleef <ds@schleef.org>
*/
#ifndef _LINUX_COMEDILIB_H
#define _LINUX_COMEDILIB_H
struct comedi_device *comedi_open(const char *path);
int comedi_close(struct comedi_device *dev);
int comedi_dio_get_config(struct comedi_device *dev, unsigned int subdev,
unsigned int chan, unsigned int *io);
int comedi_dio_config(struct comedi_device *dev, unsigned int subdev,
unsigned int chan, unsigned int io);
int comedi_dio_bitfield2(struct comedi_device *dev, unsigned int subdev,
unsigned int mask, unsigned int *bits,
unsigned int base_channel);
int comedi_find_subdevice_by_type(struct comedi_device *dev, int type,
unsigned int subd);
int comedi_get_n_channels(struct comedi_device *dev, unsigned int subdevice);
#endif