1
0
Fork 0
Commit Graph

2985 Commits (3c2c628f82a2c48c0d684dbf63b6a4765e784444)

Author SHA1 Message Date
Lars-Peter Clausen 017d84bd45 mmc: jz4740: Use managed resources
Use managed resources for the mmio memory region and the clock.
Makes the code a bit shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 12:39:14 -04:00
Lars-Peter Clausen 58e300af81 mmc: jz4740: Use slot-gpio helpers
Use the slot-gpio helpers to handle the write protect and card detect
GPIO pins instead of re-implementing the same functionality in the driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 12:39:13 -04:00
Lars-Peter Clausen 5d5c0350fc mmc: jz4740: Use SIMPLE_DEV_PM_OPS
It's a bit shorter than open-conding it. While we are at it also make
jz4740_mmc_pm_ops static.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 12:39:13 -04:00
Paul Cercueil 8a489aa10c mmc: jz4740: Fix handling of read errors.
For no reason, the code handling write errors was implemented while
the code handling read errors was missing.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 12:39:12 -04:00
Paul Cercueil 331947932d mmc: jz4740: Remove duplicated code.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 12:39:11 -04:00
Shawn Guo 9668d765ea mmc: sdhci: improve card removal check in sdhci_card_event()
The following error randomly appears on an imx6q board where gpio is
used to implement card-detection when mounting EXT4 rootfs during boot.

mmc1: Card removed during transfer!
mmc1: Resetting controller.
mmcblk0: unknown error -123 sending read/write command, card status 0x900
end_request: I/O error, dev mmcblk0, sector 106744
EXT4-fs error (device mmcblk0p2): ext4_find_entry:1312: inode #5011: comm swapper/0: reading directory lblock 0

It turns out that the error message comes from the card removal check
in function sdhci_card_event().  While we have a well implemented
function sdhci_do_get_cd() handling all the possible cases of
CD, the current code only checks controller internal CD case.  That
causes problem for other CD cases like gpio on above imx6q board.

Improve the check by using sdhci_do_get_cd() to cover all possible CD
cases, so that above error on the imx6q board gets fixed.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 12:39:11 -04:00
Doug Anderson 3c6d89ea34 mmc: dw_mmc: Add the ability to set the ciu clock frequency
As of now we rely on code outside of the driver to set the ciu clock
frequency.  There's no reason to do that.  Add support for setting up
the clock in the driver during probe.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 12:39:10 -04:00
Doug Anderson 870556a3df 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.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 12:39:06 -04:00
Lucas Stach 0ddf03c95b mmc: esdhc-imx: parse max-frequency from devicetree
In order to make it possible to reduce the SD bus frequency,
parse the optional "max-frequency" attribute as documented in
devicetree/bindings/mmc/mmc.txt

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 11:29:41 -04:00
Lucas Stach 8ba9580a80 mmc: sdhci-esdhc: calculate sdclk divider from controller clock
The SDCLK is divided down from the host controller clock. Host
controller clock may be different from the maximum SDCLK, so
get it from the platform, instead of just using the max SDCLK.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 11:29:14 -04:00
Yaniv Gardi a82e484e24 mmc: card: fixing an false identification of SANITIZE command
Inside the routine mmc_blk_ioctl_cmd() the sanitize command is
identified according to the value of bits 16-23 of the argument.

but what happens if a different command is sent, and only by
chance, bits 16-23 contain the value of SANITIZE command ?
In that case a SANITIZE command will be falsely identified.
In order to prevent such a case, the condition is expanded and
now it also checks the opcode itself, and verifies that it is an
MMC_SWITCH opcode.

Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 11:28:18 -04:00
Nicolas Ferre 4d156d50b5 mmc: atmel-mci: remove include <mach/cpu.h>
Header file not needed anymore as we have removed the calls to
cpu_is_xxx() macro.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 11:26:24 -04:00
Andy Shevchenko 1395974142 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.

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>
2013-06-27 11:25:07 -04:00
Andy Shevchenko dd36980020 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.

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>
2013-06-27 11:24:40 -04:00
Andy Shevchenko bcc8766696 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.

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>
2013-06-27 11:24:03 -04:00
Paul Taysom fdfa20c163 mmc: reordered shutdown sequence in mmc_bld_remove_req
We had a multi-partition SD-Card with two ext2 file systems. The partition
table was getting overwritten by a race between the card removal and
the unmount of the 2nd ext2 partition.

What was observed:
1. Suspend/resume would call to remove the device. The clearing
   of the device information is done asynchronously.
2. A request is made to unmount the file system (this is called
   after the removal has started).
3. The remapping table was cleared by the asynchronous part of
   the device removal.
4. A write request to the super block (block 0 of the partition)
   was sent down and instead of being remapped to the partition
   offset, it was remapped to block 0 of the device which is where
   the partition table is located.
5. Write was queued and written resulting in the overwriting
   of the partition table with the ext2 super block.
6. The mmc_queue is cleaned up.

The mmc card device driver used to access SD cards, was calling del_gendisk
before calling mmc_cleanup-queue. The comment in the mmc_blk_remove_req
code indicated that it expected del_gendisk to block all further requests
from being queued but it doesn't. The mmc driver uses the presences of the
mmc_queue to determine if the request should be queued.

The fix was to clean up the mmc_queue before the rest of the
the delete partition code is called.

This prevents the overwriting of the partition table.

However, the umount gets an error trying to write the super block.
The umount should be issued before the device is removed but that
is not always possible. The umount is still needed to cleanup other
data structures.

Addresses the problem described in http://crbug.com/240815

Signed-off-by: Paul Taysom <taysom@chromium.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 11:23:15 -04:00
Arnd Bergmann e2f6aac6a8 mmc: sirf: fix sdhci_pltfm_init sequence
Patch "mmc: sdhci: Add size for caller in init+register" changed the
interface for sdhci_pltfm_init, while patch "mmc: sdhci-sirf: add mmc
host sdhci-pltfm based driver for SiRF SoCs" added a new driver
with the old interface.

This changes the sirf driver to use the new interface, avoiding
one warning, and simplifying the init sequence. Since we're here
already, this also adds an error path for failed clk_prepare_enable.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Christian Daudt <csd@broadcom.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 11:17:25 -04:00
Jingoo Han 6e2c0f3ffb mmc: host: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 11:13:02 -04:00
Wei Yongjun 7913ae7d10 mmc: sh_mobile_sdhi: fix error return code in sh_mobile_sdhi_probe()
Fix to return a negative error code instead of 0 when we cannot get
IRQ source by platform_get_irq(), as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:57:29 -04:00
Wei Yongjun 5a0e807466 mmc: sdhci-acpi: fix error return code in sdhci_acpi_add_own_cd()
Fix to return a negative error code in the gpio_to_irq() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:56:03 -04:00
Jaehoon Chung 3f7eec62ec 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.

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>
2013-06-27 10:53:36 -04:00
Fabio Estevam dcac5fe3cf mmc: mxs-mmc: Let device core handle pinctrl
Since commit ab78029 (drivers/pinctrl: grab default handles from
device core), we can rely on device core for handling pinctrl.

So remove devm_pinctrl_get_select_default() from the driver.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:49:16 -04:00
Yuvaraj Kumar C D 6636bad839 mmc: core: Update the ext-csd.rev check for eMMC5.1
With the new eMMC5.1 spec, there is a new EXT_CSD register with
the revision number(EXT_CSD_REV) 7. This patch updates the check
for ext-csd.rev number as 7.

Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:38:32 -04:00
Barry Song 0b856f4ecb mmc: sdhci-sirf: let device core setup the default pin configuration
With device core now able to setup the default pin configuration, the
call to devm_pinctrl_get_select_default can be removed. And the pin
configuration code based on the deprecated Samsung specific gpio
bindings is also removed.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:34:17 -04:00
Simon Baatz 2cd1722496 mmc: mvsdio: use standard MMC device-tree binding parser mmc_of_parse()
Instead of parsing the DT binding on our own, use the standard parser
mmc_of_parse(), introduced by commit 6c56e7a.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:25:00 -04:00
Simon Baatz 47caa84fb6 mmc: tegra: handle mmc_of_parse() errors during probe
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:23:52 -04:00
Simon Baatz d2cf6071cc mmc: sdhci-pxav3: handle mmc_of_parse() errors during probe
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:23:11 -04:00
Simon Baatz b88576965b mmc: mxcmmc: handle mmc_of_parse() errors during probe
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:23:05 -04:00
Simon Baatz 274a752b1a mmc: tmio-mmc: handle mmc_of_parse() errors during probe
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:22:57 -04:00
Simon Baatz 2c9054dc10 mmc: sh_mmcif: handle mmc_of_parse() errors during probe
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:22:50 -04:00
Simon Baatz ec0a7517dc mmc: return mmc_of_parse() errors to caller
In addition to just logging errors encountered during DT parsing or
allocating GPIO slots for CD/WP, mmc_of_parse() now returns with an error.

In particular, this is needed if the GPIO allocation may return
EPROBE_DEFER.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:22:44 -04:00
Lars-Peter Clausen fca9661c6c mmc: jz4740: Use clk_prepare_enable/clk_disable_unprepare
In preparation to switching the jz4740 clk driver to the
common clk framework, update the clk enable/disable calls
to clk_prepare_enable/clk_disable_unprepare.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-27 10:18:51 -04:00
Stephen Boyd 7f371b9825 msm_sdcc: Convert to clk_prepare/unprepare
Add calls to clk_prepare and unprepare so that MSM can migrate to
the common clock framework.

Cc: Chris Ball <cjb@laptop.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-06-24 13:06:42 -07:00
Arnd Bergmann a0639948b6 DaVinci SoC changes for v3.11
This pull request moves DaVinci EDMA library to
 arch/arm/common so it can be used by OMAP based AM335x.
 This is a temporary step until all drivers are converted
 to use the dmaengine driver in drivers/dma/edma.c.
 
 Several drivers like SPI, MMC/SD have already been converted.
 Some like audio are pending.
 
 The other two patches in the pull request are cleanup in nature.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
 iQIcBAABAgAGBQJRv+92AAoJEGFBu2jqvgRNo5kP/AmUETjUCik9j9mVUzuv0k57
 c+EO63zqtWfU9ryVaziZOnLqFK51eLbNVV0I04pjZQzsrox+X9fasRRbXPdzCCW8
 +A1AcAmNGpKNVTaXSpHZJxI7Pq57mdAo4YrdaOjOICcjUgikqSibUxg4Yojz9OxL
 mOl9dPMSXDnXKaPLSbVz/jBDJSrYvBKXpO7/kyDbnmiQ+kqw4pY0F3NLkxWtsEFF
 L4nnwrLRdoTOnqAGQsTqUl9WcNr53EZc+gc0m4cJs3Fj2GLl2gQaiCb0hZLKzSwk
 Awa0mVZHUgJx5lCS2dyhk7cq/wIv1AO8GAnq0XP/04sajJqBz1B4eDfncYP4+qph
 Z6FXEAhNj0Fo+x8ZYmGr+cep2hmkUbBmPkNDWuTcU8VtH5FlXH4BCLREoSISBktD
 lpymYaRx7G1c9gZFYVfZbInWqrF1s8avqs/UlHdp96SgHNpQsrpxyyq4VSytGWOP
 aodbcOqktK+9Sn6vmRPTELlpYmPJnpX2rbhnVj20zED+uSO5IVL194+ggrLIc/V+
 SObGLib4/FkqyJp4/WVir7TLchsj1BKASmlF0a9HZ+1wuaRyC48J0kjYINY8ycBz
 rxfG5frG4tXSObuk0zMlhNoQRh6elT9eO67uflgjSkXFxLm7Tzd4omHTokAKAo1E
 F81IsqEDqYhbrbmzj2Na
 =BH9M
 -----END PGP SIGNATURE-----

Merge tag 'davinci-for-v3.11/soc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/soc

From Sekhar Nori:

DaVinci SoC changes for v3.11

This pull request moves DaVinci EDMA library to
arch/arm/common so it can be used by OMAP based AM335x.
This is a temporary step until all drivers are converted
to use the dmaengine driver in drivers/dma/edma.c.

Several drivers like SPI, MMC/SD have already been converted.
Some like audio are pending.

The other two patches in the pull request are cleanup in nature.

* tag 'davinci-for-v3.11/soc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
  ARM: edma: remove unused transfer controller handlers
  ARM: davinci: move private EDMA API to arm/common
  ARM: davinci: remove __init atrribute from function declaration

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2013-06-20 15:06:57 +02:00
Matt Porter 3ad7a42d5a ARM: davinci: move private EDMA API to arm/common
Move mach-davinci/dma.c to common/edma.c so it can be used
by OMAP (specifically AM33xx) as well.

