The host (or host1x) bus sits between the cpu core and the 3d, 2d, camera,
display, and mpeg encoder functions. It contains provides DMA channels,
hardware mutexes, and synchronization points.
Signed-off-by: Erik Gilling <konkers@android.com>
-- Removed debugfs interface for toggling DMA
-- Added it under sysfs
-- Also added attributes for settings the attention levels of the i2s fifos
Signed-off-by: Iliyan Malchev <malchev@google.com>
This patch removes redundant i2s fifo resets, which also cause blips on playback.
It also moves the fifo attention levels to struct audio_stream.
Signed-off-by: Iliyan Malchev <malchev@google.com>
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>
-- 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>
-- 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>
On suspend, use phy_suspend save the phy registers so that there is
no need to reset the controller and re-enumerate devices on resume.
Change-Id: I00fe5b87a1b319044724494b8e635b540088a38b
Signed-off-by: Benoit Goby <benoit@android.com>
Reset the controller when the cable is unplugged to leave it in the idle
state. The OTG driver will reconfigure it on vbus/id pin detection.
Change-Id: I87903ec86f3c35af64a141f27a34cc0720a61b08
Signed-off-by: Benoit Goby <benoit@android.com>
phy_suspend save the phy registers and power it off. phy_clk_disable
disable the phy clock to put the phy in low power mode.
Change-Id: If5665ec96beec9441fae3b737923dbe69c86e650
Signed-off-by: Benoit Goby <benoit@android.com>
The OTG driver will power it up on ID pin detection. This avoids
race conditions when the device is powered on with the otg cable
attached.
Change-Id: I6bd5f1d73284f9b8534ef3dfb936b81a9400fa5b
Signed-off-by: Benoit Goby <benoit@android.com>
The clock to the ARM TWD local timer scales with the cpu
frequency. To allow the cpu frequency to change while
maintaining a constant TWD frequency, pick a lower target
frequency for the TWD and use the prescaler to divide down
to the closest lower frequency.
This patch provides a new initialization function that takes
a target TWD frequency and the relation between the cpu
clock and the TWD clock, required to be an integer divider
>= 2 by the ARM spec. It also provides a function to be
called from cpufreq drivers to set the prescaler whenever
the cpu frequency changes.
Also fixes a typo in the printk of the calibrated frequency.
Change-Id: I3fa8ef718ff5518170f1b2bab29efe960741853e
Signed-off-by: Colin Cross <ccross@google.com>
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>
On tegra, the UTMIP PAD control logic is common to all utmip phys and
are controlled from usb1. This adds a reference count to turn off the
pads when all utmip phy are off.
Change-Id: I3537d5cc52df929f817e547a79da235394d2c265
Signed-off-by: Benoit Goby <benoit@android.com>
-- 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>
Notable ommisions:
* support for anything but lvds panels
* inegration with nvhost driver to sync updates with 3D
* FB physical geometry is not set
* lacks interface to set overlay/window x,y offset
v2 changes:
* suspend/resume support
* move code into drivers/video/tegra/dc
* modularize output support
* clean register dumping, add debugfs register file
* code review feedback
* make the display controller register the framebuffer devices
Signed-off-by: Erik Gilling <konkers@android.com>
add support for system suspend to ventana; currently LP1 (DRAM in
self-refresh, CPU power-gated, core power active) is used.
Change-Id: Idb223a7da94c3b87ea61e0eef1de77206c4171e4
Signed-off-by: Gary King <gking@nvidia.com>
register I2C controllers, regulator consumers and the panjit
touchscreen platform_device
Change-Id: Ife13c0d86084f26c734dea2c358f8c4fd3e27a8e
Signed-off-by: Gary King <gking@nvidia.com>
tegra's DMA controller expects to start transfers at word boundaries,
and the standard packet alignment (2) was resulting in data corruption
also, provide a full cacheline of padding between skbuffs, to eliminate
coherency issues between the processor and USB networking devices.
Change-Id: Ibb508b512f43c8934d35eb182c8738370b7be585
Signed-off-by: Gary King <gking@nvidia.com>
-- i2s settings are passed through the board file
-- supports playback (no recording yet)
-- works in DMA and PIO (non-DMA) modes (toggle through debugfs)
-- does NOT perform volume and audio-path control
-- exports /dev/audio<n>_{in, out}, where <n> is the i2s interface
-- assumes that i2s is used such that fifo1 is TX and fifo2 is RX
Signed-off-by: Iliyan Malchev <malchev@google.com>
Don't share tegra_usb1_resources as both tegra-udc and ehci1 are loaded
in otg mode.
Change-Id: Id5c9a076572e18662b5d3e7835f638b1cc5a1e07
Signed-off-by: Benoit Goby <benoit@android.com>
update harmony and ventana to use the common UDC definition, rather
than using the current duplicated definitions
Change-Id: I2e3aca674ab35305a0c516bd22e044382280d05e
Signed-off-by: Gary King <gking@nvidia.com>
Check the transceiver state before checking udc->stopped
Enable/disable the PHY and the clock on cable events
Change-Id: Id5a8a1b94f83da8060786f31181014dd1d546fc7
Signed-off-by: Benoit Goby <benoit@android.com>