diff options
author | Iliyan Malchev <malchev@google.com> | 2010-08-20 15:11:48 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2012-03-21 22:11:02 -0700 |
commit | 065aa40809609ebd94e0296eedb24680d23f5c1b (patch) | |
tree | a54539a6ae4e2adff66f3b2db6e4323e4db24e19 /arch/arm/mach-tegra/tegra_i2s_audio.c | |
parent | 693fb6d4590d7e1f93a9c8e0a88d89fce2ec3412 (diff) |
[ARM] tegra: tegra_i2s_audio: allow preloading of the tx fifo with data
Add an ioctl to allow the TX fifo to be loaded with data before playback
starts. Playback can then be started by calling write() on the FIFO, even
with a length of 0. This will cause the pending data to be played out.
Signed-off-by: Iliyan Malchev <malchev@google.com>
Rebase-Id: Rfcaac1f7a4532ef84c8f5f08db060c256b1d58ac
Diffstat (limited to 'arch/arm/mach-tegra/tegra_i2s_audio.c')
-rw-r--r-- | arch/arm/mach-tegra/tegra_i2s_audio.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/tegra_i2s_audio.c b/arch/arm/mach-tegra/tegra_i2s_audio.c index 40653570f87a..47626e103e8d 100644 --- a/arch/arm/mach-tegra/tegra_i2s_audio.c +++ b/arch/arm/mach-tegra/tegra_i2s_audio.c @@ -1262,6 +1262,26 @@ static long tegra_audio_out_ioctl(struct file *file, if (!rc) aos->errors = 0; break; + case TEGRA_AUDIO_OUT_PRELOAD_FIFO: { + struct tegra_audio_out_preload preload; + if (copy_from_user(&preload, (void __user *)arg, + sizeof(preload))) { + rc = -EFAULT; + break; + } + rc = kfifo_from_user(&ads->out.fifo, + (void __user *)preload.data, preload.len, + &preload.len_written); + if (rc < 0) { + pr_err("%s: error copying from user\n", __func__); + break; + } + if (copy_to_user((void __user *)arg, &preload, sizeof(preload))) + rc = -EFAULT; + pr_info("%s: preloaded output fifo with %d bytes\n", __func__, + preload.len_written); + } + break; default: rc = -EINVAL; } |