Signed-off-by: Matt Porter <mporter@ti.com>
Acked-by: Chris Ball <cjb@laptop.org> # davinci_mmc.c
Acked-by: Mark Brown <broonie@linaro.org>
Acked-by: Olof Johansson <olof@lixom.net>
[nsekhar@ti.com: dropped davinci sffsdr changes]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
2013-06-18 10:52:03 +05:30
Guennadi Liakhovetski b9ec274412 mmc: tmio: reset the controller after power-up
This fixes two reported problems:
1. after a system resume the controller isn't functioning until a command
   runs on a timeout and a controller reset is performed.
2. if a card is ejected during a running write operation, its re-insertion
   isn't detected.

Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
Reported-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Tested-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
Tested-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-06 11:48:14 -04:00
Guennadi Liakhovetski e83b7a8acc mmc: tmio: fix unbalanced power-on calls with clock-gating enabled
With MMC clock gating enabled the MMC core currently calls MMC host driver's
.set_ios() method with .power_mode == MMC_POWER_ON and the clock value set
either to 0 or to the target rate. The tmio MMC driver then wrongly
translates the latter calls to card slot power-on requests, even when the
slot already was on. This patch fixes the driver to avoid needlessly
incrementing power-supplying regulator's use count.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-06 11:48:04 -04:00
Guennadi Liakhovetski 19f1ba51c7 mmc: sh_mmcif: don't clear masked interrupts
Masking events on MMCIF means that an occurrence of the masked event
won't raise an interrupt, but the event bit will still be set in the
interrupt status register. If simultaneously a different event occurs
which was enabled, both flags will be set. However, only the unmasked
event bit should be cleared in the status register in such a case.

Clearing also the masked bit can lead to lost interrupts, which indeed
can be observed on the armadillo800eva r8a7740 board with an eMMC chip.
The problem has been introduced by the recent "mmc: sh_mmcif: simplify
IRQ processing" patch. Fix the problem by only clearing enabled interrupts.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Tested-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-06 07:40:48 -04:00
Guennadi Liakhovetski b22ffdcd25 mmc: tmio: postpone controller reset during resume
When resuming, the tmio_mmc_host_resume() function is run when the
controller might still be powered down. Issuing a reset command to it at
that time has no effect. This patch postpones resetting the controller
until the first powering-up .set_ios() call.

Reported-by: Nguyen Viet Dung <nv-dung@jinso.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-06-06 07:37:48 -04:00
Rafael J. Wysocki 45f0a85c82 PM / Runtime: Rework the "runtime idle" helper routine
The "runtime idle" helper routine, rpm_idle(), currently ignores
return values from .runtime_idle() callbacks executed by it.
However, it turns out that many subsystems use
pm_generic_runtime_idle() which checks the return value of the
driver's callback and executes pm_runtime_suspend() for the device
unless that value is not 0.  If that logic is moved to rpm_idle()
instead, pm_generic_runtime_idle() can be dropped and its users
will not need any .runtime_idle() callbacks any more.

Moreover, the PCI, SCSI, and SATA subsystems' .runtime_idle()
routines, pci_pm_runtime_idle(), scsi_runtime_idle(), and
ata_port_runtime_idle(), respectively, as well as a few drivers'
ones may be simplified if rpm_idle() calls rpm_suspend() after 0 has
been returned by the .runtime_idle() callback executed by it.

To reduce overall code bloat, make the changes described above.

Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Kevin Hilman <khilman@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
2013-06-03 21:49:52 +02:00
Christian Daudt 0e74823429 mmc: sdhci: Add size for caller in init+register
Add a param to allow users of sdhci_pltfm to allocate private space
in calls to sdhci_pltfm_init+sdhci_pltfm_register. This is implemented
in the same way as sdhci does for its users.
 None of the users have been migrated yet and are passing in zero to
retain their private allocation.

- todo: migrate clients to using allocation this way
- todo: remove priv variable once migration is complete

Also removed unused variable in sdhci_pltfm_init fn

Signed-off-by: Christian Daudt <csd@broadcom.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-31 11:59:29 -04:00
Adrian Hunter 7396e318b4 mmc: sdhci-pci: support runtime PM for BYT SD cards
Add support for runtime PM for BYT SD cards.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:24 -04:00
Adrian Hunter a61abe6eeb mmc: sdhci-acpi: support runtime PM for ACPI HID 80860F14 SD cards
Enable runtime PM for ACPI HID 80860F14 SD cards, adding support for
card detect GPIO.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:24 -04:00
Adrian Hunter f0710a557c mmc: sdhci: add ability to stay runtime-resumed if the card is powered up
If card power is dependent on SD bus power then the host controller
must not be runtime suspended while the card is powered up.  Add
the ability to stay runtime-resumed in that case and enable it with a new
quirk SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:23 -04:00
Jingoo Han 113a87f868 mmc: remove unnecessary platform_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d06310
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

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>
2013-05-26 14:23:23 -04:00
Al Cooper ad82ab65d8 mmc: sdhci-pltfm: Allow drivers to set quirks2 from platform data
Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:22 -04:00
Jingoo Han 5a942b6fee mmc: atmel-mci: add CONFIG_PM_SLEEP to suspend/resume functions
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following
build warning when CONFIG_PM_SLEEP is not selected. This is because
sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when
the CONFIG_PM_SLEEP is enabled.

drivers/mmc/host/atmel-mci.c:2509:12: warning: 'atmci_suspend' defined but not used [-Wunused-function]
drivers/mmc/host/atmel-mci.c:2539:12: warning: 'atmci_resume' defined but not used [-Wunused-function]

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:21 -04:00
Guennadi Liakhovetski 87ae7bbebd mmc: sdhi/tmio: add DT DMA support
Add support for initialising DMA from the Device Tree.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:21 -04:00
Guennadi Liakhovetski eec95ee226 mmc: sdhi/tmio: switch to using dmaengine_slave_config()
This removes the deprecated use of the .private member of struct dma_chan
and switches the sdhi / tmio mmc driver to using the
dmaengine_slave_config() channel configuration method.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:20 -04:00
Guennadi Liakhovetski 03a0675b2a mmc: sdhi/tmio: make DMA filter implementation specific
So far only the SDHI implementation uses TMIO MMC with DMA. That way a DMA
channel filter function, defined in the TMIO driver wasn't a problem.
However, such a filter function is DMA controller specific. Since the SDHI
glue is only running on systems with the SHDMA DMA controller, the filter
function can safely be provided by it. Move it into SDHI.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:19 -04:00
Joonyoung Shim fc79a4d6df mmc: dw_mmc: clear IDSTS register when initialize IDMAC
If pending interrupt for IDMAC exists when initialize IDMAC, it will
call interrupt handler unnecessarily.

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>
2013-05-26 14:23:19 -04:00
Fredrik Soderstedt 6044371219 mmc: core: Fix select power class after resume
Use the saved values in card->ext_csd when selecting power class.
By doing this the power class will be selected even if mmc_init_card
is called with oldcard != NULL, which is the case after a suspend/resume.

Today ext_csd is NULL if mmc_init_card is called with oldcard != NULL
and power class will not be selected.

According to the eMMC specification the POWER_CLASS value is reset after
power failure, H/W reset assertion and any CMD0 reset.

Signed-off-by: Fredrik Soderstedt <fredrik.soderstedt@stericsson.com>
Reviewed-by: Johan Rudholm <jrudholm@gmail.com>
Acked By: Girish K S <girish.shivananjappa@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:18 -04:00
Ulf Hansson 07a6821608 mmc: core: Restructure and simplify code for mmc sleep|awake
The mmc_card_sleep|awake APIs are not being used since the support is
already properly encapsulated within the suspend sequence. Sleep|awake
command is also specific for eMMC.

We remove the sleep|awake bus_ops, the mmc_card_sleep|awake APIs and
move the code into the mmc specific core instead. This also includes
the mmc ops function, mmc_sleepawake. All releated functions have then
become static and we have got far less code to maintain.

Additionally this patch also simplifies the code from mmc_sleepawake,
since it is only used to put the card to sleep and not awake.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:17 -04:00
Ulf Hansson c4d770d724 mmc: core: Support aggressive power management for (e)MMC/SD
Aggressive power management is suitable when saving power is
essential. At request inactivity timeout, aka pm runtime
autosuspend timeout, the card will be suspended.

Once a new request arrives, the card will be re-initalized and
thus the first request will suffer from a latency. This latency
is card-specific, experiments has shown in general that SD-cards
has quite poor initialization time, around 300ms-1100ms. eMMC is
not surprisingly far better but still a couple of hundreds of ms
has been observed.

Except for the request latency, it is important to know that
suspending the card will also prevent the card from executing
internal house-keeping operations in idle mode. This could mean
degradation in performance.

To use this feature make sure the request inactivity timeout is
chosen carefully. This has not been done as a part of this patch.

Enable this feature by using host cap MMC_CAP_AGGRESSIVE_PM and
by setting CONFIG_MMC_UNSAFE_RESUME.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:17 -04:00
Ulf Hansson e94cfef698 mmc: block: Enable runtime pm for mmc blkdevice
Once the mmc blkdevice is being probed, runtime pm will be enabled.
By using runtime autosuspend, the power save operations can be done
when request inactivity occurs for a certain time. Right now the
selected timeout value is set to 3 s. Obviously this value will likely
need to be configurable somehow since it needs to be trimmed depending
on the power save algorithm.

For SD-combo cards, we are still leaving the enablement of runtime PM
to the SDIO init sequence since it depends on the capabilities of the
SDIO func driver.

Moreover, when the blk device is being suspended, we make sure the device
will be runtime resumed. The reason for doing this is that we want the
host suspend sequence to be unaware of any runtime power save operations
done for the card in this phase. Thus it can just handle the suspend as
the card is fully powered from a runtime perspective.

Finally, this patch prepares to make it possible to move BKOPS handling
into the runtime callbacks for the mmc bus_ops. Thus IDLE BKOPS can be
accomplished.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:16 -04:00
Ulf Hansson 12d01d0b81 mmc: core: Add bus_ops for runtime pm callbacks
SDIO is the only protocol that uses runtime pm for the card device
right now. To provide the option for sd and mmc to use runtime pm as
well the bus_ops callback are extended with two new functions. One for
runtime_suspend and one for runtime_resume.

This patch will also implement the callbacks for SDIO to make sure
existing functionality is maintained. It also prepares to move
away from using the mmc_power_restore_host API, since it is not
needed when using runtime PM.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:15 -04:00
Ulf Hansson 39b9431b0f mmc: core: Stop bkops for eMMC only from mmc suspend
Move mmc suspend specific operations to be executed from the .suspend
callback in the mmc bus_ops. This simplifies the mmc_suspend_host
function which is supposed to handle nothing but common suspend tasks.

Since eMMC can be considered non-removable there are no need to check
for ongoing bkops at PM_SUSPEND_PREPARE notification so remove it.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:15 -04:00
Wei Yongjun 0c5ce16bc1 mmc: mxs-mmc: fix error return code in mxs_mmc_probe()
Fix to return -ENODEV in the request dma error case instead
of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:14 -04:00
Wei Yongjun ef7aef9ab4 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.

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>
2013-05-26 14:23:13 -04:00
Maya Erez 775a9362b5 mmc: card: Adding support for sanitize in eMMC 4.5
The sanitize support is added as a user-app ioctl call, and
was removed from the block-device request, since its purpose is
to be invoked not via File-System but by a user.

This feature deletes the unmap memory region of the eMMC card,
by writing to a specific register in the EXT_CSD.

unmap region is the memory region that was previously deleted
(by erase, trim or discard operation).

In order to avoid timeout when sanitizing large-scale cards,
the timeout for sanitize operation is 240 seconds.

Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:13 -04:00
Ulf Hansson b689167984 mmc: core: Re-use code for MMC_CAP2_DETECT_ON_ERR in polling mode
Previously the MMC_CAP2_DETECT_ON_ERR was invented for detecting
slow card removal. In was never a realy good solution and a proper
fix has been merged using gpio debouncing instead. We remove this
cap in this patch.

Although when using polling card detect mode, the code invented for
MMC_CAP2_DETECT_ON_ERR is re-used to complete card removal in an
earlier phase. There are no need waiting for the polling timeout to
elapse in this case.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Liu <kliu5@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:12 -04:00
Santosh Shilimkar 4a29b5591f mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case
MMC driver probe will abort for DT case because of failed
platform_get_resource_byname() lookup. Fix it by skipping resource
lookup byname for device tree build.

