Commit Graph

211308 Commits

Author SHA1 Message Date
Gary King
e98e2b459a [ARM] tegra: add PWM driver
add support for the pulse-width-modulation APIs using the tegra 2
internal PWM controllers

Change-Id: If313301aaebab01f08edbe120060537e6917ea4b
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:28 -07:00
Gary King
c45b3a9057 [ARM] tegra: ventana: fix pinmux for wifi
configure the drive pinmux for wifi and i2c, and configure
the tristate and pullups for the wifi pins correctly

Change-Id: I40cddea16aa66e3a286c7ccc93677d5459ae3717
Signed-off-by: Gary King <gking@nvidia.com>
2010-10-06 16:28:28 -07:00
Erik Gilling
d6f0cc113a video: tegra: add HDMI support
Previous implementation was DVI only

Change-Id: I6e7defb0cf73a1cf094e330715a2a302fd273589
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:28:27 -07:00
Erik Gilling
e8118b168b video: tegra: set output size for hdmi
Change-Id: I4737963d57e01be62c95076d22a26aaae45bfde1
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:28:26 -07:00
Erik Gilling
421593c720 [ARM] serial: update tegra_hsuart to use PTR_ERRless dma API
Change-Id: I071d99032995c878bc1d563cda56602f5410ab43
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:28:25 -07:00
Erik Gilling
a24d8369e6 [ARM] tegra: update i2s to use PTR_ERRless dma API
Change-Id: I4bfe6ef64688244ae1d6a380891c7d94e2e243e7
Signed-off-by: Erik Gilling <konkers@android.com>
2010-10-06 16:28:24 -07:00
Benoit Goby
b3661dcd2e [ARM] tegra: usb_phy: Add support for usb2 ulpi external phy
Change-Id: Ie2ed0d22abae1319996fe0a6caf28ec7d7e4313d
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:23 -07:00
Benoit Goby
cf99404c25 usb: gadget: Enable/disable the gadget device on vbus_session calls
If we use an OTG driver, the driver will detect VBUS changes and notify
the gadget driver through vbus_session. Enable/disable the gadget driver
in vbus session so that there is no need to check the OTG state on every
interrupt.

Change-Id: I617ad5742be2632b2257b71314db8f330be463d5
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:23 -07:00
Benoit Goby
c3b5093ac8 usb: host: OTG driver now adds/removes the ehci device based on ID pin status
There is no need anymore to check the OTG state on every interrupts and
use a work thread.

Moved the suspend code from usb_phy.c as this is ehci specific.

Change-Id: I523baab1476323a35360b1d802088370e42d0fd7
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:22 -07:00
Benoit Goby
6e9b65b7d1 usb: host: ehci-hub: Add port_reset_no_wait quirk
Tegra quirk: The PORT_RESET bit in PORTSC1 does not need to be cleared
and there is no need to wait for it to clear. The bit will automatically
change to 0 when the bus-reset sequence is done and an interrupt will be
generated.

Change-Id: I645417013af46785a249096ebc06a1f688228d94
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:21 -07:00
Benoit Goby
f9559ba01f [ARM] tegra: Compile usb_phy.c only if usb support is enabled
Change-Id: I190bab00533d065171ab2478363830c6d95e66cb
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:20 -07:00
Benoit Goby
12cfe15dd2 [ARM] tegra: usb_phy: Moved suspend/resume code to ehci driver
The suspend/resume methods should go to the ehci driver as they only
save/restore ehci registers.

Remove phy_init and initialize all phy registers in power_on as all the
registers need to be reinitialized after LP0.

Change-Id: I649d2cb66339aaff2d7db442a5441d2d3f06268b
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 16:28:19 -07:00
Colin Cross
57e1a9e292 serial: tegra_hsuart: Fix typo preventing non 8-bit modes
Change-Id: Ife085017dd7a956c46ad4077c5bbf33d5a049f3d
Signed-off-by: Colin Cross <ccross@android.com>
2010-10-06 16:28:18 -07:00
Todd Poynor
2a9a2f685a tegra: sdhci: Remove set_clock op, not needed
The SDHCI controller specifies a maximum SDCLK speed of 48MHz, which is
now in agreement with the platform clock, and so the SDHCI host max_clk
no longer needs to be overriden.

Change-Id: Ie8c7f643d956cfd1bb83675708336278482c40d8
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2010-10-06 16:28:17 -07:00
Todd Poynor
4a4af7562a [ARM] tegra: clocks: Set all SDMMC clocks to 48MHz at boot
48MHz is the max speed reported by present-day Tegra2 SDHCI controllers
and is the max speed we can run without adjusting for DVFS changes.

Change-Id: I3f2c23ffdfc40aebe8211688077003f09f599f1a
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2010-10-06 16:28:17 -07:00
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