summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2010-05-07fsl udc: Fix cable connect/disconnect checkingtegra-9.12.11Venkat Moganty
On VBUS interrupt irq acknowledges the VBUS interrupt and schedules the work thread for powering/up down the USB phy and clocks based on the VBUS status. But, in the work thread instead of checking the VBUS status directly, rechecking the interrupt status which is already disabled. This is fixed by checking the vbus status only in the work thread for controlling the power up/down sequence. Due to the disconnect problem power numbers increased when there is no USB cable connected to the system. Bug 682756 Bug 682727 Change-Id: Id1c5b3cd1f2f195c4dfadf397e1f8650bf9da12b Reviewed-on: http://git-master/r/1300 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-05-07nvmap: re-enable use of IOVMMBharat Nihalani
IOVMM was disabled due to problems with resume from LP0; re-enabling it since associated problems are now resolved. Following bugs will get fixed: Bug 680829 Bug 683310 Bug 596477 Change-Id: Idc9b5c87d4a4a7a36a682f367c0e2deb10cea41e Reviewed-on: http://git-master/r/1309 Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Tested-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-05-03tegra accelerometer: cleanly exit in case odm driver is not availableBharat Nihalani
Bug 681203: tegra_accelerometer should be exited if no odm driver Change-Id: I9e0285ad7185f5d49dc1f6f5aa93ee9e099f2d94 Reviewed-on: http://git-master/r/1258 Reviewed-by: Hoang Pham <hopham@nvidia.com> Tested-by: Harry Hong <hhong@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2010-05-02tegra usb:Modifications to usb power up/down sequenceVenkat Moganty
Removed helper thread and replaced it with Worker Queues in udc and ehci drivers to handle usbphy power up/down sequence. Made changes to turn off usb power rail based on vbus detection mechanism is selected as PMU. Fixed usb host LP0 exit sequence. Bug 667912: AVDD_USB_Power is consuming 3.82mW of power in OSIdle and ULP audio playback case. Change-Id: I3a77d0ecb4f0b81dafe705100451c42641f0bfb9 Reviewed-on: http://git-master/r/1221 Tested-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com> Tested-by: Dara Ramesh <dramesh@nvidia.com> Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Tested-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Tested-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2010-04-30tegra mmc: fixing build break.yhsu
Fixed undeclared variable causing build break. Change-Id: I5c4b9483e25694123bedc05327c309d607bd04ff Reviewed-on: http://git-master/r/1265 Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Tested-by: Yu-Huan Hsu <yhsu@nvidia.com>
2010-04-30tegra mmc: enable sdio controller clk during wakeupDeepesh Gujarathi
Enable the sdio controller clk before the sd stack begins to enumerate the card during system resume. Failing to do so results in timeout errors and the sd card fails to mount Change-Id: I2f5399003e21d71c6a3c4776fcefda430bca20ef Reviewed-on: http://git-master/r/1262 Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Tested-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2010-04-29tegra dma: Correcting the typo error.Laxman Dewangan
Correcting the spelling error in enum definition TEGRA_DMA_REQ_ERROR_ABOTRED to TEGRA_DMA_REQ_ERROR_ABORTED. Tested on harmony. Change-Id: Ie28aea9f87c1a0a2d3f27ce6132fb3eb48eb59e6 Reviewed-on: http://git-master/r/1225 Reviewed-by: Ramachandrudu Kandhala <rkandhala@nvidia.com> Reviewed-by: Venkata (Muni) Anda <vanda@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Tested-by: Ramachandrudu Kandhala <rkandhala@nvidia.com>
2010-04-29tegra mmc: enable/diable sdio controller clockDeepesh Gujarathi
The sd controller clock will be switch on/off on a per transaction basis, this will ensure that the clock is off during OSIdle which should inturn help better DVFS results. fix for Bug:673699 Change-Id: If479fe4aea6ae2c00818c84b43fc38a66437c643 Reviewed-on: http://git-master/r/1242 Reviewed-by: Janne Hellsten <jhellsten@nvidia.com> Tested-by: Janne Hellsten <jhellsten@nvidia.com>
2010-04-29nvmap: sanitize heap order policyAntti Hatala
Fix _nvmap_do_alloc() to always stick to the requested heap mask; to never allocate from heaps that were not specified in the mask. Factor out the default heap order policy into its own function, _nvmap_heap_policy(). Fix the kernel NvRmMemAlloc() implementation to honor the order of heaps requested by calling _nvmap_do_alloc() iteratively. Fold the various alloc functions into _nvmap_do_alloc() so that the allocation code is easier to follow. Temporarily disable use of IOVMM altogether, due to problems with resume from LP0. Change-Id: I9f720d6be67d255f7370e9daa29bfa2f20912820 Reviewed-on: http://git-master/r/1237 Reviewed-by: Antti Hatala <ahatala@nvidia.com> Tested-by: Antti Hatala <ahatala@nvidia.com>
2010-04-23tegra-kernel: Fix section mismatch warningsBharat Nihalani
Bug 676157: Kernel builds in 9.12.8, 9.12.9 cause section mismatch warnings Change-Id: Ic288f077d24b03f9d6af2d20dcb01a1bfce25599 Reviewed-on: http://git-master/r/1195 Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Tested-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-04-23panjit touch: Adding the odm panjit touch screen driver.vdumpa
Checking in odm panjit touch screen driver. This is required for new harmony tablet board. This is disabled by default as of now. Also checking updated tegra-gpio.c to have the correct gpio lies info for harmony tablet. This is also disabled by default. Added the acceleremeter properties in the odm kit. The driver for accelerometer will be checked in later. updated copyright headers for panjit. Change-Id: I7089ddb11670670dc0aa683dce190bc619fb07e2 Reviewed-on: http://git-master/r/1139 Reviewed-by: Gary King <gking@nvidia.com> Reviewed-by: Krishna Reddy <vdumpa@nvidia.com> Tested-by: Krishna Reddy <vdumpa@nvidia.com>
2010-04-23tegra serial: Improving the rx flow.Laxman Dewangan
Following improvements are done in the uart rx and tx path: - Separate locks for rx and tx paths. - Implementing the continuous double buffering with same buffer for uart rx. - Deactivating the rts line only incase of if dma does not read the fifo i.e. nonmultiple of 4. - Handling the modem control signal chnage properly. - Created the separate workqueue for the receive to handle dma thresold callback as well as the rx uart interrupts. Tested on harmony and whistler with uart testcase and BT on harmony. we tested the simulatenous file transfer and the A2DP on BT-harmony and did not observe any glitches. Change-Id: Id451ca2f42e246b524a7c9e4bbf3aa832cd0d535 Reviewed-on: http://git-master/r/1172 Reviewed-by: Gary King <gking@nvidia.com> Reviewed-by: Anantha Idapalapati <aidapalapati@nvidia.com> Tested-by: Anantha Idapalapati <aidapalapati@nvidia.com>
2010-04-22tegra keyboard: do not disable key scanning in EC during suspendVarun Wadekar
Removed the support to disable key scanning from the EC based keyboard driver when the system enters suspend state. This way any key press in suspend state is recognised by the EC which in turn wakes up the AP. reviewed by nobody tested on Harmony For Bug 673371 Change-Id: Ie28c4f135b0ba2fcfb95667d015802fea0cb2001 Reviewed-on: http://git-master/r/1146 Tested-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: Phillip Smith <psmith@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-04-21fsl-udc:Fix USB1 resume after LP0Venkat Moganty
USB1 registers are set to default values after entering into the LP0. On LP0 resume, controller was not programmed properly, which is causing device to fail enumeration. This is fixed by reinitializing the controller on LP0 resume. Bug 677511: USB1 fails to enumerate after LP0 Tested on android/whistler/adb, USB device is working fine on resume from LP0. Change-Id: I55af61b23bec3436d1672e8c58aee8d7b8f6bcb3 Reviewed-on: http://git-master/r/1175 Reviewed-by: Ramachandrudu Kandhala <rkandhala@nvidia.com> Tested-by: Ramachandrudu Kandhala <rkandhala@nvidia.com> Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Tested-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-04-20nvmap: relax iovmm over-commit check for kernel clientAntti Hatala
Change-Id: Ia2b5576672ad65e0cf730ca1a243c2efddbea906 Reviewed-on: http://git-master/r/1162 Reviewed-by: Antti Hatala <ahatala@nvidia.com> Tested-by: Antti Hatala <ahatala@nvidia.com>
2010-04-15tegra_odm_battery:porting the battery polling timer changes.Sachin Nikam
As we know that android doesn't polls for the battery status. In order to update the battery and power supply related info created a timer func which polls for every 30Sec and updates the battery and power supply info. Also, there is a sysfs attribure "status_poll_period" using which this polling interval can be altered. Already, we have these changes in nvec_battery.c which are wokring and verified. Porting the same changes to tegra_odm_battery. Change-Id: I19f8e3f24c333745b7d90084a7e8c320ac8a1d6b Reviewed-on: http://git-master/r/1064 Reviewed-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Sachin Nikam <snikam@nvidia.com>
2010-04-15fsl udc:Fix USB disconnect notification in OTGVenkat Moganty
In OTG mode, when USB cable is removed cable disconnect notification is not sent to the client driver. Hence at application layer, UI shows up USB cable connection notification even USB cable is removed. With this fix disconnect notification is going to the client driver and UI removes the USB notification on USB cable removal. Tested on android/whistler Bug 668692: USB cable is removed, but does not appear in notification. Change-Id: I06d5a288873a2a8d7d109c5109b9dfd0c08fd1ee Reviewed-on: http://git-master/r/1112 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-04-15[spi] update tegra driver to support multiple slavesGary King
the spi clock, chip select and bits per word need to be applied from the spi slave device specified in the transaction previously, the values were constant for each master, and corresponded to the last device registered on the bus issue originally reported by Mike Corrigan Change-Id: I047b6aa6d92f2c9e134311d3d32bcb75d5f689f5 Reviewed-on: http://git-master/r/1102 Reviewed-by: Venkata (Muni) Anda <vanda@nvidia.com> Tested-by: Venkata (Muni) Anda <vanda@nvidia.com>
2010-04-14usb gadget: Implementing checks to fix NULL pointer dereference exceptionAbhishek Aggarwal
In LDK, no gadget driver gets registered with the udc driver and thus udc->driver is not initialized and is NULL. Accessing members of udc->driver in the execution path of fsl_udc_irq() results in NULL pointer dereference exception. Fixing it by implementing NULL value checks for udc->driver at appropriate places. Bug 671801: [Mobile LDK\Harmony] wake up from LP1 freezes the device Bug 671807: [Mobile LDK\Harmony\LP1] Wake-up by USB mini-b cable is not working Change-Id: I502ad8b4ba804bc82ec95af739e71ccfb11493d7 Reviewed-on: http://git-master/r/1110 Tested-by: Abhishek Aggarwal <aaggarwal@nvidia.com> Reviewed-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com> Tested-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-04-13bcsp: Fix BCSP Bug: bcsp_pkt_cull: Removed only x out of x-1 pkts errors.Anantha Idapalapati
After debugging this issue - I found that the issue was fixed in linux-2.6.32. back porting the fix to present kernel. The routine bcsp_pkt_cull() displays the false error message "Removed only %u out of %u pkts" when multiple to be acked packets are queued. As if (i++ >= pkts_to_be_removed) break; will breaks the loop and increase the counter i when i==pkts_to_be_removed, the loop ends up with i=pkts_to_be_removed+1. The following line: if (i != pkts_to_be_removed) { BT_ERR("Removed only %u out of %u pkts", i, pkts_to_be_removed); } will display the false message. The counter i must not increase on the same line. Change-Id: I0ca08003a4ec7d1b8ed105f219964934afad1a50 Reviewed-on: http://git-master/r/1098 Reviewed-by: Udaykumar Rameshchan Raval <uraval@nvidia.com> Tested-by: Udaykumar Rameshchan Raval <uraval@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-04-13tegra uart: Fixing the tx and rx dma path issueLaxman Dewangan
Following issue has been fixed: - Blocking write was returning immediatly if data request is multiple of 4. - Blocking write was not able to complete if data length is nonmultiple of 4 and more than 4. - The close was taking too much time because proper timeout and fifo size was not configured. - Tx dma path optimized to fill more data to dma buffer if there is more pending chars in the buffer. - Tx path is fixed to properly signal the wakup event to tty layer. - RTS flow control is not getting set from second open even cflag is requested for that. - Rx dma was not receiving the correct data after second open. The multiple request was getting queued for the receive path at the time of closing. - Rx dma was started before uart controller is configured and it is creating to misbehave the dma. - Transfer count was not getting calculated in the dma driver. Pending issue: - Loosing the data id more than 32K of data was sennt is single shot. Debugging this. Tested on harmony with different testcase developed for testing the linux serial driver. Change-Id: I6ed9095dd6340d2b5e7ef036823d2e4e5a61abcc Reviewed-on: http://git-master/r/1065 Tested-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-by: Udaykumar Rameshchan Raval <uraval@nvidia.com> Tested-by: Udaykumar Rameshchan Raval <uraval@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-04-12tegra nvmap:fixing memory corruption is nvmap.c.vdumpa
Bug 670448 nvmap_grow_blocks() is exceeding the array bounds. This is causing the crash issues during system boot up. Fixed it by removing the erroneous two lines that are exceeding array bounds. Change-Id: Ie7fd72c3a0f79015114dc1d1c8cbf31e3a50f0b6 Reviewed-on: http://git-master/r/1080 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-04-05nvec_battery:Handling critical battery conditionSachin Nikam
1. nvec.h:Correcting enum ordering for NvEcBatterySubtype as per ECI specs. NvEcBatterySubtype_SetRemainingCapacityAlarm and NvEcBatterySubtype_GetRemainingCapacityAlar >> Verified 2. Registering interrupt for LOW_BAT# from T20 pinmux table:- GPIO interrupt for Low battery on port w and pin 3 >> Already verified on Wince. On Android when 0% power is left device is shutdown. Harmony has this setting around 9.3V which is less when the battery is at 0%. 3. Enabling LOW_BAT# as a wakeup source 11 from suspend >> As point no. 2 is wokring this should also work. This is not verfied as in suspend battery discharge is slow. 4. Enabling Low capacity alarm as a wakeup source suspend >> As remaining capacity alarm is working this should also work. This is not verfied as in suspend battery discharge is slow. 5. Setting the 10% of Design capacit as threshold for Remaining capacity alaram event. >> Verified 6. Adding 4 functions which are needed for EC firmware validation NvOdmBatterySetRemCapacityAlarm NvOdmBatteryGetRemCapacityAlarm NvOdmBatterySetConfiguration NvOdmBatteryGetConfiguration >> Verified 7. Calling kernel_power_off() when device is running on only battery and it is ctitically low to gracefully shutdown the system. >> Verified Tested on harmony + eclair + battery Change-Id: I6f4c8a1866ba63c293813b180cc5b74714aa23cd Reviewed-on: http://git-master/r/976 Reviewed-by: Sachin Nikam <snikam@nvidia.com> Tested-by: Sachin Nikam <snikam@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-04-05tegra: Enabling Accelerometer Driver for whistler board.Vishwas Rao
This should enable accelerometer on Whistler. Change-Id: I884ef704083c8d5e1fe07554301eb28a2c24db49 Reviewed-on: http://git-master/r/987 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-04-02ARM/tegra: delete SDIO DDK and DDK-based MMC host drivertegra-9.12.9Gary King
Change-Id: I30872e9905b7bdf1cca56e53089e5cfde7586798 Reviewed-on: http://git-master/r/1026 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-04-01Fix NvRmMemUnpin so it ignores NULL memhandlesAcorn Pooley
Change-Id: Iffad8a511bb6434b26e58d8dacf24a5751c23610 Reviewed-on: http://git-master/r/1028 Reviewed-by: Acorn Pooley <apooley@nvidia.com> Tested-by: Acorn Pooley <apooley@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-03-30tegra: SMSC LAN V4 driver integration to reduce power during OS idleNarendra Damahe
Change-Id: I5dacba846a7c979cf556470699c4b1e036c72ede Reviewed-on: http://git-master/r/970 Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Tested-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-03-30Use CONFIG_ARCH_TEGRA_XX_SOC instead of RM capsNagesh Penumarty
Use CONFIG_ARCH_TEGRA_XX_SOC defines for differentiating between various tegra SOCs instead of getting the SOC caps from the RM. With this change enabling quirks for various chips would be much simpler. Tested on Android, whistler. Bug 661035 SD 3.0 support in the linux native driver. Change-Id: I0a85f3464d00080673a351d1614f311f1855bdae Reviewed-on: http://git-master/r/969 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-29tegra spi: fixed a coding bug that was forcing the SPI signal mode to zero..Sheshu Shenoy
Change-Id: I316f614ae6d866f642a1ae5f6b1e19b37e50cae2 Reviewed-on: http://git-master/r/973 Tested-by: Sheshagiri Shenoy <sshenoy@nvidia.com> Reviewed-by: Udaykumar Rameshchan Raval <uraval@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-03-29cpuidle: always return with interrupts enabledKevin Hilman
In the case where cpuidle_idle_call() returns before changing state due to a need_resched(), it was returning with IRQs disabled. The idle path assumes that the platform specific idle code returns with interrupts enabled (although this too is undocumented AFAICT) and on ARM we have a WARN_ON(!(irqs_disabled()) when returning from the idle loop, so the user-visible effects were only a warning since interrupts were eventually re-enabled later. On x86, this same problem exists, but there is no WARN_ON() to detect it. As on ARM, the interrupts are eventually re-enabled, so I'm not sure of any actual bugs triggered by this. It's primarily a correctness/consistency fix. This patch ensures IRQs are (re)enabled before returning. Reported-by: Hemanth V <hemanthv@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Len Brown <len.brown@intel.com> Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Tested-by: Martin Michlmayr <tbm@cyrius.com> Cc: <stable@kernel.org> [2.6.31.x] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Change-Id: Ide8e1fe20ba7b30ae321f520b620dfb2e3614022 Reviewed-on: http://git-master/r/982 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-29nvec_battery:registering battery as wakeup source and battery events.Sachin Nikam
1. Making Battery and AC present as a wakeup source 2. Registering battery events:present, charging, remaining capacity 3. Handling battery odm flags and events in nvec_battery.c Change-Id: I814960ab5f065e6aaad72ea1c403ad9c8d6a1af8 Reviewed-on: http://git-master/r/907 Reviewed-by: Sachin Nikam <snikam@nvidia.com> Tested-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-03-23input: add keyboard controller support for tegraGary King
implement a keyboard input driver for tegra's internal matrix keyboard controller (16x8 support on Tegra 2 class processors). supports * power management * limit wakeup to a subset of keys * platform-defined remapping of key to keycode * platform-defined pin configuration add support for converting tegra ODM kit APIs to kbc platform data, so existing clients will continue to function Change-Id: If1496e7ada4f6f18a3e98a15ebc5f925f254bf65 Reviewed-on: http://git-master/r/933 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Gary King <gking@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-03-22tegra fb: Cleanup partially removed fb disable code.Venkata(Muni) Anda
An ioctl to disable fb used to exist and called from the nvrm daemon code. This was partially removed sometime back and there are still traces of that code causing some confusion which is cleaned up by this commit. ioctl define is left as-is so maintain compatibility to user mode code. Change-Id: I3f792d6be075a8754ea448d588e484afc67bd8ba Reviewed-on: http://git-master/r/878 Reviewed-by: Venkata (Muni) Anda <vanda@nvidia.com> Tested-by: Venkata (Muni) Anda <vanda@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-03-21tegra usb: Switching of USB busy hints, when no active USB tranferstegra-9.12.8sgadagottu
are happening though a device connection on host port. Currently for harmony, an intergrated SMSC hub present on USB3. Because of this device connection is present on USB3 and USB power busy hints are always on. To avoid this, for host by default busy hints are off and USB busy hints will be on for : 1.Bulk and isochronus transfers 2.Interrupts transfers with buffer length >= 256. Busy hint will be on for pre-defined amount of time and after that busy hints will be off automatically. With this in idle state power is reduced. Tested on : Harmony Enumeartion is happening fine. LAN and USB HID devices are working fine Change-Id: Ifd653bebfb52c7702f7d24bf11ccf93e62ea0f66 Reviewed-on: http://git-master/r/915 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-18tegra usb: Integrating power aware LAN 9500 driver from SMSCNarendra Damahe
Integarting SMSC v1.01.06.03 (03/18/2010) LAN driver to tegra. This new version is a power aware driver and support suspend/resume functionality. Bug 635375 : [AP20 \ Android] SMSC Ethernet LAN(9514) 3rd Party driver power management in Android Tested on : Harmony Change-Id: I112a8d9805f3ce6fed45999130c7c8004865bb98 Change-Id: I112a8d9805f3ce6fed45999130c7c8004865bb98 Reviewed-on: http://git-master/r/884 Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-18tegra pm: add suspend/resume to tegra-sdhci driverDeepesh Gujarathi
Implement suspend/resume functionality for the tegra-sdhci driver. Call the sdhci_suspend/resume functions which handles the power off and re-enumeration of sd memory cards. We ignore suspend/resume requests for all sdio devices asssuming that the individual drivers will manage their own power. For tegra devices, the wifi driver implements its own early suspend model and hence is ignored by the sdhci driver. Change-Id: I5041d314123bac958da7775ee24bd2dc1be55ab5 Change-Id: I5041d314123bac958da7775ee24bd2dc1be55ab5 Reviewed-on: http://git-master/r/852 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Rahul Bansal <rbansal@nvidia.com> Tested-by: Rahul Bansal <rbansal@nvidia.com> Reviewed-by: Venkata (Muni) Anda <vanda@nvidia.com>
2010-03-17tegra nvec: suspend/resume without nvec mouse connectedNinad Malwade
- when mouse is not present or connected to board, do not register the mouse driver with EC bus driver. - Bug 663803 Change-Id: Iec11af103c4ab00a9d01e66969fceb6161cec1e2 Reviewed-on: http://git-master/r/862 Reviewed-by: Ninad Malwade <nmalwade@nvidia.com> Tested-by: Ninad Malwade <nmalwade@nvidia.com> Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Tested-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-03-12nvmap: add barriers around atomic_read and atomic_setGary King
add SMP memory barriers before atomic_read and after atomic_set to ensure that any changes to the values are properly flushed so that they are visible to all processors in the system, since neither operator guarantees atomicity. change the poison flag to be a non-zero value, so that zero-filled memory isn't improperly detected as a valid handle. re-enable error prints for pinning & unpinning handles with no local references, now that the performance regression-causing misuse in the codec firmware is resolved. Change-Id: Ibbf5f0ad48f83f5eb475afb6dec8633adba8e3ca Reviewed-on: http://git-master/r/844 Reviewed-by: Antti Hatala <ahatala@nvidia.com> Tested-by: Antti Hatala <ahatala@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-11tegra touch: enable multi-touchVarun Wadekar
adding multi-touch support to the touch screen driver. Tested with Gallery3D, Multitouch Visualizer and Multitouch Visualise test apps. Fod Bug 653317 Change-Id: I2976ab91c06a54de4772d88c3d96d72a753205ed Reviewed-on: http://git-master/r/834 Tested-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: Harry Hong <hhong@nvidia.com> Tested-by: Harry Hong <hhong@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
2010-03-11serial: delete tegra DDK serial driverGary King
this driver is no longer being used, and its continued existence just causes confusion. Change-Id: Ia5b4a350b6590bbd0e8914625e9e81951096fb8c Reviewed-on: http://git-master/r/843 Reviewed-by: John Davis <jodavis@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-09tegra serial: Tx Path OptimizationsAnantha Idapalapati
Based on profiling, observed UART Tx to be mostly waiting for a previous DMA to be finished so that it can proceed for further processing of data from upper layers. Two Mmodifications are implemented as part of this commit 1. Forming a DMA request for smaller transfers and waiting for DMA request to be finished introduced overhead. Implemented a polling based transfers for transfers less than a certain limit. 2. Implemented a parallel activity between "DMA Buffer -> UART FIFO" and "Application -> DMA Buffer" copies. introduced a new DMA Buffer which can be made ready by the time DMA finishes use of another DMA Buffer that was filled by Driver. Bug ID: 652334 Change-Id: I30cad291553f9c0c67cb95afa67e468446f7ffd7 Reviewed-on: http://git-master/r/743 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-08[nvmap] fix strided read/write loop incrementGary King
in the process of cleaning up the implementation of do_rw so that it could be called from both ioctl and kernel contexts, the loop increment for source and distination addresses was erroneously set to the element size, rather than the provided strides. bug 660448 Change-Id: I02e2b2b980f90a2171d811192b667883f2a3ab41 Reviewed-on: http://git-master/r/805 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-08tegra: Commenting the error prints for memory pin/Unpin functionsNinad Malwade
- On behalf of Gautam Moharir - Bug 660462 Change-Id: I66e22e247ce5df6135f31c75ae91ec5d0b11e666 Reviewed-on: http://git-master/r/792 Reviewed-by: Ninad Malwade <nmalwade@nvidia.com> Tested-by: Ninad Malwade <nmalwade@nvidia.com> Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-05tegra: EHCI bus suspend/resume requires CONFIG_PMScott Williams
If CONFIG_PM is not selected, don't compile EHCI bus suspend/resume. Change-Id: Ia89612fa3d82dc671accc597e4d1ca05f56eaa5c Reviewed-on: http://git-master/r/783 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-05[nvmap] handle NULL return for pin multiple, fix infinite loopGary King
the handle alignment parameter query had an off-by-one bug in its loop initializer which caused any carveout handle to trigger an infinite loop. the only caller of this API was the debug EGL driver, which used it to verify that the allocation matched the requested alignment. also, if the user passes NULL as the address array when pinning multiple handles to ioctl_pinop, pin the handles and skip the output write, rather than returning a permission error. big thanks to antti for finding the infinite loop. bug 660526 Change-Id: I90f819a231b5a8bef5b473252122cdbefc744efb Reviewed-on: http://git-master/r/782 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-04[usb mass storage] return -EINVAL on NULL requestGary King
there appears to be a race condition which causes req to be NULL. issue a warning and return -EINVAL in this case, rather than dereferencing a NULL pointer Change-Id: I46d7fdd63ec6fb09bdda18e1a1e5509af079beab Reviewed-on: http://git-master/r/768 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-04nvmap: implement nvmap as a full memory manager driverGary King
previously, the task of managing RM-managed memory handles was split between nvos (OS page allocation), the RM (heap management for carveout & IRAM heaps, and handle life-time management), nvreftrack (abnormal process termination) and nvmap (user-space read/write/map of memory handles). this resulted in an opaque system that was wasteful of kernel virtual address space, didn't support CPU cache attributes for kernel mappings and couldn't fully unwind leaked handles (e.g., if the application leaked a pinned handle the memory might never be reclaimed). nvmap is now a full re-implementation of the RM memory manager, unifying all of the functionality from nvreftrack, nvos, nvmap and nvrm into one driver used by both user and kernel-space clients. add configs to control paranoid operation. when paranoid is enabled, every handle reference passed into the kernel is verified to actually have been created by nvmap; furthermore, handles which are not global (the GET_ID ioctl has not been called for it) will fail validation if they are referenced by any process other than the one which created them, or a super-user process (opened via /dev/knvmap). each file descriptor maintains its own table of nvmap_handle_ref references, so the handle value returned to each process is unique; furthermore, nvmap_handle_ref objects track how many times they have been pinned, to ensure that processes which abnormally terminate with pinned handles can be unwound correctly. as a compile-time option, fully-unpinned handles which require IOVMM mappings may be stored in a segmented (by size) MRU (most-recently unpinned) eviction cache; if IOVMM space is over-committed across multiple processes, a pin operation may reclaim any or all of the IOVMM areas in the MRU cache. MRU is used as the eviction policy since graphics operations frequently operate cyclically, and the least-recently used entry may be needed almost immediately if the higher-level client starts (e.g.) rendering the next frame. introduce a concept of "secure" handles. secure handles may only be mapped into IOVMM space, and when unpinned their mapping in IOVMM space will be zapped immediately, to prevent malicious processes from being able to access the handle. expose carveout heap attributes for each carveout heap in sysfs, under the nvmap device with sub-device name heap-<heap name> * total size * free size * total block count * free block count * largest block * largest free block * base address * name * heap usage bitmask carveout heaps may be split at run-time, if sufficient memory is available in the heap. the split heap can be (should be) assigned a different name and usage bitmask than the original heap. this allows a large initial carveout to be split into smaller carveouts, to reserve sections of carveout memory for specific usages (e.g., camera and/or video clients). add a split entry in the sysfs tree for each carveout heap, to support run-time splitting of carveout heaps into reserved regions. format is: <size>,<usage>,<name> * size should be parsable with memparse (suffixes k/K and m/M are legal) * usage is the new heap's usage bitmask * name is the name of the new heap (must be unique) carveout heaps are managed using a first-fit allocator with an explicit free list, all blocks are kept in a dynamically-sized array (doubles in size every time all blocks are exhausted); to reduce fragmentation caused by allocations with different alignment requirements, the allocator will compare left-justifying and right-justifying the allocation within the first-fit block, and choose the justification that results in the largest remaining free block (this is particularly important for 1M-aligned split heaps). other code which duplicated functionality subsumed by this changelist (RM memory manager, NvOs carveout command line parser, etc.) is deleted; implementations of the RM memory manager on top of nvmap are provided to support backwards compatibility bug 634812 Change-Id: Ic89d83fed31b4cadc68653d0e825c368b9c92f81 Reviewed-on: http://git-master/r/590 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-03nvec_battery:Adding a new sysfs attribute "status_poll_period"Sachin Nikam
The default Battery status poll period is 30 Sec. Adding a new sysfs attribute by which this polling period can be modified. To view the polling period:- cat /sys/devices/nvec/nvec_battery/status_poll_period To modify polling period:- echo <newvalue> > /sys/devices/nvec/nvec_battery/status_poll_period bug 646822 Synopsis:[Harmony/android] Battery status is not updated whenever there is any change in battery/power supply property Change-Id:I3b17be7f01fcf91f1c268fdb36fe348ddcf5f626 Reviewed-on: http://git-master/r/742 Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-03tegra usb: Making USB busy hints off on resume, when there is no adbsgadagottu
cable/usb device connection Currently on resume from LP1, though there is no adb cable/USB device connected to USB1/USB3 then also usb busy hints are getting on. With this change on resume: For gadget driver, if cable is not connected then busy hints made off. For host driver, if device(s) are not connected then busy hints are off. Code Clean-up for power improvement Tested on : Whistler board USB1 OTG + USB3 host Tested with all possible connection on USB1 and USB3 Change-Id: I6d210bba1264d9c0134d586d3f67ff609ba2b3fe Reviewed-on: http://git-master/r/745 Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Tested-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>
2010-03-02Proper fix for commit I5c6914ef8906eed80cba15249b0760d71e3d0255Venkata(Muni) Anda
csd_struct version on some of the cards is 4.4 cards is 3. This change skips the check for that verison. Change-Id: Ib44344237c99e1a52e1b3eb864e96194b090929b Reviewed-on: http://git-master/r/739 Reviewed-by: Gary King <gking@nvidia.com> Tested-by: Gary King <gking@nvidia.com>