Issue is hidden because hwmod populates the IO resources which
helps to succeed platform_get_resource_byname() and probe.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:11 -04:00
Fredrik Soderstedt 810e08ee42 mmc: core: Only execute tuning for SDR50 and SDR104
Only execute tuning for sd and sdio devices that are using
SDR50 or SDR104.

Make sure clock is hold during tuning for sdio devices.

Signed-off-by: Fredrik Soderstedt <fredrik.soderstedt@stericsson.com>
Acked-by: Johan Rudholm <jrudholm@gmail.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:11 -04:00
Matt Porter d272fbf0ca mmc: omap_hsmmc: convert to dma_request_slave_channel_compat
Convert dmaengine channel requests to use
dma_request_slave_channel_compat(). This supports platforms booting
with or without DT populated.

Signed-off-by: Matt Porter <mporter@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:10 -04:00
Tony Lindgren cf5ae40b39 mmc: omap_hsmmc: Fix the DT pbias workaround for MMC controllers 2 to 5
Otherwise SDIO cards won't necessarily work when booted with
device tree as we will never power down the SDIO cards. This
means the SDIO card reset does not happen which at least some
WLAN controllers expect to happen with ifconfig wlan0 down.

The PBIAS voltage is only available for the first controller
instance, so let's limit the PBIAS workaround to the first
controller only.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Tested-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 14:23:09 -04:00
Adrian Hunter 728ef3d193 mmc: sdhci-pci: add more device ids
Add three more PCI device ids.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 13:50:50 -04:00
Adrian Hunter 07a588837b mmc: sdhci-acpi: add more device ids
Add three more ACPI HIDs.  Also, as some devices must be
further distinguished by ACPI UID, slot information is now
associated with HID and UID.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 13:50:50 -04:00
Adrian Hunter 1d1ff45871 mmc: sdhci-acpi: fix initial runtime pm status
Initial runtime pm status is active.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 13:50:49 -04:00
Ludovic Desroches 8c964df07a mmc: atmel-mci: convert to dma_request_slave_channel_compat()
Use generic DMA DT helper. Platforms booting with or without DT populated
are both supported.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 13:32:13 -04:00
Lucas Stach 361b848202 mmc: sdhci-esdhc-imx: fix multiblock reads on i.MX53
The eSDHC controller on the i.MX53 needs an additional, non spec
compliant CMD12 after a multiblock read with a predefined number of
blocks. Otherwise the internal state machine won't go back to the
idle state.

This commit effectively reverts 5b6b0ad6 (mmc: sdhci-esdhc-imx:
fix for mmc cards on i.MX5), which fixed part of the problem by
making multiblock reads work, however this fix was not sufficient
when multi- and singleblock reads got intermixed.

This implements the recommended workaround (Freescale i.MX Reference
Manual, section 29.6.8 "Multi-block Read") by manually sending a
CMD12 with the RSPTYP bits cleared.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 13:13:31 -04:00
Martin Fuzzey f6825748bd mmc: sdhci-esdhc-imx: Fix SDIO interrupts
Currently SDIO interrupts do not work on i.MX53 and maybe others.

This was observed with a Marvell 8787 based SDIO wifi adapter
using the mwifiex driver and firmware from the Marvell git
repository.
The symptom was a timeout after firmware download.

Observing the SDIO_DAT1 line showed that an interrupt was requested
(level 0) but no interrupt was generated in software, the line
stayed low until a timeout ocurred and the card was reset.

There is a Freescale errata
	ENGcm11186 "eSDHC misses SDIO interrupt when CINT is disabled"

The workaround suggested by this errata is already implemented and
involves clearing and then setting the D3CD bit in the host control
register [see esdhc_writel_le()]

However, when esdhc_writeb_le() is later used to write to
SDHCI_HOST_CONTROL it always resets the D3CD bit.

To fix this simply add the D3CD bit to the set of bits
not modified by esdhc_writeb_le().

Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-05-26 13:10:36 -04:00
Ulf Hansson 0125962000 ARM: 7726/1: mmc: mmci: Add card_busy function to improve UHS card support
To verify a signal voltage switch at initialization of UHS cards the
.card_busy callback is used. For some of the ST-variants, card busy
detection on the DAT0 pin is supported.

We extend the variant struct with a busy_detect flag to indicate
support for it. A corresponding busy detect function, which polls the
busy status bit, is then set to the .card_busy callback.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-05-23 00:09:16 +01:00
Ulf Hansson 9cc639a20f ARM: 7725/1: mmc: mmci: Cache MMCIDATACTRL register
Add a cache variable in the host struct that reflects the current data in
the MMCIDATACTRL register. This patch will not introduce any functional
change but instead provide an easy option to keep specific bits in the
register between each data transfer.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-05-23 00:09:15 +01:00
Ulf Hansson 0f3ed7f75c ARM: 7724/1: mmc: mmci: Support signal voltage switch for UHS cards
Add .start_signal_voltage_switch callback to be able to support UHS cards.
The voltage switch requires the optional vqmmc regulator to exist since
the actual voltage switch will be performed directly on it.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-05-23 00:07:38 +01:00
Ulf Hansson 7c0136ef77 ARM: 7721/1: mmc: mmci: Fixup regulator handling for vqmmc
We can not rely on regulator_is_enabled to decide whether to
enable|disable the regulator. It would mean that the reference
counter for it is not balanced properly.

Instead keep track of our internal state by using a new flag in
the host struct, so we can take correct decisions.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-05-23 00:07:07 +01:00
Lee Jones 1fd83f0ecf ARM: 7713/1: mmc: mmci: Allow MMCI to request channels with information acquired from DT
Currently, if DMA information isn't passed from platform data, then DMA
will not be used. This patch allows DMA information obtained though Device
Tree to be used as well.

Cc: Chris Ball <cjb@laptop.org>
Cc: linux-mmc@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-05-23 00:07:04 +01:00
Ulf Hansson 024629c62f ARM: 7719/1: mmc: mmci: Support for CMD23
Support added for transmission of CMD23 during multi block read or
write. In order to activate this feature, MMC_CAP_CMD23 flag needs
to be enabled in the capabilities field. Note that CMD23 support is
mandatory to support features like reliable write, data tag, context
ID, packed command.

This patch is based upon a patch from Saugata Das.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-05-23 00:07:03 +01:00
Ulf Hansson c58a85090c ARM: 7718/1: mmc: mmci: Set actual clock for debug purpose
Update cclk to the acutal used value and copy it to the actual_clock
variable in the mmc host for debug purpose.

Signed-off-by: Fredrik Soderstedt <fredrik.soderstedt@stericsson.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-05-23 00:07:01 +01:00
Ulf Hansson 665ba56fda ARM: 7717/1: mmc: mmci: Use devm_clk_get API
Converting to devm_clk_get simplifies error handling in probe
and we can remove other corresponding calls to clk_put.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-05-23 00:07:00 +01:00
Linus Torvalds d21572c515 Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm
Pull ARM fixes from Russell King:
 "A small number of fixes for stuff from the last merge window, and in
  one case (IRQ time accounting) the previous merge window."

* 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
  ARM: 7720/1: ARM v6/v7 cmpxchg64 shouldn't clear upper 32 bits of the old/new value
  ARM: 7715/1: MCPM: adapt to GIC changes after upstream merge
  ARM: 7714/1: mmc: mmci: Ensure return value of regulator_enable() is checked
  ARM: 7712/1: Remove trailing whitespace in arch/arm/Makefile
  ARM: 7711/1: dove: fix Dove cpu type from V7 to PJ4
  ARM: finally enable IRQ time accounting config
2013-05-15 13:37:54 -07:00
Lee Jones db90f91f6f ARM: 7714/1: mmc: mmci: Ensure return value of regulator_enable() is checked
This patch suppresses the warning below:

drivers/mmc/host/mmci.c: In function ‘mmci_set_ios’:
drivers/mmc/host/mmci.c:1165:20: warning: ignoring return value of
        ‘regulator_enable’, declared with attribute warn_unused_result
        [-Wunused-result]

Cc: Chris Ball <cjb@laptop.org>
Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-05-10 14:44:17 +01:00
Linus Torvalds 292088ee03 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull more vfs updates from Al Viro:
 "A couple of fixes + getting rid of __blkdev_put() return value"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  proc: Use PDE attribute setting accessor functions
  make blkdev_put() return void
  block_device_operations->release() should return void
  mtd_blktrans_ops->release() should return void
  hfs: SMP race on directory close()
2013-05-07 15:14:53 -07:00
Linus Torvalds 38f56f33ca ARM: arm-soc device tree changes, part 2
These are mostly new device tree bindings for existing drivers, as well
 as changes to the device tree source files to add support for those
 devices, and a couple of new boards, most notably Samsung's Exynos5
 based Chromebook.
 
 The changes depend on earlier platform specific updates and touch
 the usual platforms: omap, exynos, tegra, mxs, mvebu and davinci.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIVAwUAUYgjh2CrR//JCVInAQJTvRAAmxaeoI+kQ/pbbRDa/Mnhf+bUmQjvJvx4
 uFGYAAi23Txem2Bx6xrfvOo9//ATYSfRxenoSSOtXQucsnrqD0+837Sj2NbO6AB9
 MSiFDK4usJtGwSUybkSHNLb2QPBr8XTgmyWVE/sHEw2UtrIToC1n3sxFofFm0guT
 ReILKsgK0Wjyq5RntnjWOCHNNp6OGqDGvFXlSJqNA7Z6gR/VZy4o0oXS4Sv3TWgF
 zG7ngSG7/u9FP1IQnMr/SxY1T4QS/bBbAC1YvD/7X30DPHrWKR3/3LfLcsc9TUN2
 smTlZQjHdgBbGfVPL7JN0fQwA82HEjNSZKLJ0w9uFjxXgnoKT3znpUpQeuf3dsWm
 BhEFqN1Rf446S4ft2btBSB2nhX4NTlJ7w6z2F65xgaylgYFsGFTYcpjiOurKe3wF
 gGsw31DZdcuI4/LjiWbNGRKbMd7HFFLbFDMJ16TFbNcNr+pM3qpoQ6z3uMbfCBSe
 xFnYr+ESN8F2HXMNLiz3CTqLY+Fi/bHd22n3KuI9qsWws/0KDUrTvFh9Sm3kYji5
 QwwLl6PRoeFw8H29e3KrPsKoY/BGYAvrAetnC1o79cDFPLwUyii/1B6WwzC4ynfs
 K1VhwdVOwnp0sS/a2Pv8sZBpDNI07gwT9P20aiholxgREq2RKNXXVxGGFfK5Qvm9
 FG4Vp6EKEQ0=
 =G60S
 -----END PGP SIGNATURE-----

Merge tag 'dt-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC device tree updates (part 2) from Arnd Bergmann:
 "These are mostly new device tree bindings for existing drivers, as
  well as changes to the device tree source files to add support for
  those devices, and a couple of new boards, most notably Samsung's
  Exynos5 based Chromebook.

  The changes depend on earlier platform specific updates and touch the
  usual platforms: omap, exynos, tegra, mxs, mvebu and davinci."

* tag 'dt-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (169 commits)
  ARM: exynos: dts: cros5250: add EC device
  ARM: dts: Add sbs-battery for exynos5250-snow
  ARM: dts: Add i2c-arbitrator bus for exynos5250-snow
  ARM: dts: add mshc controller node for Exynos4x12 SoCs
  ARM: dts: Add chip-id controller node on Exynos4/5 SoC
  ARM: EXYNOS: Create virtual I/O mapping for Chip-ID controller using device tree
  ARM: davinci: da850-evm: add SPI flash support
  ARM: davinci: da850: override SPI DT node device name
  ARM: davinci: da850: add SPI1 DT node
  spi/davinci: add DT binding documentation
  spi/davinci: no wildcards in DT compatible property
  ARM: dts: mvebu: Convert mvebu device tree files to 64 bits
  ARM: dts: mvebu: introduce internal-regs node
  ARM: dts: mvebu: Convert all the mvebu files to use the range property
  ARM: dts: mvebu: move all peripherals inside soc
  ARM: dts: mvebu: fix cpus section indentation
  ARM: davinci: da850: add EHRPWM & ECAP DT node
  ARM/dts: OMAP3: fix pinctrl-single configuration
  ARM: dts: Add OMAP3430 SDP NOR flash memory binding
  ARM: dts: Add NOR flash bindings for OMAP2420 H4
  ...
