ARM: dts: Add i2s0 controller node on smdk5420

This patch adds i2s0 and enables sound support
on smdk5420.

BUG=chrome-os-partner:20316
TEST=Build and boot smdk5420.

Change-Id: I0e6db8ad3ebe3000a07770b058f4d8de4e67d660
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59234
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
ARM: dts: wm8994: Add wm8994 regulator support on smdk5420

This patch adds the required regulator supplies and properties
for wm8994 codec on smdk5420 board.

BUG=chrome-os-partner:20316
TEST=Build and boot on smdk5420.
play audio on smdk5420 after applying below mixer commands
amixer sset 'DAC1' on,on ;
amixer sset 'Left Headphone Mux' DAC;
amixer sset 'Right Headphone Mux' DAC;
amixer sset 'DAC1L Mixer AIF1.1' on;
amixer sset 'DAC1R Mixer AIF1.1' on;

aplay -D hw:0 <file_name>

Change-Id: Ie823f6957c53078adc288622422f6fb977bf162d
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59235
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
CHROMIUM: ASoC: SMDK: wm8994: Add .pm to struct smdk_audio_driver

Missed .pm of struct smdk_audio_driver will prevent the audio
framework to call corresponding pm functions

BUG=chrome-os-partner:20316
TEST=Build and boot on smdk5420.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
(cherry picked from peach-alpha commit
	26b2d5a37054b095b276b0995922008c9e6df2d3)

Change-Id: Icf3e44f6761e3290fe80374d32843fd53050ca54
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/59236
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
CHROMIUM: mmc: core: Add a capability for disabling mmc cards

On some systems we need a way to disable MMC card support in a MMC/SD
card slot.  Add support in the core SD/MMC code to support this.

BUG=chrome-os-partner:11811
TEST=With patch series, plug in an MMC card and saw that it was
detected before this patch but isn't detected after.

Change-Id: I052b2a43a8a51d581196036e85f3ac174434e232
Original-Change-Id: I5b94a1d7deba85e0eb4709a419589cc3e9058eca
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/61487
Reviewed-by: Grant Grundler <grundler@chromium.org>
CHROMIUM: mmc: dw_mmc: Add a DISABLE_MMC quirk that sets the core mmc cap

This quirk can be set from the device tree to disable mmc on a given
slot.

BUG=chrome-os-partner:11811
TEST=With patch series, plug in an MMC card and saw that it was
detected before this patch but isn't detected after.

Change-Id: Idd8fc0fb105c305a0f0cc6b05e6605f249cc85c6
Original-Change-Id: I169b070578cff16b74f1556934e09ea3ea542b84
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/61488
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
UPSTREAM: mmc: dw_mmc: fix error return code in dw_mci_probe()

Fix to return -ENOMEM in alloc workqueue error case instead
of 0, as done elsewhere in this function.

BUG=chrome-os-partner:20373
TEST=Boot many times with eMMC and SD; test that WiFi works each time

Change-Id: I4d2686ef159deb81a9277f720480bd193b2d572d
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit ef7aef9ab41d9aa95e9c2e2fdd4b5dbbf890f1d7)

Reviewed-on: https://gerrit.chromium.org/gerrit/61457
Reviewed-by: Grant Grundler <grundler@chromium.org>
UPSTREAM: mmc: dw_mmc: clear IDSTS register when initialize IDMAC

If pending interrupt for IDMAC exists when initialize IDMAC, it will
call interrupt handler unnecessarily.

BUG=chrome-os-partner:20373
TEST=Boot many times with eMMC and SD; test that WiFi works each time

Change-Id: If2f96c7da8b1a9188b48331ddc6c29f8fb69a385
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit fc79a4d6dfa736672281aedbe384ece1f0044756)

Reviewed-on: https://gerrit.chromium.org/gerrit/61458
Reviewed-by: Grant Grundler <grundler@chromium.org>
UPSTREAM: mmc: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

BUG=chrome-os-partner:20373
TEST=Boot many times with eMMC and SD; test that WiFi works each time

Conflicts:
	drivers/mmc/host/android-goldfish.c
[dianders: conflict due to file that we don't have]

Change-Id: Ic5e3cc59165a0dbfa9cb58ac490ecc11a3683864
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit 113a87f868b2f2e086790a68e8b9e41d8f0c3295)
Reviewed-on: https://gerrit.chromium.org/gerrit/61459
Reviewed-by: Grant Grundler <grundler@chromium.org>
UPSTREAM: mmc: dw_mmc: change the macro name from DTO to DRTO

