staging: comedi: ni_tio: tidy up Gxx_Joint_Status2_Bits
Convert this enum into defines and rename the CamelCase symbols. For aesthetics, move the new defines so they are associated with the register define. 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>
This commit is contained in:
parent
dc613766b7
commit
29c2003d11
2 changed files with 4 additions and 17 deletions
|
@ -129,6 +129,9 @@
|
|||
#define GI_RESET(x) (1 << (2 + ((x) % 2)))
|
||||
#define NITIO_STATUS1_REG(x) (NITIO_G01_STATUS1 + ((x) / 2))
|
||||
#define NITIO_STATUS2_REG(x) (NITIO_G01_STATUS2 + ((x) / 2))
|
||||
#define GI_OUTPUT(x) (((x) % 2) ? (1 << 1) : (1 << 0))
|
||||
#define GI_HW_SAVE(x) (((x) % 2) ? (1 << 13) : (1 << 12))
|
||||
#define GI_PERMANENT_STALE(x) (((x) % 2) ? (1 << 15) : (1 << 14))
|
||||
#define NITIO_DMA_CFG_REG(x) (NITIO_G0_DMA_CFG + (x))
|
||||
#define NITIO_DMA_STATUS_REG(x) (NITIO_G0_DMA_STATUS + (x))
|
||||
#define NITIO_ABZ_REG(x) (NITIO_G0_ABZ + (x))
|
||||
|
@ -136,22 +139,6 @@
|
|||
#define NITIO_STATUS_REG(x) (NITIO_G0_STATUS + (x))
|
||||
#define NITIO_INT_ENA_REG(x) (NITIO_G0_INT_ENA + (x))
|
||||
|
||||
enum Gxx_Joint_Status2_Bits {
|
||||
G0_Output_Bit = 0x1,
|
||||
G1_Output_Bit = 0x2,
|
||||
G0_HW_Save_Bit = 0x1000,
|
||||
G1_HW_Save_Bit = 0x2000,
|
||||
G0_Permanent_Stale_Bit = 0x4000,
|
||||
G1_Permanent_Stale_Bit = 0x8000
|
||||
};
|
||||
static inline enum Gxx_Joint_Status2_Bits Gi_Permanent_Stale_Bit(unsigned
|
||||
counter_index)
|
||||
{
|
||||
if (counter_index % 2)
|
||||
return G1_Permanent_Stale_Bit;
|
||||
return G0_Permanent_Stale_Bit;
|
||||
}
|
||||
|
||||
enum Gi_DMA_Config_Reg_Bits {
|
||||
Gi_DMA_Enable_Bit = 0x1,
|
||||
Gi_DMA_Write_Bit = 0x2,
|
||||
|
|
|
@ -409,7 +409,7 @@ void ni_tio_acknowledge_and_confirm(struct ni_gpct *counter, int *gate_error,
|
|||
*stale_data = 1;
|
||||
}
|
||||
if (read_register(counter, NITIO_STATUS2_REG(cidx)) &
|
||||
Gi_Permanent_Stale_Bit(cidx)) {
|
||||
GI_PERMANENT_STALE(cidx)) {
|
||||
dev_info(counter->counter_dev->dev->class_dev,
|
||||
"%s: Gi_Permanent_Stale_Data detected.\n",
|
||||
__func__);
|
||||
|
|
Loading…
Reference in a new issue