29
29
#include <linux/poll.h>
30
30
#include <linux/mm.h>
31
31
#include <linux/bitops.h>
32
#include <linux/pm_qos_params.h>
32
#include <linux/pm_qos.h>
34
34
#define snd_pcm_substream_chip(substream) ((substream)->private_data)
35
35
#define snd_pcm_chip(pcm) ((pcm)->private_data)
374
374
char name[32]; /* substream name */
375
375
int stream; /* stream (direction) */
376
struct pm_qos_request_list latency_pm_qos_req; /* pm_qos request */
376
struct pm_qos_request latency_pm_qos_req; /* pm_qos request */
377
377
size_t buffer_bytes_max; /* limit ring buffer size */
378
378
struct snd_dma_buffer dma_buffer;
379
379
unsigned int dma_buf_id;
507
507
void snd_pcm_vma_notify_data(void *client, void *data);
508
508
int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
511
#ifdef CONFIG_SND_DEBUG
512
void snd_pcm_debug_name(struct snd_pcm_substream *substream,
513
char *name, size_t len);
516
snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size)
749
761
return ¶ms->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
752
#define params_access(p) ((__force snd_pcm_access_t)snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)))
753
#define params_format(p) ((__force snd_pcm_format_t)snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_FORMAT)))
754
#define params_subformat(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_SUBFORMAT))
755
#define params_channels(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_CHANNELS)->min
756
#define params_rate(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_RATE)->min
757
#define params_period_size(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->min
758
#define params_period_bytes(p) ((params_period_size(p)*snd_pcm_format_physical_width(params_format(p))*params_channels(p))/8)
759
#define params_periods(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_PERIODS)->min
760
#define params_buffer_size(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_BUFFER_SIZE)->min
761
#define params_buffer_bytes(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->min
764
#define params_channels(p) \
765
(hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_CHANNELS)->min)
766
#define params_rate(p) \
767
(hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_RATE)->min)
768
#define params_period_size(p) \
769
(hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->min)
770
#define params_periods(p) \
771
(hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_PERIODS)->min)
772
#define params_buffer_size(p) \
773
(hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_BUFFER_SIZE)->min)
774
#define params_buffer_bytes(p) \
775
(hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->min)
764
777
int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v);
765
778
void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c);
812
825
int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime,
813
826
unsigned int cond,
814
827
snd_pcm_hw_param_t var);
828
int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime,
829
unsigned int base_rate);
815
830
int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime,
816
831
unsigned int cond,
1022
1037
atomic_dec(&substream->mmap_count);
1040
int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
1041
struct vm_area_struct *area);
1025
1042
/* mmap for io-memory area */
1026
1043
#if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA)
1027
1044
#define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP