Commit Graph

397690 Commits

Author SHA1 Message Date
Ulf Hansson
cbac2e5201 mmc: core: Handle card shutdown from mmc_bus
Considering shutdown of the card, the responsibility to initate this
sequence shall be driven from the mmc_bus.

This patch enables the mmc_bus to handle this sequence properly. A new
.shutdown callback is added in the mmc_driver struct which is used to
shutdown the blk device.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 13:07:45 +08:00
Ulf Hansson
aec2327ed0 mmc: core: Initiate suspend|resume from mmc bus instead of mmc host
The host should be responsible to suspend|resume the host and not the
card. This patch changes this behaviour, by moving the responsiblity
to the mmc bus instead which already holds the card device.

The exported functions mmc_suspend|resume_host are now to be considered
as depcrecated. Once all host drivers moves away from using them, we
can remove them. As of now, a successful error code is always returned.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>

Conflicts:
	drivers/mmc/core/core.c
2014-03-07 13:07:41 +08:00
Ulf Hansson
8acf2c95af mmc: core: Push common suspend|resume code into each bus_ops
By moving code from the mmc_suspend|resume_host down into each
.suspend|resume bus_ops callback, we get a more flexible solution.

Some nice side effects are that we get a better understanding of each
bus_ops suspend|resume sequence and the common code don't have to take
care of specific corner cases, especially for the SDIO case.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>

Conflicts:
	drivers/mmc/core/core.c
	drivers/mmc/core/sd.c
2014-03-07 13:03:43 +08:00
Ulf Hansson
cf46d24117 mmc: core: Validate suspend prerequisites for SDIO at SUSPEND_PREPARE
This patch moves the validation for all the suspend prerequisites to be
done at SUSPEND_PREPARE notification. Previously in the SDIO case parts
of the validation was done from mmc_suspend_host.

This patch invents a new pre_suspend bus_ops callback and implements it
for SDIO. Returning an error code from it, will mean at SUSPEND_PREPARE
notification, the card will be removed before proceeding with the
suspend sequence.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 12:55:04 +08:00
Ulf Hansson
0bdc9d6ec0 mmc: core: Remove unnecessary check for the remove callback
For every bus_ops type the .remove callback always exist, thus there
are no need to check the existence of it, before we decide to call it.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 12:54:56 +08:00
Yuvaraj Kumar C D
e79fc06ce7 mmc: core: Update the ext-csd.rev check for eMMC5.1
With the new eMMC5.1 spec, there is a new EXT_CSD register with
the revision number(EXT_CSD_REV) 7. This patch updates the check
for ext-csd.rev number as 7.

Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 12:54:45 +08:00
Simon Baatz
3a392c1df3 mmc: return mmc_of_parse() errors to caller
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 <gmbnomis@gmail.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 12:53:48 +08:00
Rafael J. Wysocki
e83e9aef51 PM / Runtime: Rework the "runtime idle" helper routine
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 <mika.westerberg@linux.intel.com>
Tested-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Kevin Hilman <khilman@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
2014-03-07 12:52:24 +08:00
Fredrik Soderstedt
65cdca4472 mmc: core: Fix select power class after resume
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 <fredrik.soderstedt@stericsson.com>
Reviewed-by: Johan Rudholm <jrudholm@gmail.com>
Acked By: Girish K S <girish.shivananjappa@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 12:48:57 +08:00
Ulf Hansson
d7b8a89726 mmc: core: Restructure and simplify code for mmc sleep|awake
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 <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 12:48:03 +08:00
Ulf Hansson
0a82e11529 mmc: core: Support aggressive power management for (e)MMC/SD
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 <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 12:46:23 +08:00
Ulf Hansson
22c6d9771f mmc: block: Enable runtime pm for mmc blkdevice
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 <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 12:45:16 +08:00
Ulf Hansson
32c59bface mmc: core: Add bus_ops for runtime pm callbacks
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 <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 12:43:10 +08:00
Ulf Hansson
1cdf166111 mmc: core: Stop bkops for eMMC only from mmc suspend
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 <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 12:42:10 +08:00
Maya Erez
cac3fcee6f mmc: card: Adding support for sanitize in eMMC 4.5
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 <ygardi@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>

Conflicts:
	drivers/mmc/card/block.c
