···1919#define SSP_OPOLARITY _IOR('S', 4, unsigned int)2020#define SSP_SPI _IOR('S', 5, unsigned int)2121#define SSP_INBUFCHUNK _IOR('S', 6, unsigned int)2222+#define SSP_INPUT _IOR('S', 7, unsigned int)22232324/* Values for SSP_SPEED */2425#define SSP150 0···3837#define SSP921600 133938#define SSP3125000 144039#define CODEC 154040+#define CODEC_f32768 1641414242#define FREQ_4MHz 04343#define FREQ_2MHz 1···4846#define FREQ_128kHz 54947#define FREQ_64kHz 65048#define FREQ_32kHz 74949+/* FREQ_* with values where bit (value & 0x10) is set are */5050+/* used for CODEC_f32768 */5151+#define FREQ_4096kHz 16 /* CODEC_f32768 */51525253/* Used by application to set CODEC divider, word rate and frame rate */5353-#define CODEC_VAL(freq, clk_per_sync, sync_per_frame) (CODEC | (freq << 8) | (clk_per_sync << 16) | (sync_per_frame << 28))5454+#define CODEC_VAL(freq, clk_per_sync, sync_per_frame) \5555+ ((CODEC + ((freq & 0x10) >> 4)) | (freq << 8) | \5656+ (clk_per_sync << 16) | (sync_per_frame << 28))54575558/* Used by driver to extract speed */5659#define GET_SPEED(x) (x & 0xff)···7568#define NORMAL_SYNC 17669#define EARLY_SYNC 27770#define SECOND_WORD_SYNC 0x400007171+#define LATE_SYNC 0x8000078727973#define BIT_SYNC 48074#define WORD_SYNC 8···111103112104/* Values for SSP_INBUFCHUNK */113105/* plain integer with the size of DMA chunks */106106+107107+/* To ensure that the timestamps are aligned with the data being read108108+ * the read length MUST be a multiple of the length of the DMA buffers.109109+ *110110+ * Use a multiple of SSP_INPUT_CHUNK_SIZE defined below.111111+ */112112+#define SSP_INPUT_CHUNK_SIZE 256113113+114114+/* Request struct to pass through the ioctl interface to read115115+ * data with timestamps.116116+ */117117+struct ssp_request {118118+ char __user *buf; /* Where to put the data. */119119+ size_t len; /* Size of buf. MUST be a multiple of */120120+ /* SSP_INPUT_CHUNK_SIZE! */121121+ struct timespec ts; /* The time the data was sampled. */122122+};114123115124#endif