2013-05-07 11:06:17 -07:00
Al Viro db2a144bed block_device_operations->release() should return void
The value passed is 0 in all but "it can never happen" cases (and those
only in a couple of drivers) *and* it would've been lost on the way
out anyway, even if something tried to pass something meaningful.
Just don't bother.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-05-07 02:16:21 -04:00
Linus Torvalds 173192958d MMC highlights for 3.10:
Core:
  - Introduce MMC_CAP2_NO_PRESCAN_POWERUP to allow skipping mmc_power_up()
    at boot/initialization time if it's already happened, for performance
    (faster boot time) reasons.
  - Fix a bit width test failure that resulted in old eMMC cards being put
    into 1-bit mode when 4-bit mode was available.
  - Expose fwrev/hwrev for MMCv4 parts.
  - Improve card removal logic in the case where the card's removed slowly;
    we were missing card removal events if the card retained contact with
    the slot pads for long enough to reply to a CMD13 while being removed.
 
 Drivers:
  - davinci_mmc: Support using PIO instead of DMA.
  - dw_mmc: Add support for Exynos4412.
  - mxcmmc: DT support, use slot-gpio API.
  - mxs-mmc: Add broken-cd/cd-inverted/non-removable DT property support.
  - sdhci-sirf: New sdhci-pltfm driver for CSR SiRF SoCs:
     SiRFprimaII: unicore ARM Cortex-A9
     SiRFatlas6: unicore ARM Cortex-A9
     SiRFmarco: dual core ARM Cortex-A9 SMP
  - sdhci-tegra: Add support for Tegra114 platforms, use mmc_of_parse().
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (GNU/Linux)
 
 iQIcBAABAgAGBQJRfr+qAAoJEHNBYZ7TNxYMG90QALW6ArdTxkfNKNybCx/s3ttm
 hyP2BB9eXF/FbZ9bGHGuv9NXV/4YZ4yr4c3yV4paOMW3s0z/+IhqajLfCgPFPCGK
 MOk5GAStN/+znBjLy+5V/17EJuVpE+WVwUqDg3RafB8NGQtaClymwPg6R+SMWwL9
 uiRcCVgmgzlk9l+4Z1p9wHUeQlhZQ/Okzj4CjkOpWfgsUpo0PcWQRosd+CHHirWz
 iWnhFBM1cP4Nj59ashYSedu797s29pKGd31JcuWWQE228iykGfcCJWzMr9YMiU6x
 LwESeuTST8b9HblI7WYnFvpVvD9qTuBkkKMIKMNb4E34xBf8+H2zUh1hK7iEnDXt
 W0F1xy3WsxpJ1yF0BY9SqqnNeLpJBOenHlTZfGlf5r+kHWYUUQvvqw/ZdmWStRgv
 mSoqXSmz/oM3rn1KjMritJ9oyr0EH8kHDMAsoiCF0EuGipmenFTdJJiwbh0JZJxK
 bjqPUROtSK8TdPvTw1BPRX5YtJLzsG4HdsI3C8W05BTbCL9iIE1NaWP27nikPVfq
 glt9EilzgR252Wc649OrB7JAHBZjlVFIndNzjziGdxNzH6m1AK05qxTL5hBvba99
 plccrsVMDGWLSmsGVwz7Eo+TLflRCdtrE+7O4NrlydZzp2t24HZrMc9rN8GDWQQE
 dP91YUdpDYrTsUBKiKGQ
 =Pr7P
 -----END PGP SIGNATURE-----

Merge tag 'mmc-updates-for-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc

Pull MMC update from Chris Ball:
 "MMC highlights for 3.10:

  Core:
   - Introduce MMC_CAP2_NO_PRESCAN_POWERUP to allow skipping
     mmc_power_up() at boot/initialization time if it's already
     happened, for performance (faster boot time) reasons.
   - Fix a bit width test failure that resulted in old eMMC cards being
     put into 1-bit mode when 4-bit mode was available.
   - Expose fwrev/hwrev for MMCv4 parts.
   - Improve card removal logic in the case where the card's removed
     slowly; we were missing card removal events if the card retained
     contact with the slot pads for long enough to reply to a CMD13
     while being removed.

  Drivers:
   - davinci_mmc: Support using PIO instead of DMA.
   - dw_mmc: Add support for Exynos4412.
   - mxcmmc: DT support, use slot-gpio API.
   - mxs-mmc: Add broken-cd/cd-inverted/non-removable DT property
     support.
   - sdhci-sirf: New sdhci-pltfm driver for CSR SiRF SoCs:
       SiRFprimaII: unicore ARM Cortex-A9
       SiRFatlas6: unicore ARM Cortex-A9
       SiRFmarco: dual core ARM Cortex-A9 SMP
   - sdhci-tegra: Add support for Tegra114 platforms, use
     mmc_of_parse()"

* tag 'mmc-updates-for-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (66 commits)
  mmc: sdhci-tegra: fix MODULE_DEVICE_TABLE
  mmc: core: fix init controller performance regression, updated patch
  mmc: mxcmmc: enable DMA support on mpc512x
  mmc: mxcmmc: constify mxcmci_devtype
  mmc: mxcmmc: use slot-gpio API for write-protect detection
  mmc: mxcmmc: add mpc512x SDHC support
  mmc: mxcmmc: fix race conditions for host->req and host->data access
  mmc: mxcmmc: DT support
  mmc: dw_mmc: let device core setup the default pin configuration
  mmc: mxs-mmc: add broken-cd property
  mmc: mxs-mmc: add non-removable property
  mmc: mxs-mmc: add cd-inverted property
  mmc: core: call pm_runtime_put_noidle in pm_runtime_get_sync failed case
  mmc: mxcmmc: Fix bug when card is present during boot
  mmc: core: fix performance regression initializing MMC host controllers
  Revert "mmc: core: wait while adding MMC host to ensure root mounts successfully"
  mmc: atmel-mci: pio hang on block errors
  mmc: core: Fix bit width test failing on old eMMC cards
  mmc: dw_mmc: Use pr_info instead of printk
  mmc: dw_mmc: Check return value of regulator_enable
  ...
2013-05-04 13:45:17 -07:00
Linus Torvalds 99c6bcf46d ARM: arm-soc multiplatform updates for 3.10
More multiplatform enablement for ARM platforms. The ones converted in
 this branch are:
 - bcm2835
 - cns3xxx
 - sirf
 - nomadik
 - msx
 - spear
 - tegra
 - ux500
 
 We're getting close to having most of them converted!
 
 One of the larger platforms remaining is Samsung Exynos, and there are
 a bunch of supporting patches in this merge window for it. There was a
 patch in this branch to a early version of multiplatform conversion,
 but it ended up being reverted due to need of more bake time. The
 revert commit is part of the branch since it would have required
 rebasing multiple dependent branches and they were stable by then.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRgg99AAoJEIwa5zzehBx3n78P/j0w/8v+F4dM29ba5M/tqbFI
 e3wpeFykZ/HJH+FFIEYfIablpfHsLB0LEMh0dZmwHESFC6eR0RfGL2jOkpfcH9Ne
 7B/JIFN4l1iwqqKCXf+QbYL6e8YFxlJkg6BIB4KhNgliQoO/ASP/8EbcgROYuxmN
 KPVdw9laUCCvb5Ogh2NWVAkBHhVGAEiqK20r4TQz8alI8RUmMleWM3o+wLBWVhOO
 d3gtYSfuFSbrJfbpKSdycLizoV/NekdOC1A9Ov9YuOdw8DzNbrThCRQtu0tIUgxN
 JjfnGlEJLsJS9SESfr8SYWxTuhe/lB2dGqjQPvRtl2HGBhbtTlnWfQ0k2ZHdeJuD
 J50SLrGA2gN9E5PlHJXjYk8uhhGIq8bNTJ//CtDkfKTq1D7PuHVEpEctsaz3BBbM
 U+x9zP2v4FB+yrZu8w+gkQY/wDgHsxj08mT6BK0+l8ePdyQV22CvwmM5XlJFI03x
 5J0nLYiYfef+ZN9rGgVrQbn+yv+IEkE4DmeiscjeVJE5LVdVrDpYGfx7UA7V0UA7
 i3KRVpNKuy1v7GJDnKlEBPkmB+vgXTRXUPDVCuC4n0Hi5PYj4es1gY6AoXGF90wm
 vtKxGr/2XDLP7Ro+m0OXMttSgQShnmbrbOngfkWcFwUmG7cB3SSUUOGKM+2LNnXM
 MJTqVhPjkZ2GYBi/J6S/
 =4hSo
 -----END PGP SIGNATURE-----

Merge tag 'multiplatform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC multiplatform updates from Olof Johansson:
 "More multiplatform enablement for ARM platforms.  The ones converted
  in this branch are:

   - bcm2835
   - cns3xxx
   - sirf
   - nomadik
   - msx
   - spear
   - tegra
   - ux500

  We're getting close to having most of them converted!

  One of the larger platforms remaining is Samsung Exynos, and there are
  a bunch of supporting patches in this merge window for it.  There was
  a patch in this branch to a early version of multiplatform conversion,
  but it ended up being reverted due to need of more bake time.  The
  revert commit is part of the branch since it would have required
  rebasing multiple dependent branches and they were stable by then"

* tag 'multiplatform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (70 commits)
  mmc: sdhci-s3c: Fix operation on non-single image Samsung platforms
  clocksource: nomadik-mtu: fix up clocksource/timer
  Revert "ARM: exynos: enable multiplatform support"
  ARM: SPEAr13xx: Fix typo "ARCH_HAVE_CPUFREQ"
  ARM: exynos: enable multiplatform support
  rtc: s3c: make header file local
  mtd: onenand/samsung: make regs-onenand.h file local
  thermal/exynos: remove unnecessary header inclusions
  mmc: sdhci-s3c: remove platform dependencies
  ARM: samsung: move mfc device definition to s5p-dev-mfc.c
  ARM: exynos: move debug-macro.S to include/debug/
  ARM: exynos: prepare for sparse IRQ
  ARM: exynos: introduce EXYNOS_ATAGS symbol
  ARM: tegra: build assembly files with -march=armv7-a
  ARM: Push selects for TWD/SCU into machine entries
  ARM: ux500: build hotplug.o for ARMv7-a
  ARM: ux500: move to multiplatform
  ARM: ux500: make remaining headers local
  ARM: ux500: make irqs.h local to platform
  ARM: ux500: get rid of <mach/[hardware|db8500-regs].h>
  ...
2013-05-02 09:38:16 -07:00
Linus Torvalds 97b1007a29 ARM: arm-soc platform updates for 3.10, part 1
This branch contains platform updates for 3.10. Among the highlights:
 
 - Support for the new Atmel Cortex-A5 based platforms (SAMA5D3)
 - New support for CSR SiRFatlas6 SoCs
 - A handful of updates for NVidia T114 (a.k.a. Tegra 4)
 - A bunch of updates for the shmobile platforms
 - A handful of updates for davinci
 - A few updates for Qualcomm MSM
 - Plus a handful of other patches, defconfig updates, etc.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRgg+LAAoJEIwa5zzehBx3ePcP/3NUsSOTRQ2SZIVpyjnWOhkf
 RMZiRaVsxrY0BPfDB9E2Vcb6lannKmACTujs/Ux7kJC22BreuFM1PnZoDfhkRuSE
 n/nVB1981XJS82z2uONRSZGlUPSGWYzhTTUDJ0nHiBGmIGf5ctnC0iYWp3As3lv9
 kNY14H7NkwQ4zBVNEMu7WfW8d2IJgqZJgR9xhZPv5fOZ+LlQmK6VaHWTmQtjyea1
 bG1qoJ0dPbfJB4Vnr3a49rBkSJxZUiv8xQucw9+vo+ADRi64M4sZ1Jj2vVyDpqZp
 F4fxBNMVvg7xM0TcBbItFFYJBXlUjeT4z+UI5iYjkbnE7EV9ndFeZXHCWX1qzOSy
 X/nrJKuoe7ISQanBE9SHS9DpDGlkPDO0Mn0vb1f2VUQOY513pt/D1iFYEucZ6WCN
 fWUYtvt5GayidUr55D1U8ssbE0oGt2rizd9x7GUk4KbRVAnUUNopIQAhXrefTrZm
 jfdZNDckJ2F3aq8IPjsKuyJTpe61xD4Wvb3P/pEE3Q8fowPF5WIxXV+qjqHQ9vtt
 Tz4LkP/YdynVFGmhOwz3QZmPaQItaabaYyCcZ5cVCvt5mdxx5VuHYppafhCPJz+V
 KCQpKi1azuIv+sDR+nlGOl6+Ideea3s7TsRudfbmQFp5GsqkqOdJzR9gbbKmJauQ
 4JPpRd+4W8wC8zXQnhVY
 =HXX3
 -----END PGP SIGNATURE-----

