2 * ioctl defines for synchronous serial port driver
4 * Copyright (c) 2001-2003 Axis Communications AB
6 * Author: Mikael Starvik
13 #include <linux/ioctl.h>
15 #define SSP_SPEED _IOR('S', 0, unsigned int)
16 #define SSP_MODE _IOR('S', 1, unsigned int)
17 #define SSP_FRAME_SYNC _IOR('S', 2, unsigned int)
18 #define SSP_IPOLARITY _IOR('S', 3, unsigned int)
19 #define SSP_OPOLARITY _IOR('S', 4, unsigned int)
20 #define SSP_SPI _IOR('S', 5, unsigned int)
21 #define SSP_INBUFCHUNK _IOR('S', 6, unsigned int)
23 /* Values for SSP_SPEED */
50 /* Used by application to set CODEC divider, word rate and frame rate */
51 #define CODEC_VAL(freq, clk_per_sync, sync_per_frame) (CODEC | (freq << 8) | (clk_per_sync << 16) | (sync_per_frame << 28))
53 /* Used by driver to extract speed */
54 #define GET_SPEED(x) (x & 0xff)
55 #define GET_FREQ(x) ((x & 0xff00) >> 8)
56 #define GET_WORD_RATE(x) (((x & 0x0fff0000) >> 16) - 1)
57 #define GET_FRAME_RATE(x) (((x & 0xf0000000) >> 28) - 1)
59 /* Values for SSP_MODE */
60 #define MASTER_OUTPUT 0
61 #define SLAVE_OUTPUT 1
62 #define MASTER_INPUT 2
64 #define MASTER_BIDIR 4
67 /* Values for SSP_FRAME_SYNC */
73 #define EXTENDED_SYNC 0x10
77 #define WORD_SIZE_8 0x80
78 #define WORD_SIZE_12 0x100
79 #define WORD_SIZE_16 0x200
80 #define WORD_SIZE_24 0x400
81 #define WORD_SIZE_32 0x800
82 #define BIT_ORDER_LSB 0x1000
83 #define BIT_ORDER_MSB 0x2000
84 #define FLOW_CONTROL_ENABLE 0x4000
85 #define FLOW_CONTROL_DISABLE 0x8000
86 #define CLOCK_GATED 0x10000
87 #define CLOCK_NOT_GATED 0x20000
89 /* Values for SSP_IPOLARITY and SSP_OPOLARITY */
90 #define CLOCK_NORMAL 1
91 #define CLOCK_INVERT 2
92 #define CLOCK_INEGEDGE CLOCK_NORMAL
93 #define CLOCK_IPOSEDGE CLOCK_INVERT
94 #define FRAME_NORMAL 4
95 #define FRAME_INVERT 8
96 #define STATUS_NORMAL 0x10
97 #define STATUS_INVERT 0x20
99 /* Values for SSP_SPI */
103 /* Values for SSP_INBUFCHUNK */
104 /* plain integer with the size of DMA chunks */