Commit Graph

211293 Commits

Author SHA1 Message Date
Gary King
7e9bd8ff3f [ARM] tegra: add tegra_wdt_device to devices.c
Change-Id: I8098fa38ebef8636a6eeb1179e679201445e5237
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:16 -07:00
Gary King
2b3a85e078 watchdog: add tegra_wdt driver
add a driver for the hardware watchdog timer embedded in NVIDIA
Tegra SoCs

Change-Id: I45bc829f26f350143d5a07e1f4ddc46d24f3a54c
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:15 -07:00
Gary King
a2f0e22979 [ARM] tegra: ventana: do not tristate backlight & battery pins
Change-Id: I5f844fd58a379cb7191f03bb23599cd4061caf5c
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:14 -07:00
Gary King
d66805a40c [ARM] tegra: ventana: fix suspend build break
update the suspend platform data for ventana to match recent changes

Change-Id: I142123027453ee34f80c094fb7cf1fcb464e889d
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:13 -07:00
Gary King
2c7d591aa1 usb: host: ehci-hcd: add controller_resets_phy quirk
only reset the controller when doing so won't also reset the phy (Tegra quirk)

Change-Id: I549a18977d0d5ebfa12c32016aa9e6bffaa8643c
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:12 -07:00
Gary King
dcc9fcc567 panjit_touch: fix warning "control reaches end of non-void function"
Change-Id: I3a43dc58edff3687e294c2d2a09d1f6e06e27fce
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:12 -07:00
Gary King
fbf56d14a0 input: touchscreen driver for panjit capacitive i2c touch panels
driver supports the MGG1010AI06 and EGG1010AI06 capacitive touch panels

Change-Id: I038030bf4c9acbd0d3d504427a32f4e46632c115
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:11 -07:00
Olof Johansson
1c119f2c16 mmc: fix non-arm build due to eMMC 4.3+ change
drivers/mmc/core/mmc.c:228: error: ‘SZ_256K’ undeclared (first use in this function)

Introduced by:
    mmc: subtract boot sectors from disk size for eMMC 4.3+ devices

(SZ_* doesn't exist on anything but arm)

Change-Id: I981217adea4ef56bf870562b6711488f3f4bf830
Signed-off-by: Olof Johansson <olof@lixom.net>
2010-10-06 16:28:10 -07:00
Jay Cheng
03b85005e5 serial: tegra_hsuart: fix receive DMA, RTS, timeout, and tx trigger
initialize baud rate and configuration settings to safe default values
when receive DMA is in use, so that the DMA request may be enqueued at
initialization time

re-enqueue the receive DMA buffer immediately it is dequeued by the
DMA threshold callback and the receive ISR, rather than waiting for the
DMA complete callback

originally fixed by Gary King <gking@nvidia.com>

Fixing tx trigger level setting:

On tegra uart, the FCR setting for different tx trigger level
is not same as the 16550 tx trigger level setting. The tegra
uart have the setting in reverse direction on tx fifo attention
level:
b00 for 16 bytes attention level.
b01 for 8 byte attention level.
b10 for 4 byte attention level
b11 for 1 byte attention level.

The rx trigger attention level match with the standard uart
FCR register setttings.

Also fixing the typo in code when setting DTR.
originally fixed by Laxman Dewangan (ldewangan@nvidia.com)

Change-Id: Iea00478f143e61c604828035c6c92d614fa7cccb
Signed-off-by: Jay Cheng <jacheng@nvidia.com>
2010-10-06 16:28:09 -07:00
Colin Cross
40ac8c757b serial: tegra_hsuart: Fix void return type on writel accessors
Signed-off-by: Colin Cross <ccross@google.com>
2010-10-06 16:28:08 -07:00
Gary King
3c8d2022b6 serial: tegra_hsuart: fix section mismatch error
Change-Id: Ib4c1872c691a98f11bc7c8553df41bec93f64285
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:07 -07:00
Colin Cross
333c9f1ef0 serial: tegra_hsuart: Cleanups and bug fixes
tegra_start_tx was called directly by the serial core, as
well as from dma and serial interrupts to queue the next
block of data.  Separate out the "queue next data"
functionality into tegra_start_next_tx.

Also fixes TX PIO by adjusting FIFO sizes and prevents
last characters from getting lost by spinning on TEMT
before disabling clocks.

Change-Id: If8ce15490f77dcbde48f1e64959d5c3f0ec35120
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:28:06 -07:00
Colin Cross
816d63e397 serial: tegra_hsuart: Fix DMA receive, drop err in dma callbacks
Change-Id: I4c4bc12e8c883912f8979b75a8eb418a62e77f94
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:28:06 -07:00
Colin Cross
3fafe51166 serial: Add tegra_hsuart driver
Change-Id: Ic2d0a43ac3597c8a270758af6ea3090acdd0fe7f
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:28:05 -07:00
Dmitry Shmidt
1e1278227f mmc: sdhci-tegra: Always call sdhci suspend/resume functions
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-10-06 16:28:04 -07:00
Dmitry Shmidt
da2d1c69d6 mmc: sdhci: Skip mmc suspend/resume ops for SDIO device,
enable/disable sdc irq instead of request/free,
mask all sdc interrupts on suspend

Change-Id: I3fb137363c6e639882b796aff8b80784c5256a71
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-10-06 16:28:03 -07:00
Gary King
2cdc235bbe mmc: subtract boot sectors from disk size for eMMC 4.3+ devices
the csd sector count reported by eMMC 4.3+ cards includes the boot
partition size; subtract this from the size reported to the disk
since the boot partition is inaccessible

Change-Id: I601b83aa0159b7aa446409ea8c945b256dd0b5b1
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:02 -07:00
Gary King
52525d352a tegra-sdhci: treat -1 as invalid card detect GPIO
0 is a valid GPIO number (GPIO_PA0), so the check in the tegra
SDHCI driver for a valid card detect pin should compare against -1
instead

Change-Id: I47ad31eaf89472b2e6938978d72a9d0b92a74958
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:01 -07:00
Dmitry Shmidt
0a37a25e5e drivers: mmc: sdhci-tegra: Add suspend/resume processing
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2010-10-06 16:28:00 -07:00
Colin Cross
196487c054 mmc: sdhci: Initial Tegra sdhci driver
Change-Id: I6a761b978224fe91dc7928ef5595af2cbd66fc92
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:27:59 -07:00
Erik Gilling
ee4460b9a6 video: tegra: include nvhost.h instead of nvhost_dev.h
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:27:58 -07:00
Erik Gilling
85b8599c03 video: tegra: set window size on mode change
otherwise it's hardcoded by the platform-data

Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:27:57 -07:00
Erik Gilling
279c0de833 video: tegra: add hdmi output support
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:27:56 -07:00
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