Merge tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC platform updates from Olof Johansson:
 "This branch contains part 1 of the platform updates for 3.10.  Among
  the highlights:

   - Support for the new Atmel Cortex-A5 based platforms (SAMA5D3)
   - New support for CSR SiRFatlas6 SoCs
   - A handful of updates for NVidia T114 (a.k.a. Tegra 4)
   - A bunch of updates for the shmobile platforms
   - A handful of updates for davinci
   - A few updates for Qualcomm MSM
   - Plus a handful of other patches, defconfig updates, etc."

* tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (135 commits)
  ARM: tegra: pm: fix build error w/o PM_SLEEP
  ARM: davinci: ensure global variables are declared
  ARM: davinci: sram.c: fix incorrect type in assignment
  ARM: davinci: da8xx dt: make file local symbols static
  ARM: davinci: da8xx: add remoteproc support
  ARM: socfpga: Upgrade clk driver for socfpga to make use of dts clock entries
  ARM: socfpga: Add clock entries into device tree
  ARM: socfpga: Enable soft reset
  ARM: EXYNOS: replace cpumask by the corresponding macro
  ARM: EXYNOS: handle properly the return values
  ARM: EXYNOS: factor out the idle states
  ARM: OMAP4: Enable fix for Cortex-A9 erratas
  ARM: OMAP2+: Export SoC information to userspace
  ARM: OMAP2+: SoC name and revision unification
  ARM: OMAP2+: Move common part of late init into common function
  ARM: tegra: pm: remove duplicated include from pm.c
  ARM: davinci: da850: override mmc DT node device name
  ARM: davinci: da850: add mmc DT entries
  mmc: davinci_mmc: add DT support
  ARM: SAMSUNG: check processor type before cache restoration in resume
  ...
2013-05-02 09:31:45 -07:00
Linus Torvalds a7726350e0 ARM: arm-soc cleanup for 3.10
Here is a collection of cleanup patches. Among the pieces that stand out are:
 
 - The deletion of h720x platforms
 - Split of at91 non-dt platforms to their own Kconfig file to keep them separate
 - General cleanups and refactoring of i.MX and MXS platforms
 - Some restructuring of clock tables for OMAP
 - Convertion of PMC driver for Tegra to dt-only
 - Some renames of sunxi -> sun4i (Allwinner A10)
 - ... plus a bunch of other stuff that I haven't mentioned
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRggUqAAoJEIwa5zzehBx3HjEQAJwp7heRs/HwTDzmzcyHkRMV
 usbaa9dHBuAZ0DzsWjLK99xEn8VWD9TvbeP6hN5gNhxko06UVza3o8PI2iV1ztMB
 9K3u2+LS5on/5cOxnsU1va16h5hBZ0ZIgNx5NY+PZ5mBY6v1U3qTjljPP62iXp63
 w+sdXeZDe/c5JvuoDRbY0OBR++3Jp8cQg7KbU78jWz3r5D2rC1zwhkf2audcRY6b
 jIWTj9M8CHynh/D6OzKqDcOYorBHNSRj0YbiWS2nnMfm+0V8nya00EPRpCPRiBUb
 sobSy1CI9Qxiih3bOf6QCfzCRzJ5hbtE0zlI8g3bqtEZ1yOsE949HrKapWHJJdIU
 JNTXrxXORAnaRhbzvSPNpp/iJBSDQRsfEETgv5BuHg/4lzTQfzElySbcgb4EeoHr
 7Zt8ZR2/Du+u76qIPqs19ES3Wx+nOEOfSDAgZmlfPvlwmlGDYvqAXoeJ006VXnhG
 JacLuD/cFnJ1w00Bcl48ZXMIsVkoRqjvsCG5q688HGXMM1lU8DfgUpQY6OCWAbdu
 kFnBinJZk+HbE8FGS8O0BoQ+oiC0YIr2XhATL66PGHq7bLHb5ycwvZ7mrfC0AN9j
 M9hqTFednwfo9wF8vSj5nMsxXwP8/mky4ECGoFvLsMYDosunrNVnAHtTgDSE+ZgO
 6kQJ1P8jBBXn2LyjF88W
 =xCAx
 -----END PGP SIGNATURE-----

Merge tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC cleanup from Olof Johansson:
 "Here is a collection of cleanup patches.  Among the pieces that stand
  out are:

   - The deletion of h720x platforms
   - Split of at91 non-dt platforms to their own Kconfig file to keep
     them separate
   - General cleanups and refactoring of i.MX and MXS platforms
   - Some restructuring of clock tables for OMAP
   - Convertion of PMC driver for Tegra to dt-only
   - Some renames of sunxi -> sun4i (Allwinner A10)
   - ... plus a bunch of other stuff that I haven't mentioned"

* tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (119 commits)
  ARM: i.MX: remove unused ARCH_* configs
  ARM i.MX53: remove platform ahci support
  ARM: sunxi: Rework the restart code
  irqchip: sunxi: Rename sunxi to sun4i
  irqchip: sunxi: Make use of the IRQCHIP_DECLARE macro
  clocksource: sunxi: Rename sunxi to sun4i
  clocksource: sunxi: make use of CLKSRC_OF
  clocksource: sunxi: Cleanup the timer code
  ARM: at91: remove trailing semicolon from macros
  ARM: at91/setup: fix trivial typos
  ARM: EXYNOS: remove "config EXYNOS_DEV_DRM"
  ARM: EXYNOS: change the name of USB ohci header
  ARM: SAMSUNG: Remove unnecessary code for dma
  ARM: S3C24XX: Remove unused GPIO drive strength register definitions
  ARM: OMAP4+: PM: Restore CPU power state to ON with clockdomain force wakeup method
  ARM: S3C24XX: Removed unneeded dependency on CPU_S3C2412
  ARM: S3C24XX: Removed unneeded dependency on CPU_S3C2410
  ARM: S3C24XX: Removed unneeded dependency on ARCH_S3C24XX for boards
  ARM: SAMSUNG: Fix typo "CONFIG_SAMSUNG_DEV_RTC"
  ARM: S5P64X0: Fix typo "CONFIG_S5P64X0_SETUP_SDHCI"
  ...
2013-05-02 09:03:55 -07:00
Linus Torvalds 4d26aa3054 ARM: arm-soc non-critical fixes for 3.10
Here is a collection of fixes (and some intermixed cleanups) that were
 considered less important and thus not included in the later parts of
 the 3.9-rc cycle.
 
 It's a bit all over the map, contents wise. A series of ux500 fixes
 and cleanups, a bunch of various fixes for OMAP and tegra, and some for
 Freescale i.MX and even Qualcomm MSM.
 
 Note that there's also a patch on this branch to globally turn off
 -Wmaybe-uninitialized when building with -Os. It's been posted several
 times by Arnd and no dissent was raised, but nobody seemed interested
 to pick it up. So here it is, as the topmost patch.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRggtQAAoJEIwa5zzehBx3TmYP/i4Kt3JDYEbYyAqNsH3nb0mN
 3kLwViUxDdS/aZCXEaNYLwZBUgl1Zyz3oRd39zFCo4dRM2uG1AW+lC73AP3/eW6n
 2oHxI43xzwjDNPxRkiipB4NXPyIoIdbRXM6/QIxXzM9zD3MJXj7BpBBpDgGAsLov
 BQ2r28idxZE6jB4puPjVZCuyG5UMjA0Ko2Fp2em7QXarQBBscDvhAtjqNZ3JPtlN
 thASsou1B8805J7jf5G8Wz6fNeVJg2wlWMgE9ywJpKFbut4cGM4riS/QvB0fTe6d
 tmkCae0bw3UD+D+N1gYcZpeGve8oPSHbeyhrSPAfI/wAVBh0J397MgJW5/f0vW8p
 DffLjQI+S450Kw0Bab41Tn0JnMnXtYUo56yjemdxa/NQJF34ycBFQ3HOm6nFxo7U
 6tce2O775uvG0+rJfDbX6M+Mu7QoIi0p8sOdg0/W+pFK08xvaezsOc1NjqTvuYoC
 s/2LYiIJqVG6tFVU0i/46duQhdp0I/Oj7wXtFXH0ZvZPBz0cDaSU3irB3QA9pNt5
 PI6JEBg0FUPUork24gShSUf7un4Itrjlq20HTkC9/z1skx87PbB3Wa7A8jnHeFme
 tpuPRvmfBWhIhp06AIA8znhDik9xuJ4B7ypsFNM0VyoV/qx+TSIHbViVQuwcOf9b
 nAidtuhMjE+P2sAu+VGU
 =bzsu
 -----END PGP SIGNATURE-----

Merge tag 'fixes-nc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC non-critical fixes from Olof Johansson:
 "Here is a collection of fixes (and some intermixed cleanups) that were
  considered less important and thus not included in the later parts of
  the 3.9-rc cycle.

  It's a bit all over the map, contents wise.  A series of ux500 fixes
  and cleanups, a bunch of various fixes for OMAP and tegra, and some
  for Freescale i.MX and even Qualcomm MSM.

  Note that there's also a patch on this branch to globally turn off
  -Wmaybe-uninitialized when building with -Os.  It's been posted
  several times by Arnd and no dissent was raised, but nobody seemed
  interested to pick it up.  So here it is, as the topmost patch."

* tag 'fixes-nc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (70 commits)
  Turn off -Wmaybe-uninitialized when building with -Os
  ARM: orion5x: include linux/cpu.h
  ARM: tegra: call cpu_do_idle from C code
  ARM: u300: fix ages old copy/paste bug
  ARM: OMAP2+: add dependencies on ARCH_MULTI_V6/V7
  ARM: tegra: solve adr range issue with THUMB2_KERNEL enabled
  ARM: tegra: fix relocation truncated error when THUMB2_KERNEL enabled
  ARM: tegra: fix build error when THUMB2_KERNEL enabled
  ARM: msm: Fix uncompess.h tx underrun check
  ARM: vexpress: Remove A9 PMU compatible values for non-A9 platforms
  ARM: cpuimx27 and mbimx27: prepend CONFIG_ to Kconfig macro
  ARM: OMAP2+: fix typo "CONFIG_BRIDGE_DVFS"
  ARM: OMAP1: remove "config MACH_OMAP_HTCWIZARD"
  ARM: mach-imx: mach-imx6q: Fix sparse warnings
  ARM: mach-imx: src: Include "common.h
  ARM: mach-imx: gpc: Include "common.h"
  ARM: mach-imx: avic: Staticize *avic_base
  ARM: mach-imx: tzic: Staticize *tzic_base
  ARM: mach-imx: clk: Include "clk.h"
  ARM: mach-imx: clk-busy: Staticize clk_busy_mux_ops
  ...
2013-05-02 08:56:55 -07:00
Mark Brown 2fdfe1c26f mmc: sdhci-s3c: Fix operation on non-single image Samsung platforms
Commit cc014f3 (mmc: sdhci-s3c: remove platform dependencies) changed
the platform dependency in Kconfig to depend on SAMSUNG_SINGLE, meaning
the driver was available only on single zImage Samsung platforms.  This
breaks platforms that haven't been converted such as S3C64xx.  Revert
that part of the change to fix.

[arnd: CONFIG_SAMSUNG_SINGLE was actually introduced only for
non-multiplatform configurations, but was subsequently removed,
which means the driver was now broken both for single- and multi-
platform. The dependency was there by accident anyway, so reverting
this is still the correct solution]

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2013-04-30 16:44:43 +02:00
Akinobu Mita 2e744fcb90 mmc: rename random32() to prandom_u32()
Use preferable function name which implies using a pseudo-random
number generator.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Chris Ball <cjb@laptop.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-29 18:28:42 -07:00
Linus Torvalds 507ffe4f38 TTY/Serial driver update for 3.10-rc1
Here's the big tty/serial driver merge request for 3.10-rc1
 
 Once again, Jiri has a number of TTY driver fixes and cleanups, and
 Peter Hurley came through with a bunch of ldisc fixes that resolve a
 number of reported issues.  There are some other serial driver cleanups
 as well.
 
 All of these have been in the linux-next tree for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEYEABECAAYFAlF+nSMACgkQMUfUDdst+ymy9QCfRmYn0MC0W+Q1D3Spz87gVsuo
 cqEAniu1BEkYZpjAz7ZlIN07Ao0jbQOR
 =Osu/
 -----END PGP SIGNATURE-----

