diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2017-04-04 13:32:27 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-08 14:03:17 +0300 |
commit | 2bbd5023ee09c8df507f7a6ed5ab45fc619a7ff6 (patch) | |
tree | 7acacfd313c482a8ac4cc149688c829afec3c44c | |
parent | a19aa38022a37bee17e0aebf1053b1cf0496812d (diff) | |
download | linux-2bbd5023ee09c8df507f7a6ed5ab45fc619a7ff6.tar.xz |
staging: comedi: amplc_pci224: convert CLK_CONFIG() macro to function
Convert the `CLK_CLKFIG(chan, src)` macro to a static function
`pci224_clk_config(chan, src)`. This is consistent with an earlier
change to convert `GAT_CONFIG(chan, src)` to a static function.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/comedi/drivers/amplc_pci224.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c b/drivers/staging/comedi/drivers/amplc_pci224.c index 7de2cd5f0f7e..4e554944bc71 100644 --- a/drivers/staging/comedi/drivers/amplc_pci224.c +++ b/drivers/staging/comedi/drivers/amplc_pci224.c @@ -206,8 +206,11 @@ #define CLK_1KHZ 5 /* internal 1 kHz clock */ #define CLK_OUTNM1 6 /* output of channel-1 modulo total */ #define CLK_EXT 7 /* external clock */ -/* Macro to construct clock input configuration register value. */ -#define CLK_CONFIG(chan, src) ((((chan) & 3) << 3) | ((src) & 7)) + +static unsigned int pci224_clk_config(unsigned int chan, unsigned int src) +{ + return ((chan & 3) << 3) | (src & 7); +} /* * Counter/timer gate input configuration sources. @@ -825,9 +828,11 @@ static void pci224_ao_start_pacer(struct comedi_device *dev, /* Make sure Z2-2 is gated on. */ outb(pci224_gat_config(2, GAT_VCC), devpriv->iobase1 + PCI224_ZGAT_SCE); /* Z2-2 needs 10 MHz clock. */ - outb(CLK_CONFIG(2, CLK_10MHZ), devpriv->iobase1 + PCI224_ZCLK_SCE); + outb(pci224_clk_config(2, CLK_10MHZ), + devpriv->iobase1 + PCI224_ZCLK_SCE); /* Z2-0 is clocked from Z2-2's output. */ - outb(CLK_CONFIG(0, CLK_OUTNM1), devpriv->iobase1 + PCI224_ZCLK_SCE); + outb(pci224_clk_config(0, CLK_OUTNM1), + devpriv->iobase1 + PCI224_ZCLK_SCE); comedi_8254_pacer_enable(dev->pacer, 2, 0, false); } |