2014-03-07 12:40:27 +08:00
Ulf Hansson
59d3e81209 mmc: core: Re-use code for MMC_CAP2_DETECT_ON_ERR in polling mode
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 <ulf.hansson@linaro.org>
Reviewed-by: Kevin Liu <kliu5@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 12:28:15 +08:00
Fredrik Soderstedt
6ed94c6e1b mmc: core: Only execute tuning for SDR50 and SDR104
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 <fredrik.soderstedt@stericsson.com>
Acked-by: Johan Rudholm <jrudholm@gmail.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
2014-03-07 10:56:04 +08:00
hwg
284bbb1201 support 3188 vmac 2014-03-07 09:13:02 +08:00
ljf
6d8f4c6201 upload vcodec (vpu and hevc) service driver 2014-03-06 20:27:30 +08:00
ljf
97632dedc7 upload iep driver for linux kernel 3.10 2014-03-06 20:14:38 +08:00
zsq
61072dd4e2 fix rga copy DMA_buf error 2014-03-06 17:54:57 +08:00
zsq
0139668219 rga2 on rk3288 FPGA is valid 2014-03-06 17:35:38 +08:00
xbw
8d3e94e2e9 SDMMC: complete submission rk_sdmmc debug function 2014-03-06 17:26:40 +08:00
zyk
154cd6f739 rk3188 tp: ct365 2014-03-06 16:13:08 +08:00
zwl
b0478573cf HDMI: add dt node at rk3288.dtsi and add HDMI config 2014-03-06 14:24:21 +08:00
wlf
9fbc91f34d USB: change FSG_BUFLEN from 16KB to 64KB in order to increase copy-speed 2014-03-06 14:06:01 +08:00
wlf
33bcfb9ce4 USB: support development tool to do reboot loader 2014-03-06 14:00:21 +08:00
zwl
8244d0b013 HDMI: implement function at rk3288_hdmi.c and fix some code error 2014-03-06 11:57:41 +08:00
yxj
58f19df659 porting tp ct36x to linux3.10 2014-03-06 11:47:38 +08:00
yxj
7aefc71b17 rk32 edp:add bist/hw link traing support 2014-03-06 11:47:38 +08:00
yxj
cc0f8133d2 dts: rk3188-lrl097: pwm backlight fix 2014-03-06 11:47:38 +08:00
yxj
bede187814 edp anx6345: add dpcd&edid read support 2014-03-06 11:47:37 +08:00
CMY
b39b67de2e rk: ion: to view the CMA heap debug information through bitmap 2014-03-06 11:08:26 +08:00
qjb
218f41bded audio codec : add support compile all audio codec (omission rt5631) 2014-03-06 11:01:23 +08:00
qjb
ef6dfe3932 audio codec : add support compile all audio codec 2014-03-06 10:57:14 +08:00
陈金泉
6ed71bab97 Audio: add codec-of-node and cpu-of-node, delete CODEC_NAME_CMP, codec-name, cpu-dai-name 2014-03-06 10:48:47 +08:00
zsq
8b7d13ec16 del rga disable status 2014-03-06 09:24:35 +08:00
lintao
b4233bd82a dts: add mshc@rk3288.dtsi 2014-03-06 08:30:51 +08:00
guoyi
a1fb7ec11a fix sensors include file err 2014-03-05 18:14:22 +08:00
guoyi
af2d9a0801 porting sensor-dev to 3.10 2014-03-05 18:14:22 +08:00
xbw
6c5210f314 SDMMC: complete submission for IDMA. With reading and writing to verify IDMA, no exception occurs. 2014-03-05 17:53:16 +08:00
xbw
0c421031e2 SDMMC: define the debug log 2014-03-05 17:46:31 +08:00
xbw
fd4cecf962 SDMMC: set the init-clock to 200Khz. 2014-03-05 17:46:31 +08:00
zsq
5ce4ab4254 add rga support for dma buf 2014-03-05 17:43:31 +08:00
zsq
9813a63cad fix rga 3288 dts interp error 2014-03-05 17:32:07 +08:00
qjb
38d93ad16e update i2s spdif dts 2014-03-05 17:23:49 +08:00
qjb
392a497fe0 sound soc-core:codec_name not adapted i2c_name
change i2s id
2014-03-05 16:43:58 +08:00
wlf
05427aa0c9 USB: add gadget_connected and fsg.luns[1] for usb gadget 2014-03-05 15:48:45 +08:00
wdc
ba3e311651 key: add rk_send_wakeup_key function 2014-03-05 14:07:48 +08:00
xbw
c45ce17457 SDMMC: guarantee stop-abort cmd in data errors
In error cases, DTO interrupt may or may not be generated depending
    on remained data. Stop/Abort command ensures DTO generation for that
    situation. Currently if 'stop' field of data is empty, there is no
    stop/abort command. So, it could hang waiting DTO. This change
    reinforces these cases.
2014-03-05 13:55:14 +08:00