summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2014-05-28 23:26:40 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-18 21:33:52 (GMT)
commitf8f6d91d8e65cf5eaaa861eb842f466aab30a9a6 (patch)
treee20642f4b35afb325ec84f572fa384e7cf2f1c65 /drivers/staging/comedi
parentd2a577c0226c98ad5c6d8ca6cc3e08879dac49d9 (diff)
downloadlinux-f8f6d91d8e65cf5eaaa861eb842f466aab30a9a6.tar.xz
staging: comedi: ni_mio_common: remove forward declaration 17
Move the get_last_sample_*() helpers to remove the need for the forward declarations. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/ni_mio_common.c84
1 files changed, 41 insertions, 43 deletions
diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
index 65c20c9..2a592a4 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -274,8 +274,6 @@ static void handle_a_interrupt(struct comedi_device *dev, unsigned short status,
unsigned ai_mite_status);
static void handle_b_interrupt(struct comedi_device *dev, unsigned short status,
unsigned ao_mite_status);
-static void get_last_sample_611x(struct comedi_device *dev);
-static void get_last_sample_6143(struct comedi_device *dev);
static inline void ni_set_bitfield(struct comedi_device *dev, int reg,
unsigned bit_mask, unsigned bit_values)
@@ -821,6 +819,47 @@ static int ni_ao_wait_for_dma_load(struct comedi_device *dev)
}
#endif /* PCIDMA */
+static void get_last_sample_611x(struct comedi_device *dev)
+{
+ const struct ni_board_struct *board = comedi_board(dev);
+ struct ni_private *devpriv __maybe_unused = dev->private;
+ struct comedi_subdevice *s = &dev->subdevices[NI_AI_SUBDEV];
+ unsigned short data;
+ u32 dl;
+
+ if (board->reg_type != ni_reg_611x)
+ return;
+
+ /* Check if there's a single sample stuck in the FIFO */
+ if (ni_readb(XXX_Status) & 0x80) {
+ dl = ni_readl(ADC_FIFO_Data_611x);
+ data = (dl & 0xffff);
+ cfc_write_to_buffer(s, data);
+ }
+}
+
+static void get_last_sample_6143(struct comedi_device *dev)
+{
+ const struct ni_board_struct *board = comedi_board(dev);
+ struct ni_private *devpriv __maybe_unused = dev->private;
+ struct comedi_subdevice *s = &dev->subdevices[NI_AI_SUBDEV];
+ unsigned short data;
+ u32 dl;
+
+ if (board->reg_type != ni_reg_6143)
+ return;
+
+ /* Check if there's a single sample stuck in the FIFO */
+ if (ni_readl(AIFIFO_Status_6143) & 0x01) {
+ ni_writel(0x01, AIFIFO_Control_6143); /* Get stranded sample into FIFO */
+ dl = ni_readl(AIFIFO_Data_6143);
+
+ /* This may get the hi/lo data in the wrong order */
+ data = (dl >> 16) & 0xffff;
+ cfc_write_to_buffer(s, data);
+ }
+}
+
static void shutdown_ai_command(struct comedi_device *dev)
{
struct comedi_subdevice *s = &dev->subdevices[NI_AI_SUBDEV];
@@ -1338,47 +1377,6 @@ static void ni_handle_fifo_dregs(struct comedi_device *dev)
}
}
-static void get_last_sample_611x(struct comedi_device *dev)
-{
- const struct ni_board_struct *board = comedi_board(dev);
- struct ni_private *devpriv __maybe_unused = dev->private;
- struct comedi_subdevice *s = &dev->subdevices[NI_AI_SUBDEV];
- unsigned short data;
- u32 dl;
-
- if (board->reg_type != ni_reg_611x)
- return;
-
- /* Check if there's a single sample stuck in the FIFO */
- if (ni_readb(XXX_Status) & 0x80) {
- dl = ni_readl(ADC_FIFO_Data_611x);
- data = (dl & 0xffff);
- cfc_write_to_buffer(s, data);
- }
-}
-
-static void get_last_sample_6143(struct comedi_device *dev)
-{
- const struct ni_board_struct *board = comedi_board(dev);
- struct ni_private *devpriv __maybe_unused = dev->private;
- struct comedi_subdevice *s = &dev->subdevices[NI_AI_SUBDEV];
- unsigned short data;
- u32 dl;
-
- if (board->reg_type != ni_reg_6143)
- return;
-
- /* Check if there's a single sample stuck in the FIFO */
- if (ni_readl(AIFIFO_Status_6143) & 0x01) {
- ni_writel(0x01, AIFIFO_Control_6143); /* Get stranded sample into FIFO */
- dl = ni_readl(AIFIFO_Data_6143);
-
- /* This may get the hi/lo data in the wrong order */
- data = (dl >> 16) & 0xffff;
- cfc_write_to_buffer(s, data);
- }
-}
-
static void ni_ai_munge(struct comedi_device *dev, struct comedi_subdevice *s,
void *data, unsigned int num_bytes,
unsigned int chan_index)