aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
* Revert "mmc: core: wait while adding MMC host to ensure root mounts ↵Adrian Hunter2013-04-12
| | | | | | | | | | | | | | | | | | | | | | successfully" This reverts commit 3500ed90b26a9935b943b5e2e4cd3226600d6b58. 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>
* mmc: atmel-mci: pio hang on block errorsTerry Barnaby2013-04-08
| | | | | | | | | | | | | | | | 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>
* mmc: core: Fix bit width test failing on old eMMC cardsPhilip Rakity2013-04-04
| | | | | | | | | | | | | | 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>
* mmc: dw_mmc: Use pr_info instead of printkSachin Kamat2013-04-04
| | | | | | | | | 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>
* mmc: dw_mmc: Check return value of regulator_enableSachin Kamat2013-04-04
| | | | | | | | | | | | | | | | | | | | 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>
* mmc: sdhci-spear: add CONFIG_PM_SLEEP to suspend/resume functionsJingoo Han2013-04-04
| | | | | | | | | | | | | | 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>
* mmc: dw_mmc: control the power-enable registerJaehoon Chung2013-04-04
| | | | | | | | | | 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>
* mmc: sdhci-pxav3: controller should use SDCLK for timeout calculationKevin Liu2013-04-04
| | | | | | | | 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>
* mmc: sdhci-pxav3: enhance device tree parser codeKevin Liu2013-04-04
| | | | | | | | | | | | 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>
* mmc: sdhci-pxav3: remove cd-broken quirk for permanently present cardKevin Liu2013-04-04
| | | | | | | | | | | | | | 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>
* mmc: sdhci-pxav3: transfer sdhci_pltfm_data as args to sdhci_pltfm_initKevin Liu2013-04-04
| | | | | | | | | | 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>
* mmc: dw_mmc: fix fifo access for 64-bitSeungwon Jeon2013-04-04
| | | | | | | | | 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>
* mmc: mvsdio: use dev_*() API instead of pr_*() APIThomas Petazzoni2013-03-22
| | | | | | | | | | | | | | 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>
* mmc: mvsdio: fix non-DT probing of GPIOsThomas Petazzoni2013-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 07728b77c03d (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>
* mmc: sdhci-sirf: add mmc host sdhci-pltfm based driver for SiRF SoCsBarry Song2013-03-22
| | | | | | | | | | | | | 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>
* mmc: block: fix the host's claim-release in special requestSeungwon Jeon2013-03-22
| | | | | | | | | | | | | | | | | | | | 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>
* mmc: core: wait while adding MMC host to ensure root mounts successfullySergey Yanovich2013-03-22
| | | | | | | | | | | | | | | | | | | | | | | 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>
* mmc: sdhci: Constify sdhci_ops structs where possibleLars-Peter Clausen2013-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* mmc: sdhci-pltfm: Constify the ops field of sdhci_pltfm_data structLars-Peter Clausen2013-03-22
| | | | | | | | | | | | | 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>
* mmc: sdhci_pltfm: Constify sdhci_pltfm_dataLars-Peter Clausen2013-03-22
| | | | | | | | | | | | | | 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>
* mmc: at91/avr32/atmel-mci: fix DMA-channel leak on module unloadJohan Hovold2013-03-22
| | | | | | | | | | | | | | | | Fix regression introduced by commit 796211b7953 ("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>
* mmc: dw_mmc: Add MSHC compatible for Exynos4412Dongjin Kim2013-03-22
| | | | | | | | | | 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>
* mmc: dw_mmc: exynos: Remove unnecessary use of of_match_ptr()Sachin Kamat2013-03-22
| | | | | | | | | | '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>
* mmc: android-goldfish: use resource_size()Silviu-Mihai Popescu2013-03-22
| | | | | | | | 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>
* mmc: dw_mmc: Handle unaligned data submission correctlyMarkos Chandras2013-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit f9c2a0dc42a6938ff2a80e55ca2bbd1d5581c72e "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>
* mmc: dw_mmc: Avoid adding the number of transmitted bytes twiceMarkos Chandras2013-03-22
| | | | | | | | | | | | 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>
* mmc: dw_mmc: Don't loop when handling an interruptMarkos Chandras2013-03-22
| | | | | | | | | | | | 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>
* mmc: dw_mmc: move host->data_offset init earlierJames Hogan2013-03-22
| | | | | | | | | | | | 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>
* mmc: dw_mmc: setpower on MMC_POWER_{UP,OFF}James Hogan2013-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* mmc: sdhci: Don't ignore regulator_enable() return valueChris Ball2013-03-22
| | | | | | | | | | | 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>
* mmc: wmt-sdmmc: Use resource_size()Alexandru Gheorghiu2013-03-22
| | | | | | | | 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>
* mmc: wmt-sdmmc: remove unused variable in wmt_complete_data_request()Wei Yongjun2013-03-22
| | | | | | | | 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>
* mmc: sdhci-pltfm: Fix timeout on t4240's sdhci controllerChunhe Lan2013-03-22
| | | | | | | | | | | 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>
* mmc: rtsx_pci_sdmmc: Don't execute power up sequence repeatedlyWei WANG2013-03-22
| | | | | | | | | | | 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>
* mmc: sdhci-s3c: let device core setup the default pin configurationThomas Abraham2013-03-22
| | | | | | | | | | | 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>
* mmc: mvsdio: use module_platform_driver_probe()Jingoo Han2013-03-22
| | | | | | | | This patch uses module_platform_driver_probe() macro which makes the code smaller and simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: davinci_mmc: use module_platform_driver_probe()Jingoo Han2013-03-22
| | | | | | | | This patch uses module_platform_driver_probe() macro which makes the code smaller and simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: sdio: bind acpi with sdio function deviceAaron Lu2013-03-22
| | | | | | | | | | | | | ACPI spec 5 defined the _ADR encoding for sdio bus as: High word - slot number (0 based) Low word - function number This patch adds support for binding sdio function device with acpi node, and if successful, involve acpi into its power management. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Reviewed-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: sdhci: add get_cd() implementationKevin Liu2013-03-22
| | | | | | | | | | | 1. mmc_rescan will call get_cd to know whether the card is present before mmc_rescan_try_freq to avoid useless trials during card removal or start host is called when card is not present. 2. get_cd needs to be checked to resolve slow card removal issue. Signed-off-by: Kevin Liu <kliu5@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: core: enhance card removal judgement for slow removalKevin Liu2013-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Function _mmc_detect_card_removed will be called to know whether the card is still present when host->bus_ops->detect is called. In current code, the return value of this function generally only depend on the result of sending cmd13 to card, which may not safe for card with detection support like slot gpio detection. Because the communication status between host and card may out of sync with the detect status if remove the card slowly or hands shake during the process. The direct reason is the async between card detect switch and card/slot pad contaction in hardware, which is defined by spec. The spec define card insert/remove sequence as below (both standard size SD card and MicroSD card have the same sequence): "Part 1 Standard Size SD Card Mechanical Addendum Ver4.00 Final, Appendix C: Card Detection Switch" (Take normally open type as example) a)SD card insertion sequence: The card detection switch should be turned on after all SD card contact pads are connected to the host connector contact pads. b)SD removal sequence: The card detection switch should be turned off when the SD card is just going to be removed and before any SD card contact pad is disconnected from the host connector contact pad. Below is the sequence when this issue occur (Take slot gpio detection as example and remove the card slowly during the process): 1. gpio level changed and card detect interrupt triggered. 2. mmc_rescan was launched. 3. the card pads were still contacted with the slot pads because of slow removal. So _mmc_detect_card_removed and mmc_rescan think card was still present (cmd13 succeed). 4. card pads were discontacted from the card slot pads. So the card was actually removed finally but the card removal event has been missed by system. The interval length between step 1 and step 4 depends on the card removal speed. If it's longer than the detect work schedule delay which is 200ms, this issue will likely happen. This patch add the card detect status check in function _mmc_detect_card_removed if cmd13 check succeed and host->ops->get_cd provided. If get_cd detect no card present then schedule another detect work 200ms later. Signed-off-by: Kevin Liu <kliu5@marvell.com> Tested-by: Johan Rudholm <johan.rudholm@stericsson.com> Reviewed-by: Philip Rakity <prakity@nvidia.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: core: Add in support to expose PRV for v4 MMCsBernie Thompson2013-03-22
| | | | | | | | | | The JEDEC MMC v4 spec defines a new PRV value in place of the original fwrev and hwrev specified in v1. We can expose this in the kernel to enable user space to more easily determine the product revision of a given MMC. Signed-off-by: Bernie Thompson <bhthompson@chromium.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: davinci_mmc: allow driver to work without DMA resourceManjunathappa, Prakash2013-03-22
| | | | | | | | | | Do not return probe failure with missing DMA resources, allow driver to work in PIO mode. Tested on da850-evm by mounting partition followed by file creation and deletion. Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> Tested-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: dw_mmc: fixed a wrong UHS_REG 16 bit clearHyeonsu Kim2013-03-22
| | | | | | | | | | | | | | | In the legacy code, driver clear not only UHS_REG 16 bit also 0-15bit. If we use UHS-1 mode spec card like SDR50, SDR104. UHS_REG 0-15 should be set by 1 according to slot id. In this case, legacy code can cause problems. In particular, UHS_REG consists of DDR_REG[31:16] and VOLT_REG[15:0]. Before adjusting this patch, bit[15:0] is always cleared. Signed-off-by: Hyeonsu Kim <hyeonsu.kim@samsung.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>
* mmc: dw_mmc: empty FIFO after data transfer over interrupt in pio modeKyoungil Kim2013-03-22
| | | | | | | | | | | | | | | | | In dwc manual, the below contents are described: "During end of packet, interrupt is not generated if threshold programming is larger than any remaining data. It is responsibility of host to read remaining bytes on seeing Data Transfer Done interrupt" We also have seen the data cannot be read fully when "sg_miter->length" is less than FIFO size. Signed-off-by: Kyoungil Kim <ki0351.kim@samsung.com> 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>
* mmc: dw_mmc: return the result of mmc_add_host()Jaehoon Chung2013-03-22
| | | | | | | | Check the result of mmc_add_host() and return the value. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Acked-by: Seungwon Jeon <tgih.jun@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: sdhci-s3c: Use devm_clk_get()Jingoo Han2013-03-22
| | | | | | | | | | Use devm_clk_get() rather than clk_get() to make cleanup paths more simple. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: omap_hsmmc: support deferred probing for GPIOsJan Luebbe2013-03-22
| | | | | | | | | | | | | If the CD/WP-GPIOs are not provided by the SoC's GPIO controller, we need to handle the case where omap_hsmmc is probed earlier than the GPIO controller chosen in the device tree. Fix this by checking the return value of of_get_named_gpio against -EPROBE_DEFER and passing it through to the probe function. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Acked-by: Balaji T K <balajitk@ti.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: tegra: use mmc_of_parse to get the support of standard MMC DT bindingsJoseph Lo2013-03-19
| | | | | | | | | | | Updating the sdhci-tegra driver to use mmc_of_parse to support standard MMC DT bindings. Then we can remove the redundant code that already support in generic MMC core. Signed-off-by: Joseph Lo <josephl@nvidia.com> Tested-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* Merge tag 'tegra-for-3.10-fixes-for-mmc' of ↵Chris Ball2013-03-19
|\ | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into mmc-next ARM: tegra: DT-related fixes needed by the MMC tree In order to convert the Tegra MMC driver to using mmc_of_parse(), some bugs in the Tegra device-tree content need to be fixed first; it's currently wrong but unused, and mmc_of_parse() causes that data to be used for the first time.
| * ARM: dts: tegra: fix the activate polarity of cd-gpio in mmc hostJoseph Lo2013-03-11
| | | | | | | | | | | | | | | | The GPIO pin of SD slot card detection should active low. Signed-off-by: Joseph Lo <josephl@nvidia.com> Tested-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Stephen Warren <swarren@nvidia.com>