Changeset 703 for GPL/trunk/alsa-kernel/include
- Timestamp:
- Sep 26, 2021, 6:18:40 PM (4 years ago)
- Location:
- GPL/trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-next merged: 696-702
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/include/sound/core.h
r695 r703 132 132 #ifdef CONFIG_PM 133 133 unsigned int power_state; /* power state */ 134 atomic_t power_ref; 134 135 wait_queue_head_t power_sleep; 136 wait_queue_head_t power_ref_sleep; 135 137 #endif 136 138 … … 146 148 static inline unsigned int snd_power_get_state(struct snd_card *card) 147 149 { 148 return card->power_state;150 return READ_ONCE(card->power_state); 149 151 } 150 152 151 153 static inline void snd_power_change_state(struct snd_card *card, unsigned int state) 152 154 { 153 card->power_state = state;155 WRITE_ONCE(card->power_state, state); 154 156 wake_up(&card->power_sleep); 155 157 } 156 158 159 /** 160 * snd_power_ref - Take the reference count for power control 161 * @card: sound card object 162 * 163 * The power_ref reference of the card is used for managing to block 164 * the snd_power_sync_ref() operation. This function increments the reference. 165 * The counterpart snd_power_unref() has to be called appropriately later. 166 */ 167 static inline void snd_power_ref(struct snd_card *card) 168 { 169 atomic_inc(&card->power_ref); 170 } 171 172 /** 173 * snd_power_unref - Release the reference count for power control 174 * @card: sound card object 175 */ 176 static inline void snd_power_unref(struct snd_card *card) 177 { 178 if (atomic_dec_and_test(&card->power_ref)) 179 wake_up(&card->power_ref_sleep); 180 } 181 182 /** 183 * snd_power_sync_ref - wait until the card power_ref is freed 184 * @card: sound card object 185 * 186 * This function is used to synchronize with the pending power_ref being 187 * released. 188 */ 189 static inline void snd_power_sync_ref(struct snd_card *card) 190 { 191 wait_event(card->power_ref_sleep, !atomic_read(&card->power_ref)); 192 } 193 157 194 /* init.c */ 158 int snd_power_wait(struct snd_card *card, unsigned int power_state); 195 int snd_power_wait(struct snd_card *card); 196 int snd_power_ref_and_wait(struct snd_card *card); 159 197 160 198 #else /* ! CONFIG_PM */ 161 199 162 static inline int snd_power_wait(struct snd_card *card, unsigned int state) { return 0; } 200 static inline int snd_power_wait(struct snd_card *card) { return 0; } 201 static inline void snd_power_ref(struct snd_card *card) {} 202 static inline void snd_power_unref(struct snd_card *card) {} 203 static inline int snd_power_ref_and_wait(struct snd_card *card) { return 0; } 204 static inline void snd_power_sync_ref(struct snd_card *card) {} 163 205 #define snd_power_get_state(card) ({ (void)(card); SNDRV_CTL_POWER_D0; }) 164 206 #define snd_power_change_state(card, state) do { (void)(card); } while (0) -
GPL/trunk/alsa-kernel/include/sound/hdmi-codec.h
r695 r703 66 66 /* 67 67 * Configures HDMI-encoder for audio stream. 68 * Mandatory68 * Having either prepare or hw_params is mandatory. 69 69 */ 70 70 int (*hw_params)(struct device *dev, void *data, 71 71 struct hdmi_codec_daifmt *fmt, 72 72 struct hdmi_codec_params *hparms); 73 74 /* 75 * Configures HDMI-encoder for audio stream. Can be called 76 * multiple times for each setup. 77 * 78 * Having either prepare or hw_params is mandatory. 79 */ 80 int (*prepare)(struct device *dev, void *data, 81 struct hdmi_codec_daifmt *fmt, 82 struct hdmi_codec_params *hparms); 73 83 74 84 /* -
GPL/trunk/alsa-kernel/include/sound/memalloc.h
r679 r703 13 13 14 14 struct device; 15 struct vm_area_struct; 15 16 16 17 /* … … 65 66 } 66 67 67 #ifdef CONFIG_SND_DMA_SGBUF68 /*69 * Scatter-Gather generic device pages70 */71 void *snd_malloc_sgbuf_pages(struct device *device,72 size_t size, struct snd_dma_buffer *dmab,73 size_t *res_size);74 int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab);75 76 struct snd_sg_page {77 void *buf;78 dma_addr_t addr;79 };80 81 struct snd_sg_buf {82 int size; /* allocated byte size */83 int pages; /* allocated pages */84 int tblsize; /* allocated table size */85 struct snd_sg_page *table; /* address table */86 struct page **page_table; /* page table (for vmap/vunmap) */87 struct device *dev;88 };89 90 /*91 * return the physical address at the corresponding offset92 */93 static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab,94 size_t offset)95 {96 struct snd_sg_buf *sgbuf = dmab->private_data;97 dma_addr_t addr;98 99 if (!sgbuf)100 return dmab->addr + offset;101 addr = sgbuf->table[offset >> PAGE_SHIFT].addr;102 addr &= ~((dma_addr_t)PAGE_SIZE - 1);103 return addr + offset % PAGE_SIZE;104 }105 106 /*107 * return the virtual address at the corresponding offset108 */109 static inline void *snd_sgbuf_get_ptr(struct snd_dma_buffer *dmab,110 size_t offset)111 {112 struct snd_sg_buf *sgbuf = dmab->private_data;113 114 if (!sgbuf)115 return dmab->area + offset;116 return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE;117 }118 119 unsigned int snd_sgbuf_get_chunk_size(struct snd_dma_buffer *dmab,120 unsigned int ofs, unsigned int size);121 #else122 /* non-SG versions */123 static inline dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab,124 size_t offset)125 {126 return dmab->addr + offset;127 }128 129 static inline void *snd_sgbuf_get_ptr(struct snd_dma_buffer *dmab,130 size_t offset)131 {132 return dmab->area + offset;133 }134 135 #define snd_sgbuf_get_chunk_size(dmab, ofs, size) (size)136 137 #endif /* CONFIG_SND_DMA_SGBUF */138 139 68 /* allocate/release a buffer */ 140 69 int snd_dma_alloc_pages(int type, struct device *dev, size_t size, … … 143 72 struct snd_dma_buffer *dmab); 144 73 void snd_dma_free_pages(struct snd_dma_buffer *dmab); 74 int snd_dma_buffer_mmap(struct snd_dma_buffer *dmab, 75 struct vm_area_struct *area); 76 77 dma_addr_t snd_sgbuf_get_addr(struct snd_dma_buffer *dmab, size_t offset); 78 struct page *snd_sgbuf_get_page(struct snd_dma_buffer *dmab, size_t offset); 79 unsigned int snd_sgbuf_get_chunk_size(struct snd_dma_buffer *dmab, 80 unsigned int ofs, unsigned int size); 145 81 146 82 #endif /* __SOUND_MEMALLOC_H */ -
GPL/trunk/alsa-kernel/include/sound/pcm.h
r695 r703 1087 1087 int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, 1088 1088 unsigned int cmd, void *arg); 1089 void snd_pcm_period_elapsed_under_stream_lock(struct snd_pcm_substream *substream); 1089 1090 void snd_pcm_period_elapsed(struct snd_pcm_substream *substream); 1090 1091 snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream, … … 1274 1275 #define snd_pcm_get_dma_buf(substream) ((substream)->runtime->dma_buffer_p) 1275 1276 1276 #ifdef CONFIG_SND_DMA_SGBUF1277 /*1278 * SG-buffer handling1279 */1280 #define snd_pcm_substream_sgbuf(substream) \1281 snd_pcm_get_dma_buf(substream)->private_data1282 #endif /* SND_DMA_SGBUF */1283 1284 1277 /** 1285 1278 * snd_pcm_sgbuf_get_addr - Get the DMA address at the corresponding offset … … 1291 1284 { 1292 1285 return snd_sgbuf_get_addr(snd_pcm_get_dma_buf(substream), ofs); 1293 }1294 1295 /**1296 * snd_pcm_sgbuf_get_ptr - Get the virtual address at the corresponding offset1297 * @substream: PCM substream1298 * @ofs: byte offset1299 */1300 static inline void *1301 snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs)1302 {1303 return snd_sgbuf_get_ptr(snd_pcm_get_dma_buf(substream), ofs);1304 1286 } 1305 1287 -
GPL/trunk/alsa-kernel/include/sound/pcm_iec958.h
r679 r703 4 4 5 5 #include <linux/types.h> 6 7 int snd_pcm_create_iec958_consumer_default(u8 *cs, size_t len); 8 9 int snd_pcm_fill_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, 10 size_t len); 11 12 int snd_pcm_fill_iec958_consumer_hw_params(struct snd_pcm_hw_params *params, 13 u8 *cs, size_t len); 6 14 7 15 int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs, -
GPL/trunk/alsa-kernel/include/sound/rawmidi.h
r679 r703 82 82 bool append; /* append flag (merge more streams) */ 83 83 bool active_sensing; /* send active sensing when close */ 84 unsigned int framing; /* whether to frame input data */ 85 unsigned int clock_type; /* clock source to use for input framing */ 84 86 int use_count; /* use counter (for output) */ 85 87 size_t bytes; -
GPL/trunk/alsa-kernel/include/sound/soc-dai.h
r695 r703 37 37 #define SND_SOC_DAIFMT_LSB SND_SOC_DAIFMT_RIGHT_J 38 38 39 /* Describes the possible PCM format */ 40 /* 41 * use SND_SOC_DAI_FORMAT_xx as eash shift. 42 * see 43 * snd_soc_runtime_get_dai_fmt() 44 */ 45 #define SND_SOC_POSSIBLE_DAIFMT_FORMAT_SHIFT 0 46 #define SND_SOC_POSSIBLE_DAIFMT_FORMAT_MASK (0xFFFF << SND_SOC_POSSIBLE_DAIFMT_FORMAT_SHIFT) 47 #define SND_SOC_POSSIBLE_DAIFMT_I2S (1 << SND_SOC_DAI_FORMAT_I2S) 48 #define SND_SOC_POSSIBLE_DAIFMT_RIGHT_J (1 << SND_SOC_DAI_FORMAT_RIGHT_J) 49 #define SND_SOC_POSSIBLE_DAIFMT_LEFT_J (1 << SND_SOC_DAI_FORMAT_LEFT_J) 50 #define SND_SOC_POSSIBLE_DAIFMT_DSP_A (1 << SND_SOC_DAI_FORMAT_DSP_A) 51 #define SND_SOC_POSSIBLE_DAIFMT_DSP_B (1 << SND_SOC_DAI_FORMAT_DSP_B) 52 #define SND_SOC_POSSIBLE_DAIFMT_AC97 (1 << SND_SOC_DAI_FORMAT_AC97) 53 #define SND_SOC_POSSIBLE_DAIFMT_PDM (1 << SND_SOC_DAI_FORMAT_PDM) 54 39 55 /* 40 56 * DAI Clock gating. … … 45 61 #define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */ 46 62 #define SND_SOC_DAIFMT_GATED (0 << 4) /* clock is gated */ 63 64 /* Describes the possible PCM format */ 65 /* 66 * define GATED -> CONT. GATED will be selected if both are selected. 67 * see 68 * snd_soc_runtime_get_dai_fmt() 69 */ 70 #define SND_SOC_POSSIBLE_DAIFMT_CLOCK_SHIFT 16 71 #define SND_SOC_POSSIBLE_DAIFMT_CLOCK_MASK (0xFFFF << SND_SOC_POSSIBLE_DAIFMT_CLOCK_SHIFT) 72 #define SND_SOC_POSSIBLE_DAIFMT_GATED (0x1ULL << SND_SOC_POSSIBLE_DAIFMT_CLOCK_SHIFT) 73 #define SND_SOC_POSSIBLE_DAIFMT_CONT (0x2ULL << SND_SOC_POSSIBLE_DAIFMT_CLOCK_SHIFT) 47 74 48 75 /* … … 72 99 #define SND_SOC_DAIFMT_IB_IF (4 << 8) /* invert BCLK + FRM */ 73 100 101 /* Describes the possible PCM format */ 102 #define SND_SOC_POSSIBLE_DAIFMT_INV_SHIFT 32 103 #define SND_SOC_POSSIBLE_DAIFMT_INV_MASK (0xFFFFULL << SND_SOC_POSSIBLE_DAIFMT_INV_SHIFT) 104 #define SND_SOC_POSSIBLE_DAIFMT_NB_NF (0x1ULL << SND_SOC_POSSIBLE_DAIFMT_INV_SHIFT) 105 #define SND_SOC_POSSIBLE_DAIFMT_NB_IF (0x2ULL << SND_SOC_POSSIBLE_DAIFMT_INV_SHIFT) 106 #define SND_SOC_POSSIBLE_DAIFMT_IB_NF (0x4ULL << SND_SOC_POSSIBLE_DAIFMT_INV_SHIFT) 107 #define SND_SOC_POSSIBLE_DAIFMT_IB_IF (0x8ULL << SND_SOC_POSSIBLE_DAIFMT_INV_SHIFT) 108 74 109 /* 75 110 * DAI hardware clock providers/consumers … … 89 124 #define SND_SOC_DAIFMT_CBM_CFS SND_SOC_DAIFMT_CBP_CFC 90 125 #define SND_SOC_DAIFMT_CBS_CFS SND_SOC_DAIFMT_CBC_CFC 126 127 /* Describes the possible PCM format */ 128 #define SND_SOC_POSSIBLE_DAIFMT_CLOCK_PROVIDER_SHIFT 48 129 #define SND_SOC_POSSIBLE_DAIFMT_CLOCK_PROVIDER_MASK (0xFFFFULL << SND_SOC_POSSIBLE_DAIFMT_CLOCK_PROVIDER_SHIFT) 130 #define SND_SOC_POSSIBLE_DAIFMT_CBP_CFP (0x1ULL << SND_SOC_POSSIBLE_DAIFMT_CLOCK_PROVIDER_SHIFT) 131 #define SND_SOC_POSSIBLE_DAIFMT_CBC_CFP (0x2ULL << SND_SOC_POSSIBLE_DAIFMT_CLOCK_PROVIDER_SHIFT) 132 #define SND_SOC_POSSIBLE_DAIFMT_CBP_CFC (0x4ULL << SND_SOC_POSSIBLE_DAIFMT_CLOCK_PROVIDER_SHIFT) 133 #define SND_SOC_POSSIBLE_DAIFMT_CBC_CFC (0x8ULL << SND_SOC_POSSIBLE_DAIFMT_CLOCK_PROVIDER_SHIFT) 91 134 92 135 #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f … … 132 175 133 176 /* Digital Audio interface formatting */ 177 int snd_soc_dai_get_fmt_max_priority(struct snd_soc_pcm_runtime *rtd); 178 u64 snd_soc_dai_get_fmt(struct snd_soc_dai *dai, int priority); 134 179 int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); 135 180 … … 293 338 struct snd_soc_dai *); 294 339 340 /* 341 * Format list for auto selection. 342 * Format will be increased if priority format was 343 * not selected. 344 * see 345 * snd_soc_dai_get_fmt() 346 */ 347 u64 *auto_selectable_formats; 348 int num_auto_selectable_formats; 349 295 350 /* bit field */ 296 351 unsigned int no_capture_mute:1; -
GPL/trunk/alsa-kernel/include/sound/soc-topology.h
r695 r703 55 55 /* dynamic widget object */ 56 56 struct snd_soc_dobj_widget { 57 unsigned int kcontrol_type; /* kcontrol type: mixer, enum, bytes */57 unsigned int *kcontrol_type; /* kcontrol type: mixer, enum, bytes */ 58 58 }; 59 59 -
GPL/trunk/alsa-kernel/include/sound/soc.h
r695 r703 1239 1239 const char *propname); 1240 1240 int snd_soc_of_parse_aux_devs(struct snd_soc_card *card, const char *propname); 1241 unsigned int snd_soc_of_parse_daifmt(struct device_node *np, 1242 const char *prefix, 1243 struct device_node **bitclkmaster, 1244 struct device_node **framemaster); 1241 1242 unsigned int snd_soc_daifmt_clock_provider_fliped(unsigned int dai_fmt); 1243 unsigned int snd_soc_daifmt_clock_provider_from_bitmap(unsigned int bit_frame); 1244 1245 unsigned int snd_soc_daifmt_parse_format(struct device_node *np, const char *prefix); 1246 unsigned int snd_soc_daifmt_parse_clock_provider_raw(struct device_node *np, 1247 const char *prefix, 1248 struct device_node **bitclkmaster, 1249 struct device_node **framemaster); 1250 #define snd_soc_daifmt_parse_clock_provider_as_bitmap(np, prefix) \ 1251 snd_soc_daifmt_parse_clock_provider_raw(np, prefix, NULL, NULL) 1252 #define snd_soc_daifmt_parse_clock_provider_as_phandle \ 1253 snd_soc_daifmt_parse_clock_provider_raw 1254 #define snd_soc_daifmt_parse_clock_provider_as_flag(np, prefix) \ 1255 snd_soc_daifmt_clock_provider_from_bitmap( \ 1256 snd_soc_daifmt_parse_clock_provider_as_bitmap(np, prefix)) 1257 1245 1258 int snd_soc_get_dai_id(struct device_node *ep); 1246 1259 int snd_soc_get_dai_name(const struct of_phandle_args *args, -
GPL/trunk/alsa-kernel/include/sound/version.h
r695 r703 1 1 /* include/version.h */ 2 #define CONFIG_SND_VERSION "5.1 3.10"2 #define CONFIG_SND_VERSION "5.14.7" 3 3 #define CONFIG_SND_DATE "" -
GPL/trunk/alsa-kernel/include/uapi/sound/asound.h
r629 r703 748 748 */ 749 749 750 #define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 1)750 #define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 2) 751 751 752 752 enum { … … 774 774 }; 775 775 776 #define SNDRV_RAWMIDI_MODE_FRAMING_MASK (7<<0) 777 #define SNDRV_RAWMIDI_MODE_FRAMING_SHIFT 0 778 #define SNDRV_RAWMIDI_MODE_FRAMING_NONE (0<<0) 779 #define SNDRV_RAWMIDI_MODE_FRAMING_TSTAMP (1<<0) 780 #define SNDRV_RAWMIDI_MODE_CLOCK_MASK (7<<3) 781 #define SNDRV_RAWMIDI_MODE_CLOCK_SHIFT 3 782 #define SNDRV_RAWMIDI_MODE_CLOCK_NONE (0<<3) 783 #define SNDRV_RAWMIDI_MODE_CLOCK_REALTIME (1<<3) 784 #define SNDRV_RAWMIDI_MODE_CLOCK_MONOTONIC (2<<3) 785 #define SNDRV_RAWMIDI_MODE_CLOCK_MONOTONIC_RAW (3<<3) 786 787 #define SNDRV_RAWMIDI_FRAMING_DATA_LENGTH 16 788 789 struct snd_rawmidi_framing_tstamp { 790 /* For now, frame_type is always 0. Midi 2.0 is expected to add new 791 * types here. Applications are expected to skip unknown frame types. 792 */ 793 __u8 frame_type; 794 __u8 length; /* number of valid bytes in data field */ 795 __u8 reserved[2]; 796 __u32 tv_nsec; /* nanoseconds */ 797 __u64 tv_sec; /* seconds */ 798 __u8 data[SNDRV_RAWMIDI_FRAMING_DATA_LENGTH]; 799 #ifndef TARGET_OS2 800 } __packed; 801 #else 802 }; 803 #endif 804 776 805 struct snd_rawmidi_params { 777 806 int stream; … … 779 808 size_t avail_min; /* minimum avail bytes for wakeup */ 780 809 unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */ 781 unsigned char reserved[16]; /* reserved for future use */ 810 unsigned int mode; /* For input data only, frame incoming data */ 811 unsigned char reserved[12]; /* reserved for future use */ 782 812 }; 783 813
Note:
See TracChangeset
for help on using the changeset viewer.