Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

CRIS: Add ARTPEC-3 and timestamps for sync-serial

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>

+26 -1
+26 -1
arch/cris/include/asm/sync_serial.h
··· 19 19 #define SSP_OPOLARITY _IOR('S', 4, unsigned int) 20 20 #define SSP_SPI _IOR('S', 5, unsigned int) 21 21 #define SSP_INBUFCHUNK _IOR('S', 6, unsigned int) 22 + #define SSP_INPUT _IOR('S', 7, unsigned int) 22 23 23 24 /* Values for SSP_SPEED */ 24 25 #define SSP150 0 ··· 38 37 #define SSP921600 13 39 38 #define SSP3125000 14 40 39 #define CODEC 15 40 + #define CODEC_f32768 16 41 41 42 42 #define FREQ_4MHz 0 43 43 #define FREQ_2MHz 1 ··· 48 46 #define FREQ_128kHz 5 49 47 #define FREQ_64kHz 6 50 48 #define FREQ_32kHz 7 49 + /* FREQ_* with values where bit (value & 0x10) is set are */ 50 + /* used for CODEC_f32768 */ 51 + #define FREQ_4096kHz 16 /* CODEC_f32768 */ 51 52 52 53 /* Used by application to set CODEC divider, word rate and frame rate */ 53 - #define CODEC_VAL(freq, clk_per_sync, sync_per_frame) (CODEC | (freq << 8) | (clk_per_sync << 16) | (sync_per_frame << 28)) 54 + #define CODEC_VAL(freq, clk_per_sync, sync_per_frame) \ 55 + ((CODEC + ((freq & 0x10) >> 4)) | (freq << 8) | \ 56 + (clk_per_sync << 16) | (sync_per_frame << 28)) 54 57 55 58 /* Used by driver to extract speed */ 56 59 #define GET_SPEED(x) (x & 0xff) ··· 75 68 #define NORMAL_SYNC 1 76 69 #define EARLY_SYNC 2 77 70 #define SECOND_WORD_SYNC 0x40000 71 + #define LATE_SYNC 0x80000 78 72 79 73 #define BIT_SYNC 4 80 74 #define WORD_SYNC 8 ··· 111 103 112 104 /* Values for SSP_INBUFCHUNK */ 113 105 /* plain integer with the size of DMA chunks */ 106 + 107 + /* To ensure that the timestamps are aligned with the data being read 108 + * the read length MUST be a multiple of the length of the DMA buffers. 109 + * 110 + * Use a multiple of SSP_INPUT_CHUNK_SIZE defined below. 111 + */ 112 + #define SSP_INPUT_CHUNK_SIZE 256 113 + 114 + /* Request struct to pass through the ioctl interface to read 115 + * data with timestamps. 116 + */ 117 + struct ssp_request { 118 + char __user *buf; /* Where to put the data. */ 119 + size_t len; /* Size of buf. MUST be a multiple of */ 120 + /* SSP_INPUT_CHUNK_SIZE! */ 121 + struct timespec ts; /* The time the data was sampled. */ 122 + }; 114 123 115 124 #endif