aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/rtsx_pci_sdmmc.c
Commit message (Collapse)AuthorAge
* mmc: rtsx: add support for pre_req and post_reqMicky Ching2014-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for non-blocking request, pre_req() runs dma_map_sg() and post_req() runs dma_unmap_sg(). This patch can increase card read/write speed, especially for high speed card and slow CPU(for some embedded platform). Users can get a great benefit from this patch. if CPU frequency is 800MHz, SDR104 or DDR50 card read/write speed may increase more than 15%. test results: intel i3(800MHz - 2.3GHz), SD card clock 208MHz performance mode(2.3GHz): Before: dd if=/dev/mmcblk0p1 of=/dev/null bs=64k count=1024 67108864 bytes (67 MB) copied, 1.18191 s, 56.8 MB/s After: dd if=/dev/mmcblk0p1 of=/dev/null bs=64k count=1024 67108864 bytes (67 MB) copied, 1.09276 s, 61.4 MB/s powersave mode(800MHz): Before: dd if=/dev/mmcblk0p1 of=/dev/null bs=64k count=1024 67108864 bytes (67 MB) copied, 1.29569 s, 51.8 MB/s After: dd if=/dev/mmcblk0p1 of=/dev/null bs=64k count=1024 67108864 bytes (67 MB) copied, 1.11218 s, 60.3 MB/s Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Signed-off-by: Chris Ball <chris@printf.net>
* mmc: rtsx: modify phase searching method for tuningMicky Ching2014-02-22
| | | | | | | | The new phase searching method is more concise and easier to understand. Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Signed-off-by: Chris Ball <chris@printf.net>
* mmc: rtsx: fix card poweroff bugMicky Ching2014-02-22
| | | | | | | | | | If the host driver removed while card in the slot, the host will not power off card power correctly. This bug is produced because host eject flag set before the last mmc_set_ios callback, we should set the eject flag after power off. Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Signed-off-by: Chris Ball <chris@printf.net>
* mmc: rtsx: Remove redundant suspend and resume callbacksUlf Hansson2013-10-30
| | | | | | | | | | | | | Suspend and resume of cards are handled by the protocol layer and consequently the mmc_suspend|resume_host APIs are marked as deprecated. While moving away from using the deprecated APIs, there are nothing left to be done for the suspend and resume callbacks, so remove them. Cc: Wei WANG <wei_wang@realsil.com.cn> Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: core: clean up duplicate macrosJackey Shen2013-09-25
| | | | | | | | | Clean up the duplicate macros: mmc_sd_card_uhs -> mmc_card_uhs mmc_sd_card_set_uhs -> mmc_card_set_uhs Signed-off-by: Jackey Shen <jackey.shen@amd.com> Signed-off-by: Chris Ball <cjb@laptop.org>
* mmc: memstick: rtsx: Modify copyright commentsWei WANG2013-08-30
| | | | | | | | Update copyright date, and remove author address. Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Acked-by: Chris Ball <cjb@laptop.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mmc: rtsx: Clear SD_CLK toggle enable bit if switching voltage failWei WANG2013-08-30
| | | | | | | | | If switching voltage fails, SD_CLK toggle enable bit should been cleared so that SD host can control SD clock automatically. Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Acked-by: Chris Ball <cjb@laptop.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: mmc: rtsx: Change default tx phaseWei WANG2013-08-30
| | | | | | | | | | | | | | The default phase can meet most cards' requirement, but it is not the optimal one. In some extreme situation, the rx phase point produced by the following tuning process will drift quite a distance. Before tuning UHS card, this patch will set a more proper initial tx phase point, which is calculated from statistic data, and can achieve a much better tx signal quality. Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Chris Ball <cjb@laptop.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mmc: remove unnecessary platform_set_drvdata()Jingoo Han2013-05-26
| | | | | | | | | | | | | | | | | | The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. 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>
* 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>
* Merge tag 'mmc-updates-for-3.9-rc1' of ↵Linus Torvalds2013-02-26
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc Pull MMC update from Chris Ball: "MMC highlights for 3.9: Core: - Support for packed commands in eMMC 4.5. (This requires a host capability to be turned on. It increases write throughput by 20%+, but may also increase average write latency; more testing needed.) - Add DT bindings for capability flags. - Add mmc_of_parse() for shared DT parsing between drivers. Drivers: - android-goldfish: New MMC driver for the Android Goldfish emulator. - mvsdio: Add DT bindings, pinctrl, use slot-gpio for card detection. - omap_hsmmc: Fix boot hangs with RPMB partitions. - sdhci-bcm2835: New driver for controller used by Raspberry Pi. - sdhci-esdhc-imx: Add 8-bit data, auto CMD23 support, use slot-gpio. - sh_mmcif: Add support for eMMC DDR, bundled MMCIF IRQs. - tmio_mmc: Add DT bindings, support for vccq regulator" * tag 'mmc-updates-for-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (92 commits) mmc: tegra: assume CONFIG_OF, remove platform data mmc: add DT bindings for more MMC capability flags mmc: tmio: add support for the VccQ regulator mmc: tmio: remove unused and deprecated symbols mmc: sh_mobile_sdhi: use managed resource allocations mmc: sh_mobile_sdhi: remove unused .pdata field mmc: tmio-mmc: parse device-tree bindings mmc: tmio-mmc: define device-tree bindings mmc: sh_mmcif: use mmc_of_parse() to parse standard MMC DT bindings mmc: (cosmetic) remove "extern" from function declarations mmc: provide a standard MMC device-tree binding parser centrally mmc: detailed definition of CD and WP MMC line polarities in DT mmc: sdhi, tmio: only check flags in tmio-mmc driver proper mmc: sdhci: Fix parameter of sdhci_do_start_signal_voltage_switch() mmc: sdhci: check voltage range only on regulators aware of voltage value mmc: bcm2835: set SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK mmc: support packed write command for eMMC4.5 devices mmc: add packed command feature of eMMC4.5 mmc: rtsx: remove driving adjustment mmc: use regulator_can_change_voltage() instead of regulator_count_voltages ...
| * mmc: rtsx: remove driving adjustmentRoger Tseng2013-02-24
| | | | | | | | | | | | | | | | | | | | | | Several new models of readers use different way to select driving capability (a necessary adjustment along with voltage change). Removing this from device-independent rtsx_pci_sdmmc module. It will be implemented in device-depend calls encapsulated by rtsx_pci_switch_output_voltage(). Signed-off-by: Roger Tseng <rogerable@realtek.com> Reviewed-by: Wei WANG <wei_wang@realsil.com.cn> Signed-off-by: Chris Ball <cjb@laptop.org>
* | mfd: rtsx: Fix issue that booting OS with SD card insertedWei WANG2013-02-13
|/ | | | | | | | | | | | | | | | | | Realtek card reader supports both SD and MS card. According to the settings of rtsx MFD driver, SD host will be probed before MS host. If we boot/reboot Linux with SD card inserted, the resetting flow of SD card will succeed, and the following resetting flow of MS is sure to fail. Then MS upper-level driver will ask rtsx driver to turn power off. This request leads to the result that the following SD commands fail and SD card can't be accessed again. In this commit, Realtek's SD and MS host driver will check whether the card that upper driver requesting is the one existing in the slot. If not, Realtek's host driver will refuse the operation to make sure the exlusive accessing at the same time. Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mmc: rtsx: Call MFD hook to switch output voltageWei WANG2013-01-26
| | | | | | | | | Different card reader has different method to switch output voltage, so we have to use the callback function provided by MFD driver to switch output pad voltage. Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mmc: rtsx: Explicitely include slab.h in rtsx_pci_sdmmc.cWei WANG2012-11-21
| | | | | | | | | | | | | | | | | | This fixes the following build error on some architectures (parisc at least): drivers/mmc/host/rtsx_pci_sdmmc.c: In function 'sd_normal_rw': drivers/mmc/host/rtsx_pci_sdmmc.c:448:2: error: implicit declaration of function 'kzalloc' [-Werror=implicit-function-declaration] drivers/mmc/host/rtsx_pci_sdmmc.c:448:6: warning: assignment makes pointer from integer without a cast [enabled by default] drivers/mmc/host/rtsx_pci_sdmmc.c:472:2: error: implicit declaration of function 'kfree' [-Werror=implicit-function-declaration] Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Acked-by: Chris Ball <cjb@laptop.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mmc: rtsx: Configure SD_CFG2 register in sd_rw_multiWei WANG2012-11-21
| | | | | | | | | | | | | | | For Realtek card reader, internal regsiter SD_CFG2 should be configured before transferring data. The default value of SD_CFG2 is proper for writing data. But for reading sequence, the timing is not good enough. So in some extreme circumstance, card reader may sample the response data from the card as good even if the data is wrong. And this will cause the bad consequence. In the prior version, the value of this register has been calculated, but forgotten to write back to the internal register. Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Acked-by: Chris Ball <cjb@laptop.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mmc: rtsx: Remove a duplicate command in sd_rw_multiWei WANG2012-11-20
| | | | | Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mmc: Add realtek pcie sdmmc host driverWei WANG2012-11-08
Realtek PCI-E SD/MMC card host driver is used to access SD/MMC card, with the help of Realtek PCI-E card reader MFD driver. Signed-off-by: Wei WANG <wei_wang@realsil.com.cn> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Borislav Petkov <bp@alien8.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>