Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Simon Baatz <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Signed-off-by: Simon Baatz <[email protected]>
Acked-by: Guennadi Liakhovetski <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Signed-off-by: Simon Baatz <[email protected]>
Acked-by: Guennadi Liakhovetski <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
In addition to just logging errors encountered during DT parsing or
allocating GPIO slots for CD/WP, mmc_of_parse() now returns with an error.
In particular, this is needed if the GPIO allocation may return
EPROBE_DEFER.
Signed-off-by: Simon Baatz <[email protected]>
Reviewed-by: Ulf Hansson <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
In preparation to switching the jz4740 clk driver to the
common clk framework, update the clk enable/disable calls
to clk_prepare_enable/clk_disable_unprepare.
Signed-off-by: Lars-Peter Clausen <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Add calls to clk_prepare and unprepare so that MSM can migrate to
the common clock framework.
Cc: Chris Ball <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Signed-off-by: David Brown <[email protected]>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/soc
From Sekhar Nori:
DaVinci SoC changes for v3.11
This pull request moves DaVinci EDMA library to
arch/arm/common so it can be used by OMAP based AM335x.
This is a temporary step until all drivers are converted
to use the dmaengine driver in drivers/dma/edma.c.
Several drivers like SPI, MMC/SD have already been converted.
Some like audio are pending.
The other two patches in the pull request are cleanup in nature.
* tag 'davinci-for-v3.11/soc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
ARM: edma: remove unused transfer controller handlers
ARM: davinci: move private EDMA API to arm/common
ARM: davinci: remove __init atrribute from function declaration
Signed-off-by: Arnd Bergmann <[email protected]>
|
|
Move mach-davinci/dma.c to common/edma.c so it can be used
by OMAP (specifically AM33xx) as well.
Signed-off-by: Matt Porter <[email protected]>
Acked-by: Chris Ball <[email protected]> # davinci_mmc.c
Acked-by: Mark Brown <[email protected]>
Acked-by: Olof Johansson <[email protected]>
[[email protected]: dropped davinci sffsdr changes]
Signed-off-by: Sekhar Nori <[email protected]>
|
|
This fixes two reported problems:
1. after a system resume the controller isn't functioning until a command
runs on a timeout and a controller reset is performed.
2. if a card is ejected during a running write operation, its re-insertion
isn't detected.
Reported-by: Nguyen Viet Dung <[email protected]>
Reported-by: Nguyen Hong Ky <[email protected]>
Signed-off-by: Guennadi Liakhovetski <[email protected]>
Tested-by: Nguyen Viet Dung <[email protected]>
Tested-by: Nguyen Hong Ky <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
With MMC clock gating enabled the MMC core currently calls MMC host driver's
.set_ios() method with .power_mode == MMC_POWER_ON and the clock value set
either to 0 or to the target rate. The tmio MMC driver then wrongly
translates the latter calls to card slot power-on requests, even when the
slot already was on. This patch fixes the driver to avoid needlessly
incrementing power-supplying regulator's use count.
Signed-off-by: Guennadi Liakhovetski <[email protected]>
Tested-by: Laurent Pinchart <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Masking events on MMCIF means that an occurrence of the masked event
won't raise an interrupt, but the event bit will still be set in the
interrupt status register. If simultaneously a different event occurs
which was enabled, both flags will be set. However, only the unmasked
event bit should be cleared in the status register in such a case.
Clearing also the masked bit can lead to lost interrupts, which indeed
can be observed on the armadillo800eva r8a7740 board with an eMMC chip.
The problem has been introduced by the recent "mmc: sh_mmcif: simplify
IRQ processing" patch. Fix the problem by only clearing enabled interrupts.
Signed-off-by: Guennadi Liakhovetski <[email protected]>
Tested-by: Nguyen Viet Dung <[email protected]>
Tested-by: Kuninori Morimoto <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
When resuming, the tmio_mmc_host_resume() function is run when the
controller might still be powered down. Issuing a reset command to it at
that time has no effect. This patch postpones resetting the controller
until the first powering-up .set_ios() call.
Reported-by: Nguyen Viet Dung <[email protected]>
Signed-off-by: Guennadi Liakhovetski <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
The "runtime idle" helper routine, rpm_idle(), currently ignores
return values from .runtime_idle() callbacks executed by it.
However, it turns out that many subsystems use
pm_generic_runtime_idle() which checks the return value of the
driver's callback and executes pm_runtime_suspend() for the device
unless that value is not 0. If that logic is moved to rpm_idle()
instead, pm_generic_runtime_idle() can be dropped and its users
will not need any .runtime_idle() callbacks any more.
Moreover, the PCI, SCSI, and SATA subsystems' .runtime_idle()
routines, pci_pm_runtime_idle(), scsi_runtime_idle(), and
ata_port_runtime_idle(), respectively, as well as a few drivers'
ones may be simplified if rpm_idle() calls rpm_suspend() after 0 has
been returned by the .runtime_idle() callback executed by it.
To reduce overall code bloat, make the changes described above.
Tested-by: Mika Westerberg <[email protected]>
Tested-by: Kevin Hilman <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Acked-by: Kevin Hilman <[email protected]>
Reviewed-by: Ulf Hansson <[email protected]>
Acked-by: Alan Stern <[email protected]>
|
|
Add a param to allow users of sdhci_pltfm to allocate private space
in calls to sdhci_pltfm_init+sdhci_pltfm_register. This is implemented
in the same way as sdhci does for its users.
None of the users have been migrated yet and are passing in zero to
retain their private allocation.
- todo: migrate clients to using allocation this way
- todo: remove priv variable once migration is complete
Also removed unused variable in sdhci_pltfm_init fn
Signed-off-by: Christian Daudt <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Reviewed-by: Ulf Hansson <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Add support for runtime PM for BYT SD cards.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Enable runtime PM for ACPI HID 80860F14 SD cards, adding support for
card detect GPIO.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
If card power is dependent on SD bus power then the host controller
must not be runtime suspended while the card is powered up. Add
the ability to stay runtime-resumed in that case and enable it with a new
quirk SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
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 <[email protected]>
Acked-by: Sonic Zhang <[email protected]>
Acked-by: Seungwon Jeon <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Acked-by: Haojian Zhuang <[email protected]>
Acked-by: Jaehoon Chung <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Acked-by: Tony Prisk <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Signed-off-by: Al Cooper <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following
build warning when CONFIG_PM_SLEEP is not selected. This is because
sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when
the CONFIG_PM_SLEEP is enabled.
drivers/mmc/host/atmel-mci.c:2509:12: warning: 'atmci_suspend' defined but not used [-Wunused-function]
drivers/mmc/host/atmel-mci.c:2539:12: warning: 'atmci_resume' defined but not used [-Wunused-function]
Signed-off-by: Jingoo Han <[email protected]>
Acked-by: Ludovic Desroches <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Add support for initialising DMA from the Device Tree.
Signed-off-by: Guennadi Liakhovetski <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
This removes the deprecated use of the .private member of struct dma_chan
and switches the sdhi / tmio mmc driver to using the
dmaengine_slave_config() channel configuration method.
Signed-off-by: Guennadi Liakhovetski <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
So far only the SDHI implementation uses TMIO MMC with DMA. That way a DMA
channel filter function, defined in the TMIO driver wasn't a problem.
However, such a filter function is DMA controller specific. Since the SDHI
glue is only running on systems with the SHDMA DMA controller, the filter
function can safely be provided by it. Move it into SDHI.
Signed-off-by: Guennadi Liakhovetski <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
If pending interrupt for IDMAC exists when initialize IDMAC, it will
call interrupt handler unnecessarily.
Signed-off-by: Joonyoung Shim <[email protected]>
Acked-by: Seungwon Jeon <[email protected]>
Reviewed-by: Jaehoon Chung <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Use the saved values in card->ext_csd when selecting power class.
By doing this the power class will be selected even if mmc_init_card
is called with oldcard != NULL, which is the case after a suspend/resume.
Today ext_csd is NULL if mmc_init_card is called with oldcard != NULL
and power class will not be selected.
According to the eMMC specification the POWER_CLASS value is reset after
power failure, H/W reset assertion and any CMD0 reset.
Signed-off-by: Fredrik Soderstedt <[email protected]>
Reviewed-by: Johan Rudholm <[email protected]>
Acked By: Girish K S <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
The mmc_card_sleep|awake APIs are not being used since the support is
already properly encapsulated within the suspend sequence. Sleep|awake
command is also specific for eMMC.
We remove the sleep|awake bus_ops, the mmc_card_sleep|awake APIs and
move the code into the mmc specific core instead. This also includes
the mmc ops function, mmc_sleepawake. All releated functions have then
become static and we have got far less code to maintain.
Additionally this patch also simplifies the code from mmc_sleepawake,
since it is only used to put the card to sleep and not awake.
Signed-off-by: Ulf Hansson <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Aggressive power management is suitable when saving power is
essential. At request inactivity timeout, aka pm runtime
autosuspend timeout, the card will be suspended.
Once a new request arrives, the card will be re-initalized and
thus the first request will suffer from a latency. This latency
is card-specific, experiments has shown in general that SD-cards
has quite poor initialization time, around 300ms-1100ms. eMMC is
not surprisingly far better but still a couple of hundreds of ms
has been observed.
Except for the request latency, it is important to know that
suspending the card will also prevent the card from executing
internal house-keeping operations in idle mode. This could mean
degradation in performance.
To use this feature make sure the request inactivity timeout is
chosen carefully. This has not been done as a part of this patch.
Enable this feature by using host cap MMC_CAP_AGGRESSIVE_PM and
by setting CONFIG_MMC_UNSAFE_RESUME.
Signed-off-by: Ulf Hansson <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Once the mmc blkdevice is being probed, runtime pm will be enabled.
By using runtime autosuspend, the power save operations can be done
when request inactivity occurs for a certain time. Right now the
selected timeout value is set to 3 s. Obviously this value will likely
need to be configurable somehow since it needs to be trimmed depending
on the power save algorithm.
For SD-combo cards, we are still leaving the enablement of runtime PM
to the SDIO init sequence since it depends on the capabilities of the
SDIO func driver.
Moreover, when the blk device is being suspended, we make sure the device
will be runtime resumed. The reason for doing this is that we want the
host suspend sequence to be unaware of any runtime power save operations
done for the card in this phase. Thus it can just handle the suspend as
the card is fully powered from a runtime perspective.
Finally, this patch prepares to make it possible to move BKOPS handling
into the runtime callbacks for the mmc bus_ops. Thus IDLE BKOPS can be
accomplished.
Signed-off-by: Ulf Hansson <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
SDIO is the only protocol that uses runtime pm for the card device
right now. To provide the option for sd and mmc to use runtime pm as
well the bus_ops callback are extended with two new functions. One for
runtime_suspend and one for runtime_resume.
This patch will also implement the callbacks for SDIO to make sure
existing functionality is maintained. It also prepares to move
away from using the mmc_power_restore_host API, since it is not
needed when using runtime PM.
Signed-off-by: Ulf Hansson <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Move mmc suspend specific operations to be executed from the .suspend
callback in the mmc bus_ops. This simplifies the mmc_suspend_host
function which is supposed to handle nothing but common suspend tasks.
Since eMMC can be considered non-removable there are no need to check
for ongoing bkops at PM_SUSPEND_PREPARE notification so remove it.
Signed-off-by: Ulf Hansson <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Fix to return -ENODEV in the request dma error case instead
of 0, as done elsewhere in this function.
Signed-off-by: Wei Yongjun <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Fix to return -ENOMEM in alloc workqueue error case instead
of 0, as done elsewhere in this function.
Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: Seungwon Jeon <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
The sanitize support is added as a user-app ioctl call, and
was removed from the block-device request, since its purpose is
to be invoked not via File-System but by a user.
This feature deletes the unmap memory region of the eMMC card,
by writing to a specific register in the EXT_CSD.
unmap region is the memory region that was previously deleted
(by erase, trim or discard operation).
In order to avoid timeout when sanitizing large-scale cards,
the timeout for sanitize operation is 240 seconds.
Signed-off-by: Yaniv Gardi <[email protected]>
Signed-off-by: Maya Erez <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Previously the MMC_CAP2_DETECT_ON_ERR was invented for detecting
slow card removal. In was never a realy good solution and a proper
fix has been merged using gpio debouncing instead. We remove this
cap in this patch.
Although when using polling card detect mode, the code invented for
MMC_CAP2_DETECT_ON_ERR is re-used to complete card removal in an
earlier phase. There are no need waiting for the polling timeout to
elapse in this case.
Signed-off-by: Ulf Hansson <[email protected]>
Reviewed-by: Kevin Liu <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
MMC driver probe will abort for DT case because of failed
platform_get_resource_byname() lookup. Fix it by skipping resource
lookup byname for device tree build.
Issue is hidden because hwmod populates the IO resources which
helps to succeed platform_get_resource_byname() and probe.
Signed-off-by: Santosh Shilimkar <[email protected]>
Signed-off-by: Balaji T K <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Only execute tuning for sd and sdio devices that are using
SDR50 or SDR104.
Make sure clock is hold during tuning for sdio devices.
Signed-off-by: Fredrik Soderstedt <[email protected]>
Acked-by: Johan Rudholm <[email protected]>
Acked-by: Ulf Hansson <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Convert dmaengine channel requests to use
dma_request_slave_channel_compat(). This supports platforms booting
with or without DT populated.
Signed-off-by: Matt Porter <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: Balaji T K <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Otherwise SDIO cards won't necessarily work when booted with
device tree as we will never power down the SDIO cards. This
means the SDIO card reset does not happen which at least some
WLAN controllers expect to happen with ifconfig wlan0 down.
The PBIAS voltage is only available for the first controller
instance, so let's limit the PBIAS workaround to the first
controller only.
Signed-off-by: Tony Lindgren <[email protected]>
Tested-by: Luciano Coelho <[email protected]>
Signed-off-by: Balaji T K <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Add three more PCI device ids.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Add three more ACPI HIDs. Also, as some devices must be
further distinguished by ACPI UID, slot information is now
associated with HID and UID.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Initial runtime pm status is active.
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Use generic DMA DT helper. Platforms booting with or without DT populated
are both supported.
Signed-off-by: Ludovic Desroches <[email protected]>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
The eSDHC controller on the i.MX53 needs an additional, non spec
compliant CMD12 after a multiblock read with a predefined number of
blocks. Otherwise the internal state machine won't go back to the
idle state.
This commit effectively reverts 5b6b0ad6 (mmc: sdhci-esdhc-imx:
fix for mmc cards on i.MX5), which fixed part of the problem by
making multiblock reads work, however this fix was not sufficient
when multi- and singleblock reads got intermixed.
This implements the recommended workaround (Freescale i.MX Reference
Manual, section 29.6.8 "Multi-block Read") by manually sending a
CMD12 with the RSPTYP bits cleared.
Signed-off-by: Lucas Stach <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
Currently SDIO interrupts do not work on i.MX53 and maybe others.
This was observed with a Marvell 8787 based SDIO wifi adapter
using the mwifiex driver and firmware from the Marvell git
repository.
The symptom was a timeout after firmware download.
Observing the SDIO_DAT1 line showed that an interrupt was requested
(level 0) but no interrupt was generated in software, the line
stayed low until a timeout ocurred and the card was reset.
There is a Freescale errata
ENGcm11186 "eSDHC misses SDIO interrupt when CINT is disabled"
The workaround suggested by this errata is already implemented and
involves clearing and then setting the D3CD bit in the host control
register [see esdhc_writel_le()]
However, when esdhc_writeb_le() is later used to write to
SDHCI_HOST_CONTROL it always resets the D3CD bit.
To fix this simply add the D3CD bit to the set of bits
not modified by esdhc_writeb_le().
Signed-off-by: Martin Fuzzey <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
|
|
To verify a signal voltage switch at initialization of UHS cards the
.card_busy callback is used. For some of the ST-variants, card busy
detection on the DAT0 pin is supported.
We extend the variant struct with a busy_detect flag to indicate
support for it. A corresponding busy detect function, which polls the
busy status bit, is then set to the .card_busy callback.
Signed-off-by: Ulf Hansson <[email protected]>
Signed-off-by: Russell King <[email protected]>
|
|
Add a cache variable in the host struct that reflects the current data in
the MMCIDATACTRL register. This patch will not introduce any functional
change but instead provide an easy option to keep specific bits in the
register between each data transfer.
Signed-off-by: Ulf Hansson <[email protected]>
Signed-off-by: Russell King <[email protected]>
|
|
Add .start_signal_voltage_switch callback to be able to support UHS cards.
The voltage switch requires the optional vqmmc regulator to exist since
the actual voltage switch will be performed directly on it.
Signed-off-by: Ulf Hansson <[email protected]>
Signed-off-by: Russell King <[email protected]>
|
|
We can not rely on regulator_is_enabled to decide whether to
enable|disable the regulator. It would mean that the reference
counter for it is not balanced properly.
Instead keep track of our internal state by using a new flag in
the host struct, so we can take correct decisions.
Signed-off-by: Ulf Hansson <[email protected]>
Signed-off-by: Russell King <[email protected]>
|
|
acquired from DT
Currently, if DMA information isn't passed from platform data, then DMA
will not be used. This patch allows DMA information obtained though Device
Tree to be used as well.
Cc: Chris Ball <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
Signed-off-by: Russell King <[email protected]>
|
|
Support added for transmission of CMD23 during multi block read or
write. In order to activate this feature, MMC_CAP_CMD23 flag needs
to be enabled in the capabilities field. Note that CMD23 support is
mandatory to support features like reliable write, data tag, context
ID, packed command.
This patch is based upon a patch from Saugata Das.
Signed-off-by: Ulf Hansson <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Russell King <[email protected]>
|