At Interrupt status register, Bit9 is Data Read Timeout.
But we used macro name as the DTO. It could be confused with the
Data Transfer Over(DTO)-Bit[3].
It's clearly that is changed the DRTO instead of DTO.

BUG=chrome-os-partner:20373
TEST=Boot many times with eMMC and SD; test that WiFi works each time

Change-Id: I547cf7cff895fbaf2aa690f88e62809b7b5dfe9e
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit 3f7eec62ecb7e30bd2f7e0fc4432d0d08a1aae46)
Reviewed-on: https://gerrit.chromium.org/gerrit/61460
Reviewed-by: Grant Grundler <grundler@chromium.org>
UPSTREAM: mmc: dw_mmc-pltfm: don't check resource with devm_ioremap_resource

devm_ioremap_resource does sanity checks on the given resource.
No need to duplicate this in the driver.

BUG=chrome-os-partner:20373
TEST=Boot many times with eMMC and SD; test that WiFi works each time

Change-Id: I1c69b2f8124e31fb8f2d3588f5f9797747ccdc20
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit bcc8766696fe2023b498a4a5c19cf8d2193aa62e)
Reviewed-on: https://gerrit.chromium.org/gerrit/61461
Reviewed-by: Grant Grundler <grundler@chromium.org>
UPSTREAM: mmc: dw_mmc: eliminate useless usage of ret

In few places usage of ret variable is not needed.
This patch simplifies those pieces of code.

BUG=chrome-os-partner:20373
TEST=Boot many times with eMMC and SD; test that WiFi works each time

Change-Id: Id43c7f7db9b96d99468d625c5ceb0f9a9a33c140
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit dd369800202f1aeeb23b64fe9d336d67b202c3b2)
Reviewed-on: https://gerrit.chromium.org/gerrit/61462
Reviewed-by: Grant Grundler <grundler@chromium.org>
UPSTREAM: mmc: dw_mmc-pci: convert to use pcim_* and devm_*

The PCI driver is getting simplier and tidier with pcim_* and devm_*
functions in use.

BUG=chrome-os-partner:20373
TEST=Boot many times with eMMC and SD; test that WiFi works each time

Change-Id: Ia3381455aa03b203e57d2cb4cf000345a06e041d
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit 1395974142bde026da39020a15374a713edbbfb9)
Reviewed-on: https://gerrit.chromium.org/gerrit/61463
Reviewed-by: Grant Grundler <grundler@chromium.org>
UPSTREAM: mmc: dw_mmc: Handle late vmmc regulators with EPROBE_DEFER

It is possible to specify a regulator that should be turned on when
dw_mmc is probed.  At the moment dw_mmc will fail to use the regulator
properly if the regulator probes after dw_mmc.  Fix this problem by
honoring EPROBE_DEFER.

At the same time move the regulator code out of the slot init code.
We only specify one regulator for the whole device and other parts of
the code (like suspend/resume) assume that the regulator has only been
enabled once.

BUG=chrome-os-partner:20373
TEST=Boot many times with eMMC and SD; test that WiFi works each time

Conflicts:
	Documentation/devicetree/bindings/mmc/synopsis-dw-mshc.txt
[dianders: conflict due to bypass smu being added]

Change-Id: Ie331c0c553d95e11272cd46bfb6235e3a69a1dcf
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit 870556a3dfb16d004f8e09dd59a1eddc727fcf0c)
Reviewed-on: https://gerrit.chromium.org/gerrit/61464
Reviewed-by: Grant Grundler <grundler@chromium.org>
UPSTREAM: mmc: dw_mmc: Add support DW SD/MMC driver on SOCFPGA

Add platform specific functionality for the DW SD/MMC driver for
SoCFPGA. Move SDMMC_CMD_USE_HOLD_REG to dw_mmc.h so other platforms
can use this define.

BUG=chrome-os-partner:20373
TEST=Boot many times with eMMC and SD; test that WiFi works each time

Conflicts:
	drivers/mmc/host/dw_mmc-exynos.c
[dianders: conflicts due to local changes]

