Commit 8c6356e2 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: dt3155: coding style cleanups for the .h files

This cleans up some of the coding style issues in the .h files.

More remains to be done.

Cc: Scott Smedley <ss@aao.gov.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1769fd86
...@@ -20,8 +20,6 @@ along with the DT3155 Device Driver; if not, write to the Free ...@@ -20,8 +20,6 @@ along with the DT3155 Device Driver; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA MA 02111-1307 USA
$Id: dt3155.h,v 1.11 2005/08/09 06:08:51 ssmedley Exp $
-- Changes -- -- Changes --
Date Programmer Description of changes made Date Programmer Description of changes made
...@@ -57,7 +55,7 @@ MA 02111-1307 USA ...@@ -57,7 +55,7 @@ MA 02111-1307 USA
#define MAXBOARDS 1 #define MAXBOARDS 1
#define BOARD_MAX_BUFFS 3 #define BOARD_MAX_BUFFS 3
#define MAXBUFFERS BOARD_MAX_BUFFS*MAXBOARDS #define MAXBUFFERS (BOARD_MAX_BUFFS*MAXBOARDS)
#define PCI_PAGE_SIZE (1 << 12) #define PCI_PAGE_SIZE (1 << 12)
...@@ -80,28 +78,29 @@ struct dt3155_config_s { ...@@ -80,28 +78,29 @@ struct dt3155_config_s {
/* hold data for each frame */ /* hold data for each frame */
typedef struct typedef struct {
{
u_long addr; /* address of the buffer with the frame */ u_long addr; /* address of the buffer with the frame */
u_long tag; /* unique number for the frame */ u_long tag; /* unique number for the frame */
struct timeval time; /* time that capture took place */ struct timeval time; /* time that capture took place */
} frame_info_t; } frame_info_t;
/* Structure for interrupt and buffer handling. */ /*
/* This is the setup for 1 card */ * Structure for interrupt and buffer handling.
* This is the setup for 1 card
*/
struct dt3155_fbuffer_s { struct dt3155_fbuffer_s {
int nbuffers; int nbuffers;
frame_info_t frame_info[ BOARD_MAX_BUFFS ]; frame_info_t frame_info[BOARD_MAX_BUFFS];
int empty_buffers[ BOARD_MAX_BUFFS ]; /* indexes empty frames */ int empty_buffers[BOARD_MAX_BUFFS]; /* indexes empty frames */
int empty_len; /* Number of empty buffers */ int empty_len; /* Number of empty buffers */
/* Zero means empty */ /* Zero means empty */
int active_buf; /* Where data is currently dma'ing */ int active_buf; /* Where data is currently dma'ing */
int locked_buf; /* Buffers used by user */ int locked_buf; /* Buffers used by user */
int ready_que[ BOARD_MAX_BUFFS ]; int ready_que[BOARD_MAX_BUFFS];
u_long ready_head; /* The most recent buffer located here */ u_long ready_head; /* The most recent buffer located here */
u_long ready_len; /* The number of ready buffers */ u_long ready_len; /* The number of ready buffers */
...@@ -110,7 +109,6 @@ struct dt3155_fbuffer_s { ...@@ -110,7 +109,6 @@ struct dt3155_fbuffer_s {
int stop_acquire; /* Flag to stop interrupts */ int stop_acquire; /* Flag to stop interrupts */
u_long frame_count; /* Counter for frames acquired by this card */ u_long frame_count; /* Counter for frames acquired by this card */
}; };
...@@ -122,15 +120,14 @@ struct dt3155_fbuffer_s { ...@@ -122,15 +120,14 @@ struct dt3155_fbuffer_s {
#define DT3155_ACQ 2 #define DT3155_ACQ 2
/* There is one status structure for each card. */ /* There is one status structure for each card. */
typedef struct dt3155_status_s typedef struct dt3155_status_s {
{
int fixed_mode; /* if 1, we are in fixed frame mode */ int fixed_mode; /* if 1, we are in fixed frame mode */
u_long reg_addr; /* Register address for a single card */ u_long reg_addr; /* Register address for a single card */
u_long mem_addr; /* Buffer start addr for this card */ u_long mem_addr; /* Buffer start addr for this card */
u_long mem_size; /* This is the amount of mem available */ u_long mem_size; /* This is the amount of mem available */
u_int irq; /* this card's irq */ u_int irq; /* this card's irq */
struct dt3155_config_s config; /* configuration struct */ struct dt3155_config_s config; /* configuration struct */
struct dt3155_fbuffer_s fbuffer;/* frame buffer state struct */ struct dt3155_fbuffer_s fbuffer; /* frame buffer state struct */
u_long state; /* this card's state */ u_long state; /* this card's state */
u_int device_installed; /* Flag if installed. 1=installed */ u_int device_installed; /* Flag if installed. 1=installed */
} dt3155_status_t; } dt3155_status_t;
...@@ -147,24 +144,23 @@ extern struct dt3155_status_s dt3155_status[MAXBOARDS]; ...@@ -147,24 +144,23 @@ extern struct dt3155_status_s dt3155_status[MAXBOARDS];
#define DT3155_IOC_MAGIC '!' #define DT3155_IOC_MAGIC '!'
#define DT3155_SET_CONFIG _IOW( DT3155_IOC_MAGIC, 1, struct dt3155_config_s ) #define DT3155_SET_CONFIG _IOW(DT3155_IOC_MAGIC, 1, struct dt3155_config_s)
#define DT3155_GET_CONFIG _IOR( DT3155_IOC_MAGIC, 2, struct dt3155_status_s ) #define DT3155_GET_CONFIG _IOR(DT3155_IOC_MAGIC, 2, struct dt3155_status_s)
#define DT3155_STOP _IO( DT3155_IOC_MAGIC, 3 ) #define DT3155_STOP _IO(DT3155_IOC_MAGIC, 3)
#define DT3155_START _IO( DT3155_IOC_MAGIC, 4 ) #define DT3155_START _IO(DT3155_IOC_MAGIC, 4)
#define DT3155_FLUSH _IO( DT3155_IOC_MAGIC, 5 ) #define DT3155_FLUSH _IO(DT3155_IOC_MAGIC, 5)
#define DT3155_IOC_MAXNR 5 #define DT3155_IOC_MAXNR 5
/* Error codes */ /* Error codes */
#define DT_ERR_NO_BUFFERS 0x10000 /* not used but it might be one day - SS */ #define DT_ERR_NO_BUFFERS 0x10000 /* not used but it might be one day */
#define DT_ERR_CORRUPT 0x20000 #define DT_ERR_CORRUPT 0x20000
#define DT_ERR_OVERRUN 0x30000 #define DT_ERR_OVERRUN 0x30000
#define DT_ERR_I2C_TIMEOUT 0x40000 #define DT_ERR_I2C_TIMEOUT 0x40000
#define DT_ERR_MASK 0xff0000/* not used but it might be one day - SS */ #define DT_ERR_MASK 0xff0000/* not used but it might be one day */
/* User code will probably want to declare one of these for each card */ /* User code will probably want to declare one of these for each card */
typedef struct dt3155_read_s typedef struct dt3155_read_s {
{
u_long offset; u_long offset;
u_long frame_seq; u_long frame_seq;
u_long state; u_long state;
......
...@@ -25,7 +25,7 @@ MA 02111-1307 USA ...@@ -25,7 +25,7 @@ MA 02111-1307 USA
#define DT3155_DRV_INC #define DT3155_DRV_INC
/* kernel logical address of the frame grabbers */ /* kernel logical address of the frame grabbers */
extern u_char *dt3155_lbase[ MAXBOARDS ]; extern u_char *dt3155_lbase[MAXBOARDS];
/* kernel logical address of ram buffer */ /* kernel logical address of ram buffer */
extern u_char *dt3155_bbase; extern u_char *dt3155_bbase;
...@@ -35,7 +35,7 @@ extern u_char *dt3155_bbase; ...@@ -35,7 +35,7 @@ extern u_char *dt3155_bbase;
#include <linux/version.h> /* need access to LINUX_VERSION_CODE */ #include <linux/version.h> /* need access to LINUX_VERSION_CODE */
/* wait queue for reads */ /* wait queue for reads */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 1)
extern wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS]; extern wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS];
#else #else
extern struct wait_queue *dt3155_read_wait_queue[MAXBOARDS]; extern struct wait_queue *dt3155_read_wait_queue[MAXBOARDS];
......
...@@ -36,8 +36,8 @@ MA 02111-1307 USA ...@@ -36,8 +36,8 @@ MA 02111-1307 USA
/* macros to access registers */ /* macros to access registers */
#define WriteMReg(Address, Data) * ((u_long *) (Address)) = Data #define WriteMReg(Address, Data) (*((u_long *)(Address)) = Data)
#define ReadMReg(Address, Data) Data = * ((u_long *) (Address)) #define ReadMReg(Address, Data) (Data = *((u_long *)(Address)))
/***************** 32 bit register globals **************/ /***************** 32 bit register globals **************/
...@@ -241,10 +241,9 @@ typedef union iic_csr2_tag { ...@@ -241,10 +241,9 @@ typedef union iic_csr2_tag {
*/ */
typedef union dma_upper_lmt_tag { typedef union dma_upper_lmt_tag {
u_long reg; u_long reg;
struct struct {
{ u_long DMA_UPPER_LMT_VAL:24;
u_long DMA_UPPER_LMT_VAL : 24; u_long :8;
u_long : 8;
} fld; } fld;
} DMA_UPPER_LMT_R; } DMA_UPPER_LMT_R;
...@@ -302,26 +301,24 @@ extern DMA_UPPER_LMT_R odd_dma_upper_lmt_r; ...@@ -302,26 +301,24 @@ extern DMA_UPPER_LMT_R odd_dma_upper_lmt_r;
typedef union i2c_csr2_tag { typedef union i2c_csr2_tag {
u_char reg; u_char reg;
struct struct {
{ u_char CHROM_FIL:1;
u_char CHROM_FIL : 1; u_char SYNC_SNTL:1;
u_char SYNC_SNTL : 1; u_char HZ50:1;
u_char HZ50 : 1; u_char SYNC_PRESENT:1;
u_char SYNC_PRESENT : 1; u_char BUSY_EVE:1;
u_char BUSY_EVE : 1; u_char BUSY_ODD:1;
u_char BUSY_ODD : 1; u_char DISP_PASS:1;
u_char DISP_PASS : 1;
} fld; } fld;
} I2C_CSR2; } I2C_CSR2;
typedef union i2c_even_csr_tag { typedef union i2c_even_csr_tag {
u_char reg; u_char reg;
struct struct {
{ u_char DONE_EVE:1;
u_char DONE_EVE : 1; u_char SNGL_EVE:1;
u_char SNGL_EVE : 1; u_char ERROR_EVE:1;
u_char ERROR_EVE : 1; u_char :5;
u_char : 5;
} fld; } fld;
} I2C_EVEN_CSR; } I2C_EVEN_CSR;
...@@ -394,7 +391,7 @@ extern u_char i2c_pm_lut_data; ...@@ -394,7 +391,7 @@ extern u_char i2c_pm_lut_data;
/* access 8-bit IIC registers */ /* access 8-bit IIC registers */
extern int ReadI2C (u_char * lpReg, u_short wIregIndex, u_char * byVal); extern int ReadI2C(u_char *lpReg, u_short wIregIndex, u_char *byVal);
extern int WriteI2C (u_char * lpReg, u_short wIregIndex, u_char byVal); extern int WriteI2C(u_char *lpReg, u_short wIregIndex, u_char byVal);
#endif #endif
...@@ -62,16 +62,16 @@ int dt3155_flush(int minor); ...@@ -62,16 +62,16 @@ int dt3155_flush(int minor);
* Simple array based que struct * Simple array based que struct
**********************************/ **********************************/
bool are_empty_buffers( int minor ); bool are_empty_buffers(int minor);
void push_empty( int index, int minor ); void push_empty(int index, int minor);
int pop_empty( int minor ); int pop_empty(int minor);
bool is_ready_buf_empty( int minor ); bool is_ready_buf_empty(int minor);
bool is_ready_buf_full( int minor ); bool is_ready_buf_full(int minor);
void push_ready( int minor, int index ); void push_ready(int minor, int index);
int pop_ready( int minor ); int pop_ready(int minor);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment