diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-05 14:50:51 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-05 14:50:51 -0700 |
commit | 41844e36206be90cd4d962ea49b0abc3612a99d0 (patch) | |
tree | ce0b3a3403bc6abdb28f52779d0d7b57a51a5c86 /drivers/staging/comedi/drivers/addi_apci_3501.c | |
parent | 5691f0e9a3e7855832d5fd094801bf600347c2d0 (diff) | |
parent | fc1e2c8ea85e109acf09e74789e9b852f6eed251 (diff) |
Merge tag 'staging-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging and IIO updates from Greg KH:
"Here is the big staging and IIO driver pull request for 4.9-rc1.
There are a lot of patches in here, the majority due to the
drivers/staging/greybus/ subsystem being merged in with full
development history that went back a few years, in order to preserve
the work that those developers did over time.
Lots and lots of tiny cleanups happened in the tree as well, due to
the Outreachy application process and lots of other developers showing
up for the first time to clean code up. Along with those changes, we
deleted a wireless driver, and added a raspberrypi driver (currently
marked broken), and lots of new iio drivers.
Overall the tree still shrunk with more lines removed than added,
about 10 thousand lines removed in total. Full details are in the very
long shortlog below.
All of this has been in the linux-next tree with no issues. There will
be some merge problems with other subsystem trees, but those are all
minor problems and shouldn't be hard to work out when they happen
(MAINTAINERS and some lustre build problems with the IB tree)"
And furter from me asking for clarification about greybus:
"Right now there is a phone from Motorola shipping with this code (a
slightly older version, but the same tree), so even though Ara is not
alive in the same form, the functionality is happening. We are working
with the developers of that phone to merge the newer stuff in with
their fork so they can use the upstream version in future versions of
their phone product line.
Toshiba has at least one chip shipping in their catalog that
needs/uses this protocol over a Unipro link, and rumor has it that
there might be more in the future.
There are also other users of the greybus protocols, there is a talk
next week at ELC that shows how it is being used across a network
connection to control a device, and previous ELC talks have showed the
protocol stack being used over USB to drive embedded Linux boards.
I've also talked to some people who are starting to work to add a host
controller driver to control arduinos as the greybus PHY protocols are
very useful to control a serial/i2c/spio/whatever device across a
random physical link, as it is a way to have a self-describing device
be attached to a host without needing manual configuration.
So yes, people are using it, and there is still the chance that it
will show up in a phone/laptop/tablet/whatever from Google in the
future as well, the tech isn't dead, even if the original large phone
project happens to be"
* tag 'staging-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (3703 commits)
Staging: fbtft: Fix bug in fbtft-core
staging: rtl8188eu: fix double unlock error in rtw_resume_process()
staging:r8188eu: remove GEN_MLME_EXT_HANDLER macro
staging:r8188eu: remove GEN_DRV_CMD_HANDLER macro
staging:r8188eu: remove GEN_EVT_CODE macro
staging:r8188eu: remove GEN_CMD_CODE macro
staging:r8188eu: remove pkt_newalloc member of the recv_buf structure
staging:r8188eu: remove rtw_handle_dualmac declaration
staging:r8188eu: remove (RGTRY|BSSID)_(OFT|SZ) macros
staging:r8188eu: change rtl8188e_process_phy_info function argument type
Staging: fsl-mc: Remove blank lines
Staging: fsl-mc: Fix unaligned * in block comments
Staging: comedi: Align the * in block comments
Staging : ks7010 : Fix block comments warninig
Staging: vt6655: Remove explicit NULL comparison using Coccinelle
staging: rtl8188eu: core: rtw_xmit: Use macros instead of constants
staging: rtl8188eu: core: rtw_xmit: Move constant of the right side
staging: dgnc: Fix lines longer than 80 characters
Staging: dgnc: constify attribute_group structures
Staging: most: hdm-dim2: constify attribute_group structures
...
Diffstat (limited to 'drivers/staging/comedi/drivers/addi_apci_3501.c')
-rw-r--r-- | drivers/staging/comedi/drivers/addi_apci_3501.c | 85 |
1 files changed, 29 insertions, 56 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_3501.c b/drivers/staging/comedi/drivers/addi_apci_3501.c index 40ff91411139..57f0f46de0be 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3501.c +++ b/drivers/staging/comedi/drivers/addi_apci_3501.c @@ -22,12 +22,36 @@ * more details. */ +/* + * Driver: addi_apci_3501 + * Description: ADDI-DATA APCI-3501 Analog output board + * Devices: [ADDI-DATA] APCI-3501 (addi_apci_3501) + * Author: H Hartley Sweeten <hsweeten@visionengravers.com> + * Updated: Mon, 20 Jun 2016 10:57:01 -0700 + * Status: untested + * + * Configuration Options: not applicable, uses comedi PCI auto config + * + * This board has the following features: + * - 4 or 8 analog output channels + * - 2 optically isolated digital inputs + * - 2 optically isolated digital outputs + * - 1 12-bit watchdog/timer + * + * There are 2 versions of the APCI-3501: + * - APCI-3501-4 4 analog output channels + * - APCI-3501-8 8 analog output channels + * + * These boards use the same PCI Vendor/Device IDs. The number of output + * channels used by this driver is determined by reading the EEPROM on + * the board. + * + * The watchdog/timer subdevice is not currently supported. + */ + #include <linux/module.h> -#include <linux/interrupt.h> -#include <linux/sched.h> #include "../comedi_pci.h" -#include "addi_tcw.h" #include "amcc_s5933.h" /* @@ -67,8 +91,6 @@ struct apci3501_private { unsigned long amcc; - unsigned long tcw; - struct task_struct *tsk_Current; unsigned char timer_mode; }; @@ -139,8 +161,6 @@ static int apci3501_ao_insn_write(struct comedi_device *dev, return insn->n; } -#include "addi-data/hwdrv_apci3501.c" - static int apci3501_di_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, @@ -253,37 +273,6 @@ static int apci3501_eeprom_insn_read(struct comedi_device *dev, return insn->n; } -static irqreturn_t apci3501_interrupt(int irq, void *d) -{ - struct comedi_device *dev = d; - struct apci3501_private *devpriv = dev->private; - unsigned int status; - unsigned int ctrl; - - /* Disable Interrupt */ - ctrl = inl(devpriv->tcw + ADDI_TCW_CTRL_REG); - ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG | - ADDI_TCW_CTRL_IRQ_ENA); - outl(ctrl, devpriv->tcw + ADDI_TCW_CTRL_REG); - - status = inl(devpriv->tcw + ADDI_TCW_IRQ_REG); - if (!(status & ADDI_TCW_IRQ)) { - dev_err(dev->class_dev, "IRQ from unknown source\n"); - return IRQ_NONE; - } - - /* Enable Interrupt Send a signal to from kernel to user space */ - send_sig(SIGIO, devpriv->tsk_Current, 0); - ctrl = inl(devpriv->tcw + ADDI_TCW_CTRL_REG); - ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG | - ADDI_TCW_CTRL_IRQ_ENA); - ctrl |= ADDI_TCW_CTRL_IRQ_ENA; - outl(ctrl, devpriv->tcw + ADDI_TCW_CTRL_REG); - inl(devpriv->tcw + ADDI_TCW_STATUS_REG); - - return IRQ_HANDLED; -} - static int apci3501_reset(struct comedi_device *dev) { unsigned int val; @@ -333,17 +322,9 @@ static int apci3501_auto_attach(struct comedi_device *dev, devpriv->amcc = pci_resource_start(pcidev, 0); dev->iobase = pci_resource_start(pcidev, 1); - devpriv->tcw = dev->iobase + APCI3501_TIMER_BASE; ao_n_chan = apci3501_eeprom_get_ao_n_chan(dev); - if (pcidev->irq > 0) { - ret = request_irq(pcidev->irq, apci3501_interrupt, IRQF_SHARED, - dev->board_name, dev); - if (ret == 0) - dev->irq = pcidev->irq; - } - ret = comedi_alloc_subdevices(dev, 5); if (ret) return ret; @@ -383,17 +364,9 @@ static int apci3501_auto_attach(struct comedi_device *dev, s->range_table = &range_digital; s->insn_bits = apci3501_do_insn_bits; - /* Initialize the timer/watchdog subdevice */ + /* Timer/Watchdog subdevice */ s = &dev->subdevices[3]; - s->type = COMEDI_SUBD_TIMER; - s->subdev_flags = SDF_WRITABLE; - s->n_chan = 1; - s->maxdata = 0; - s->len_chanlist = 1; - s->range_table = &range_digital; - s->insn_write = apci3501_write_insn_timer; - s->insn_read = apci3501_read_insn_timer; - s->insn_config = apci3501_config_insn_timer; + s->type = COMEDI_SUBD_UNUSED; /* Initialize the eeprom subdevice */ s = &dev->subdevices[4]; |