summaryrefslogtreecommitdiff
path: root/drivers/mmc/host
AgeCommit message (Collapse)AuthorFilesLines
2015-05-18mmc: atmel-mci: fix bad variable type for clkdivLudovic Desroches1-2/+7
clkdiv is declared as an u32 but it can be set to a negative value causing a huge divisor value. Change its type to int to avoid this case. Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Cc: <stable@vger.kernel.org> # 3.4 and later Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-05-08mmc: dw_mmc: dw_mci_get_cd check MMC_CAP_NONREMOVABLEZhangfei Gao1-1/+2
When non-removable is used for emmc, MMC_CAP_NONREMOVABLE should also be checked, otherwise detection fail since present=0 Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-05-08mmc: dw_mmc: init desc in dw_mci_idmac_initZhangfei Gao1-1/+3
Set 0 to des1 in 32bit case. Otherwise the random value of des1 will be used in dw_mci_translate_sglist: IDMAC_SET_BUFFER1_SIZE(desc, length) Signed-off-by: Fei Wang <w.f@huawei.com> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-05-06mmc: sh_mmcif: Fix timeout value for command requestTakeshi Kihara1-1/+1
f9fd54f22e ("mmc: sh_mmcif: Use msecs_to_jiffies() for host->timeout") changed the timeout value from 1000 jiffies to 1s. In the case where HZ is 1000 the values are the same. However, for smaller HZ values the timeout is now smaller, 1s instead of 10s in the case of HZ=100. Since the timeout occurs in spite of a normal data transfer a timeout of 10s seems more appropriate. This restores the previous timeout in the case where HZ=100 and results in an increase over the previous timeout for larger values of HZ. Fixes: f9fd54f22e ("mmc: sh_mmcif: Use msecs_to_jiffies() for host->timeout") Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com> [horms: rewrote changelog to refer to HZ] Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-24Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dmaLinus Torvalds4-40/+13
Pull slave-dmaengine updates from Vinod Koul: - new drivers for: - Ingenic JZ4780 controller - APM X-Gene controller - Freescale RaidEngine device - Renesas USB Controller - remove device_alloc_chan_resources dummy handlers - sh driver cleanups for peri peri and related emmc and asoc patches as well - fixes and enhancements spread over the drivers * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (59 commits) dmaengine: dw: don't prompt for DW_DMAC_CORE dmaengine: shdmac: avoid unused variable warnings dmaengine: fix platform_no_drv_owner.cocci warnings dmaengine: pch_dma: fix memory leak on failure path in pch_dma_probe() dmaengine: at_xdmac: unlock spin lock before return dmaengine: xgene: devm_ioremap() returns NULL on error dmaengine: xgene: buffer overflow in xgene_dma_init_channels() dmaengine: usb-dmac: Fix dereferencing freed memory 'desc' dmaengine: sa11x0: report slave capabilities to upper layers dmaengine: vdma: Fix compilation warnings dmaengine: fsl_raid: statify fsl_re_chan_probe dmaengine: Driver support for FSL RaidEngine device. dmaengine: xgene_dma_init_ring_mngr() can be static Documentation: dma: Add documentation for the APM X-Gene SoC DMA device DTS binding arm64: dts: Add APM X-Gene SoC DMA device and DMA clock DTS nodes dmaengine: Add support for APM X-Gene SoC DMA engine driver dmaengine: usb-dmac: Add Renesas USB DMA Controller (USB-DMAC) driver dmaengine: renesas,usb-dmac: Add device tree bindings documentation dmaengine: edma: fixed wrongly initialized data parameter to the edma callback dmaengine: ste_dma40: fix implicit conversion ...
2015-04-22Merge tag 'armsoc-cleanup' of ↵Linus Torvalds4-1739/+0
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC cleanups from Olof Johansson: "We've got a fairly large cleanup branch this time. The bulk of this is removal of non-DT platforms of several flavors: - Atmel at91 platforms go full-DT, with removal of remaining board-file based support - OMAP removes legacy board files for three more platforms - removal of non-DT mach-msm, newer Qualcomm platforms now live in mach-qcom - Freescale i.MX25 also removes non-DT platform support" Most of the rest of the changes here are fallout from the above, i.e. for example removal of drivers that now lack platforms, etc. * tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (58 commits) mmc: Remove msm_sdcc driver gpio: Remove gpio-msm-v1 driver ARM: Remove mach-msm and associated ARM architecture code ARM: shmobile: cpuidle: Remove the pointless default driver ARM: davinci: dm646x: Add interrupt resource for McASPs ARM: davinci: irqs: Correct McASP1 TX interrupt definition for DM646x ARM: davinci: dm646x: Clean up the McASP DMA resources ARM: davinci: devices-da8xx: Add support for McASP2 on da830 ARM: davinci: devices-da8xx: Clean up and correct the McASP device creation ARM: davinci: devices-da8xx: Add interrupt resource to McASP structs ARM: davinci: devices-da8xx: Add resource name for the McASP DMA request ARM: OMAP2+: Remove legacy support for omap3 TouchBook ARM: OMAP3: Remove legacy support for devkit8000 ARM: OMAP3: Remove legacy support for EMA-Tech Stalker board ARM: shmobile: Consolidate the pm code for R-Car Gen2 ARM: shmobile: r8a7791: Correct SYSCIER value ARM: shmobile: r8a7790: Correct SYSCIER value ARM: at91: remove old setup ARM: at91: sama5d4: remove useless map_io ARM: at91: sama5 use SoC detection infrastructure ...
2015-04-16Merge tag 'powerpc-4.1-1' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux Pull powerpc updates from Michael Ellerman: - Numerous minor fixes, cleanups etc. - More EEH work from Gavin to remove its dependency on device_nodes. - Memory hotplug implemented entirely in the kernel from Nathan Fontenot. - Removal of redundant CONFIG_PPC_OF by Kevin Hao. - Rewrite of VPHN parsing logic & tests from Greg Kurz. - A fix from Nish Aravamudan to reduce memory usage by clamping nodes_possible_map. - Support for pstore on powernv from Hari Bathini. - Removal of old powerpc specific byte swap routines by David Gibson. - Fix from Vasant Hegde to prevent the flash driver telling you it was flashing your firmware when it wasn't. - Patch from Ben Herrenschmidt to add an OPAL heartbeat driver. - Fix for an oops causing get/put_cpu_var() imbalance in perf by Jan Stancek. - Some fixes for migration from Tyrel Datwyler. - A new syscall to switch the cpu endian by Michael Ellerman. - Large series from Wei Yang to implement SRIOV, reviewed and acked by Bjorn. - A fix for the OPAL sensor driver from Cédric Le Goater. - Fixes to get STRICT_MM_TYPECHECKS building again by Michael Ellerman. - Large series from Daniel Axtens to make our PCI hooks per PHB rather than per machine. - Small patch from Sam Bobroff to explicitly abort non-suspended transactions on syscalls, plus a test to exercise it. - Numerous reworks and fixes for the 24x7 PMU from Sukadev Bhattiprolu. - Small patch to enable the hard lockup detector from Anton Blanchard. - Fix from Dave Olson for missing L2 cache information on some CPUs. - Some fixes from Michael Ellerman to get Cell machines booting again. - Freescale updates from Scott: Highlights include BMan device tree nodes, an MSI erratum workaround, a couple minor performance improvements, config updates, and misc fixes/cleanup. * tag 'powerpc-4.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux: (196 commits) powerpc/powermac: Fix build error seen with powermac smp builds powerpc/pseries: Fix compile of memory hotplug without CONFIG_MEMORY_HOTREMOVE powerpc: Remove PPC32 code from pseries specific find_and_init_phbs() powerpc/cell: Fix iommu breakage caused by controller_ops change powerpc/eeh: Fix crash in eeh_add_device_early() on Cell powerpc/perf: Cap 64bit userspace backtraces to PERF_MAX_STACK_DEPTH powerpc/perf/hv-24x7: Fail 24x7 initcall if create_events_from_catalog() fails powerpc/pseries: Correct memory hotplug locking powerpc: Fix missing L2 cache size in /sys/devices/system/cpu powerpc: Add ppc64 hard lockup detector support oprofile: Disable oprofile NMI timer on ppc64 powerpc/perf/hv-24x7: Add missing put_cpu_var() powerpc/perf/hv-24x7: Break up single_24x7_request powerpc/perf/hv-24x7: Define update_event_count() powerpc/perf/hv-24x7: Whitespace cleanup powerpc/perf/hv-24x7: Define add_event_to_24x7_request() powerpc/perf/hv-24x7: Rename hv_24x7_event_update powerpc/perf/hv-24x7: Move debug prints to separate function powerpc/perf/hv-24x7: Drop event_24x7_request() powerpc/perf/hv-24x7: Use pr_devel() to log message ... Conflicts: tools/testing/selftests/powerpc/Makefile tools/testing/selftests/powerpc/tm/Makefile
2015-04-10mmc: sdhci-st: Update the quirks for this controller.Peter Griffin1-1/+4
Some additional quirks need to be enabled now we support UHS modes. This avoids some spurious warnings like "Got data interrupt 0x00000002 even though no data operation was in progress" Testing on stih410-b2120 board achieves the following speeds with HS200 eMMC card. max-frequency = 200Mhz /dev/mmcblk0p1: Timing buffered disk reads: 270 MB in 3.02 seconds = 89.54 MB/sec max-frequency = 100Mhz root@debian-armhf:~# hdparm -t /dev/mmcblk0p1 /dev/mmcblk0p1: Timing buffered disk reads: 210 MB in 3.00 seconds = 70.00 MB/sec max-frequency = 50Mhz root@debian-armhf:~# hdparm -t /dev/mmcblk0p1 /dev/mmcblk0p1: Timing buffered disk reads: 118 MB in 3.00 seconds = 39.28 MB/sec This is better than the 3.10 kernel which achieves 77.59 MB/sec at 200Mhz clock (same board/soc/eMMC). Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-10mmc: sdhci-st: Add sdhci_st_set_uhs_signaling function.Peter Griffin1-0/+51
To allow UHS modes to work properly we need to provide the st specific set_uhs_signaling callback function. This function differs from the generic sdhci_set_uhs_signaling callback in that we need to configure the correct delay depending on the UHS mode, and also set the V18_EN bit. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-10mmc: sdhci-st: Add st_mmcss_cconfig function to configure mmcss glue registers.Peter Griffin1-0/+88
STiH407 family SoC's have glue registers in the flashSS subsystem which are used to configure the Arasan HC. This patch configures these glue registers according to what has been specified in the DT. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-10mmc: sdhci-st: Add delay management functions for top registers (eMMC).Peter Griffin1-0/+59
Due to the tight timing constraints in some UHS modes, it is required to have some delay management in the design. Two types of delay management are supported in the HW: - 1) Static delay management 2) Dynamic delay management NB: The delay management is only there when eMMC interface is selected. 1: Static delay management: is used to provide PVT dependent static delay on the clock/data lines to manage setup/hold requirements of the interface. The maximum delay possible is 3.25ns. These delays are PVT dependent, and thus delay values applied are not accurate and vary across provcess voltage and temperature range. Due to this these delays must not be used on the very time critical paths. 2. Dynamic delay locked loop (DLL): is used to provide dynamic delay management. The advantage of DLL is that it provides accurate & PVT indepedent delay. The DLL is used to provide delay on the loopback clock on "Read Path" to capture read data reliably. On TX path the clock on which output data is transmitted is delayed, resulting in delay of TX data. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-10mmc: sdhci-st: Add support for de-asserting reset signal and top regs resourcePeter Griffin1-3/+57
STiH407 family SoC's can have a reset signal for the controller which needs to be managed. Also the eMMC controller has some additional 'top' memory mapped registers which are used to manage the dynamic and static delay required for UHS modes. This patch adds support for creating the mapping, which will be used by subsequent patches. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-10mmc: sdhci-st: Add macros for register offsets and bitfields for mmcss glue regsPeter Griffin1-0/+91
The stih407 family SoC's have additional glue registers in the flashSS which are used to configure the Arasan controller. This patch adds macros for the register offsets and bitfields which will be used by subsequent patches to support stih407 family SoC's. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Acked-by: Maxime Coquelin <maxime.coquelin@st.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-09mmc: sdhci-esdhc-imx: Call mmc_of_parse()Fabio Estevam1-32/+6
Currently it is not possible to use 'mmc-pwrseq-simple' property with this driver because mmc_of_parse() is never called. mmc_of_parse() calls mmc_pwrseq_alloc() that manages MMC power sequence and allows passing GPIOs in the devicetree to properly power/reset the Wifi chipset. When using mmc_of_parse() we no longer need to have custom code to request card-detect and write-protect pins, as this can now be handled by the mmc core. Tested on a imx6sl-warp board where BT/Wifi is functional and also on a imx6q-sabresd. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-09mmc: dw_mmc: Add locking around cmd11 timerDoug Anderson1-3/+21
It is possible for the cmd11 interrupt to fire and delete the cmd11_timer before the cmd11_timer was actually setup. Let's fix this race by adding a few spinlocks. Note that the race wasn't seen in practice without adding some printk statements, but it still seems wise to fix. Fixes: 5c935165da79 ("mmc: dw_mmc: Add a timeout for sending CMD11") Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-09mmc: dw_mmc: Add a return in an unexpected cmd11 timeoutDoug Anderson1-2/+4
If we get an unexpected cmd11 timeout we shouldn't actually treat it as a timeout (not that we really expect to get an unexpected cmd11 timeout, but still). Fixes: 5c935165da79 ("mmc: dw_mmc: Add a timeout for sending CMD11") Reported-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-09mmc: dw_mmc: Increase cmd11 timeout to 500msDoug Anderson1-3/+5
Although the cmd11 interrupt should come within 2ms, that's a very short time. Let's increase the timeout to be really sure that we don't get an accidnetal timeout. One case in particular this is useful is if you've got a serial console and printk in just the right places. Under that scenario I've seen delays of up to 130ms before the interrupt fired. CMD11 is only sent during card insertion, so this extra timeout shouldn't be terrible. Fixes: 5c935165da79 ("mmc: dw_mmc: Add a timeout for sending CMD11") Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-09mmc: dw_mmc: fix fifo ordering in big endianBen Dooks2-35/+38
The dw_mmc driver changes to make the IO accesors endian agnostic did not take into account the fifo accesses do not need to be swapped. To fix this add a mmci_fifo_read/write wrapper to allow these to be passed through the IO without being swapped. Since these are now specific functions, it would be easier just to store the pointer to the fifo registers in the host block instead of the offset to them. So change the host->data_offset to host->fifo_reg (which also means we catch all the places this is read or written). Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-09mmc: dw_mmc: change idmac descriptor files to __le32Ben Dooks1-15/+16
The dw_mmc driver does not take into account the processor may be in big endian when writing the descriptors. Change the descriptors for the 32bit IDMA to use __le32 and ensure they are suitably swapped before writing. Note, this has not been tested as the socfpga driver does not try to use idma. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-09mmc: dw_mmc: make IO accessors endian agnosticBen Dooks1-6/+6
The dw_mmc driver does not use endian agnostic IO accessors, so fix the use of __raw reads and writes to be the relaxed versions. This fixes the dw_mmc driver initialisation on Altera socfpga in big endian. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-08mmc: sdhci-of-arasan: Call OF parsing for MMCMichal Simek1-0/+6
Also check MMC OF properties. The controller supports MMC too. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-08mmc: sdhci-pci: fix 64 BIT DMA quirks for rtsxMicky Ching1-0/+1
rts5250 chip failed handle 64 bit ADMA for address below 4G. Add 64 BIT quirks to disable this feature. Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-04-01mmc: sdhci-tegra: convert to use GPIO descriptorsMylene JOSSERAND1-24/+8
Modify the driver to handle GPIOs using the descriptor API. Signed-off-by: Mylene JOSSERAND <josserand.mylene@gmail.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Tested-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-31mmc: omap_hsmmc: use generic slot-gpio isr to manage card detect pinAndreas Fenkart1-13/+0
Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-31mmc: omap_hsmmc: simplify card/cover detect isrAndreas Fenkart1-24/+3
strip the card dectet logic from cover detect isr and vice versa the generic mmc_gpio_cd_irqt isr, uses 200ms on removal/insertion, hence that should be fine here as well Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-31mmc: dw_mmc: Don't try to enable the CD until we're sure we're not deferringDoug Anderson1-3/+3
If dw_mci_init_slot() returns that we got a probe deferral then it may leave slot->mmc as NULL. That will cause dw_mci_enable_cd() to crash when it calls mmc_gpio_get_cd(). Fix this by moving the call of dw_mci_enable_cd() until we're sure that we're good. Note that if we have more than one slot and one defers (but the others don't) things won't work so well. ...but that's not a new thing and everyone has already agreed that multislot support ought to be removed from dw_mmc eventually anyway since it is unused, untested, and you can see several bugs like this by inspecting the code. Fixes: bcafaf5470f0 ("mmc: dw_mmc: Only enable CD after setup and only if needed") Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-31mmc: dw_mmc: Add a timeout for sending CMD11Doug Anderson1-0/+26
In the Designware databook's description of the "Voltage Switch Normal Scenario" it instructs us to set a timer and fail the voltage change if we don't see the voltage change interrupt within 2ms. Let's implement that. Without implementing this I have often been able to reproduce a hang while trying to send CMD11 on an rk3288-based board while constantly ejecting and inserting UHS cards. Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-31mmc: dw_mmc: enable card read threshold when mode is HS400Jaehoon Chung1-0/+1
Enable card-read-threshold, when eMMC mode is HS400. Refer to f1d2736c8156 (mmc: dw_mmc: control card read threshold) Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-27mmc: Remove msm_sdcc driverStephen Boyd4-1739/+0
This driver is orphaned now that mach-msm has been removed. Delete it. Cc: Chris Ball <chris@printf.net> Cc: David Brown <davidb@codeaurora.org> Cc: Bryan Huntsman <bryanh@codeaurora.org> Cc: Daniel Walker <dwalker@fifo99.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Kumar Gala <galak@codeaurora.org>
2015-03-27ARM: OMAP2: HSMMC: explicit fields to declare cover/card detect pinAndreas Fenkart1-5/+6
board-rx51 has no card detect pin in the mmc slot, but can detect that the (cell-phone) cover has been removed and the card is accessible. The semantics between cover/card detect differ, the gpio on the slot informs you after the card has been removed, cover removal does not necessarily mean that the card has been removed. This means different code paths are necessary. To complete this we also want different fields in the platform data for cover and card detect. This separation is not pushed all the way down into struct omap2_hsmmc_info which is used to initialize the platform data. If we did that we had to go over all board files and set the new gpio_cod pin to -EINVAL. If we forget one board or some out-of-tree archicture forgets that the default '0' is used which is a valid pin number. Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-27mmc: omap_hsmmc: stop using ->enable|disable() callbacksNeilBrown1-21/+9
The ->enable|disable() callbacks are only used to get and put runtime PM references. Currently omap_hsmmc's ->set_ios() already does this itself. Other host drivers deals with runtime PM without using the ->enable|disable() callbacks and thus do the runtime PM reference counting themselves. Apply that approach for omap_hsmmc as well and then discard the ->enable|disable() callbacks. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-25mmc: sdhci-msm: Add support for vendor capabilities registersGeorgi Djakov1-1/+28
Some versions of this controller do not advertise their 3.0v and 8bit bus-width support capabilities. It is required to explicitly set these capabilities for the specific controller versions. Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-25mmc: sdhci-esdhc-imx: support voltage-range propertySascha Hauer1-1/+5
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-25mmc: mmci: Cascade EPROBE_DEFER from regulators.Bjorn Andersson1-1/+4
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-25mmc: atmel-mci: use endian agnostic IOBen Dooks1-2/+9
Change the __raw IO functions to endian agnostic relaxed ones to allow the driver to function on big endian ARM systems. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-24powerpc: Remove arch specific byteswappers from the MXC MMC driverDavid Gibson1-1/+1
When the MXC MMUC driver is used on a Freescale MPC512x machine, it contains some additional byteswapping code (I'm assuming this is a workaround for a hardware defect). This uses the ppc specific st_le32() function, but there's no reason not to use the generic swab32() function instead. gcc is capable of generating the efficient ppc byte-reversing load/store instructions without the arch-specific helper. This patch, therefore, switches to the generic byteswap routine. Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Sascha Hauer <kernel@pengutronix.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2015-03-23mmc: constify of_device_id arrayFabian Frederick2-2/+2
of_device_id is always used as const. (See driver.of_match_table and open firmware functions) Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: sunxi: add MMC_CAP_SDIO_IRQ capabilityHans de Goede1-1/+1
When the sunxi mmc-controller code was initially merged MMC_CAP_SDIO_IRQ was not added to the host caps because of issues with some sdio wifi modules. It turns out that these issues have nothing to do with using sdio-irq support, they also happen with oob interrupts. Since the hardware supports sdio-irq everywhere, and since the one reason to not claim the capability is gone, add MMC_CAP_SDIO_IRQ to the default host caps. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: sdhci-iproc: fix oops in sdhci_iproc_writewDmitry Torokhov1-1/+1
The driver co-allocates sdhci_iproc_host with sdhci_pltfm_host and so to access it we need to use sdhci_pltfm_priv() and not pltfm_host->priv. Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: sdhci: fix card presence logic in sdhci_request functionScott Branden1-17/+3
The sdhci_request function should consider a non-removable device always present. Call the correct logic already available in sdhci_do_get_cd function. This fixes some logic paths where MMC requests are being made to non-removable devices that do not have the card detect pin connected on the hardware as it is non-removable. Signed-off-by: Scott Branden <sbranden@broadcom.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: sdhci-spear: Remove exported headerUlf Hansson1-26/+9
Move the member for card_int_gpio into the struct spear_sdhci. In this way we eliminate the last user of the struct sdhci_plat_data, which enables us to remove the exported header for sdhci-spear. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: sdhci-spear: Simplify by adding build dependency to CONFIG_OFUlf Hansson2-16/+5
This driver is used on SoCs which are using CONFIG_OF. By adding a compile dependency in the Kconfig, it enables us to simplify some code. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: sdhci: Remove the sdhci exported header fileUlf Hansson2-2/+202
Since there no users of the struct sdhci_host, but the shdci host drivers themselves, let's move the definition of it to the local sdhci header. The exported sdhci header then becomes empty, so let's remove it. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: sdhci-pltfm: remove the unneeded check of disabled deviceKevin Hao1-28/+26
Since commit cd1e65044d44 ("of/device: Don't register disabled devices"), the disabled device will not be registered at all. So we don't need to do the check again in the platform device driver. And the check in the current code is useless even if we really run into a disabled device. In this case, it just doesn't parse the dtb for the infos such as quirks or clock, but it will continue to try to init the disabled device after that check. So just remove it. Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: tegra: Optimize write_w path for tegra114 and laterRhyland Klein1-21/+26
Setup a different set of sdhci_ops for tegra114 and later so that the write_w callback is only used on tegra114. This allows us to remove the NVQUIRK_SHADOW_XFER_MODE_REG and simply the logic in tegra_sdhci_writew. Suggested-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Rhyland Klein <rklein@nvidia.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: sh_mmcif: Add exclusion between cmd and interruptKouichi Tomita1-1/+10
A command end interrupt should not be processed between command issue and setting of wait_for flag. It expects already the flag to be set. Therefore the exclusive control was added. Signed-off-by: Kouichi Tomita <kouichi.tomita.yn@renesas.com> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: sh_mmcif: Move dev_err() of mmcif_timeout_work()Kouichi Tomita1-3/+3
If interruption of command already occurred, mrq pointer in dev_err() would refer to NULL, because the host-state is changed to STATE_IDLE and mrq pointer is changed to NULL by interrupt handler. Therefore dev_err is moved after checking STATE_IDLE. Signed-off-by: Kouichi Tomita <kouichi.tomita.yn@renesas.com> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: Fix hardware dependencies for sdhci-pxav3Jean Delvare1-1/+1
It was brought to my attention that the sdhci-pxav3 driver is needed on a few more ARM machines than I initially thought. Add the missing architectures to the dependency list. Credits to Peter Robinson for noticing my mistake and reporting. Reported-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Chris Ball <chris@printf.net> Cc: Ulf Hansson <ulf.hansson@linaro.org> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: sunxi: avoid invalid pointer calculationArnd Bergmann1-2/+3
The sunxi mmc driver tries to calculate a dma address by using pointer arithmetic, which causes a warning when dma_addr_t is wider than a pointer: drivers/mmc/host/sunxi-mmc.c: In function 'sunxi_mmc_init_idma_des': drivers/mmc/host/sunxi-mmc.c:296:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] struct sunxi_idma_des *pdes_pa = (struct sunxi_idma_des *)host->sg_dma; ^ To avoid this warning and to simplify the logic, this changes the code to avoid the cast and calculate the correct address manually. The behavior should be unchanged. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: David Lanzendörfer <david.lanzendoerfer@o2s.ch> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-03-23mmc: kconfig: replace PPC_OF with PPCKevin Hao1-2/+2
The PPC_OF is a ppc specific option which is used to mean that the firmware device tree access functions are available. Since all the ppc platforms have a device tree, it is aways set to 'y' for ppc. So it makes no sense to keep a such option in the current kernel. Replace it with PPC. Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>