mfd: ti_am335x_tscadc: fix TSC resume

In the resume path, the ADC invokes am335x_tsc_se_set_cache() with 0 as
argument if continous mode is not in use. This in turn disables the TSC
steps and so it is not working until one ADC sampling is performed.

This patch fixes it by writing the current cached mask instead of the
passed steps.

Fixes: 7ca6740cd1cd ("mfd: input: iio: ti_amm335x: Rework TSC/ADCA
synchronization")
Cc: stable@vger.kernel.org # v3.13+
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ARM: dts: dra72-evm: Fix NAND due to wrong default state for pcf8575@i2c5

Set NOR_BOOTn_OVR and NOR_BOOTn_OVR_OEN high to keep NOR_SELn controlled
by DIP switch SW5.

Fixes NAND by not forcing NOR_SELn low and avoiding conflict with NAND
data bus as both NOR and NAND share the same chip select.

We also set MMC2_BOOTn_OVR and MMC2_BOOTn_OVR_OEN high so that MMC2_SELn
is controlled by DIP switch SW5.

Fixes: 1262275b4eda ("ARM: dts: dra72-evm: Add HDMI node and tpd12s015 level shifter")

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
drivers: net: cpsw: fix warn message on suspend/resume

In dual EMAC, skb is tried to requeue back to DMA when any of the
netdev interface is up and running in the commit id e7cf277 which
results in a warn as during suspend DMA is already in teardown mode.

Fixes: e7cf277a6eca ("drivers: net: cpsw: dual_emac: fix reducing of rx descriptor during ifdown")

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
drivers: net: cpsw: dual_emac: in suspend/resume bring down/up all the netdev

During suspend and resume in Dual EMAC, second port is not working as in
suspend/resume only the first slave netdev is closed and opened. So bring
down and up all the interfaces that are up during suspend/resume.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
usb: dwc3: core: fix order of PM runtime calls

Currently, we disable pm_runtime before all register
accesses are done, this is dangerous and might lead
to abort exceptions due to the driver trying to access
a register which is clocked by a clock which was long
gated.

Fix that by moving pm_runtime_put_sync() and pm_runtime_disable()
as the last thing we do before returning from our ->remove()
method.

Fixes: 72246da (usb: Introduce DesignWare USB3 DRD Driver)
Cc: <stable@vger.kernel.org> # v3.2+
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arm: boot: dts: am4372: fix USB regs size

Size should be 64KiB instead of 92KiB.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
usb: dwc3: fix ordering for PHY suspend

We can't suspend the PHYs before dwc3_core_exit_mode()
has been called, that's because the host and/or device
sides might still need to communicate with the far end
link partner.

Fixes: 8ba007a (usb: dwc3: core: enable the USB2 and USB3 phy in probe)
Cc: <stable@vger.kernel.org> # v3.9+
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
usb: dwc3: omap: fix ordering for runtime pm calls

we don't to gate clocks until our children are
done with their remove path.

Fixes: af310e9 (usb: dwc3: omap: use runtime API's to enable clocks)
Cc: <stable@vger.kernel.org> # v3.9+
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
usb: dwc3: gadget: remove unnecessary 'start_new' variable

[ Upstream commit 029d97ff543219762685805e15d71f7005ad7c5e ]

Remove 'start_new' variable from dwc3_endpoint_transfer_complete(),
since this variable has not been used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
usb: dwc3: fix TRB completion when multiple TRBs are started

After commit 2ec2a8be (usb: dwc3: gadget:
always enable IOC on bulk/interrupt transfers)
we created a situation where it was possible to
hang a bulk/interrupt endpoint if we had more
than one pending request in our queue and they
were both started with a single Start Transfer
command.

The problems triggers because we had not enabled
Transfer In Progress event for those endpoints
and we were not able to process early giveback
of requests completed without LST bit set.

Fix the problem by finally enabling Xfer In Progress
event for all endpoint types, except control.

Fixes: 2ec2a8be (usb: dwc3: gadget: always
	enable IOC on bulk/interrupt transfers)
Cc: <stable@vger.kernel.org> # v3.14+
Reported-by: Pratyush Anand <pratyush.anand@st.com>
Tested-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ARM: dts: am437x-gp: switch i2c0 to 100KHz

On the GP EVM, the ambient light sensor is limited to 100KHz on the
I2C bus.

So use 100kHz for I2C on the GP EVM due to this limitation on the
ambient light sensor.

Reported-by: Aparna Balasubramanian <aparnab@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ARM: dts: am43x-epos-evm: Disable QSPI to prevent conflict with GPMC-NAND

Both QSPI and GPMC-NAND share the same Pin (A8) from the SoC for Chip Select
functionality. So both can't be enabled simultaneously.

Disable QSPI node to prevent the pin conflict as well as
be similar to 3.12 release.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
phy: phy-omap-control: Add support PHY Wakeup control

Add support to enable and disable the PHY wakeup feature
on AM43x. This is used to support the USB remote wakeup
feature in AM43x SoC.

Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
phy: phy-omap-usb2: Add support for enable/disable PHY wkup for AM43x

Add support to enable/disable PHY wakeup feature in AM43x Soc during
system suspend/resume.

Also add SYSTEM_SLEEP_PM_OPS to enable AM43x to successfully enter
deep sleep state.

Signed-off-by: George Cherian <george.cherian@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
drivers: net: cpsw: convert tx completion to NAPI

CPSW driver TX and RX interrupt handling is not optimal. The driver handles
both irq's together and relies on RX NAPI to proces the TX packet. Lets
seperate the interrupt handling and convert the TX completion to NAPI as
well.

With these changes the network perfromance shoots up by almost 40 %
for UDP. For TCP we also we get pretty good boost.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ARM: dts: dra7-evm: Add MMCSD card removal GPIO

SDMMC Card Detect can be used over default GPIO map.

Reported-by: Yan Liu <yan-liu@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Merge branch 'connectivity-ti-linux-3.14.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-3.14.y

TI-Feature: connectivity
TI-Tree: git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel.git
TI-Branch: connectivity-ti-linux-3.14.y

* 'connectivity-ti-linux-3.14.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  ARM: dts: dra7-evm: Add MMCSD card removal GPIO
  drivers: net: cpsw: convert tx completion to NAPI
  phy: phy-omap-usb2: Add support for enable/disable PHY wkup for AM43x
  phy: phy-omap-control: Add support PHY Wakeup control
  ARM: dts: am43x-epos-evm: Disable QSPI to prevent conflict with GPMC-NAND
  ARM: dts: am437x-gp: switch i2c0 to 100KHz
  usb: dwc3: fix TRB completion when multiple TRBs are started
  usb: dwc3: gadget: remove unnecessary 'start_new' variable
  usb: dwc3: omap: fix ordering for runtime pm calls
  usb: dwc3: fix ordering for PHY suspend
  arm: boot: dts: am4372: fix USB regs size
  usb: dwc3: core: fix order of PM runtime calls
  drivers: net: cpsw: dual_emac: in suspend/resume bring down/up all the netdev
  drivers: net: cpsw: fix warn message on suspend/resume
  ARM: dts: dra72-evm: Fix NAND due to wrong default state for pcf8575@i2c5
  mfd: ti_am335x_tscadc: fix TSC resume

Signed-off-by: Dan Murphy <DMurphy@ti.com>