summaryrefslogtreecommitdiff
path: root/drivers/mmc/host
AgeCommit message (Collapse)Author
2016-05-17Merge tag 'pm-4.7-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "The majority of changes go into the cpufreq subsystem this time. To me, quite obviously, the biggest ticket item is the new "schedutil" governor. Interestingly enough, it's the first new cpufreq governor since the beginning of the git era (except for some out-of-the-tree ones). There are two main differences between it and the existing governors. First, it uses the information provided by the scheduler directly for making its decisions, so it doesn't have to track anything by itself. Second, it can invoke drivers (supporting that feature) to adjust CPU performance right away without having to spawn work items to be executed in process context or similar. Currently, the acpi-cpufreq driver is the only one supporting that mode of operation, but then it is used on a large number of systems. The "schedutil" governor as included here is very simple and mostly regarded as a foundation for future work on the integration of the scheduler with CPU power management (in fact, there is work in progress on top of it already). Nevertheless it works and the preliminary results obtained with it are encouraging. There also is some consolidation of CPU frequency management for ARM platforms that can add their machine IDs the the new stub dt-platdev driver now and that will take care of creating the requisite platform device for cpufreq-dt, so it is not necessary to do that in platform code any more. Several ARM platforms are switched over to using this generic mechanism. In addition to that, the intel_pstate driver is now going to respect CPU frequency limits set by the platform firmware (or a BMC) and provided via the ACPI _PPC object. The devfreq subsystem is getting a new "passive" governor for SoCs subsystems that will depend on somebody else to manage their voltage rails and its support for Samsung Exynos SoCs is consolidated. The rest is support for new hardware (Intel Broxton support in intel_idle for one example), bug fixes, optimizations and cleanups in a number of places. Specifics: - New cpufreq "schedutil" governor (making decisions based on CPU utilization information provided by the scheduler and capable of switching CPU frequencies right away if the underlying driver supports that) and support for fast frequency switching in the acpi-cpufreq driver (Rafael Wysocki) - Consolidation of CPU frequency management on ARM platforms allowing them to get rid of some platform-specific boilerplate code if they are going to use the cpufreq-dt driver (Viresh Kumar, Finley Xiao, Marc Gonzalez) - Support for ACPI _PPC and CPU frequency limits in the intel_pstate driver (Srinivas Pandruvada) - Fixes and cleanups in the cpufreq core and generic governor code (Rafael Wysocki, Sai Gurrappadi) - intel_pstate driver optimizations and cleanups (Rafael Wysocki, Philippe Longepe, Chen Yu, Joe Perches) - cpufreq powernv driver fixes and cleanups (Akshay Adiga, Shilpasri Bhat) - cpufreq qoriq driver fixes and cleanups (Jia Hongtao) - ACPI cpufreq driver cleanups (Viresh Kumar) - Assorted cpufreq driver updates (Ashwin Chaugule, Geliang Tang, Javier Martinez Canillas, Paul Gortmaker, Sudeep Holla) - Assorted cpufreq fixes and cleanups (Joe Perches, Arnd Bergmann) - Fixes and cleanups in the OPP (Operating Performance Points) framework, mostly related to OPP sharing, and reorganization of OF-dependent code in it (Viresh Kumar, Arnd Bergmann, Sudeep Holla) - New "passive" governor for devfreq (for SoC subsystems that will rely on someone else for the management of their power resources) and consolidation of devfreq support for Exynos platforms, coding style and typo fixes for devfreq (Chanwoo Choi, MyungJoo Ham) - PM core fixes and cleanups, mostly to make it work better with the generic power domains (genpd) framework, and updates for that framework (Ulf Hansson, Thierry Reding, Colin Ian King) - Intel Broxton support for the intel_idle driver (Len Brown) - cpuidle core optimization and fix (Daniel Lezcano, Dave Gerlach) - ARM cpuidle cleanups (Jisheng Zhang) - Intel Kabylake support for the RAPL power capping driver (Jacob Pan) - AVS (Adaptive Voltage Switching) rockchip-io driver update (Heiko Stuebner) - Updates for the cpupower tool (Arjun Sreedharan, Colin Ian King, Mattia Dongili, Thomas Renninger)" * tag 'pm-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (112 commits) intel_pstate: Clean up get_target_pstate_use_performance() intel_pstate: Use sample.core_avg_perf in get_avg_pstate() intel_pstate: Clarify average performance computation intel_pstate: Avoid unnecessary synchronize_sched() during initialization cpufreq: schedutil: Make default depend on CONFIG_SMP cpufreq: powernv: del_timer_sync when global and local pstate are equal cpufreq: powernv: Move smp_call_function_any() out of irq safe block intel_pstate: Clean up intel_pstate_get() cpufreq: schedutil: Make it depend on CONFIG_SMP cpufreq: governor: Fix handling of special cases in dbs_update() PM / OPP: Move CONFIG_OF dependent code in a separate file cpufreq: intel_pstate: Ignore _PPC processing under HWP cpufreq: arm_big_little: use generic OPP functions for {init, free}_opp_table PM / OPP: add non-OF versions of dev_pm_opp_{cpumask_, }remove_table cpufreq: tango: Use generic platdev driver PM / OPP: pass cpumask by reference cpufreq: Fix GOV_LIMITS handling for the userspace governor cpupower: fix potential memory leak PM / devfreq: style/typo fixes PM / devfreq: exynos: Add the detailed correlation for Exynos5422 bus ..
2016-05-16Merge branches 'pm-core' and 'pm-domains'Rafael J. Wysocki
* pm-core: PM / sleep: Drop unused `info' variable PM / Runtime: Move ignore_children flag under CONFIG_PM PM / Runtime: Fix error path in pm_runtime_force_resume() * pm-domains: PM / Domains: Drop unnecessary wakeup code from pm_genpd_prepare() PM / Domains: Remove redundant pm_runtime_get|put*() in pm_genpd_prepare() PM / Domains: Remove ->save|restore_state() callbacks PM / Domains: Rename pm_genpd_runtime_suspend|resume() PM / Domains: Rename stop_ok to suspend_ok for the genpd governor
2016-05-16mmc: sh_mobile_sdhi: enable SDIO IRQs for RCar Gen3Wolfram Sang
Tested on a Salvator-X board with a Spectec SDW-823 WLAN card. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-16mmc: sdhci: removed unneeded function wrappersDong Aisheng
After commit d6463f170cf0 ("mmc: sdhci: Remove redundant runtime PM calls"), some of original sdhci_do_xx() function wrappers becomes meaningless, so remove them. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-04mmc: sdhci-of-arasan: fix set_clock when a phy is supportedShawn Lin
commit 61b914eb81f8 ("mmc: sdhci-of-arasan: add phy support for sdhci-of-arasan") introduce phy support for arasan. According to the vendor's databook, we should make sure the phy is in poweroff status before we configure the clk stuff. Otherwise it may cause some IO sample timing issues from the test. And we don't need this extra operation while running in low performance mode since phy doesn't trigger sampling block. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-04mmc: omap: Use dma_request_chan() for requesting DMA channelPeter Ujfalusi
With the new dma_request_chan() the client driver does not need to look for the DMA resource and it does not need to pass filter_fn anymore. By switching to the new API the driver can now support deferred probing against DMA. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> CC: Ulf Hansson <ulf.hansson@linaro.org> CC: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-04mmc: sh_mobile_sdhi: check return value when changing clkWolfram Sang
And return the old clock rate if something went wrong. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-04mmc: sh_mobile_sdhi: only change the clock on RCar Gen2+Wolfram Sang
We had a regression on r8a7740 where the SDHI clock was a generic peripheral clock, so changing its rate was not desired. This should be fixed in the clock driver. However, it also shows that the new clock calculation should only be used on tested systems. Add a check for that. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-04mmc: tmio/sdhi: introduce flag for RCar 2+ specific featuresWolfram Sang
RCar Gen2 and later implementations of TMIO/SDHI have their own set of features and additions. FAST_CLK_CHG is just one of them and I see a few others being added soon. Some may work on older chipsets but this needs to be tested case by case. Instead of adding a bunch of flags for each feature, add a global RCar2+ one for now. We can still break out features if the need arises. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-04mmc: sh_mobile_sdhi: make clk_update function more compactWolfram Sang
Save a few lines, the codebase is large enough. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-04mmc: omap_hsmmc: Use dma_request_chan() for requesting DMA channelPeter Ujfalusi
With the new dma_request_chan() the client driver does not need to look for the DMA resource and it does not need to pass filter_fn anymore. By switching to the new API the driver can now support deferred probing against DMA. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-04mmc: sdhci-of-at91: add presets setupLudovic Desroches
The controller claims to support SDR104. In fact, it only supports a degraded SDR104 since the maximum frequency of the SD clock is 120 MHz instead of 208 MHz. The sdhci core is unaware of it and will compute a wrong clock divider. We can deal with this specific case by using presets. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: usdhi6rol0: add pinctrl to set pin drive strengthLars Persson
Some boards need different pin drive strength for the UHS mode. Add an optional pinctrl setting with two pin states covering UHS speeds and other speeds. Signed-off-by: Lars Persson <larper@axis.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: usdhi6rol0: add support for UHS modesLars Persson
Add a start_signal_voltage_switch() operation to support enabling of UHS modes. Signed-off-by: Lars Persson <larper@axis.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: usdhi6rol0: do not announce UHS capabilitiesLars Persson
The driver in its current form does not support UHS at all due to a missing start_signal_voltage_switch callback. Also when this callback is added we should let the device tree control UHS capabilities using the standard mmc bindings. Signed-off-by: Lars Persson <larper@axis.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: tmio: document CTL_STATUS handlingWolfram Sang
Now that reading CTL_STATUS is consistent, we can remove CTL_STATUS2 and document how this is handled internally. Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: tmio/sdhi: distinguish between SCLKDIVEN and ILL_FUNCWolfram Sang
This bit has a different meaning in SDHI and original TMIO. Document that and use the proper naming. Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: tmio: use CTL_STATUS consistentlyWolfram Sang
To prevent confusion, use the virtual u32 CTL_STATUS in card_busy() the same way as in other parts of this driver. Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: tmio: use BIT() within definesWolfram Sang
BIT() makes it easier to match the bits to the datasheet. This is especially important here, since some variants have different names in their datasheets (like with Renesas R-Car). Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: tmio: give read32/write32 functions more descriptive namesWolfram Sang
Looking at the backlogs, I am not the only one who missed that the above functions do not read u32 from one register, but create a virtual u32 from reading to adjacent u16 registers (which depending on 'bus_shift' can be up to 8 byte apart). Because this driver supports old hardware for which we don't have documentation, I first wrongly assumed there was a variant which had a few u32 registers. Let's give the functions more descriptive names to make it more obvious what is happening. Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: omap_hsmmc: Check if MMC slot name is passed in pdataTony Lindgren
The legacy user space for n900 relies on the MMC slot names. Let's check if those are passed in pdata and use them. As this makes the DT booting compatible with legacy booting, we should be able to start dropping omap3 legacy booting support in v4.8. Cc: Ulf Hansson <ulf.hansson@linaro.org> Cc: Kishon Vijay Abraham I <kishon@ti.com> Cc: linux-mmc@vger.kernel.org Signed-off-by: Tony Lindgren <tony@atomide.com> Tested-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sh_mobile_sdhi: remove obsolete support for sh7372Wolfram Sang
There is no support for this platform in the kernel anymore. Reported-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sh_mmcif: remove obsolete support for sh7372Wolfram Sang
There is no support for this platform in the kernel anymore. Make the Kconfig text more generic, so it won't get stale anymore. Reported-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sh_mobile_sdhi: simplify code for voltage switchingWolfram Sang
A last minute fix applied by Ulf made room for some simplification. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: tmio: merge distributed include filesWolfram Sang
There is no reason to have a public and private header file. Merge them into a private one, so looking up symbols is less confusing. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: tmio: simplify irq handlerWolfram Sang
Having just one irq handler again, let's include the 'card_status' function in the main handler which is way more readable. Drop a useless debug output while here. It should be a dev_dbg in case we ever need it again. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: tmio: remove now unneeded seperate irq handlersWolfram Sang
We removed installation of separate handlers previously, so we can also remove the separate handlers. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sh_mobile_sdhi: remove obsolete irq_by_name registrationWolfram Sang
There is no user left in the kernel, so this code can be removed. (Legacy, non-DT sh_mobile boards have been removed a while ago.) The diff looks more complicated than it is: The if-block for multiplexed isr is now the main code path, the rest is removed. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sh_mobile_sdhi: don't use array for DT configsWolfram Sang
We won't access an index based array to get our DT config, but create separate structs instead. So, remove the array which only wastes memory. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci: use IS_ENABLE(CONFIG_LEDS_CLASS) to enable LED struct membersMasahiro Yamada
defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) is equivalent to: IS_ENABLED(CONFIG_LEDS_CLASS) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci: use IS_REACHABLE(CONFIG_LEDS_CLASS) to enable LED codeMasahiro Yamada
defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \ defined(CONFIG_MMC_SDHCI_MODULE)) is equivalent to: defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \ defined(MODULE)) and it can also be written shortly as: IS_REACHABLE(CONFIG_LEDS_CLASS) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci: Remove SDHCI_SDR104_NEEDS_TUNINGAdrian Hunter
SDHCI_SDR104_NEEDS_TUNING was originally named SDHCI_HS200_NEEDS_TUNING and was added in commit 069c9f142822 ("mmc: host: Adds support for eMMC 4.5 HS200 mode"). That commit conflated SDHCI_SDR50_NEEDS_TUNING and SDHCI_HS200_NEEDS_TUNING due to what appears to be misplaced parentheses. Commit 156e14b126ff ("mmc: sdhci: fix caps2 for HS200") made HS200 configuration equivalent to SDR104 configuration, renaming SDHCI_HS200_NEEDS_TUNING to SDHCI_SDR104_NEEDS_TUNING despite tuning for HS200 now being non-optional. The mix-up with SDHCI_SDR50_NEEDS_TUNING remained and became more obvious after commit 4b6f37d3a379 ("mmc: sdhci: clean up sdhci_execute_tuning() decision") where the author noted the patch was "reflecting what the original code was doing, it shows that it may not be what the author actually intended." The way the code is currently written, SDHCI_SDR104_NEEDS_TUNING causes tuning to be done always for SDR50 mode if SDR104 mode is also supported by the host controller. That makes no sense because we already have capabilities bit SDHCI_USE_SDR50_TUNING and corresponding flag SDHCI_SDR50_NEEDS_TUNING for that purpose. Given the dubious origins of SDHCI_SDR104_NEEDS_TUNING, it seems reasonable to remove it. The benefit being SDR50 mode will now not un-nessessarily do tuning. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci-pltfm: call platform_get_irq() before sdhci_alloc_host()Masahiro Yamada
Swap the call order of sdhci_alloc_host() and platform_get_irq(). It makes sdhci_alloc_host() the last function that can fail in the sdhci_pltfm_init(). So, we can drop the sdhci_free_host() call from the failure path. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci-pltfm: move devm_ioremap_resource() upMasahiro Yamada
Call devm_ioremap_resource() right after platform_get_resource(). This saves the error check of platform_get_resource() because devm_ioremap_resource() checks if the given resource is NULL. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci-pltfm: use devm_ioremap_resource()Masahiro Yamada
The chain of devm_request_mem_region() and devm_ioremap() can be replaced with devm_ioremap_resource(). Also, we can drop the error messages because devm_ioremap_resource() displays similar messages on error. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci-pltfm: use devm_ioremap()Masahiro Yamada
Use the managed variant of ioremap(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci-pltfm: use devm_request_mem_region()Masahiro Yamada
Use the managed variant of request_mem_region(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci-pltfm: check return value of platform_get_irq()Masahiro Yamada
The function platform_get_irq() can fail; it returns a negative error code on failure. A negative IRQ number will make sdhci_add_host() fail to request IRQ anyway, but it makes sense to let it fail earlier here. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci-pltfm: drop error message for too small MMIO resource sizeMasahiro Yamada
The requirement resource_size >= 0x100 may not necessarily be reasonable; for example, sdhci-dove appears to sidestep some registers in sdhci_dove_readw(). Moreover, current code displays an error message for too small resource size, but still moves forward. Every DT should be responsible for describing its properties correctly, so lets's remove this error message from the common framework. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci: Tidy together LED codeAdrian Hunter
ifdef's make the code more complicated and harder to read. Move all the LED code together to reduce the ifdef's to one place. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci: Fix error paths in sdhci_add_host()Adrian Hunter
Some error paths in sdhci_add_host() simply returned without cleaning up. Also the return value from mmc_add_host() was not being checked. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci: Remove redundant conditionAdrian Hunter
The logic '!mmc.f_max || (mmc.f_max && mmc.f_max > max_clk)' is equivalent to '!mmc.f_max || mmc.f_max > max_clk'. Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci-acpi: Set MMC_CAP_AGGRESSIVE_PM for Broxton controllersAdrian Hunter
Set MMC_CAP_AGGRESSIVE_PM for Broxton host controllers. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci-pci: Set MMC_CAP_AGGRESSIVE_PM for Broxton controllersAdrian Hunter
Set MMC_CAP_AGGRESSIVE_PM for Broxton host controllers. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci: Remove SDHCI_QUIRK2_NEED_DELAY_AFTER_INT_CLK_RSTLudovic Desroches
SDHCI_QUIRK2_NEED_DELAY_AFTER_INT_CLK_RST quirk is not used anymore so remove it. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci-of-at91: Implement specific ->set_clock() functionLudovic Desroches
Disabling the internal clock while configuring the SD card clock can lead to internal clock stabilization issue and/or unexpected switch to the base clock when using presets. A quirk SDHCI_QUIRK2_NEED_DELAY_AFTER_INT_CLK_RST was introduced to fix these bugs. The cause was assumed to be a too long internal re-synchronisation but it seems in some cases the delay (even if longer) doesn't fix this bug. The safest workaround is to not disable/enable the internal clock during the SD card clock configuration. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci: Introduce sdhci_calc_clk()Ludovic Desroches
In order to remove the SDHCI_QUIRK2_NEED_DELAY_AFTER_INT_CLK_RST and to reduce code duplication, put the code relative to the SD clock configuration in a function which can be used by hosts for the implementation of the ->set_clock() callback. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci: Move sdhci_runtime_pm_bus_off|on() to avoid pre-definitionUlf Hansson
There are no need to have two versions of sdhci_runtime_pm_bus_off|on(), depending on whether CONFIG_PM is set or unset. Thus it's easy to move the implementation of these functions a bit earlier to avoid the unnecessary pre-definition of them, so let's do that. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
2016-05-02mmc: sdhci-pic32: remove owner assignmentMasahiro Yamada
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-05-02mmc: sdhci: Remove redundant runtime PM callsUlf Hansson
Commit 9250aea76bfc ("mmc: core: Enable runtime PM management of host devices"), made some calls to the runtime PM API from the driver redundant. Especially those which deals with runtime PM reference counting, so let's remove them. Moreover as SDHCI have its own wrapper functions for runtime PM these becomes superfluous, so let's remove them as well. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com>