Merge tag 'tty-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial driver update from Greg Kroah-Hartman:
 "Here's the big tty/serial driver merge request for 3.10-rc1

  Once again, Jiri has a number of TTY driver fixes and cleanups, and
  Peter Hurley came through with a bunch of ldisc fixes that resolve a
  number of reported issues.  There are some other serial driver
  cleanups as well.

  All of these have been in the linux-next tree for a while"

* tag 'tty-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (117 commits)
  tty/serial/sirf: fix MODULE_DEVICE_TABLE
  serial: mxs: drop superfluous {get|put}_device
  serial: mxs: fix buffer overflow
  ARM: PL011: add support for extended FIFO-size of PL011-r1p5
  serial_core.c: add put_device() after device_find_child()
  tty: Fix unsafe bit ops in tty_throttle_safe/unthrottle_safe
  serial: sccnxp: Replace pdata.init/exit with regulator API
  serial: sccnxp: Do not override device name
  TTY: pty, fix compilation warning
  TTY: rocket, fix compilation warning
  TTY: ircomm: fix DTR being raised on hang up
  TTY: synclinkmp: fix DTR being raised on hang up
  TTY: synclink_gt: fix DTR being raised on hang up
  TTY: synclink: fix DTR being raised on hang up
  serial: 8250_dw: Fix the stub for dw8250_probe_acpi()
  serial: 8250_dw: Convert to devm_ioremap()
  serial: 8250_dw: Set port capabilities based on CPR register
  serial: 8250_dw: Let ACPI code extract the DMA client info
  serial: 8250_dw: Support clk framework also with ACPI
  serial: 8250_dw: Enable runtime PM
  ...
2013-04-29 12:16:17 -07:00
Arnd Bergmann e4404fab2e mmc: sdhci-tegra: fix MODULE_DEVICE_TABLE
The symbol referenced in MODULE_DEVICE_TABLE must match the actual
table, otherwise we get a build error like:

sdhci-tegra.c:206:34: error: '__mod_of_device_table' aliased to
undefined symbol 'sdhci_dt_ids'

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-23 15:05:57 -04:00
Arnd Bergmann 56b690481c Merge branch 'samsung/exynos-multiplatform' into next/multiplatform
These patches get us closer to adding multiplatform support on
the Exynos platform, they are part of a longer series of
patches.  This would get all the simple stuff out of the
way, and I don't think there is a big risk of introducing
regressions with these.

A lot of the other patches have already been merged into
subsystem trees. After this series in in arm-soc, what is
left comes down to

* The ASoC conversion to dmaengine won't make it unless someone
  who knows that code better steps up to do it right away. This
  means that we won't have audio in a 3.10 multiplatform kernel
  on Exynos, but it will still work for users that don't enable
  multiplatform.

* The irqchip (combiner), clk and clksource patches are all based
  on top   of other changesets we pulled in from your trees, so I
  would not make them part of the next/multiplatform branch. We can
  apply them on top of the next/drivers branch once they are
  tested successfully.

* A trivial patch is needed in the end to actually make
  CONFIG_ARCH_EXYNOS visible in multiplatform configurations.
  We will do that as a separate patch once everything else is
  there.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2013-04-19 14:33:09 +02:00
Arnd Bergmann cc014f3e29 mmc: sdhci-s3c: remove platform dependencies
plat/regs-sdhci.h is not used anywhere but in the sdhci-s3c
driver, so it can become a local file there and all other
inclusions removed.

plat/sdhci.h is used only to define the platform devices,
and with the exception of the platform_data structure not
needed by the driver, so we can split out the platform_data
definition instead and leave the rest to platform code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Chris Ball <cjb@laptop.org>
2013-04-19 13:51:23 +02:00
Olof Johansson c8bf98a28f v3.10 DT updates for DaVinci
This set of patches adds support for PWMs and SPI
 controller present on DA850 and for SPI flash present on
 DA850 EVM.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
 iQIcBAABAgAGBQJRbtMZAAoJEGFBu2jqvgRNiGwP+gPdSZc7aroAiV7C9wNg0cJ7
 D2Z4O0ZnsjeBgGlPYEVWLeqYIuTR1fa2Z1R8MMsb2GbQiSAZOd3Eg8Crto+SlFN4
 T71rbomaNnt96nXupmX5+6+aE1moA8QoneySAxMgWBiROt8ZPVrlKnlzVmJQnwiY
 r5INF76TOLCTtDZLPkyVWuMuLAt5hHnI6ihSdfmfK4DUavpwo7FynYVGl2bMGZOw
 i3gpICOoODbypLYraIDZg4o0vdVzlvjm03rvoplWRO84Aa10pINAhZ76fnQqDFPm
 USfqHDXXmF4mwYFzKSlnY159Dha74LGRJcb7+PLmpKZtvFbTwJ92GyZLZq5YpSjD
 bfPZ4hhJZqzG2PCaLwUvuD7352nuT5+05P+yGDHxeTxStqPGZcxxrPoQKISh82Mz
 gCB+B6hYsxFhaJ0A0lmCmpxmOnytiJVuHAtgAbPWOhDjqwRC1g4xnNyoZDoIquOe
 8KKTqKojtG7O4st8UuE4+SB0OyJYk2nDhpsDXyY5F5z71eVOGYp4cj9avOhN+9zO
 0DuQkeX1BhUfspSU5sZqMABLvpVvtwckMnDy95bEvBBxUyx/tunigX3Eg5nhGu/j
 K894RtsziYKXcq50RlAp+RvpBoizrm4E3iBfxk3PlO74nbFp4AMgUcrHAz90QUGE
 Q4/hKwIc+wbTPSRzQs3V
 =KZ+c
 -----END PGP SIGNATURE-----

Merge tag 'davinci-for-v3.10/dt-2-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/dt2

From Sekhar Nori:
v3.10 DT updates for DaVinci

This set of patches adds support for PWMs and SPI
controller present on DA850 and for SPI flash present on
DA850 EVM.

* tag 'davinci-for-v3.10/dt-2-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
  ARM: davinci: da850-evm: add SPI flash support
  ARM: davinci: da850: override SPI DT node device name
  ARM: davinci: da850: add SPI1 DT node
  spi/davinci: add DT binding documentation
  spi/davinci: no wildcards in DT compatible property
  ARM: davinci: da850: add EHRPWM & ECAP DT node
  ARM: davinci: da850: override mmc DT node device name
  ARM: davinci: da850: add mmc DT entries
  mmc: davinci_mmc: add DT support
  ARM: davinci: da850: add tps6507x regulator DT data
  ARM: regulator: add tps6507x device tree data
  ARM: davinci: remove test for undefined Kconfig macro
  ARM: davinci: mmc: derive version information from device name
  ARM: davinci: da850: add ECAP & EHRPWM clock nodes
  ARM: davinci: clk framework support for enable/disable functionality

Signed-off-by: Olof Johansson <olof@lixom.net>
2013-04-17 23:51:31 -07:00
Adrian Hunter a08b17be8b mmc: core: fix init controller performance regression, updated patch
Add MMC_CAP2_NO_PRESCAN_POWERUP to sdhci-pci.c also, use mmc_power_off()
for MMC_CAP2_NO_PRESCAN_POWERUP.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
[cjb: previously applied v1 of this patch instead of v4]
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-15 11:27:25 -04:00
Olof Johansson 5ed3ebe3be Cleanups for MSM for 3.10
These are some patches for various parts of MSM that gradually bring
 us closer to being part of single zimage.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJRaImzAAoJEOa6n1xeVN+CBYQQALoydAc36RZ0WK5Ksz77bv0r
 jv8jSu6XyorjI+OJAeGOCUuotpa8nLnhBmwOtgM2Sd83hA/voIUt1olc1skO/Ahb
 MSwHCWrHicGrq8RPrWmhRRlAGG4394p3wfro58QAlxh/Wgi8AHzXfR+ahlBCU23F
 Dj2BFh+INx8h/A6H1BzZWUwvjVWThLAqcPfsAovyEH7//DLJP4Mbd3KhUeqtFrWO
 nrh05ymss5PgElxdZQP8eowVsTEXcsQGn0IoXmGtxhBSvAKxw6pnrL3/e29f1poM
 A9/Ci+qgMXW6TjjBdxID/MWzeL1v/Om1xJ7DI6be1D5PqodZpCWkh5mKJwaI0Q2j
 U6aobtRiV/wEUq7iWFMVzCywQIGua7/wfh6PshTMtOjHNXOn9mAh1bCrv9wKUt+D
 VkkCzx6dnpjQv3hDQ4wdz2R8hsXj/8NEV48g+NwFWaDpKJgVQA92sWpIjNdaDsk+
 OzWC5gkMpCE7/SmEaClcyybjuA4N+W7Tan4zQot0mlXZzuuSAIhXIfRnR+OiExnY
 jsQSfxyWGUm9yR4kJdJjcyYM+IvKEq4Tm7oyPH551qs7Ww8TxUgcJhPdevN0eFBM
 cvljVzU54zZo9S08No14lp7LvRbM+o3/wphz9/NZijgpFGw24W1kj85Pa2ywQhzs
 zn5Qqg5adOGS/R/v+PaD
 =rBJL
 -----END PGP SIGNATURE-----

Merge tag 'msm-cleanup-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/davidb/linux-msm into next/cleanup

From David Brown:
Cleanups for MSM for 3.10

These are some patches for various parts of MSM that gradually bring
us closer to being part of single zimage.

* tag 'msm-cleanup-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/davidb/linux-msm:
  ARM: msm: Remove unused cpu.h header file
  gpio: Make gpio-msm-v1 into a platform driver
  mmc: msm_sdcc: Remove unnecessary include
  ARM: msm: Move dma.h #defines that are private to dma.c

Signed-off-by: Olof Johansson <olof@lixom.net>
2013-04-14 20:41:39 -07:00
Olof Johansson bf049ded36 update device tree for exynos4 and exynos5
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJRYvOSAAoJEA0Cl+kVi2xqSxAQAKYKxx8PRNweKw3IeqIRQ+gs
 Ia+0ZkHqPgoD/ezASGUmaTDGvAGVlNFqFTpzYiCLqFII5O4NzjFO9BfwE80PxaDe
 I/tcofrU6aWNfYtT/0YsrvcdqVsSNxJwPBxfpEHyCK+4xoXsV6xJV0IpvE/u9bNT
 2hLMfGndPkeTTqk7H3MpdJVB5DZOnE6LEwFVz1hVpBcCoQPJnpltIAGs/m4Rri7p
 hlgdHxKAqo+VUcmmcP3HanylFvWwbJdtemdgPXTalzOFTZJ16RFJ3+ylRf7PbWjK
 zVmjg7tFCmuAnh6HQTdm4hsnIohkL/GJfJClvNS52xL8ovfVWvjSF/x8LLZi5+4G
 HBRZh2A1jIOGWxfSbpkPD64/rAp1aYZBeBVEQwAkeJdPCqlgvx8YS7vxZZT8i/1g
 vck+d4zKzUCldGADu1YAHGBhRFAbmv1sJR4fzvkYrKGyzd+5jbyFx4fdZFpj6XEO
 95P5CJgN6UIywBHrTG0CLP/828sdM7V8rmAnkvmAFXFv/MUJfPR5H81OUMWL5KAY
 3a+ZJLPcwizb/cBMl7Qqq/YIXoV+o1byd49+/1rJvcD9KLlGwLawnbE/ZZp6PlQz
 td2TNONzj3bqEXBDNx+PwpqcjSvO7KQFp+iFijZI7yRR6t+kfoqad5Vv+J0H7ATP
 MxNZ7mSIKLa/rTDWK8LV
 =YqMV
 -----END PGP SIGNATURE-----

Merge tag 'dt-exynos-for-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/dt2

update device tree for exynos4 and exynos5

* tag 'dt-exynos-for-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung: (125 commits)
  ARM: dts: add PDMA0 changes for exynos5440
  ARM: dts: Add cpufreq controller node for Exynos5440 SoC
  ARM: dts: Fix gmac clock ids due to changes in Exynos5440
  ARM: dts: add device tree file for SD5v1 board
  ARM: dts: update bootargs to boot from sda2 for exynos5440-ssdk5440
  ARM: dts: add PMU support in exynos5440
  ARM: dts: Add node for GMAC for exynos5440
  ARM: dts: list the interrupts generated by pin-controller on Exynos5440
  ARM: dts: Add FIMD DT binding Documentation
  ARM: dts: Add FIMD node and display timing node to exynos4412-origen.dts
  ARM: dts: Add FIMD node to exynos4
  ARM: dts: Add SYSREG block node for S5P/Exynos4 SoC series
  ARM: dts: Add display timing node to exynos5250-smdk5250.dts
  ARM: dts: Add FIMD node to exynos5
  ARM: dts: Add virtual GIC DT bindings for exynos5440
  ARM: dts: Document usb clocks in samsung,exynos4210-ehci/ohci bindings
  ARM: dts: add usb 2.0 clock references to exynos5250 device tree
  ARM: dts: Add architected timer nodes for exynos5250
  ARM: dts: Declare the gic as a15 compatible for exynos5250
  ARM: dts: Add HDMI HPD and regulator node for Arndale board
  ...

