mmc: omap_hsmmc: add tuning support

MMC tuning procedure is required to support SD card
UHS1-SDR104 mode and EMMC HS200 mode.

The tuning function omap_execute_tuning() will only
be called by the MMC/SD core if the corresponding
speed modes are supported by the OMAP silicon which
is set in the mmc host "caps" field.

Signed-off-by: Viswanath Puttagunta <vishp@ti.com>
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
[ kishon@ti.com : Set the functional clock to 192MHz if the contoller
                  supports HS200 ]
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
mmc: omap_hsmmc: add voltage switch support for UHS SD card

UHS sd card i/o data line can operate at 3V and 1.8V on UHS speed
modes. Add support for signal voltage switch and check for card_busy.

Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ARM: dts: add pbias-supply

Add pbias-supply to mmc1/sd card.

Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ARM: dts: dra72-evm: Set MMC host controller capability properties

Added properties in device tree to indicate the MMC controllers support
UHS or HS200.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ARM: dts: dra72-evm: Set max clock frequency of MMC1 and MMC2 to 192MHz

MMC1 supports SDR104 and MMC2 supports HS200 both of which requires
192MHz clock. Set the maximum operating clock frequency to 192 MHz.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ARM: dts: dra7-evm: add evm_3v3_sd regulator

Add a node for evm_3v3_sd using onboard pcf GPIO expander which feeds
on to mmc power-on.

Update mapping for vmmc-supply and vmmc_aux-supply.
evm_3v3_sd supplies to SD card vdd, and ldo1 to sdcard i/o voltage.

Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ARM: dts: dra72-evm: add evm_3v3_sd regulator

Add a node for evm_3v3_sd using pcf which feeds on to mmc power-on.

Update mapping for vmmc-supply and vmmc_aux-supply.
evm_3v3_sd supplies to SD card vdd, and ldo1 to sdcard i/o voltage.

Signed-off-by: Kishon Vijay Abraham I <kishon@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: dra72-evm: add evm_3v3_sd regulator
  ARM: dts: dra7-evm: add evm_3v3_sd regulator
  ARM: dts: dra72-evm: Set max clock frequency of MMC1 and MMC2 to 192MHz
  ARM: dts: dra72-evm: Set MMC host controller capability properties
  ARM: dts: add pbias-supply
  mmc: omap_hsmmc: add voltage switch support for UHS SD card
  mmc: omap_hsmmc: add tuning support

Signed-off-by: Texas Instruments Auto Merger <lcpd_integration@list.ti.com>
drivers: net: cpsw: fix cpsw hang on ethernet cable connect/disconnect

During cable disconnect CPSW internal fifo's should be put in disable mode
else internal fifo's can overflow and DMA can hang and can be recovered
only by issuing IP reset via interface down and up. In the commit 088f02263,
instead of putting the fifo in disable mode it is put in forward mode via
port state. So during cable connect/disconnect CPSW Tx might not work.
Fixing this by setting disable state to the slave fifo's during cable
disconnect.

Fixes: 088f02263 ("drivers: net: cpsw: switch-config: set/get port state")

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
gpio: pcf857x: restore the initial line state of all pcf lines

The reset values for all the PCF lines are high and hence on shutdown
we should drive all the lines high in order to bring it to the reset state.

This is actually required since pcf doesn't have a reset line and even after
warm reset (by invoking "reboot" in prompt) the pcf lines maintains it's
previous programmed state. This becomes a problem if the boards are designed
to work with the default initial state.

DRA7XX_evm uses PCF8575 and one of the PCF output lines feeds to MMC/SD and
this line should be driven high in order for the MMC/SD to be detected.
This line is modelled as regulator and the hsmmc driver takes care of enabling
and disabling it. In the case of 'reboot', during shutdown path as part of it's
cleanup process the hsmmc driver disables this regulator. This makes MMC boot
not functional.

Fixed it by driving high all the pcf lines.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
usb: musb: stuff leak of struct usb_hcd

