ARM: OMAP2+: AM33xx: Enhance McASP FIFO length

Existing fifo level of 1 being configured for McASP is as good as
fifo being disabled. Increase the fifo level so as to fully utilize
McASP FIFO support.

The maximum fifo level possible is 64. It this patch, it is being
set to the midway point 32 so that there is some fifo available
for new data when the level is reached.

Signed-off-by: Hebbar Gururaja <gururaja.hebbar@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
usb: musb: cppi41: workaround fix for Early TxFifoEmpty Interrupt

The TxFifoEmpty interrupt is used to workaround TxDMA early
completion issue. The TxDMA generates interrupt while transmit
data is still in txfifo. The SW need to wait/poll in workthread till
last byte from TxFifo is transfered out. To avoid this TxFifoEmpty
interrupt used to make sure last byte is transfer out.

When TxFfifoEmpty interrupt is enabled, the dma completion interrupt
occurs first followed by TxFifoEmpty interrupt. But sometimes
TxFifoEmpty occurs first and then dma completion Interrupt.
This patch fixes this by handling the dma completion interrupt
in the TxFifoEmpty interrupt handler.

This logic enabled only for isochrnous transfer type.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
usb: musb: cppi41: rxdma generic configuration for both host and device

For device mode: by default transparent mode is used, for SoCs which
has infinite mode support can use this feature by enabling infinite mode

For host mode : by default transparent mode is used in rx direction

The generic rndis mode and infinte mode for both host is verfied
but disabled due to IP/HW limitation of extra IN/token & datatoggle issues

forced rxdma to use transparent mode for gadget mode.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
usb: musb: cppi41: remove unnecessary reserved space for desc region

the index for descriptor starts from 0, there is no reserved
descriptor for unallocated memory region

Signed-off-by: Ravi Babu <ravibabu@ti.com>
usb: musb: cppi41: enable the txfifo empty interrupt logic for am33xx

This patch will enable the txfifo empty interrupt logic for
am33xx SoC which supports this features.
This logic is enabled only for isochronous transfers, does not
work reliablely for other transfer types.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
usb: musb: host: reset dma->actual_len after transfer complete

Signed-off-by: Ravi Babu <ravibabu@ti.com>
usb: musb: host: fix for out of order giveback of URBs

Signed-off-by: Ravi Babu <ravibabu@ti.com>
usb: misc: introduce OTG & EH Test Driver

This patch introduces support for test modes as
defined by the USB OTG & Embedded host Specification.

Note that we _must_ be able to suspend & resume ports
as we wish, so this driver depends on USB_SUSPEND and
makes use (well, somewhat abuses) usb autopm features
to achieve what we want.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
usb: musb: ti81xx: fix for handling vbus error

some bus powered devices can draw more current and can cause
fluctuation in vbus leads to vbuserror condition, the workaround
fix is to set session and wait till vbus raise to above valid
threshold.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
mtd/nand/omap2: Free the memory allocated in probe

Instead of freeing memory allocated for omap_nand_info in probe, member
being freed in remove. This patch fixes the same.

This patch back-ported from mainline kernel
7d9b110269253b1d5858cfa57d68dfc7bf50dd77
mtd: omap2: fix omap_nand_remove segfault

[avinashphilip@ti.com: changed the commit message to give better
description of the bug]

Signed-off-by: Andreas Bießmann <andreas@biessmann.de>
Signed-off-by: Philip Avinash <avinashphilip@ti.com>
Handle the occational SYNC loss

Earlier the display driver was not handling the SYNC loss and was
resulting the other modules waiting for the VSYNC to crash.
This patch handles the SYNC loss and reset the LCDC.

Signed-off-by: Arun Joseph <arunjoseph@ti.com>
ARM: OMAP2+: AM335X: Add ADC platform data

Add platform data pertaining to ADC.
By default 4 input lines i.e. (AIN4 - AIN7) are enabled as
ADC lines.

Change-Id: Ia8f03352b291cb3a85abdce955574554920ae58e
Signed-off-by: Patil, Rachna <rachna@ti.com>
ARM: OMAP2+: AM335x: Update defconfig with ADC support

Enable ADC in AM335x default config

Signed-off-by: Patil, Rachna <rachna@ti.com>
MFD: ti_tscadc: register children only when they are available.

Not all children(TSC/ADC) are available on all platforms.
Previously either of TSC/ADC which is not required had to be
explicitly disabled from menuconfig.
Now registering a client driver is based on whether respective client
platform data is present or not.

Signed-off-by: Hebbar Gururaja <gururaja.hebbar@ti.com>
Signed-off-by: Patil, Rachna <rachna@ti.com>
Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>
MFD: ti_tscadc: disable TSC control register bits when TSC not in use

AFE Pen Ctrl and TouchScreen transistors enabling is not
required when only ADC mode is being used, so check for availability of
TSC driver before accessing control register.

Signed-off-by: Patil, Rachna <rachna@ti.com>
Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>
IIO: ADC: ti_adc: Reflect the correct analog input enabled

Current driver reflected analog input number in sysfs starting from 0.
The driver has been updated to reflect analog input number's corresponding
to the hardware input channel being used.

Signed-off-by: Patil, Rachna <rachna@ti.com>
IIO: ADC: ti_adc: Fix wrong samples received on 1st read

Previously we tried to read data form ADC even before ADC sequencer
finished sampling. This led to wrong samples.

We now wait on ADC status register idle bit to be set.

Signed-off-by: Patil, Rachna <rachna@ti.com>
input: ti_tsc: Enable shared IRQ for TSC

Touchscreen and ADC share the same IRQ line from parent
MFD core.
Previously only Touchscreen was interrupt based.
With continuous mode support added in ADC driver, now driver requires
interrupt to process the ADC samples, so enable shared IRQ flag bit for
touchscreen.

Signed-off-by: Patil, Rachna <rachna@ti.com>
Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>
IIO: ti_adc: Add support for ADC continuous mode

Current ADC driver supports only one shot mode.
Now ADC driver is enhanced to capture data continuously
from /dev/iio:deviceX interface.

ADC is now IRQ based, on interrupt ADC copies data onto
a software buffer, which is exposed to user.

Signed-off-by: Patil, Rachna <rachna@ti.com>
am335x android config: sync up with linux config

Change-Id: I8381a95765aea42775fe9dda0bb9160245b64d2e
Signed-off-by: Vishveshwar Bhat <vishveshwar.bhat@ti.com>