diff options
author | Iliyan Malchev <malchev@google.com> | 2010-08-17 11:34:39 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:35:13 -0800 |
commit | efea6a1ee6b0dbdc3bdf87ccf39eb2c473f57dba (patch) | |
tree | 5f0ce17d083731a7de4374431c64eb17cc2f682c /include/linux/tegra_audio.h | |
parent | 8f5120c386e37ddeb0313f9373a51af5f6809e8d (diff) |
[ARM] tegra: tegra_i2s_audio: configure in/out buffer sizes from user space
-- Add ioctls for configuring buffer, threshold, and DMA-transaction sizes from
user space.
-- Buffer sizes are provided in orders of magnitude.
-- Allocate max-sized buffers during probe, and allow the user to resize them
only within the original allocation, to avoid the risk from kmalloc failing
due to kernel-heap fragmentation, and also to avoid race conditions on DMA
shut-down.
-- In tegra_audio_write(), moved the call to start_playback_if_necessary()
immediately after writing to the fifo. Otherwise, when the fifo size is
smaller than what the user is trying to write, the user will block before
playback is started.
-- Silenced printk spew on spinning on i2s registers after transactions are
completed.
-- Cleaned up a 80-col style violation in downsample()
Signed-off-by: Iliyan Malchev <malchev@google.com>
Diffstat (limited to 'include/linux/tegra_audio.h')
-rw-r--r-- | include/linux/tegra_audio.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/tegra_audio.h b/include/linux/tegra_audio.h index 9dc11cc8b871..9461a5f2eda9 100644 --- a/include/linux/tegra_audio.h +++ b/include/linux/tegra_audio.h @@ -36,4 +36,20 @@ struct tegra_audio_in_config { #define TEGRA_AUDIO_IN_GET_CONFIG _IOR(TEGRA_AUDIO_MAGIC, 3, \ struct tegra_audio_in_config *) +struct tegra_audio_buf_config { + unsigned size; /* order */ + unsigned threshold; /* order */ + unsigned chunk; /* order */ +}; + +#define TEGRA_AUDIO_IN_SET_BUF_CONFIG _IOW(TEGRA_AUDIO_MAGIC, 4, \ + const struct tegra_audio_buf_config *) +#define TEGRA_AUDIO_IN_GET_BUF_CONFIG _IOR(TEGRA_AUDIO_MAGIC, 5, \ + struct tegra_audio_buf_config *) + +#define TEGRA_AUDIO_OUT_SET_BUF_CONFIG _IOW(TEGRA_AUDIO_MAGIC, 6, \ + const struct tegra_audio_buf_config *) +#define TEGRA_AUDIO_OUT_GET_BUF_CONFIG _IOR(TEGRA_AUDIO_MAGIC, 7, \ + struct tegra_audio_buf_config *) + #endif/*_CPCAP_AUDIO_H*/ |