Signed-off-by: Olof Johansson <olof@lixom.net>
2013-04-12 23:05:08 -07:00
Anatolij Gustschin e48fc15aa2 mmc: mxcmmc: enable DMA support on mpc512x
Add SDHC DMA channel description to the mpc512x device tree to enable
slave channel requesting in the mxcmmc driver.

mpc512x DMA engine doesn't support endianness conversion when
reading/writing data from peripheral's FIFO, so we have to swap data
buffers before each DMA write and after each DMA read transfer manually.

Since chained SDHC DMA transfers are not supported on mpc512x, limit
'max_segs' tunable parameter to one and initialise it to 64 only when
running on i.MX platforms.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 15:13:41 -04:00
Anatolij Gustschin 42477053c3 mmc: mxcmmc: constify mxcmci_devtype
mxcmci_devtype struct contains constant data, so
constify this struct.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 15:13:34 -04:00
Anatolij Gustschin bcf53524ac mmc: mxcmmc: use slot-gpio API for write-protect detection
slot-gpio API suppors read-only detection when "wp-gpios"
property is present in the device tree mmc node. Use this
API for write-protect detection.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 15:13:27 -04:00
Anatolij Gustschin c7ceab0254 mmc: mxcmmc: add mpc512x SDHC support
The SDHC controller on mpc512x is compatible with i.MX31 SDHC,
so the mxcmmc driver can be used on mpc512x, too. Extend the
driver to support mpc512x as well.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 15:13:20 -04:00
Anatolij Gustschin 70aa610959 mmc: mxcmmc: fix race conditions for host->req and host->data access
mxcmci_dma_callback() is invoked by DMA drivers in soft-irq
context and can be interrupted by the mxcmci_irq() interrupt
which can finish the mmc request or data transfer and set
host->req or host->data pointers to NULL. Then mxcmci_data_done()
crashes with a null pointer dereferences. Protect all accesses
to host->req and host->data by spin locks.

Also check host->data pointer in mxcmci_watchdog() before
dereferencing it.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 15:13:13 -04:00
Markus Pargmann 7ff747c459 mmc: mxcmmc: DT support
Adding devicetree support for imx21-mmc and imx31-mmc. Based on generic
gpio helper functions by Guennadi and generic DMA devicetree bindings.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 15:12:34 -04:00
Thomas Abraham 32d781a310 mmc: dw_mmc: let device core setup the default pin configuration
With device core now able to setup the default pin configuration,
the pin configuration code based on the deprecated Samsung specific
gpio bindings is removed.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 14:18:56 -04:00
Hector Palacios 1d53196a0d mmc: mxs-mmc: add broken-cd property
According to bindings documentation for mmc, the property 'broken-cd'
can be used to indicate card-detection is not available and polling
must be used instead. This patch retrieves this property
and sets a custom flag. On the get_cd() hook, it returns 1 if
the flag is set, to always assume the card is present.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 14:17:55 -04:00
Marc Kleine-Budde 5086e5f41f mmc: mxs-mmc: add non-removable property
Some boards have non removable cards like eMMC. Handle such case.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 14:17:46 -04:00
Marc Kleine-Budde 4c0c9be050 mmc: mxs-mmc: add cd-inverted property
The card-detect GPIO is inverted on some boards. Handle such case.

Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 14:17:38 -04:00
Li Fei 3bffb800b9 mmc: core: call pm_runtime_put_noidle in pm_runtime_get_sync failed case
Even in failed case of pm_runtime_get_sync, the usage_count
is incremented. In order to keep the usage_count with correct
value and runtime power management to behave correctly, call
pm_runtime_put_noidle in such case.

Signed-off-by: Liu Chuansheng <chuansheng.liu@intel.com>
Signed-off-by: Li Fei <fei.li@intel.com>
Acked-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 14:15:04 -04:00
Alexander Shiyan abd4190f0c mmc: mxcmmc: Fix bug when card is present during boot
This patch fixes bug when card is present during boot.
Bug was introduced due commit "mmc: mxcmmc: fix bug that may block a
data transfer forever". When a card is present "mxcmci_setup_data"
function is executed, but the timer is not initialized.