since the split of host+gadget mode in commit 74c2e9360058 ("usb: musb:
factor out hcd initalization") we leak the usb_hcd struct. We call now
musb_host_cleanup() which does basically usb_remove_hcd() and also sets
the hcd variable to NULL. Doing so makes the finall call to
musb_host_free() basically a nop and the usb_hcd remains around for ever
without anowner.
This patch drops that NULL assignment for that reason.

Fixes: 74c2e9360058 ("usb: musb: factor out hcd initalization")
Cc: stable@vger.kernel.org
Cc: Daniel Mack <zonque@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
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:
  usb: musb: stuff leak of struct usb_hcd
  gpio: pcf857x: restore the initial line state of all pcf lines
  drivers: net: cpsw: fix cpsw hang on ethernet cable connect/disconnect

Signed-off-by: Texas Instruments Auto Merger <lcpd_integration@list.ti.com>
ASoC: omap-hdmi-audio: Set SNDRV_PCM_HW_PARAM_BUFFER_BYTES constraint

Set SNDRV_PCM_HW_PARAM_BUFFER_BYTES contraint that matches with
SNDRV_PCM_HW_PARAM_PERIOD_BYTES constraint.

For some reason setting the hw params with snd_pcm_hw_params_*_near()
functions sometimes fails if the period bytes constraint is set
without a matching buffer bytes constraint.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
PM / Runtime: Better support for nested irq_safe drivers

Do not lock parent of irq safe device to enabled state if the parent
is also irq safe.

Before this patch the pm_runtime_irq_safe() always called
pm_runtime_get_sync() for the parent, locking the parent to enabled
state and for sure making any parent irq_safe. This is hardly optimal
if the parent device PM code is also irq_safe.

After this patch the PM runtime core synchronously enables any
irq_safe parents of an irq_safe device when pm_runtime_get_sync() is
called. The parents are checked asyncronously after pm_runtime_put()
call.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
OMAPDSS: make dss & dispc runtime PM irq-safe

Both dss and dispc runtime PM suspend & resume can be called in atomic
context. As omapdrm has a habit of calling runtime get/put from atomic
context, set both dss and dispc as irq-safe to solve fix omapdrm.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
drm/omap: fbdev: add a module option controlling num backbuffers allocated

Some software requires the use of the fbdev PAN ioctl (SGX driver in flip
mode for instance).  This commit adds a new kernel parameter:
omapdrm.num_fbdev_backbuffers=<int>
that can be used to specify how many buffers get allocated when the
omapdrm/fbdev driver gets initialized.  It defaults to 1 if it is not
specified which is the existing behavior.

Signed-off-by: Darren Etheridge <detheridge@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
drm/irq: Implement a generic vblank_wait function

[ Upstream commit e8450f51a4b39cfe0878b4aee339820b2bfff240 ]

As usual in both a crtc index and a struct drm_crtc * version.

The function assumes that no one drivers their display below 10Hz, and
it will complain if the vblank wait takes longer than that.

v2: Also check dev->max_vblank_counter since some drivers register a
fake get_vblank_counter function.

v3: Use drm_vblank_count instead of calling the low-level
->get_vblank_counter callback. That way we'll get the sw-cooked
counter for platforms without proper vblank support and so can ditch
the max_vblank_counter check again.

v4: Review from Michel Dänzer:
- Restore lost notes about v3:
- Spelling in kerneldoc.
- Inline wait_event condition.
- s/vblank_wait/wait_one_vblank/

Cc: Michel Dänzer <michel@daenzer.net>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Merge branch 'audio-display-ti-linux-3.14.y' of git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree into ti-linux-3.14.y

TI-Feature: audio-display
TI-Tree: git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree.git
TI-Branch: audio-display-ti-linux-3.14.y

* 'audio-display-ti-linux-3.14.y' of git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree:
  drm/irq: Implement a generic vblank_wait function
  drm/omap: fbdev: add a module option controlling num backbuffers allocated
  OMAPDSS: make dss & dispc runtime PM irq-safe
  PM / Runtime: Better support for nested irq_safe drivers
  ASoC: omap-hdmi-audio: Set SNDRV_PCM_HW_PARAM_BUFFER_BYTES constraint

Signed-off-by: Texas Instruments Auto Merger <lcpd_integration@list.ti.com>
backport: gpio_backlight.c from: v3.15.10

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
firmware: am335x-pm-firmware.elf

#git://git.ti.com/ti-cm3-pm-firmware/amx3-cm3.git
#4e219d5053ee41b8fa8f85b48b1529ae4c6feb48

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>