mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chase Southwood <chase.southwood@gmail.com>
To: gregkh@linuxfoundation.org
Cc: abbotti@mev.co.uk, hsweeten@visionengravers.com,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Chase Southwood <chase.southwood@gmail.com>
Subject: [PATCH 4/6] staging: comedi: addi_apci_1564: add a subdevice for Change-of-State interrupt support
Date: Thu, 29 May 2014 23:43:15 -0500	[thread overview]
Message-ID: <1401424995-22375-1-git-send-email-chase.southwood@gmail.com> (raw)
In-Reply-To: <1401424853-21683-1-git-send-email-chase.southwood@gmail.com>

This board supports an interrupt that can be generated by an AND/OR
combination of 16 of the input channels.

Create a separate subdevice to handle this interrupt.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/drivers/addi_apci_1564.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c
index 5901143..183fdc3 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -105,7 +105,7 @@ static int apci1564_auto_attach(struct comedi_device *dev,
 			dev->irq = pcidev->irq;
 	}
 
-	ret = comedi_alloc_subdevices(dev, 3);
+	ret = comedi_alloc_subdevices(dev, 4);
 	if (ret)
 		return ret;
 
@@ -144,6 +144,20 @@ static int apci1564_auto_attach(struct comedi_device *dev,
 	s->insn_read = apci1564_timer_read;
 	s->insn_config = apci1564_timer_config;
 
+	/* Change-Of-State (COS) interrupt subdevice */
+	s = &dev->subdevices[3];
+	if (dev->irq) {
+		dev->read_subdev = s;
+		s->type = COMEDI_SUBD_DI;
+		s->subdev_flags = SDF_READABLE | SDF_CMD_READ;
+		s->n_chan = 1;
+		s->maxdata = 1;
+		s->range_table = &range_digital;
+		s->len_chanlist = 1;
+	} else {
+		s->type = COMEDI_SUBD_UNUSED;
+	}
+
 	return 0;
 }
 
-- 
1.9.3


  parent reply	other threads:[~2014-05-30  4:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-30  4:40 [PATCH 0/6] staging: comedi: addi_apci_1564: fix Change-of-State interrupt functionality Chase Southwood
2014-05-30  4:41 ` [PATCH 1/6] staging: comedi: addi_apci_1564: remove send_sig() use Chase Southwood
2014-05-30 16:37   ` Hartley Sweeten
2014-06-18 22:07   ` Greg KH
2014-05-30  4:42 ` [PATCH 2/6] staging: comedi: addi_apci_1564: remove use of devpriv->b_OutputMemoryStatus Chase Southwood
2014-05-30 16:38   ` Hartley Sweeten
2014-05-30  4:42 ` [PATCH 3/6] staging: comedi: addi_apci_1564: introduce apci1564_private struct Chase Southwood
2014-05-30 16:44   ` Hartley Sweeten
2014-05-30  4:43 ` Chase Southwood [this message]
2014-05-30 16:49   ` [PATCH 4/6] staging: comedi: addi_apci_1564: add a subdevice for Change-of-State interrupt support Hartley Sweeten
2014-05-30  4:43 ` [PATCH 5/6] staging: comedi: addi_apci_1564: hook-up the interrupt subdevice Chase Southwood
2014-05-30 16:57   ` Hartley Sweeten
2014-05-30  4:43 ` [PATCH 6/6] staging: comedi: addi_apci_1564: cleanup v_ADDI_Interrupt() Chase Southwood
2014-05-30 17:26   ` Hartley Sweeten
2014-06-02  3:52     ` Chase Southwood
2014-05-30  7:45 ` [PATCH 0/6] staging: comedi: addi_apci_1564: fix Change-of-State interrupt functionality Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401424995-22375-1-git-send-email-chase.southwood@gmail.com \
    --to=chase.southwood@gmail.com \
    --cc=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®