2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-01 18:24:23 +08:00
linux-next/drivers/staging/comedi
Ian Abbott 6192756574 staging: comedi: skel: do auto-attachment of PCI devices
This driver is an example of how to write a Comedi driver and includes
some code for handling PCI devices, but not very much.  It calls
`comedi_pci_auto_config()` at PCI probe time.  That normally expects to
call the comedi driver's `auto_attach()` hook (or the deprecated
`attach_pci()` hook), but will fall back to using the `attach()` hook
that should only be used for attaching devices "manually" via the
`COMEDI_DEVCONFIG` ioctl.

Add an `auto_attach()` hook (`skel_auto_attach()`) to handle
auto-attachment of supported PCI devices.  Add comments to the
`attach()` hook (`skel_attach()`) to indicate that it shouldn't
generally allow PCI devices to be attached that way (and probably isn't
needed at all for PCI-only Comedi drivers).  Add code to the `detach()`
hook (`skel_detach()`) to disable PCI devices enabled by the
`auto_attach()` hook.

`skel_auto_attach()` calls new function `skel_find_pci_board()` to find
a matching element in `skel_boards[]`.  PCI device ID information has
been added to `skel_boards[]` to give the function something to look
for.

Remove the `pci_dev` member of `struct skel_private` as drivers now use
the `hw_dev` member of `struct comedi_device` to get at the PCI device.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-01 08:46:02 -07:00
..
drivers staging: comedi: skel: do auto-attachment of PCI devices 2012-11-01 08:46:02 -07:00
kcomedilib staging/comedi: Use dev_ printks in kcomedilib/kcomedilib_main.c 2012-10-22 12:47:56 -07:00
comedi_compat32.c staging: comedi: shrink comedi_compat32.h 2012-06-20 12:57:43 -07:00
comedi_compat32.h staging: comedi: shrink comedi_compat32.h 2012-06-20 12:57:43 -07:00
comedi_fops.c staging: comedi: fix memory leak for saved channel list 2012-09-21 09:29:53 -07:00
comedi_internal.h staging: comedi: remove comedi_fops.h 2012-06-20 12:56:55 -07:00
comedi.h staging: comedi: comedi.h: add clock sources for amplc_dio200 timer 2012-10-24 15:25:22 -07:00
comedidev.h staging: comedi: add comedi to usb interface helper 2012-10-29 15:02:08 -07:00
comedilib.h
drivers.c staging: comedi: support auto_attach() for PCI and USB 2012-10-29 15:02:08 -07:00
Kconfig staging: comedi: Kconfig: update COMEDI_AMPLC_DIO200_PCI option 2012-10-24 15:25:23 -07:00
Makefile Staging: comedi: Makefile: replace the use of <module>-objs with <module>-y 2010-10-08 07:23:52 -07:00
proc.c staging: comedi: remove comedi_fops.h 2012-06-20 12:56:55 -07:00
range.c staging: comedi: range: remove subdevice pointer math 2012-09-05 20:06:32 -07:00
TODO Staging: comedi: Remove typedefs 2010-06-17 13:49:07 -07:00