...
i.MX SDHC driver
mmc0: SD Status: Invalid Allocation Unit size.
mmc0: new SD card at address b368
mmcblk0: mmc0:b368 SDC   1.91 GiB
------------[ cut here ]------------
kernel BUG at kernel/timer.c:729!
Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
CPU: 0    Not tainted  (3.9.0-rc5-next-20130404 #2)
PC is at mod_timer+0x168/0x198
LR is at mxcmci_request+0x21c/0x328
...

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 14:12:50 -04:00
Adrian Hunter 0d3e3350d5 mmc: core: fix performance regression initializing MMC host controllers
Commit fa5501890d introduced a performance
regression by adding mmc_power_up() to mmc_start_host().  mmc_power_up()
is not necessary to host controller initialization, it is part of card
initialization and is performed anyway asynchronously.

This patch allows a driver to leave the power up in asynchronous code
(as it was before).

On my current target platform this reduces driver initialization from:

[    1.313220] initcall sdhci_acpi_driver_init+0x0/0x12 returned 0 after 102008 usecs

to this:

[    1.217209] initcall sdhci_acpi_driver_init+0x0/0x12 returned 0 after 8331 usecs

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 14:08:07 -04:00
Adrian Hunter f9a94e0a3f Revert "mmc: core: wait while adding MMC host to ensure root mounts successfully"
This reverts commit 3500ed90b2.

The reverted patch caused a significant performance regression when
booting with the root file system on eMMC.

Before the patch:

[    1.625623] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.

After the patch:

[    1.935851] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.

That was an addition of 310 ms which is a 19% performance degradation.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-12 14:07:50 -04:00
Terry Barnaby bdbc5d0c60 mmc: atmel-mci: pio hang on block errors
The driver is doing, by default, multi-block reads. When a block error
occurs, card/block.c instigates a single block read: "mmcblk0: retrying
using single block read".  It leaves the sg chain intact and just changes
the length attribute for the first sg entry and the overall sg_len
parameter.  When atmci_read_data_pio is called to read the single block
of data it ignores the sg_len and expects to read more than 512 bytes as
it sees there are multiple items in the sg list. No more data comes as
the controller has only been commanded to get one block.

Signed-off-by: Terry Barnaby <terry@beam.ltd.uk>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: stable <stable@vger.kernel.org> # 3.2+
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-08 12:05:47 -04:00
Philip Rakity 836dc2fe89 mmc: core: Fix bit width test failing on old eMMC cards
PARTITION_SUPPORT needs to be set before doing the compare on version
number so the bit width test does not get invalid data.  Before this
patch, a Sandisk iNAND eMMC card would detect 1-bit width although
the hardware supports 4-bit.

Only affects old emmc devices - pre 4.4 devices.

Reported-by: Elad Yi <elad.yi@gmail.com>
Signed-off-by: Philip Rakity <prakity@yahoo.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-04 15:33:29 -04:00
Sachin Kamat 8e1c4e4d73 mmc: dw_mmc: Use pr_info instead of printk
pr_info(... is preferred to printk(KERN_INFO ...

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-04 10:18:27 -04:00
Sachin Kamat f2f942ce4a mmc: dw_mmc: Check return value of regulator_enable
regulator_enable() is declared with __must_check attribute.
Hence check the return value to ensure that the regulator is enabled.

Fixes the following warning:

drivers/mmc/host/dw_mmc.c:2461:19: warning:
ignoring return value of ‘regulator_enable’, declared with attribute
warn_unused_result [-Wunused-result]
drivers/mmc/host/dw_mmc.c: In function ‘dw_mci_init_slot’:
drivers/mmc/host/dw_mmc.c:1994:19: warning:
ignoring return value of ‘regulator_enable’, declared with attribute
warn_unused_result [-Wunused-result]

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-04 10:18:05 -04:00
Jingoo Han b0dd099ceb mmc: sdhci-spear: add CONFIG_PM_SLEEP to suspend/resume functions
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following
build warning when CONFIG_PM_SLEEP is not selected. This is because
sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when
the CONFIG_PM_SLEEP is enabled.

drivers/mmc/host/sdhci-spear.c:295:12: warning: 'sdhci_suspend' defined but not used [-Wunused-function]
drivers/mmc/host/sdhci-spear.c:308:12: warning: 'sdhci_resume' defined but not used [-Wunused-function]

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-04 10:13:58 -04:00
Jaehoon Chung 4366dcc52a mmc: dw_mmc: control the power-enable register
When card is power-on/off, need to control the power-enable register.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@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>
2013-04-04 10:08:37 -04:00
Kevin Liu e065162ae4 mmc: sdhci-pxav3: controller should use SDCLK for timeout calculation
sdhci-pxav3 host controller used SDCLK for data timeout.

Signed-off-by: Kevin Liu <kliu5@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-04 09:59:42 -04:00
Kevin Liu 943647f6fe mmc: sdhci-pxav3: enhance device tree parser code
1. seperate device tree parsing from platform data handling which
   can make further work easy when platform data can be removed.

2. add calling mmc_of_parse which can parse more of property and
   pxav3_get_mmc_pdata can be shrinked a lot.

Signed-off-by: Kevin Liu <kliu5@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-04 09:59:12 -04:00
Kevin Liu c844a46f13 mmc: sdhci-pxav3: remove cd-broken quirk for permanently present card
Flag PXA_FLAG_CARD_PERMANENT is set in sdhci_pxa_platdata flags to
indicate that the card is always wired to host, like on-chip emmc,
which is permanently present and don't need detection.

So only MMC_CAP_NONREMOVABLE should be set for this case. But current
code also sets SDHCI_QUIRK_BROKEN_CARD_DETECTION, which doesn't make
sense.

Signed-off-by: Kevin Liu <kliu5@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-04 09:58:20 -04:00
Kevin Liu 73b7afb976 mmc: sdhci-pxav3: transfer sdhci_pltfm_data as args to sdhci_pltfm_init
sdhci_pltfm_init can set host->ops and host->quirks if sdhci_pltfm_data
is transfered as arguments. Then no need to set them manually in
sdhci_pxav3_probe.

Signed-off-by: Kevin Liu <kliu5@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-04 09:58:11 -04:00
Seungwon Jeon c09fbd7451 mmc: dw_mmc: fix fifo access for 64-bit
mci_writew causes a failure of fifo access for 64-bit.
mci_writeq is correct.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-04-04 09:55:53 -04:00
Shawn Guo 0e91e434c8 mmc: mxs-mmc: move to use generic DMA helper
With the generic DMA device tree helper supported by mxs-dma driver,
client devices only need to call dma_request_slave_channel() for
requesting a DMA channel from dmaengine.

Since mxs is a DT only platform now, along with the changes, the non-DT
case checking in probe function also gets cleaned up.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Chris Ball <cjb@laptop.org>
Cc: linux-mmc@vger.kernel.org
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
2013-04-04 21:22:44 +08:00
Manjunathappa, Prakash 7b43da4cfd mmc: davinci_mmc: add DT support
Adds device tree support for davinci_mmc. Also add binding documentation.
As of now tested for non-dma PIO mode and without GPIO card_detect/
write_protect option because of dependencies on EDMA and GPIO module DT
support.

Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Sekhar Nori <nsekhar@ti.com>
Cc: linux-mmc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: davinci-linux-open-source@linux.davincidsp.com
Cc: devicetree-discuss@lists.ozlabs.org
Cc: cjb@laptop.org
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: mporter@ti.com
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
2013-04-04 16:55:05 +05:30
Manjunathappa, Prakash d7ca4c755a ARM: davinci: mmc: derive version information from device name
Remove specifying mmc controller IP version information via platform
data, instead specify device name so that driver derives it from
platform_device_id table. Also change the clock node name to match
the changed dev_id.
Tested on da850-evm to make sure driver loads without clk_get failures.

Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
Reviewed-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
2013-04-03 09:42:16 +05:30
Thomas Petazzoni e573d6985e mmc: mvsdio: use dev_*() API instead of pr_*() API
The mvsdio driver was already using some dev_*() functions to print
some messages, but still using pr_*() functions for some others. This
patch converts all messages to use dev_*() functions.

Many of the pr_*() function calls were printing the output of
mmc_hostname() to preprend the message with an identifier for the
device. Since the dev_*() functions do that automatically, this patch
also gets rid of those string prefixes.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 13:29:47 -04:00
Thomas Petazzoni 5e81441e24 mmc: mvsdio: fix non-DT probing of GPIOs
Ralph Droms <rdroms@gmail.com> reported that 3.9-rc was breaking the
SDIO interface on his Sheevaplug platform, and that the recent changes
to the mvsdio driver are responsible for this breakage. Precisely, the
regression has been introduced by 07728b77c0 (mmc: mvsdio: use
slot-gpio for card detect gpio).

After investigation, is turns out that the Sheevaplug does not have
any "card detect" GPIO, and the Sheevaplug has not been converted to
the Device Tree. Therefore, the Sheevaplug board code does not define
a value for the .gpio_card_detect field of the mvsdio_platform_data
structure, which means that its value is 0. Unfortunately,
gpio_is_valid() considers 0 as a valid GPIO, and therefore calls
mmc_gpio_request_cd(), which fails and makes the entire probing of the
driver fail.

In fact, in the previous mvsdio code, before the Device Tree binding
was introduced, 0 was not considered as a valid GPIO. Therefore, this
fix revert back to this behavior in the non-DT case, by setting the
gpio_card_detect and gpio_write_protect local variables to -EINVAL
when the corresponding fields of the mvsdio_platform_data structure
are set to zero (i.e, left undefined). Of course, it prevents to use
GPIO 0 as a card detect or write protect GPIO, but it was a defiency
of the previous non-DT code, and the fix moving forward is to convert
platforms to the Device Tree.

The problem has been reproduced successfully on the Kirkwood-based
Marvell DB-88F6281-BP Development Board (that doesn't use the Device
Tree) and the fix has proven to work properly, after of course
removing the gpio_card_detect field of the mvsdio_platform_data
instance for this board.

Reported-by: Ralph Droms <rdroms@gmail.com>
Tested-by: Ralph Droms <rdroms@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 13:29:46 -04:00
Barry Song b3b665b0a9 mmc: sdhci-sirf: add mmc host sdhci-pltfm based driver for SiRF SoCs
This patch adds the new driver for CSR SiRF SoCs:

SiRFprimaII: unicore ARM Cortex-A9
SiRFatlas6: unicore ARM Cortex-A9
SiRFmarco: dual core ARM Cortex-A9 SMP

Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Bin Shi <Bin.Shi@csr.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 13:29:46 -04:00
Seungwon Jeon ef3a69c7a4 mmc: block: fix the host's claim-release in special request
For normal request mmc_blk_issue_rq is called twice with asynchronous
transfer(cur and prev). Host's claim and release can be done in each
mmc_blk_issue_rq. However, Special request is currently excluded in
asynchronous transfer. After special request is finished, if there is
no new request, mmc_release_host won't be called in mmc_blk_issue_rq.
The problem is founded during mmc_suspend.

[<c0541124>] (__schedule+0x0/0x78c) from [<c05419e8>] (schedule+0x38/0x78)
[<c05419b0>] (schedule+0x0/0x78) from [<c03a843c>] (__mmc_claim_host+0xac/0x1b4)
[<c03a8390>] (__mmc_claim_host+0x0/0x1b4) from [<c03ac98c>] (mmc_suspend+0x28/0x9c)
[<c03ac964>] (mmc_suspend+0x0/0x9c) from [<c03aad24>] (mmc_suspend_host+0xb4/0x194)
...

Reported-by: Johan Rudholm <jrudholm@gmail.com>
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Tested-by: Johan Rudholm <johan.rudholm@stericsson.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 13:29:36 -04:00
Sergey Yanovich 3500ed90b2 mmc: core: wait while adding MMC host to ensure root mounts successfully
MMC hosts are added asynchronously. We need to wait until detect returns to
avoid failed root filesystem mounts.

VFS: Cannot open root device "mmcblk0p1" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
mmc0: host does not support reading read-only switch. assuming write-enable.
1f00             256 mtdblock0  (driver?)
1f01             256 mtdblock1  (driver?)
1f02            2560 mtdblock2 mmc0: new SDHC card at address b368
 (driver?)
1f03           29696 mtdblock3  (driver?)
1f04           16384 mtdblock4 mmcblk0: mmc0:b368 USD   3.72 GiB
 (driver?)
 mmcblk0: p1
b300         3910656 mmcblk0  driver: mmcblk
  b301         3906560 mmcblk0p1 00000000-01
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Signed-off-by: Sergey Yanovich <ynvich@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 13:03:29 -04:00
Lars-Peter Clausen c915568d99 mmc: sdhci: Constify sdhci_ops structs where possible
Basically all drivers can have sdhci_ops struct const, but almost none do.
This patch constifies all sdhci_ops struct declarations where possible.

The patch was auto-generated with the following coccinelle semantic patch:

// <smpl>
@r1@
identifier ops;
identifier fld;
@@
ops.fld = ...;

@disable optional_qualifier@
identifier ops != r1.ops;
@@
static
+const
struct sdhci_ops ops = { ... };
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 13:00:51 -04:00
Lars-Peter Clausen ad1df8c25e mmc: sdhci-pltfm: Constify the ops field of sdhci_pltfm_data struct
All users of the sdhci_ops struct in the sdhci core already treat it as
const.  The sdhci-pltfm code itself never actually looks at the ops field
of the sdhci_pltfm_data struct and merely passes it on to the sdhci core,
so make we can make it const in the sdhci_pltfm_data struct as well.
This allows us to declare sdhci_ops structs as const in drivers using
the sdhci-pltfm helper code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 13:00:29 -04:00
Lars-Peter Clausen 1db5eebf22 mmc: sdhci_pltfm: Constify sdhci_pltfm_data
The sdhci_pltfm_data struct is never modified within the sdhci_pltfm
module. So make the pdata parameter to sdhci_pltfm_init and
sdhci_pltfm_register const.  This allows drivers to declare their
sdhci_pltfm_data struct as const.

This patch also makes the sdhci_pltfm_data declarations const where
possible.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 13:00:06 -04:00
Johan Hovold 91cf54feec mmc: at91/avr32/atmel-mci: fix DMA-channel leak on module unload
Fix regression introduced by commit 796211b795 ("mmc: atmel-mci: add
pdc support and runtime capabilities detection") which removed the need
for CONFIG_MMC_ATMELMCI_DMA but kept the Kconfig-entry as well as the
compile guards around dma_release_channel() in remove(). Consequently,
DMA is always enabled (if supported), but the DMA-channel is not
released on module unload unless the DMA-config option is selected.

Remove the no longer used CONFIG_MMC_ATMELMCI_DMA option completely.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:57:22 -04:00
Dongjin Kim 0f6e73d0ab mmc: dw_mmc: Add MSHC compatible for Exynos4412
This patch adds the compatible string for MSHC controller of Exynos4412.
And exynos5250_dwmmc_caps is renamed to exynos_dwmmc_caps, since it has the
capabilities of common features supported by Exynos4 and Exynos5.

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:55:32 -04:00
Sachin Kamat 20183d509c mmc: dw_mmc: exynos: Remove unnecessary use of of_match_ptr()
'dw_mci_exynos_match' is always compiled in. Hence of_match_ptr
is not required.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:54:12 -04:00
Silviu-Mihai Popescu 6a966e0609 mmc: android-goldfish: use resource_size()
Use resource_size() instead of explicit calculation. This was found via
make coccicheck.

Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:53:52 -04:00
Markos Chandras cfbeb59c7a mmc: dw_mmc: Handle unaligned data submission correctly
Commit f9c2a0dc42
"mmc: dw_mmc: Fix PIO mode with support of highmem" introduced
a regression since v3.2 making the mmc_test hang on test #13
with a "Data starvation by host timeout" interrupt.

This is because, sg_mapping_iter is used to iterate through the
data which spans on multiple pages. The problem is detected on
unaligned data submission where the code previously checked for
!(sg_next(host->sg)) which is true because we only have a single
scatter/gather list which then expands to multiple pages.
Therefore, the driver incorrectly assumed that this was the last
list item and submitted unaligned data to the mmc device. This
overflowed the FIFO on the device before all the data were written
to it. The code was fixed to only submit unaligned data when we are
handling the last sg_miter item by checking whether we reached
the desired data length or not.

The patch was tested against mmc_test and all the tests passed.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:53:49 -04:00
Markos Chandras 3e4b0d8bdc mmc: dw_mmc: Avoid adding the number of transmitted bytes twice
Previously, it was possible to add either 0 bytes or add nbytes
twice if we broke out of the outer loop and then carry on to the
"done" label. This is now fixed by adding the transferred bytes
right after the pull/pop operation

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:50:05 -04:00
Markos Chandras 1fb5f68add mmc: dw_mmc: Don't loop when handling an interrupt
There is no reason to loop when handling an interrupt. The "if" clauses
will handle all of them sequentially. This also eliminates the extra loop
we used to take with no pending interrupts and we ended up breaking out
of the while loop.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:45:32 -04:00
James Hogan 63008768d2 mmc: dw_mmc: move host->data_offset init earlier
host->data_offset is initialised at the end of the probe function
depending on the VERID register, and is used for PIO operations. Move
this initialisation earlier, before IRQs or slots are initialised, to be
sure that PIO won't occur prior to host->data_offset being initialised.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:42:53 -04:00
James Hogan e6f34e2fd3 mmc: dw_mmc: setpower on MMC_POWER_{UP,OFF}
Call the setpower platform callback in response to set_ios with
ios->power_mode == MMC_POWER_UP or MMC_POWER_OFF, instead of from the
card detect work function.

This appears to fix a problem I have where a card stuck in a funny state
doesn't get properly cleared by the power being turned off, presumably
due to lack of power sequencing. This resulted in the following log
messages after boot:

mmc0: error -110 whilst initialising SD card
mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 300000Hz, actual 298922HZ div = 167)
mmc0: error -110 whilst initialising SD card
mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 200000Hz, actual 199680HZ div = 250)
mmc0: error -110 whilst initialising SD card
mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 195765Hz, actual 195764HZ div = 255)
mmc0: error -110 whilst initialising SD card
mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 400000Hz, actual 399360HZ div = 125)
mmc0: error -110 whilst initialising SD card
mmc_host mmc0: Bus speed (slot 0) = 99840000Hz (slot req 300000Hz, actual 298922HZ div = 167)

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:41:54 -04:00
Chris Ball a3361abaae mmc: sdhci: Don't ignore regulator_enable() return value
Fixes:
/git/arm-soc/drivers/mmc/host/sdhci.c: In function 'sdhci_add_host':
/git/arm-soc/drivers/mmc/host/sdhci.c:2910:19: warning: ignoring
return value of 'regulator_enable', declared with attribute
warn_unused_result [-Wunused-result]

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:40:05 -04:00
Alexandru Gheorghiu 2211990162 mmc: wmt-sdmmc: Use resource_size()
Used resource_size function instead of explicit computation.
Patch found using coccinelle.

Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:38:46 -04:00
Wei Yongjun 8a8396ae21 mmc: wmt-sdmmc: remove unused variable in wmt_complete_data_request()
The variable 'mmc' is initialized but never used, so remove it.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:37:50 -04:00
Chunhe Lan 4590205b9f mmc: sdhci-pltfm: Fix timeout on t4240's sdhci controller
This patch fixes timeout problems on t4240's sdhci controller:

	mmc0: Too large timeout requested for CMD25!
	mmc0: Too large timeout requested for CMD25!
	mmc0: Too large timeout requested for CMD25!

Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:36:52 -04:00
Wei WANG d88691be7b mmc: rtsx_pci_sdmmc: Don't execute power up sequence repeatedly
For some Realtek card readers, the power up sequence can only be executed
when power has been turned off fully.

So the rtsx host should not start power up sequence again when set_ios
been called if the power has been turned on.

Signed-off-by: Wei WANG <wei_wang@realsil.com.cn>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:35:42 -04:00
Thomas Abraham e19499ae10 mmc: sdhci-s3c: let device core setup the default pin configuration
With device core now able to setup the default pin configuration,
the call to devm_pinctrl_get_select_default can be removed. And
the pin configuration code based on the deprecated Samsung specific
gpio bindings is also removed.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2013-03-22 12:33:21 -04:00