Change-Id: I39d686189c723531970b1b8031e350b01eaa8325
Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Reviewed-by: Pavel Machek <pavel@denx.de>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit eede2111c522264f6260e0a5fb742be31f725a99)
Reviewed-on: https://gerrit.chromium.org/gerrit/61465
Reviewed-by: Grant Grundler <grundler@chromium.org>
UPSTREAM: mmc: dw_mmc-pltfm: remove static from dw_mci_pltfm_remove

dw_mci_pltfm_remove gets exported and used by dw_mmc-exynos, so should
not be static.

BUG=chrome-os-partner:20373
TEST=Boot many times with eMMC and SD; test that WiFi works each time

Change-Id: If0283fcca6ba50193bd8e583dff6a8ab427e0e16
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit 04520817d90f1dce863ab7f06531da7579798696)
Reviewed-on: https://gerrit.chromium.org/gerrit/61466
Reviewed-by: Grant Grundler <grundler@chromium.org>
UPSTREAM: mmc: dw_mmc-pltfm: move probe and remove below dt match table

In a subsquent patch probe will need to do some handling of data from
the dt match table. So to prevent the need for forward declarations,
move probe and remove below the match table.

BUG=chrome-os-partner:20373
TEST=Boot many times with eMMC and SD; test that WiFi works each time

Change-Id: Ibc5c44c6853bfcbc04fc465ae2ef8af27b89be16
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit b177a530bbe4f7dd01617f542311f87208d21ec6)
Reviewed-on: https://gerrit.chromium.org/gerrit/61467
Reviewed-by: Grant Grundler <grundler@chromium.org>
UPSTREAM: mmc: dw_mmc-pltfm: add Rockchip variant

Cortex-A9 SoCs from Rockchip use a slightly modified variant of dw_mmc
controllers that seems to require the SDMMC_CMD_USE_HOLD_REG bit to
always be set.

There also seem to be no other modifications (additional register etc)
present, so to keep the footprint low, add this small variant to the
pltfm driver.

BUG=chrome-os-partner:20373
TEST=Boot many times with eMMC and SD; test that WiFi works each time

Change-Id: I37cac4e88a7b15116f96edd7224451c84b5efd81
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
(cherry picked from commit c73e41c898bb59aaf50098c2c672c7132a88fdbc)
Reviewed-on: https://gerrit.chromium.org/gerrit/61468
Reviewed-by: Grant Grundler <grundler@chromium.org>
CHROMIUM: drm/exynos: hdmi: remove unnecessary memset

Our resources were just zalloc'ed as part of hdata.  They are already 0.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>

BUG=chromium:239570
TEST=none

Change-Id: Ibfc92e233953e6b0c972c562fca7bd918d43a8e6
Reviewed-on: https://gerrit.chromium.org/gerrit/56698
Commit-Queue: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
UPSTREAM: Documentation: Add examples to samsung-pinctrl device tree bindings documentation

This patch adds examples to samsung-pinctrl.txt documentaion file
on how to make gpio binding and gpio request

BUG=chrome-os-partner:19881
TEST=Documentation is clear

Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

Conflicts:
	Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
(cherry picked from commit 03cfc67753c8ab78f97983e947bb8f7610)
(cherry-picked from: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git)

Change-Id: I275abbbb35c2bf339a0bd3eb2d1e5ecebf197856
Reviewed-on: https://gerrit.chromium.org/gerrit/57577
Commit-Queue: naveen krishna chatradhi <naveen@chromium.org>
Reviewed-by: naveen krishna chatradhi <naveen@chromium.org>
Tested-by: naveen krishna chatradhi <naveen@chromium.org>
ARM: dts: peach: Preserves SDIO card power during a suspend/resume cycle

Preserves SDIO card power during a suspend/resume cycle by enabling
MMC_PM_KEEP_POWER pm_caps for dw_mmc channel 1 which has a SDIO card
attached.

BUG=chrome-os-partner:20523
TEST=build and booted on peach rev3, run multiple s2r cycles and not
     seeing the below print from kernel as this was getting printed before
     this patch
     [  941.710353] mwifiex_sdio: mmc1:0001:1: cannot remain alive while
     host is suspended

Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>

Change-Id: I3bd71f30f79780dddb403c9e8d587170751f427c
Reviewed-on: https://gerrit.chromium.org/gerrit/61416
Reviewed-by: Prathyush Kalashwaram <prathyush@chromium.org>
Tested-by: Prathyush Kalashwaram <prathyush@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: Alim Akhtar <alim.akhtar@samsung.com>
Tested-by: Alim Akhtar <alim.akhtar@samsung.com>