Commit Graph

211270 Commits

Author SHA1 Message Date
Erik Gilling
809b025947 video: tegra: add hotplug display support
This is needed for HDMI.

Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:27:55 -07:00
Erik Gilling
5efab6d697 video: add fb_edid_add_monspecs for parsing extended edid information
Modern monitors/tvs have more extended EDID information blocks which can
contain extra detailed modes.  This adds a fb_edid_add_monspecs function
which drivers can use to parse those additions blocks.

Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:27:55 -07:00
Erik Gilling
d831fc31d8 video: tegra: add host bus support to display controller
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:27:54 -07:00
Erik Gilling
4b9e10f4c1 video: tegra: add skeleton host bus support
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>
2010-10-06 16:27:53 -07:00
Iliyan Malchev
4615839033 [ARM] tegra: tegra_i2s_audio: remove debugfs, add sysfs interface
-- 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>
2010-10-06 16:27:52 -07:00
Iliyan Malchev
ca2ab5954d [ARM] tegra: tegra_i2s_audio: do not reset the i2s fifo unnecessarily
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>
2010-10-06 16:27:51 -07:00
Iliyan Malchev
a3a03951fd [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>
2010-10-06 16:27:50 -07:00
Iliyan Malchev
a69a4cbdc9 [ARM] tegra: tegra_i2s_audio: clean up handling of state
-- 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>
2010-10-06 16:27:49 -07:00
Iliyan Malchev
6eb1d61bdd [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>
2010-10-06 16:27:49 -07:00
Iliyan Malchev
8ae52a6265 [ARM] tegra: tegra_i2s_audio: combine audio_in_stream and audio_out_stream
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-10-06 16:27:48 -07:00
Benoit Goby
f967fbb601 usb: host: Add support for suspend and bus suspend
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>
2010-10-06 16:27:47 -07:00
Benoit Goby
51901f9003 usb: gadget: Reset the controller when cable is unplugged
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>
2010-10-06 16:27:46 -07:00
Benoit Goby
549d5a2073 [ARM] tegra: usb_phy: Add phy_suspend and phy_clk_disable
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>
2010-10-06 16:27:45 -07:00
Benoit Goby
e72831f9e0 usb: gadget: In OTG mode, power down the controller on probe
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>
2010-10-06 16:27:44 -07:00
Colin Cross
77dc54fd03 [ARM] tegra: ventana: Add pmu device
Change-Id: I5fa227893cc64b900ee749d292cb09a728f9ec2f
Signed-off-by: Colin Cross <ccross@google.com>
2010-10-06 16:27:44 -07:00
Colin Cross
2d2a139ce3 [ARM] tegra: harmony: Add pmu device
Originally fixed by Will Deacon.

Change-Id: I2319d269f645766597100f91b2086fde4535c0fd
Signed-off-by: Colin Cross <ccross@google.com>
2010-10-06 16:27:43 -07:00
Colin Cross
68cfa7c453 [ARM] tegra: Add pmu to common devices
Originally fixed by Will Deacon.

Change-Id: I504f8109bedd1eea4bf637395913726a98eb6bb8
Signed-off-by: Colin Cross <ccross@google.com>
2010-10-06 16:27:42 -07:00
Colin Cross
0b4ec41425 [ARM] tegra: cpufreq: Adjust twds on frequency scaling
Change-Id: I8d187b861e18dfefcbf4566f4c695dfd1e17fe98
Signed-off-by: Colin Cross <ccross@google.com>
2010-10-06 16:27:41 -07:00
Colin Cross
65a06678fc [ARM] tegra: localtimer: Pass target twd rate
Change-Id: I4d57462045732f1f219a62c1be911437adf9a077
Signed-off-by: Colin Cross <ccross@google.com>
2010-10-06 16:27:40 -07:00
Colin Cross
128f79c82d [ARM] twd: Allow twd rescaling to match cpu frequency
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>
2010-10-06 16:27:39 -07:00
Iliyan Malchev
dada76ee11 [ARM] tegra_i2s_audio: add software downsampling for recorded data + fixes
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>
2010-10-06 16:27:38 -07:00
Erik Gilling
aa52607a90 video: tegra: include linux/pm.h in mach/tegradc.h
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:27:38 -07:00
Erik Gilling
fc6fca2f38 video: tegra: add init/suspend/resume hooks to outputs
Allows board specific code to handle panel init.

Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:27:37 -07:00
Benoit Goby
56fc16b7e0 [ARM] tegra: usb_phy: Power up/down bias and otg config pad circuitry
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>
2010-10-06 16:27:36 -07:00
Erik Gilling
f2b8046549 video: tegra: checkpatch changes
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:27:35 -07:00
Benoit Goby
e1bc56e357 usb: host: Fix kernel warning on probe
Change-Id: I6d5b10e047807f9bcb36809672705f8a8b2d11a4
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:34 -07:00
Iliyan Malchev
49dfd54af3 [ARM] tegra: audio_i2s_audio: clean up & support for recording audio
-- 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>
2010-10-06 16:27:33 -07:00
Erik Gilling
06601cc541 video: tegra: add tegra display controller driver
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>
2010-10-06 16:27:32 -07:00
Erik Gilling
fafa6bbd58 video: tegra: remove old tegra fb driver
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:27:32 -07:00
Gary King
23d7d05c8c [ARM] tegra: ventana: add suspend support to ventana
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>
2010-10-06 16:27:31 -07:00
Gary King
53ab084b41 [ARM] tegra: ventana: register gpio-keys device
Change-Id: Ie2e59f61facb116a5af88478e231542778af9eaf
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:27:30 -07:00
Benoit Goby
73254f0cce usb: host: Fix tegra EHCI suspend in OTG mode
Change-Id: Ia46830dfbb8bc39de1280b00ce30efe6022f6bd3
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:29 -07:00
Benoit Goby
f9f01aa3c6 [ARM] tegra: clock: Add pll_u to common clock init table
Change-Id: I8cdef0406b6fe04551584ae0bae9534b4aec93f6
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:28 -07:00
Gary King
781df7086f [ARM] tegra: ventana: use tegra_gart_device rather than local definition
Change-Id: I6cb57dd46162c258e32c4946de5a649daff3a79b
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:27:27 -07:00
Gary King
d8a64d3e0b [ARM] tegra: harmony: use tegra_gart_device rather than local definition
Change-Id: I1b456bb5634a75ae1dba2f5bd64ad71b8abdfc53
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:27:26 -07:00
Gary King
2f6208f663 [ARM] tegra: add gart device to devices.c
Change-Id: Id748aa37a3c2234a2a618b09dfa963a4b4ac572c
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:27:26 -07:00
Gary King
76f8650a12 [ARM] ventana: register i2c, touchscreen & regulator
register I2C controllers, regulator consumers and the panjit
touchscreen platform_device

Change-Id: Ife13c0d86084f26c734dea2c358f8c4fd3e27a8e
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:27:24 -07:00
Gary King
367c3aab79 [ARM] tegra: fix packet alignment and padding
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>
2010-10-06 16:27:23 -07:00
Iliyan Malchev
80a4c65c42 [ARM] tegra: generic driver for i2s audio (initial implementation)
-- 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>
2010-10-06 16:27:22 -07:00
Iliyan Malchev
da9070a782 [ARM] tegra: header describing i2s registers
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-10-06 16:27:22 -07:00
Iliyan Malchev
f8af4c4cf7 [ARM] tegra: add platform devices for i2s1 and i2s2
Signed-off-by: Iliyan Malchev <malchev@google.com>
2010-10-06 16:27:21 -07:00
Benoit Goby
2234fe7157 [ARM] tegra: Don't share tegra_usb1_resources
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>
2010-10-06 16:27:20 -07:00
Gary King
36564623b4 [ARM] tegra: add EHCI and UDC controllers to devices.c
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>
2010-10-06 16:27:19 -07:00
Benoit Goby
ce3a041d2e [ARM] tegra: Add USB PHY configuration
Configure board dependant phy settings from the board file.

Change-Id: I29f6ffe0b84a2a6eb55bade1379002f561d92d17
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:18 -07:00
Benoit Goby
a0e0319691 [ARM] tegra: Setup USB PHY as recommended by NVIDIA
This fixes enumeration issues with some devices

Change-Id: I6283a6fb49a9e4505ad388cacdd88ecf1bdf1b9d
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:17 -07:00
Benoit Goby
288b58e155 usb: gadget: Fix tegra udc in OTG mode
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>
2010-10-06 16:27:16 -07:00
Benoit Goby
2e39427ef6 usb: host: Add EHCI driver for NVIDIA Tegra SoCs
Change-Id: I53c560f2c31e043f139b840f58786429ded6ec62
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:15 -07:00
Benoit Goby
b2d28cdbf3 [ARM] tegra: usb_phy: Add tegra_usb_phy_power_off
Change-Id: If4d66b1a0f1810773b9dc9bcec0e252df947e609
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:27:15 -07:00
Gary King
0b00f73157 [ARM] tegra: harmony/ventana: register additional devices
register GART, pda_power, and OTG devices

Change-Id: I6dec5f765494cdc96f3395cf32fd962c87bf70b7
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:27:14 -07:00
Gary King
7c1fc9071b [ARM] tegra: ventana: add initial support for Ventana
Change-Id: I1993fda7628c623d53fd2c97649ec3533ad790e2
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:27:13 -07:00