diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-03-23 08:14:02 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-03-23 08:14:02 -0400 |
commit | 3372dbdd8ca11f51be8c6a30b2bc79eb04c4a902 (patch) | |
tree | d4499bf5a5665b4820ffaf96bce55bf6b895195e /include | |
parent | bc465aa9d045feb0e13b4a8f32cc33c1943f62d6 (diff) | |
parent | 967b1307b69b8ada8b331e01046ad1ef83742e99 (diff) |
Merge branch 'for-next' into topic/hda-core
Diffstat (limited to 'include')
-rw-r--r-- | include/sound/compress_driver.h | 4 | ||||
-rw-r--r-- | include/sound/control.h | 2 | ||||
-rw-r--r-- | include/sound/core.h | 3 | ||||
-rw-r--r-- | include/sound/pcm.h | 66 | ||||
-rw-r--r-- | include/sound/pcm_params.h | 7 | ||||
-rw-r--r-- | include/sound/seq_device.h | 46 | ||||
-rw-r--r-- | include/sound/seq_kernel.h | 6 | ||||
-rw-r--r-- | include/sound/soc.h | 18 | ||||
-rw-r--r-- | include/uapi/sound/asequencer.h | 1 | ||||
-rw-r--r-- | include/uapi/sound/asound.h | 39 | ||||
-rw-r--r-- | include/uapi/sound/compress_offload.h | 2 | ||||
-rw-r--r-- | include/uapi/sound/emu10k1.h | 3 | ||||
-rw-r--r-- | include/uapi/sound/hdspm.h | 6 |
13 files changed, 163 insertions, 40 deletions
diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h index f48089d364c5..fa1d05512c09 100644 --- a/include/sound/compress_driver.h +++ b/include/sound/compress_driver.h | |||
@@ -70,7 +70,7 @@ struct snd_compr_runtime { | |||
70 | * @device: device pointer | 70 | * @device: device pointer |
71 | * @direction: stream direction, playback/recording | 71 | * @direction: stream direction, playback/recording |
72 | * @metadata_set: metadata set flag, true when set | 72 | * @metadata_set: metadata set flag, true when set |
73 | * @next_track: has userspace signall next track transistion, true when set | 73 | * @next_track: has userspace signal next track transition, true when set |
74 | * @private_data: pointer to DSP private data | 74 | * @private_data: pointer to DSP private data |
75 | */ | 75 | */ |
76 | struct snd_compr_stream { | 76 | struct snd_compr_stream { |
@@ -95,7 +95,7 @@ struct snd_compr_stream { | |||
95 | * and the stream properties | 95 | * and the stream properties |
96 | * @get_params: retrieve the codec parameters, mandatory | 96 | * @get_params: retrieve the codec parameters, mandatory |
97 | * @set_metadata: Set the metadata values for a stream | 97 | * @set_metadata: Set the metadata values for a stream |
98 | * @get_metadata: retreives the requested metadata values from stream | 98 | * @get_metadata: retrieves the requested metadata values from stream |
99 | * @trigger: Trigger operations like start, pause, resume, drain, stop. | 99 | * @trigger: Trigger operations like start, pause, resume, drain, stop. |
100 | * This callback is mandatory | 100 | * This callback is mandatory |
101 | * @pointer: Retrieve current h/w pointer information. Mandatory | 101 | * @pointer: Retrieve current h/w pointer information. Mandatory |
diff --git a/include/sound/control.h b/include/sound/control.h index 75f3054023f7..95aad6d3fd1a 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
@@ -227,7 +227,7 @@ snd_ctl_add_slave(struct snd_kcontrol *master, struct snd_kcontrol *slave) | |||
227 | * Add a virtual slave control to the given master. | 227 | * Add a virtual slave control to the given master. |
228 | * Unlike snd_ctl_add_slave(), the element added via this function | 228 | * Unlike snd_ctl_add_slave(), the element added via this function |
229 | * is supposed to have volatile values, and get callback is called | 229 | * is supposed to have volatile values, and get callback is called |
230 | * at each time quried from the master. | 230 | * at each time queried from the master. |
231 | * | 231 | * |
232 | * When the control peeks the hardware values directly and the value | 232 | * When the control peeks the hardware values directly and the value |
233 | * can be changed by other means than the put callback of the element, | 233 | * can be changed by other means than the put callback of the element, |
diff --git a/include/sound/core.h b/include/sound/core.h index da5748289968..b12931f513f4 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -278,7 +278,8 @@ int snd_device_new(struct snd_card *card, enum snd_device_type type, | |||
278 | void *device_data, struct snd_device_ops *ops); | 278 | void *device_data, struct snd_device_ops *ops); |
279 | int snd_device_register(struct snd_card *card, void *device_data); | 279 | int snd_device_register(struct snd_card *card, void *device_data); |
280 | int snd_device_register_all(struct snd_card *card); | 280 | int snd_device_register_all(struct snd_card *card); |
281 | int snd_device_disconnect_all(struct snd_card *card); | 281 | void snd_device_disconnect(struct snd_card *card, void *device_data); |
282 | void snd_device_disconnect_all(struct snd_card *card); | ||
282 | void snd_device_free(struct snd_card *card, void *device_data); | 283 | void snd_device_free(struct snd_card *card, void *device_data); |
283 | void snd_device_free_all(struct snd_card *card); | 284 | void snd_device_free_all(struct snd_card *card); |
284 | 285 | ||
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index c0ddb7e69c28..0cb7f3f5df7b 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -60,6 +60,9 @@ struct snd_pcm_hardware { | |||
60 | 60 | ||
61 | struct snd_pcm_substream; | 61 | struct snd_pcm_substream; |
62 | 62 | ||
63 | struct snd_pcm_audio_tstamp_config; /* definitions further down */ | ||
64 | struct snd_pcm_audio_tstamp_report; | ||
65 | |||
63 | struct snd_pcm_ops { | 66 | struct snd_pcm_ops { |
64 | int (*open)(struct snd_pcm_substream *substream); | 67 | int (*open)(struct snd_pcm_substream *substream); |
65 | int (*close)(struct snd_pcm_substream *substream); | 68 | int (*close)(struct snd_pcm_substream *substream); |
@@ -71,8 +74,10 @@ struct snd_pcm_ops { | |||
71 | int (*prepare)(struct snd_pcm_substream *substream); | 74 | int (*prepare)(struct snd_pcm_substream *substream); |
72 | int (*trigger)(struct snd_pcm_substream *substream, int cmd); | 75 | int (*trigger)(struct snd_pcm_substream *substream, int cmd); |
73 | snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream); | 76 | snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream); |
74 | int (*wall_clock)(struct snd_pcm_substream *substream, | 77 | int (*get_time_info)(struct snd_pcm_substream *substream, |
75 | struct timespec *audio_ts); | 78 | struct timespec *system_ts, struct timespec *audio_ts, |
79 | struct snd_pcm_audio_tstamp_config *audio_tstamp_config, | ||
80 | struct snd_pcm_audio_tstamp_report *audio_tstamp_report); | ||
76 | int (*copy)(struct snd_pcm_substream *substream, int channel, | 81 | int (*copy)(struct snd_pcm_substream *substream, int channel, |
77 | snd_pcm_uframes_t pos, | 82 | snd_pcm_uframes_t pos, |
78 | void __user *buf, snd_pcm_uframes_t count); | 83 | void __user *buf, snd_pcm_uframes_t count); |
@@ -281,6 +286,58 @@ struct snd_pcm_hw_constraint_ranges { | |||
281 | 286 | ||
282 | struct snd_pcm_hwptr_log; | 287 | struct snd_pcm_hwptr_log; |
283 | 288 | ||
289 | /* | ||
290 | * userspace-provided audio timestamp config to kernel, | ||
291 | * structure is for internal use only and filled with dedicated unpack routine | ||
292 | */ | ||
293 | struct snd_pcm_audio_tstamp_config { | ||
294 | /* 5 of max 16 bits used */ | ||
295 | u32 type_requested:4; | ||
296 | u32 report_delay:1; /* add total delay to A/D or D/A */ | ||
297 | }; | ||
298 | |||
299 | static inline void snd_pcm_unpack_audio_tstamp_config(__u32 data, | ||
300 | struct snd_pcm_audio_tstamp_config *config) | ||
301 | { | ||
302 | config->type_requested = data & 0xF; | ||
303 | config->report_delay = (data >> 4) & 1; | ||
304 | } | ||
305 | |||
306 | /* | ||
307 | * kernel-provided audio timestamp report to user-space | ||
308 | * structure is for internal use only and read by dedicated pack routine | ||
309 | */ | ||
310 | struct snd_pcm_audio_tstamp_report { | ||
311 | /* 6 of max 16 bits used for bit-fields */ | ||
312 | |||
313 | /* for backwards compatibility */ | ||
314 | u32 valid:1; | ||
315 | |||
316 | /* actual type if hardware could not support requested timestamp */ | ||
317 | u32 actual_type:4; | ||
318 | |||
319 | /* accuracy represented in ns units */ | ||
320 | u32 accuracy_report:1; /* 0 if accuracy unknown, 1 if accuracy field is valid */ | ||
321 | u32 accuracy; /* up to 4.29s, will be packed in separate field */ | ||
322 | }; | ||
323 | |||
324 | static inline void snd_pcm_pack_audio_tstamp_report(__u32 *data, __u32 *accuracy, | ||
325 | const struct snd_pcm_audio_tstamp_report *report) | ||
326 | { | ||
327 | u32 tmp; | ||
328 | |||
329 | tmp = report->accuracy_report; | ||
330 | tmp <<= 4; | ||
331 | tmp |= report->actual_type; | ||
332 | tmp <<= 1; | ||
333 | tmp |= report->valid; | ||
334 | |||
335 | *data &= 0xffff; /* zero-clear MSBs */ | ||
336 | *data |= (tmp << 16); | ||
337 | *accuracy = report->accuracy; | ||
338 | } | ||
339 | |||
340 | |||
284 | struct snd_pcm_runtime { | 341 | struct snd_pcm_runtime { |
285 | /* -- Status -- */ | 342 | /* -- Status -- */ |
286 | struct snd_pcm_substream *trigger_master; | 343 | struct snd_pcm_substream *trigger_master; |
@@ -361,6 +418,11 @@ struct snd_pcm_runtime { | |||
361 | 418 | ||
362 | struct snd_dma_buffer *dma_buffer_p; /* allocated buffer */ | 419 | struct snd_dma_buffer *dma_buffer_p; /* allocated buffer */ |
363 | 420 | ||
421 | /* -- audio timestamp config -- */ | ||
422 | struct snd_pcm_audio_tstamp_config audio_tstamp_config; | ||
423 | struct snd_pcm_audio_tstamp_report audio_tstamp_report; | ||
424 | struct timespec driver_tstamp; | ||
425 | |||
364 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 426 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
365 | /* -- OSS things -- */ | 427 | /* -- OSS things -- */ |
366 | struct snd_pcm_oss_runtime oss; | 428 | struct snd_pcm_oss_runtime oss; |
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 3c45f3924ba7..c704357775fc 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h | |||
@@ -366,4 +366,11 @@ static inline int params_physical_width(const struct snd_pcm_hw_params *p) | |||
366 | return snd_pcm_format_physical_width(params_format(p)); | 366 | return snd_pcm_format_physical_width(params_format(p)); |
367 | } | 367 | } |
368 | 368 | ||
369 | static inline void | ||
370 | params_set_format(struct snd_pcm_hw_params *p, snd_pcm_format_t fmt) | ||
371 | { | ||
372 | snd_mask_set(hw_param_mask(p, SNDRV_PCM_HW_PARAM_FORMAT), | ||
373 | (__force int)fmt); | ||
374 | } | ||
375 | |||
369 | #endif /* __SOUND_PCM_PARAMS_H */ | 376 | #endif /* __SOUND_PCM_PARAMS_H */ |
diff --git a/include/sound/seq_device.h b/include/sound/seq_device.h index 2b5f24cc7548..ddc0d504cf39 100644 --- a/include/sound/seq_device.h +++ b/include/sound/seq_device.h | |||
@@ -25,29 +25,26 @@ | |||
25 | * registered device information | 25 | * registered device information |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #define ID_LEN 32 | ||
29 | |||
30 | /* status flag */ | ||
31 | #define SNDRV_SEQ_DEVICE_FREE 0 | ||
32 | #define SNDRV_SEQ_DEVICE_REGISTERED 1 | ||
33 | |||
34 | struct snd_seq_device { | 28 | struct snd_seq_device { |
35 | /* device info */ | 29 | /* device info */ |
36 | struct snd_card *card; /* sound card */ | 30 | struct snd_card *card; /* sound card */ |
37 | int device; /* device number */ | 31 | int device; /* device number */ |
38 | char id[ID_LEN]; /* driver id */ | 32 | const char *id; /* driver id */ |
39 | char name[80]; /* device name */ | 33 | char name[80]; /* device name */ |
40 | int argsize; /* size of the argument */ | 34 | int argsize; /* size of the argument */ |
41 | void *driver_data; /* private data for driver */ | 35 | void *driver_data; /* private data for driver */ |
42 | int status; /* flag - read only */ | ||
43 | void *private_data; /* private data for the caller */ | 36 | void *private_data; /* private data for the caller */ |
44 | void (*private_free)(struct snd_seq_device *device); | 37 | void (*private_free)(struct snd_seq_device *device); |
45 | struct list_head list; /* link to next device */ | 38 | struct device dev; |
46 | }; | 39 | }; |
47 | 40 | ||
41 | #define to_seq_dev(_dev) \ | ||
42 | container_of(_dev, struct snd_seq_device, dev) | ||
43 | |||
44 | /* sequencer driver */ | ||
48 | 45 | ||
49 | /* driver operators | 46 | /* driver operators |
50 | * init_device: | 47 | * probe: |
51 | * Initialize the device with given parameters. | 48 | * Initialize the device with given parameters. |
52 | * Typically, | 49 | * Typically, |
53 | * 1. call snd_hwdep_new | 50 | * 1. call snd_hwdep_new |
@@ -55,25 +52,40 @@ struct snd_seq_device { | |||
55 | * 3. call snd_hwdep_register | 52 | * 3. call snd_hwdep_register |
56 | * 4. store the instance to dev->driver_data pointer. | 53 | * 4. store the instance to dev->driver_data pointer. |
57 | * | 54 | * |
58 | * free_device: | 55 | * remove: |
59 | * Release the private data. | 56 | * Release the private data. |
60 | * Typically, call snd_device_free(dev->card, dev->driver_data) | 57 | * Typically, call snd_device_free(dev->card, dev->driver_data) |
61 | */ | 58 | */ |
62 | struct snd_seq_dev_ops { | 59 | struct snd_seq_driver { |
63 | int (*init_device)(struct snd_seq_device *dev); | 60 | struct device_driver driver; |
64 | int (*free_device)(struct snd_seq_device *dev); | 61 | char *id; |
62 | int argsize; | ||
65 | }; | 63 | }; |
66 | 64 | ||
65 | #define to_seq_drv(_drv) \ | ||
66 | container_of(_drv, struct snd_seq_driver, driver) | ||
67 | |||
67 | /* | 68 | /* |
68 | * prototypes | 69 | * prototypes |
69 | */ | 70 | */ |
71 | #ifdef CONFIG_MODULES | ||
70 | void snd_seq_device_load_drivers(void); | 72 | void snd_seq_device_load_drivers(void); |
71 | int snd_seq_device_new(struct snd_card *card, int device, char *id, int argsize, struct snd_seq_device **result); | 73 | #else |
72 | int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry, int argsize); | 74 | #define snd_seq_device_load_drivers() |
73 | int snd_seq_device_unregister_driver(char *id); | 75 | #endif |
76 | int snd_seq_device_new(struct snd_card *card, int device, const char *id, | ||
77 | int argsize, struct snd_seq_device **result); | ||
74 | 78 | ||
75 | #define SNDRV_SEQ_DEVICE_ARGPTR(dev) (void *)((char *)(dev) + sizeof(struct snd_seq_device)) | 79 | #define SNDRV_SEQ_DEVICE_ARGPTR(dev) (void *)((char *)(dev) + sizeof(struct snd_seq_device)) |
76 | 80 | ||
81 | int __must_check __snd_seq_driver_register(struct snd_seq_driver *drv, | ||
82 | struct module *mod); | ||
83 | #define snd_seq_driver_register(drv) \ | ||
84 | __snd_seq_driver_register(drv, THIS_MODULE) | ||
85 | void snd_seq_driver_unregister(struct snd_seq_driver *drv); | ||
86 | |||
87 | #define module_snd_seq_driver(drv) \ | ||
88 | module_driver(drv, snd_seq_driver_register, snd_seq_driver_unregister) | ||
77 | 89 | ||
78 | /* | 90 | /* |
79 | * id strings for generic devices | 91 | * id strings for generic devices |
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h index 18a2ac58b88f..feb58d455560 100644 --- a/include/sound/seq_kernel.h +++ b/include/sound/seq_kernel.h | |||
@@ -99,13 +99,9 @@ int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp, | |||
99 | int snd_seq_event_port_detach(int client, int port); | 99 | int snd_seq_event_port_detach(int client, int port); |
100 | 100 | ||
101 | #ifdef CONFIG_MODULES | 101 | #ifdef CONFIG_MODULES |
102 | void snd_seq_autoload_lock(void); | ||
103 | void snd_seq_autoload_unlock(void); | ||
104 | void snd_seq_autoload_init(void); | 102 | void snd_seq_autoload_init(void); |
105 | #define snd_seq_autoload_exit() snd_seq_autoload_lock() | 103 | void snd_seq_autoload_exit(void); |
106 | #else | 104 | #else |
107 | #define snd_seq_autoload_lock() | ||
108 | #define snd_seq_autoload_unlock() | ||
109 | #define snd_seq_autoload_init() | 105 | #define snd_seq_autoload_init() |
110 | #define snd_seq_autoload_exit() | 106 | #define snd_seq_autoload_exit() |
111 | #endif | 107 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 0d1ade195628..b371aef9819f 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -450,8 +450,10 @@ int soc_dai_hw_params(struct snd_pcm_substream *substream, | |||
450 | struct snd_soc_dai *dai); | 450 | struct snd_soc_dai *dai); |
451 | 451 | ||
452 | /* Jack reporting */ | 452 | /* Jack reporting */ |
453 | int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type, | 453 | int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type, |
454 | struct snd_soc_jack *jack); | 454 | struct snd_soc_jack *jack, struct snd_soc_jack_pin *pins, |
455 | unsigned int num_pins); | ||
456 | |||
455 | void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); | 457 | void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask); |
456 | int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, | 458 | int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count, |
457 | struct snd_soc_jack_pin *pins); | 459 | struct snd_soc_jack_pin *pins); |
@@ -659,7 +661,7 @@ struct snd_soc_jack_gpio { | |||
659 | struct snd_soc_jack { | 661 | struct snd_soc_jack { |
660 | struct mutex mutex; | 662 | struct mutex mutex; |
661 | struct snd_jack *jack; | 663 | struct snd_jack *jack; |
662 | struct snd_soc_codec *codec; | 664 | struct snd_soc_card *card; |
663 | struct list_head pins; | 665 | struct list_head pins; |
664 | int status; | 666 | int status; |
665 | struct blocking_notifier_head notifier; | 667 | struct blocking_notifier_head notifier; |
@@ -954,6 +956,9 @@ struct snd_soc_dai_link { | |||
954 | unsigned int symmetric_channels:1; | 956 | unsigned int symmetric_channels:1; |
955 | unsigned int symmetric_samplebits:1; | 957 | unsigned int symmetric_samplebits:1; |
956 | 958 | ||
959 | /* Mark this pcm with non atomic ops */ | ||
960 | bool nonatomic; | ||
961 | |||
957 | /* Do not create a PCM for this DAI link (Backend link) */ | 962 | /* Do not create a PCM for this DAI link (Backend link) */ |
958 | unsigned int no_pcm:1; | 963 | unsigned int no_pcm:1; |
959 | 964 | ||
@@ -1071,11 +1076,16 @@ struct snd_soc_card { | |||
1071 | 1076 | ||
1072 | /* | 1077 | /* |
1073 | * Card-specific routes and widgets. | 1078 | * Card-specific routes and widgets. |
1079 | * Note: of_dapm_xxx for Device Tree; Otherwise for driver build-in. | ||
1074 | */ | 1080 | */ |
1075 | const struct snd_soc_dapm_widget *dapm_widgets; | 1081 | const struct snd_soc_dapm_widget *dapm_widgets; |
1076 | int num_dapm_widgets; | 1082 | int num_dapm_widgets; |
1077 | const struct snd_soc_dapm_route *dapm_routes; | 1083 | const struct snd_soc_dapm_route *dapm_routes; |
1078 | int num_dapm_routes; | 1084 | int num_dapm_routes; |
1085 | const struct snd_soc_dapm_widget *of_dapm_widgets; | ||
1086 | int num_of_dapm_widgets; | ||
1087 | const struct snd_soc_dapm_route *of_dapm_routes; | ||
1088 | int num_of_dapm_routes; | ||
1079 | bool fully_routed; | 1089 | bool fully_routed; |
1080 | 1090 | ||
1081 | struct work_struct deferred_resume_work; | 1091 | struct work_struct deferred_resume_work; |
@@ -1469,7 +1479,7 @@ static inline struct snd_soc_codec *snd_soc_kcontrol_codec( | |||
1469 | } | 1479 | } |
1470 | 1480 | ||
1471 | /** | 1481 | /** |
1472 | * snd_soc_kcontrol_platform() - Returns the platform that registerd the control | 1482 | * snd_soc_kcontrol_platform() - Returns the platform that registered the control |
1473 | * @kcontrol: The control for which to get the platform | 1483 | * @kcontrol: The control for which to get the platform |
1474 | * | 1484 | * |
1475 | * Note: This function will only work correctly if the control has been | 1485 | * Note: This function will only work correctly if the control has been |
diff --git a/include/uapi/sound/asequencer.h b/include/uapi/sound/asequencer.h index 09c8a00ea503..5a5fa4956ebd 100644 --- a/include/uapi/sound/asequencer.h +++ b/include/uapi/sound/asequencer.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef _UAPI__SOUND_ASEQUENCER_H | 22 | #ifndef _UAPI__SOUND_ASEQUENCER_H |
23 | #define _UAPI__SOUND_ASEQUENCER_H | 23 | #define _UAPI__SOUND_ASEQUENCER_H |
24 | 24 | ||
25 | #include <sound/asound.h> | ||
25 | 26 | ||
26 | /** version of the sequencer */ | 27 | /** version of the sequencer */ |
27 | #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1) | 28 | #define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1) |
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index 0e88e7a0f0eb..46145a5277fe 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h | |||
@@ -25,6 +25,9 @@ | |||
25 | 25 | ||
26 | #include <linux/types.h> | 26 | #include <linux/types.h> |
27 | 27 | ||
28 | #ifndef __KERNEL__ | ||
29 | #include <stdlib.h> | ||
30 | #endif | ||
28 | 31 | ||
29 | /* | 32 | /* |
30 | * protocol version | 33 | * protocol version |
@@ -140,7 +143,7 @@ struct snd_hwdep_dsp_image { | |||
140 | * * | 143 | * * |
141 | *****************************************************************************/ | 144 | *****************************************************************************/ |
142 | 145 | ||
143 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 12) | 146 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 13) |
144 | 147 | ||
145 | typedef unsigned long snd_pcm_uframes_t; | 148 | typedef unsigned long snd_pcm_uframes_t; |
146 | typedef signed long snd_pcm_sframes_t; | 149 | typedef signed long snd_pcm_sframes_t; |
@@ -267,10 +270,17 @@ typedef int __bitwise snd_pcm_subformat_t; | |||
267 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ | 270 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ |
268 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ | 271 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ |
269 | #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */ | 272 | #define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */ |
270 | #define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000 /* has audio wall clock for audio/system time sync */ | 273 | #define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000 /* (Deprecated)has audio wall clock for audio/system time sync */ |
274 | #define SNDRV_PCM_INFO_HAS_LINK_ATIME 0x01000000 /* report hardware link audio time, reset on startup */ | ||
275 | #define SNDRV_PCM_INFO_HAS_LINK_ABSOLUTE_ATIME 0x02000000 /* report absolute hardware link audio time, not reset on startup */ | ||
276 | #define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000 /* report estimated link audio time */ | ||
277 | #define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000 /* report synchronized audio/system time */ | ||
278 | |||
271 | #define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */ | 279 | #define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */ |
272 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ | 280 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ |
273 | 281 | ||
282 | |||
283 | |||
274 | typedef int __bitwise snd_pcm_state_t; | 284 | typedef int __bitwise snd_pcm_state_t; |
275 | #define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */ | 285 | #define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */ |
276 | #define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */ | 286 | #define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */ |
@@ -408,6 +418,22 @@ struct snd_pcm_channel_info { | |||
408 | unsigned int step; /* samples distance in bits */ | 418 | unsigned int step; /* samples distance in bits */ |
409 | }; | 419 | }; |
410 | 420 | ||
421 | enum { | ||
422 | /* | ||
423 | * first definition for backwards compatibility only, | ||
424 | * maps to wallclock/link time for HDAudio playback and DEFAULT/DMA time for everything else | ||
425 | */ | ||
426 | SNDRV_PCM_AUDIO_TSTAMP_TYPE_COMPAT = 0, | ||
427 | |||
428 | /* timestamp definitions */ | ||
429 | SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT = 1, /* DMA time, reported as per hw_ptr */ | ||
430 | SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK = 2, /* link time reported by sample or wallclock counter, reset on startup */ | ||
431 | SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ABSOLUTE = 3, /* link time reported by sample or wallclock counter, not reset on startup */ | ||
432 | SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_ESTIMATED = 4, /* link time estimated indirectly */ | ||
433 | SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED = 5, /* link time synchronized with system time */ | ||
434 | SNDRV_PCM_AUDIO_TSTAMP_TYPE_LAST = SNDRV_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED | ||
435 | }; | ||
436 | |||
411 | struct snd_pcm_status { | 437 | struct snd_pcm_status { |
412 | snd_pcm_state_t state; /* stream state */ | 438 | snd_pcm_state_t state; /* stream state */ |
413 | struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ | 439 | struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ |
@@ -419,9 +445,11 @@ struct snd_pcm_status { | |||
419 | snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */ | 445 | snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */ |
420 | snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */ | 446 | snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */ |
421 | snd_pcm_state_t suspended_state; /* suspended stream state */ | 447 | snd_pcm_state_t suspended_state; /* suspended stream state */ |
422 | __u32 reserved_alignment; /* must be filled with zero */ | 448 | __u32 audio_tstamp_data; /* needed for 64-bit alignment, used for configs/report to/from userspace */ |
423 | struct timespec audio_tstamp; /* from sample counter or wall clock */ | 449 | struct timespec audio_tstamp; /* sample counter, wall clock, PHC or on-demand sync'ed */ |
424 | unsigned char reserved[56-sizeof(struct timespec)]; /* must be filled with zero */ | 450 | struct timespec driver_tstamp; /* useful in case reference system tstamp is reported with delay */ |
451 | __u32 audio_tstamp_accuracy; /* in ns units, only valid if indicated in audio_tstamp_data */ | ||
452 | unsigned char reserved[52-2*sizeof(struct timespec)]; /* must be filled with zero */ | ||
425 | }; | 453 | }; |
426 | 454 | ||
427 | struct snd_pcm_mmap_status { | 455 | struct snd_pcm_mmap_status { |
@@ -534,6 +562,7 @@ enum { | |||
534 | #define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t) | 562 | #define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t) |
535 | #define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22) | 563 | #define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22) |
536 | #define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr) | 564 | #define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr) |
565 | #define SNDRV_PCM_IOCTL_STATUS_EXT _IOWR('A', 0x24, struct snd_pcm_status) | ||
537 | #define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info) | 566 | #define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info) |
538 | #define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40) | 567 | #define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40) |
539 | #define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41) | 568 | #define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41) |
diff --git a/include/uapi/sound/compress_offload.h b/include/uapi/sound/compress_offload.h index 22ed8cb7800b..e00d8cbfc628 100644 --- a/include/uapi/sound/compress_offload.h +++ b/include/uapi/sound/compress_offload.h | |||
@@ -75,7 +75,7 @@ struct snd_compr_tstamp { | |||
75 | /** | 75 | /** |
76 | * struct snd_compr_avail - avail descriptor | 76 | * struct snd_compr_avail - avail descriptor |
77 | * @avail: Number of bytes available in ring buffer for writing/reading | 77 | * @avail: Number of bytes available in ring buffer for writing/reading |
78 | * @tstamp: timestamp infomation | 78 | * @tstamp: timestamp information |
79 | */ | 79 | */ |
80 | struct snd_compr_avail { | 80 | struct snd_compr_avail { |
81 | __u64 avail; | 81 | __u64 avail; |
diff --git a/include/uapi/sound/emu10k1.h b/include/uapi/sound/emu10k1.h index d1bbaf78457a..ec1535bb6aed 100644 --- a/include/uapi/sound/emu10k1.h +++ b/include/uapi/sound/emu10k1.h | |||
@@ -23,8 +23,7 @@ | |||
23 | #define _UAPI__SOUND_EMU10K1_H | 23 | #define _UAPI__SOUND_EMU10K1_H |
24 | 24 | ||
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | 26 | #include <sound/asound.h> | |
27 | |||
28 | 27 | ||
29 | /* | 28 | /* |
30 | * ---- FX8010 ---- | 29 | * ---- FX8010 ---- |
diff --git a/include/uapi/sound/hdspm.h b/include/uapi/sound/hdspm.h index b357f1a5e29c..5737332d38f2 100644 --- a/include/uapi/sound/hdspm.h +++ b/include/uapi/sound/hdspm.h | |||
@@ -20,6 +20,12 @@ | |||
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #ifdef __KERNEL__ | ||
24 | #include <linux/types.h> | ||
25 | #else | ||
26 | #include <stdint.h> | ||
27 | #endif | ||
28 | |||
23 | /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */ | 29 | /* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */ |
24 | #define HDSPM_MAX_CHANNELS 64 | 30 | #define HDSPM_MAX_CHANNELS 64 |
25 | 31 | ||