summaryrefslogtreecommitdiff
path: root/include/linux/tegra_audio.h
AgeCommit message (Collapse)Author
2012-06-14ARM: tegra: resolve compilation time warningsSanjay Singh Rawat
- Adding flag to treat warning as error. - Handling warnings of unused variable, structures and functions, wrong return type, wrong type comparision. Bug 949219 Change-Id: I9d02387ce1073c4e46f69d01669285aa3754f1d9 Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-on: http://git-master/r/104968 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-06-04arm: tegra: resolve compilation time warningsSanjay Singh Rawat
Bug 949219 Change-Id: I91a67d30869e9800c483f112d58b9f76e2dbe361 Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-on: http://git-master/r/103534 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-05-01arm: tegra: change function declaration to staticRahul Mittal
Change-Id: Ib16ea10bf1acc2c7171935429635502aee80f3f4 Signed-off-by: Rahul Mittal <rmittal@nvidia.com> Reviewed-on: http://git-master/r/99072 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Nikesh Oswal <noswal@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-04-05tegra_audio: add default implementation for tegra_is_voice_call_active()Mayuresh Kulkarni
- mods kernel do not enable audio related configs in kernel - tegra_is_voice_call_active() is defined only when audio related configs are enabled - this commit adds a default implementation for tegra_is_voice_call_active() which can be called from generic pm code in mach-tegra - it also makes the default implementation inline Bug 924817 Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-on: http://git-master/r/92312 (cherry picked from commit 1b7507db6f2266d5cac10fcd4b3e7b06f6d2f3bd) Change-Id: I286237b838c39cf5c7784c014459bdcaf50c31ef Reviewed-on: http://git-master/r/94394 Tested-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-01-30tegra_audio: declare an api for getting voice call stateNikesh Oswal
Bug: 924817 Reviewed-on: http://git-master/r/77236 Change-Id: Iea767c952cfac8cb1643e28b7e29e43ad298909e Signed-off-by: Nikesh Oswal <noswal@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/77755 Reviewed-by: Automatic_Commit_Validation_User
2011-11-30kernel: Add ioctl constants for i2s loopback testsVijay Mali
Add required ioctl constants for i2s loopback tests. Audio test framework is using these ioctls for setting pcm format paramters for I2S loopback test. Change-Id: Id192668c5e9937e3cb42f8712a982f214e999289 Reviewed-on: http://git-master/r/59524 Reviewed-by: Rahul Mittal <rmittal@nvidia.com> Reviewed-by: Vijay Mali <vmali@nvidia.com> Tested-by: Vijay Mali <vmali@nvidia.com> Reviewed-by: Scott Peterson <speterson@nvidia.com> Rebase-Id: R5cb6bfb63d281559d992818c2a2a95cb00fba78d
2011-11-30kernel: Add ioctl constants for audio test frameworkRahul Mittal
Added some ioctl constants required for audio test framework use cases like DAM mixing and APBIF channel validation Change-Id: Icc536fbb2cfd28f89ac760cd67b24e5a46892d7d Reviewed-on: http://git-master/r/56222 Tested-by: Rahul Mittal <rmittal@nvidia.com> Reviewed-by: Scott Peterson <speterson@nvidia.com> Rebase-Id: Re03b618eb7923447c13d0732641be8a2bf80e75f
2011-11-30arm:tegra: Add EXPORT_SYMBOL and ioctls for test frameworkRahul Mittal
Added EXPORT_SYMBOL to functions to be used by loadable kernel module for audio test framework. Also added ioctl declarations for the same. Change-Id: Id8a023c1d76fd031c042c7c663bb0e1df2d33b5c Reviewed-on: http://git-master/r/52333 Tested-by: Rahul Mittal <rmittal@nvidia.com> Reviewed-by: Vijay Mali <vmali@nvidia.com> Reviewed-by: Scott Peterson <speterson@nvidia.com> Rebase-Id: Rfdc9fd3b9a42b2ee601c273480f9986ab897f046
2011-11-30[ARM] tegra: i2s: Continuous DMA supportChris Fries
- Refactor DMA interactions to handle continuous single-buffered DMA - Remove PIO support (obsolete, conflicts with new buffer management) - Remove sample rate conversion (obsolete) - Remove error-reporting logic - Remove TEGRA_AUDIO_IN/OUT_GET/SET_BUF_CONFIG - Add TEGRA_AUDIO_IN/OUT_GET/SET_NUM_BUFS Change-Id: I8f21a0bb314aac3b7d1bb4918bda9141e58db38d Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-11-30[ARM] tegra_i2s_audio: fixesIliyan Malchev
-- Ignore kfifo thresholds on recording and playback and adjust the delays. -- Take out the code from TEGRA_AUDIO_IN_STOP into a separate function stop_recording_nosync() -- Rename stop_recording() to wait_for_recording_to_stop(). -- add ioctl(TEGRA_AUDIO_OUT_FLUSH), which blocks the caller until the output fifo is drained. While the caller is blocked, pending write() calls will return immediately with whatever data they had managed to queue up. -- removed ioctl(TEGRA_AUDIO_OUT_PRELOAD_FIFO) -- since TEGRA_AUDIO_OUT_FLUSH and TEGRA_AUDIO_IN_STOP act similarly, moved audio_driver_state::recording_cancelled to audio_stream::stop and changed the code accordingly. Renamed functions wait_for_recording_to_stop() and stop_recording_nosync() to wait_till_stopped() and request_stop_nosync() since they handle both playback and recording. -- print errors on close() if wakelocks are still held -- Call request_stop_nosync() on close() of a recording file handle -- Do not use struct audio_stream::active for playback streams. Instead, where applicable, use kfifo_len(). As a consequence, playback kfifo underruns are no longer reported. These were bogus anyway, as we really need the DMA engine to tell us if there are underruns. -- Because of above item, had to rework tx_fifo_atn_store(), rx_fifo_atn_store(), and __attr_fifo_atn_write(). -- Set struct audio_stream::active for a recording stream to true when a recording starts, and set it to false when recording get stopped. Do not set/clear it within the body of read(), because just being within read() does not mean that recording is in progress. -- In tegra_audio_read(), check for stop == true before calling start_recording_if_necessary(); this makes sure that if a user calls read() after calling ioctl(TEGRA_AUDIO_IN_STOP), recording will not resume unless ioctl(TEGRA_AUDIO_IN_START) gets called, or the file is closed and re-opened. -- Fixed TEGRA_AUDIO_IN_START -- In PIO mode, enabled FIFOs before enabling interrupts as specified in the TRM. -- Added missing break in tegra_audio_ioctl(). -- Silenced some debug spew Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-11-30[ARM] tegra: i2s: Add I2S ioctl for setting bit formatChris Fries
Added an ioctl to set the bit format for I2S between "DSP"/"PCM" mode and normal mode (set by board file) Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-11-30[ARM] tegra_i2s_audio: add more elaborate error countsIliyan Malchev
This patch replaces the error counter with two separate error counters, one for late dma callbacks, and another for overruns (during recording) or underruns (during playback). The ioctls TEGRA_AUDIO_IN_GET_ERROR_COUNT and TEGRA_AUDIO_OUT_GET_ERROR_COUNT now take a pointer to a struct containing both error counters. Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-11-30[ARM] tegra: tegra_i2s_audio: allow preloading of the tx fifo with dataIliyan Malchev
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>
2011-11-30[ARM] tegra: tegra_i2s_audio: clean up handling of stateIliyan Malchev
-- Use consistently the various state flags: -- active is set only when there is a read or write in flight -- recording_canncelled is set only when recording is stopped via the ioctl() -- dma_has_it is used to determine whether DMA is already in flight; do not use the state of the fifos for this (e.g., if the TX fifo is empty, do not assume that playback is stopped) -- added a stop_completion (implemented for readers only) so that readers closing a stream can wait until DMA or PIO transactions are stopped -- Split /dev/audio0_{in,out} into /dev/audio0_{in,in_ctl,out,out_ctl} where the _ctl versions have the ioctl()s -- Introduced an error count per audio_stream; error count is reset on open, can be read back & reset through an ioctl Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-11-30[ARM] tegra: tegra_i2s_audio: configure in/out buffer sizes from user spaceIliyan Malchev
-- 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>
2011-11-30[ARM] tegra_i2s_audio: add software downsampling for recorded data + fixesIliyan Malchev
downsampling: -- add ioctl()s to downsample recorded data -- supported frequencies are 8kHz, 11.025kHz, 22.05kHz, and 44.1kHz -- downsamping to stereo and mono -- default is 11.025kHz mono fixes: -- fix crashes from dequeuing DMA requests twice Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-11-30[ARM] tegra: audio_i2s_audio: clean up & support for recording audioIliyan Malchev
-- add audio_in_stream (identical to audio_out_stream, may merge them later) -- add support for DMA and PIO recording -- add ioctls for /dev/audio<n>_in to start and stop recording Signed-off-by: Iliyan Malchev <malchev@google.com>