From: Ian Abbott <abbotti@mev.co.uk> To: driverdev-devel@linuxdriverproject.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Ian Abbott <abbotti@mev.co.uk>, H Hartley Sweeten <hartleys@visionengravers.com>, linux-kernel@vger.kernel.org Subject: [PATCH 12/28] staging: comedi: amplc_pci230: remove ao_chans member Date: Mon, 1 Sep 2014 12:03:44 +0100 [thread overview] Message-ID: <1409569440-10979-13-git-send-email-abbotti@mev.co.uk> (raw) In-Reply-To: <1409569440-10979-1-git-send-email-abbotti@mev.co.uk> The PCI230(+) has an AO subdevice with 2 channels, but the PCI260(+) has none. The `ao_chans` member of `struct pci230_board` indicates whether the board has an AO subdevice and the number of AO channels. The `ao_bits` member indicates the AO sample width in bits and will only be non-zero for boards with an AO subdevice. Use `ao_bits` to indicate whether the board has an AO subdevice. If it has, assume the the number of AO channels is 2. Then the `ao_chans` member becomes redundant and can be removed. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> --- drivers/staging/comedi/drivers/amplc_pci230.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/staging/comedi/drivers/amplc_pci230.c index 42a79d2..75b0e79 100644 --- a/drivers/staging/comedi/drivers/amplc_pci230.c +++ b/drivers/staging/comedi/drivers/amplc_pci230.c @@ -455,7 +455,6 @@ struct pci230_board { const char *name; unsigned short id; int ai_bits; - int ao_chans; int ao_bits; int have_dio; unsigned int min_hwver; /* Minimum hardware version supported. */ @@ -466,7 +465,6 @@ static const struct pci230_board pci230_boards[] = { .name = "pci230+", .id = PCI_DEVICE_ID_PCI230, .ai_bits = 16, - .ao_chans = 2, .ao_bits = 12, .have_dio = 1, .min_hwver = 1, @@ -481,7 +479,6 @@ static const struct pci230_board pci230_boards[] = { .name = "pci230", .id = PCI_DEVICE_ID_PCI230, .ai_bits = 12, - .ao_chans = 2, .ao_bits = 12, .have_dio = 1, }, @@ -2609,7 +2606,7 @@ static int pci230_auto_attach(struct comedi_device *dev, */ extfunc |= PCI230P_EXTFUNC_GAT_EXTTRIG; } - if (thisboard->ao_chans > 0 && devpriv->hwver >= 2) { + if (thisboard->ao_bits && devpriv->hwver >= 2) { /* Enable DAC FIFO functionality. */ extfunc |= PCI230P2_EXTFUNC_DACFIFO; } @@ -2670,15 +2667,15 @@ static int pci230_auto_attach(struct comedi_device *dev, s = &dev->subdevices[1]; /* analog output subdevice */ - if (thisboard->ao_chans > 0) { + if (thisboard->ao_bits) { s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITABLE | SDF_GROUND; - s->n_chan = thisboard->ao_chans; + s->n_chan = 2; s->maxdata = (1 << thisboard->ao_bits) - 1; s->range_table = &pci230_ao_range; s->insn_write = pci230_ao_insn_write; s->insn_read = comedi_readback_insn_read; - s->len_chanlist = thisboard->ao_chans; + s->len_chanlist = 2; if (dev->irq) { dev->write_subdev = s; s->subdev_flags |= SDF_CMD_WRITE; -- 2.0.4
WARNING: multiple messages have this Message-ID (diff)
From: Ian Abbott <abbotti@mev.co.uk> To: driverdev-devel@linuxdriverproject.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Ian Abbott <abbotti@mev.co.uk>, linux-kernel@vger.kernel.org Subject: [PATCH 12/28] staging: comedi: amplc_pci230: remove ao_chans member Date: Mon, 1 Sep 2014 12:03:44 +0100 [thread overview] Message-ID: <1409569440-10979-13-git-send-email-abbotti@mev.co.uk> (raw) In-Reply-To: <1409569440-10979-1-git-send-email-abbotti@mev.co.uk> The PCI230(+) has an AO subdevice with 2 channels, but the PCI260(+) has none. The `ao_chans` member of `struct pci230_board` indicates whether the board has an AO subdevice and the number of AO channels. The `ao_bits` member indicates the AO sample width in bits and will only be non-zero for boards with an AO subdevice. Use `ao_bits` to indicate whether the board has an AO subdevice. If it has, assume the the number of AO channels is 2. Then the `ao_chans` member becomes redundant and can be removed. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> --- drivers/staging/comedi/drivers/amplc_pci230.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/staging/comedi/drivers/amplc_pci230.c index 42a79d2..75b0e79 100644 --- a/drivers/staging/comedi/drivers/amplc_pci230.c +++ b/drivers/staging/comedi/drivers/amplc_pci230.c @@ -455,7 +455,6 @@ struct pci230_board { const char *name; unsigned short id; int ai_bits; - int ao_chans; int ao_bits; int have_dio; unsigned int min_hwver; /* Minimum hardware version supported. */ @@ -466,7 +465,6 @@ static const struct pci230_board pci230_boards[] = { .name = "pci230+", .id = PCI_DEVICE_ID_PCI230, .ai_bits = 16, - .ao_chans = 2, .ao_bits = 12, .have_dio = 1, .min_hwver = 1, @@ -481,7 +479,6 @@ static const struct pci230_board pci230_boards[] = { .name = "pci230", .id = PCI_DEVICE_ID_PCI230, .ai_bits = 12, - .ao_chans = 2, .ao_bits = 12, .have_dio = 1, }, @@ -2609,7 +2606,7 @@ static int pci230_auto_attach(struct comedi_device *dev, */ extfunc |= PCI230P_EXTFUNC_GAT_EXTTRIG; } - if (thisboard->ao_chans > 0 && devpriv->hwver >= 2) { + if (thisboard->ao_bits && devpriv->hwver >= 2) { /* Enable DAC FIFO functionality. */ extfunc |= PCI230P2_EXTFUNC_DACFIFO; } @@ -2670,15 +2667,15 @@ static int pci230_auto_attach(struct comedi_device *dev, s = &dev->subdevices[1]; /* analog output subdevice */ - if (thisboard->ao_chans > 0) { + if (thisboard->ao_bits) { s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITABLE | SDF_GROUND; - s->n_chan = thisboard->ao_chans; + s->n_chan = 2; s->maxdata = (1 << thisboard->ao_bits) - 1; s->range_table = &pci230_ao_range; s->insn_write = pci230_ao_insn_write; s->insn_read = comedi_readback_insn_read; - s->len_chanlist = thisboard->ao_chans; + s->len_chanlist = 2; if (dev->irq) { dev->write_subdev = s; s->subdev_flags |= SDF_CMD_WRITE; -- 2.0.4 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2014-09-01 11:09 UTC|newest] Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-09-01 11:03 [PATCH 00/28] staging: comedi: more clean-up and remove legacy attach Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 01/28] staging: comedi: amplc_pci230: update MODULE_DESCRIPTION() Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 02/28] staging: comedi: amplc_pci230: don't use multiple blank lines Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 03/28] staging: comedi: amplc_pci230: remove some unnecessary parentheses Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 04/28] staging: comedi: amplc_pci230: collapse some 'else { if' chains Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 05/28] staging: comedi: amplc_pci230: remove "legacy" attach mechanism Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 06/28] staging: comedi: amplc_pci230: no need to manipulate PCI ref count Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 07/28] staging: comedi: amplc_pci230: set detach handler to comedi_pci_detach() Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 08/28] staging: comedi: amplc_pci230: absorb pci230_attach_common() Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 09/28] staging: comedi: amplc_pci230: no need to comedi_set_hw_dev() here Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 10/28] staging: comedi: amplc_pci230: absorb pci230_alloc_private() Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 11/28] staging: comedi: amplc_pci230: remove ai_chans member Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` Ian Abbott [this message] 2014-09-01 11:03 ` [PATCH 12/28] staging: comedi: amplc_pci230: remove ao_chans member Ian Abbott 2014-09-01 11:03 ` [PATCH 13/28] staging: comedi: amplc_pci230: shrink struct pci230_board Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 14/28] staging: comedi: amplc_pci230: simplify pci230_ao_mangle_datum() Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 15/28] staging: comedi: amplc_pci230: simplify pci230_ai_read() Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 16/28] staging: comedi: amplc_pci230: remove 'inline' Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 17/28] staging: comedi: amplc_pci230: rename pci230_ai_rinsn() Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 18/28] staging: comedi: amplc_pci230: add `pci230_` prefix to functions Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 19/28] staging: comedi: amplc_pci230: use comedi_range_is_bipolar() Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 20/28] staging: comedi: amplc_pci230: make `intr_running` a bitfield Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 21/28] staging: comedi: amplc_pci230: replace `state` member with bitfields Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 22/28] staging: comedi: amplc_pci230: rewrite shared resource handling Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 23/28] staging: comedi: amplc_pci230: reduce indentation in pci230_ao_inttrig_scan_begin() Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 24/28] staging: comedi: amplc_pci230: reduce indentation in pci230_ao_start() Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 25/28] staging: comedi: amplc_pci230: reduce indentation in pci230_ai_inttrig_convert() Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 26/28] staging: comedi: amplc_pci230: reduce indentation in pci230_ai_start() Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:03 ` [PATCH 27/28] staging: comedi: amplc_pci230: change pci230_handle_ao_fifo() return type Ian Abbott 2014-09-01 11:03 ` Ian Abbott 2014-09-01 11:04 ` [PATCH 28/28] staging: comedi: amplc_pci230: simplify interrupt enable handling Ian Abbott 2014-09-01 11:04 ` Ian Abbott 2014-09-02 17:43 ` [PATCH 00/28] staging: comedi: more clean-up and remove legacy attach Hartley Sweeten 2014-09-02 17:43 ` Hartley Sweeten
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=1409569440-10979-13-git-send-email-abbotti@mev.co.uk \ --to=abbotti@mev.co.uk \ --cc=driverdev-devel@linuxdriverproject.org \ --cc=gregkh@linuxfoundation.org \ --cc=hartleys@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.