Re: [PATCH 0/4] mmc: tmio / sdhi: support multiple IRQs

2011-05-06 Thread Simon Horman
On Fri, May 06, 2011 at 01:02:30PM +0200, Guennadi Liakhovetski wrote: > This is just a rebase of patches from Magnus, based on earlier patches by > Simon, on top of my PM patch from yesterday [1] with some minor > improvements. Now all three of us have posted versions of this series :^) Review

Re: [PATCH v4] mmc: add runtime and system power-management support to the MMCIF driver

2011-05-06 Thread Rafael J. Wysocki
On Friday, May 06, 2011, Guennadi Liakhovetski wrote: > On Thu, 5 May 2011, Rafael J. Wysocki wrote: > > > On Thursday, May 05, 2011, Guennadi Liakhovetski wrote: > > > Adding support for runtime power-management to the MMCIF driver allows > > > it to save power as long as no card is present. To a

Re: [PATCH v2 4/4] mmc_spi.c: add support for the regulator framework

2011-05-06 Thread Antonio Ospite
On Fri, 22 Apr 2011 14:43:11 +0200 Antonio Ospite wrote: > Add support for powering up SD cards driven by regulators. > This makes the mmc_spi driver work also with the Motorola A910 phone. > > Signed-off-by: Antonio Ospite > --- > > Changes since v1: > - Remove the ifdef CONFIG_REGULATOR as

Re: [PATCH V2 16/16] mmc: omap_hsmmc: add a hardware reset before initialization

2011-05-06 Thread Varadarajan, Charulatha
Hi, On Fri, May 6, 2011 at 14:44, Adrian Hunter wrote: > After a warm restart, an eMMC which cannot be powered off is > in an unknown state, so reset it to be sure it will initialize. > > Signed-off-by: Adrian Hunter > --- >  drivers/mmc/host/omap_hsmmc.c |   38 +

Re: [PATCH V2 04/16] mmc: omap_hsmmc: reduce a bit the error handlers in probe()

2011-05-06 Thread Andy Shevchenko
On Fri, May 6, 2011 at 2:34 PM, Varadarajan, Charulatha wrote: > On Fri, May 6, 2011 at 14:44, Adrian Hunter wrote: >> From: Andy Shevchenko >> > > Add patch description here. You mean something like following: "The code contains similarities in the error path of probe function. Let's combine th

Re: [PATCH V2 04/16] mmc: omap_hsmmc: reduce a bit the error handlers in probe()

2011-05-06 Thread Varadarajan, Charulatha
On Fri, May 6, 2011 at 14:44, Adrian Hunter wrote: > From: Andy Shevchenko > Add patch description here. > Signed-off-by: Andy Shevchenko > Signed-off-by: Adrian Hunter > --- >  drivers/mmc/host/omap_hsmmc.c |   17 ++--- >  1 files changed, 6 insertions(+), 11 deletions(-) > <> -

[PATCH 4/4] mmc: sdhi: support up to 3 interrupt sources

2011-05-06 Thread Guennadi Liakhovetski
From: Magnus Damm Convert the SDHI code to support more than a single interrupt source. Needed to support hardware that uses GIC instead of INTC as interrupt controller. Will also allow us to remove the irq forwarding workaround from the INTC code in the future. Signed-off-by: Simon Horman Sig

[PATCH 3/4] mmc: sdhi: print out something useful

2011-05-06 Thread Guennadi Liakhovetski
From: Magnus Damm Instead of printing out useless information such as the virtual base address and one of 4 interrupts, convert the SDHI probe() to print out physical base address together with clock rate. We do have a struct device so make use of dev_info(). Signed-off-by: Magnus Damm Signed-

[PATCH 0/4] mmc: tmio / sdhi: support multiple IRQs

2011-05-06 Thread Guennadi Liakhovetski
This is just a rebase of patches from Magnus, based on earlier patches by Simon, on top of my PM patch from yesterday [1] with some minor improvements. Thanks Guennadi [1] http://article.gmane.org/gmane.linux.kernel.mmc/7836 --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Devel

[PATCH 2/4] mmc: sdhi: no need for special interrupt flags

2011-05-06 Thread Guennadi Liakhovetski
From: Magnus Damm Modify the SDHI driver to get rid of unwanted irq flags. IRQF_DISABLED unused, see include/linux/interrupt.h IRQF_TRIGGER_FALLING only relevant on external IRQ pins, but since SDHI is internal in the SoC this can go away. Needed to support SDHI on sh73a0 that comes with a GIC

[PATCH 1/4] mmc: tmio / sdhi: break out interrupt request/free

2011-05-06 Thread Guennadi Liakhovetski
From: Magnus Damm Move request_irq()/free_irq() from the shared code in tmio_mmc.c into the SDHI/tmio specific portion in sh_mobile_sdhi.c and tmio_mmc_pio.c. This is ground work to allow us to adjust the SDHI code with IRQ flags and number of interupt sources. Signed-off-by: Magnus Damm Signe

Re: [PATCH v4 05/15] mmc: sd: add support for uhs bus speed mode selection

2011-05-06 Thread zhangfei gao
On Thu, May 5, 2011 at 2:49 AM, Arindam Nath wrote: > This patch adds support for setting UHS-I bus speed mode during UHS-I > initialization procedure. Since both the host and card can support > more than one bus speed, we select the highest speed based on both of > their capabilities. First we se

Re: [PATCH v4 11/15] mmc: sdhci: add support for retuning mode 1

2011-05-06 Thread zhangfei gao
On Thu, May 5, 2011 at 2:49 AM, Arindam Nath wrote: > Host Controller v3.00 can support retuning modes 1,2 or 3 depending on > the bits 46-47 of the Capabilities register. Also, the timer count for > retuning is indicated by bits 40-43 of the same register. We initialize > timer_list for retuning

Re: [PATCH v4 10/15] mmc: sdhci: add support for programmable clock mode

2011-05-06 Thread zhangfei gao
On Thu, May 5, 2011 at 2:49 AM, Arindam Nath wrote: > Host Controller v3.00 supports programmable clock mode as an optional > feature. The support for this mode is indicated by non-zero value in > bits 48-55 of the Capabilities register. If supported, the actual > value of Clock Multiplier is one

Re: [PATCH v4 09/15] mmc: sdhci: enable preset value after uhs initialization

2011-05-06 Thread zhangfei gao
On Thu, May 5, 2011 at 2:49 AM, Arindam Nath wrote: > According to the Host Controller spec v3.00, setting Preset Value Enable > in the Host Control2 register lets SDCLK Frequency Select, Clock Generator > Select and Driver Strength Select to be set automatically by the Host > Controller based on

Re: [PATCH v4 08/15] mmc: sd: add support for tuning during uhs initialization

2011-05-06 Thread zhangfei gao
On Thu, May 5, 2011 at 2:49 AM, Arindam Nath wrote: > Host Controller needs tuning during initialization to operate SDR50 > and SDR104 UHS-I cards. Whether SDR50 mode actually needs tuning is > indicated by bit 45 of the Host Controller Capabilities register. > A new command CMD19 has been defined

Re: [PATCH v4 07/15] mmc: sd: report correct speed and capacity of uhs cards

2011-05-06 Thread zhangfei gao
On Thu, May 5, 2011 at 2:49 AM, Arindam Nath wrote: > Since only UHS-I cards respond with S18A set in response to ACMD41, > we set the card as ultra-high-speed after successfull initialization. > We need to decide whether a card is SDXC based on the C_SIZE field > of CSDv2.0 register. According to

Re: [PATCH v4 06/15] mmc: sd: set current limit for uhs cards

2011-05-06 Thread zhangfei gao
On Thu, May 5, 2011 at 2:49 AM, Arindam Nath wrote: > We decide on the current limit to be set for the card based on the > Capability of Host Controller to provide current at 1.8V signalling, > and the maximum current limit of the card as indicated by CMD6 > mode 0. We then set the current limit f

Re: [PATCH v4 04/15] mmc: sdhci: reset sdclk before setting high speed enable

2011-05-06 Thread zhangfei gao
On Thu, May 5, 2011 at 2:49 AM, Arindam Nath wrote: > As per Host Controller spec v3.00, we reset SDCLK before setting > High Speed Enable, and then set it back to avoid generating clock > gliches. Before enabling SDCLK again, we make sure the clock is > stable, so we use sdhci_set_clock(). > > Si

Re: [PATCH v4 03/15] mmc: sd: add support for driver type selection

2011-05-06 Thread zhangfei gao
On Thu, May 5, 2011 at 2:48 AM, Arindam Nath wrote: > This patch adds support for setting driver strength during UHS-I > initialization prcedure. Since UHS-I cards set S18A (bit 24) in > response to ACMD41, we use this as a base for UHS-I initialization. > We modify the parameter list of mmc_sd_ge

Re: [PATCH v4 02/15] mmc: sd: query function modes for uhs cards

2011-05-06 Thread zhangfei gao
On Thu, May 5, 2011 at 2:48 AM, Arindam Nath wrote: > SD cards which conform to Physical Layer Spec v3.01 can support > additional Bus Speed Modes, Driver Strength, and Current Limit > other than the default values. We use CMD6 mode 0 to read these > additional card functions. The values read here

Re: [PATCH v4 01/15] mmc: sd: add support for signal voltage switch procedure

2011-05-06 Thread zhangfei gao
On Thu, May 5, 2011 at 2:48 AM, Arindam Nath wrote: > Host Controller v3.00 adds another Capabilities register. Apart > from other things, this new register indicates whether the Host > Controller supports SDR50, SDR104, and DDR50 UHS-I modes. The spec > doesn't mention about explicit support for

[PATCH] mmc: fixed wrong SD card detection

2011-05-06 Thread Jaehoon Chung
This patch added mmc_power_off after mmc_attach_sd() i found that didn't detect the second card insert.(using SDHCI) you can see the below log. i want to know that somebody know this issue... ->first card inserted (correct card detect) # mmc1: new SDHC card at address e624 mmcblk1: mmc1:e624 SU0

[PATCH V2 14/16] mmc: omap_hsmmc: adjust host controller clock in regard to current OPP

2011-05-06 Thread Adrian Hunter
From: Andy Shevchenko We should like to adjust MMC host controller clock whenever the OPP is changed. OPP affects to L3/L4 bus frequency. Due to this we update the maximum frequency limits before each upcoming request and when the divisor is calculated. Signed-off-by: Andy Shevchenko Signed-off

[PATCH V2 16/16] mmc: omap_hsmmc: add a hardware reset before initialization

2011-05-06 Thread Adrian Hunter
After a warm restart, an eMMC which cannot be powered off is in an unknown state, so reset it to be sure it will initialize. Signed-off-by: Adrian Hunter --- drivers/mmc/host/omap_hsmmc.c | 38 +- 1 files changed, 37 insertions(+), 1 deletions(-) diff --git

[PATCH V2 13/16] OMAP: hsmmc: implement clock switcher

2011-05-06 Thread Adrian Hunter
From: Andy Shevchenko There are 3 new platform data methods which should help us to do a clock switching when notification is happened or request is started. The purpose of the patch is to avoid high frequency of MMC controller on low OPPs due to an HW bug in OMAP 3630. The algorithm: - the PM

[PATCH V2 08/16] mmc: omap_hsmmc: split same pieces of code to separate functions

2011-05-06 Thread Adrian Hunter
From: Andy Shevchenko There are few places with the same functionality. This patch creates two functions omap_hsmmc_set_bus_width() and omap_hsmmc_set_bus_mode() to do the job. Signed-off-by: Andy Shevchenko Signed-off-by: Adrian Hunter --- drivers/mmc/host/omap_hsmmc.c | 85 +++

[PATCH V2 09/16] OMAP: hsmmc: Do not mux the slot if non default muxing is already done

2011-05-06 Thread Adrian Hunter
From: Jarkko Lavinen Allow the bootloader do all the muxing. Signed-off-by: Jarkko Lavinen Signed-off-by: Adrian Hunter --- arch/arm/mach-omap2/hsmmc.c |3 ++- arch/arm/mach-omap2/hsmmc.h |1 + 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/hsmmc.c

[PATCH V2 03/16] mmc: omap_hsmmc: move hardcoded frequency constants to definition block

2011-05-06 Thread Adrian Hunter
From: Andy Shevchenko Move the min and max frequency constants to the definition block in the source file. Signed-off-by: Andy Shevchenko Signed-off-by: Adrian Hunter --- drivers/mmc/host/omap_hsmmc.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/ho

[PATCH V2 15/16] OMAP: hsmmc: add platform data for eMMC hardware reset gpio

2011-05-06 Thread Adrian Hunter
eMMC may have a hardware reset line connected to a gpio, so pass it to the driver. Signed-off-by: Adrian Hunter --- arch/arm/mach-omap2/hsmmc.c |5 + arch/arm/mach-omap2/hsmmc.h |1 + arch/arm/plat-omap/include/plat/mmc.h |1 + 3 files changed, 7 insertions(+)

[PATCH V2 01/16] mmc: omap_hsmmc: fix missing mmc_release_host() in no_off case

2011-05-06 Thread Adrian Hunter
From: Sudhir Bera In fact the no_off check here will not be hit because 'omap_hsmmc_disabled_to_sleep()' won't schedule a deeper disable in the no_off case. Signed-off-by: Sudhir Bera Signed-off-by: Adrian Hunter --- drivers/mmc/host/omap_hsmmc.c | 10 -- 1 files changed, 4 insertio

[PATCH V2 02/16] mmc: omap_hsmmc: correct debug report error status mnemonics

2011-05-06 Thread Adrian Hunter
CERR and BADA were in the wrong place and there are only 32 not 35. Signed-off-by: Adrian Hunter Reviewed-by: Venkatraman S --- drivers/mmc/host/omap_hsmmc.c | 19 +++ 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/h

[PATCH V2 00/16] omap_hsmmc patches

2011-05-06 Thread Adrian Hunter
Hi Here is V2 of some patches for omap_hsmmc. Changes in V2: OMAP: sDMA: descriptor autoloading feature - removed the feature entirely as per Tony Lindgren mmc: omap_hsmmc: fix few bugs when set the clock divisor - added cpu_relax() as per Grazvyd

[PATCH V2 06/16] mmc: omap_hsmmc: introduce start_clock and re-use stop_clock

2011-05-06 Thread Adrian Hunter
From: Andy Shevchenko There is similar piece of code in two functions which enables clock. Split this code to omap_hsmmc_start_clock(). Re-use omap_hsmmc_stop_clock() in omap_hsmmc_context_restore() as well. Signed-off-by: Andy Shevchenko Signed-off-by: Adrian Hunter --- drivers/mmc/host/omap

[PATCH V2 05/16] mmc: omap_hsmmc: split duplicate code to calc_divisor() function

2011-05-06 Thread Adrian Hunter
From: Andy Shevchenko There are two places where the same calculations are done. Let's split them to separate function. In addition the new function is simplified by usage DIV_ROUND_UP kernel macro. Signed-off-by: Andy Shevchenko Signed-off-by: Adrian Hunter --- drivers/mmc/host/omap_hsmmc.c

[PATCH V2 07/16] mmc: omap_hsmmc: fix few bugs when set the clock divisor

2011-05-06 Thread Adrian Hunter
From: Andy Shevchenko There are two pieces of code which similar, but not the same. Each of them contains a bug. The SYSCTL register should be read before write in the omap_hsmmc_context_restore() to remain the state of the reserved bits. Before set the clock divisor and DTO bits the value from

[PATCH V2 12/16] mmc: omap_hsmmc: fix oops in omap_hsmmc_dma_cb

2011-05-06 Thread Adrian Hunter
In the case of an I/O error, the DMA will have been cleaned up in the MMC interrupt and the request structure pointer will be null. In that case, it is essential to check if the DMA DMA is over before dereferencing host->mrq->data. Oops as follows: <3>[ 2293.695281] wl1271: ERROR sdio read faile

[PATCH V2 10/16] OMAP: board-rm680: set MMC nomux flag

2011-05-06 Thread Adrian Hunter
Let the bootloader do all the pad configuration. Signed-off-by: Adrian Hunter --- arch/arm/mach-omap2/board-rm680.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c index 42d10b1..c4e821f 100644 --- a/

[PATCH V2 11/16] mmc: omap_hsmmc: ensure pbias configuration is always done

2011-05-06 Thread Adrian Hunter
Go through the driver's set_power() functions rather than calling regulator_enable/disable() directly because otherwise pbias configuration for MMC1 is not done. Signed-off-by: Adrian Hunter --- drivers/mmc/host/omap_hsmmc.c | 17 - 1 files changed, 8 insertions(+), 9 deletions

[PATCH V2 04/16] mmc: omap_hsmmc: reduce a bit the error handlers in probe()

2011-05-06 Thread Adrian Hunter
From: Andy Shevchenko Signed-off-by: Andy Shevchenko Signed-off-by: Adrian Hunter --- drivers/mmc/host/omap_hsmmc.c | 17 ++--- 1 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index c8aab47..3121293 100

Re: [PATCH v4] mmc: add runtime and system power-management support to the MMCIF driver

2011-05-06 Thread Guennadi Liakhovetski
On Thu, 5 May 2011, Rafael J. Wysocki wrote: > On Thursday, May 05, 2011, Guennadi Liakhovetski wrote: > > Adding support for runtime power-management to the MMCIF driver allows > > it to save power as long as no card is present. To also allow to turn > > off the power domain at that time, we rele

Re: [PATCH v2 7/7] ARM: mxc: remove esdhc.h and use the public one

2011-05-06 Thread Uwe Kleine-König
Hello Shawn, On Thu, May 05, 2011 at 09:22:58PM +0800, Shawn Guo wrote: > Signed-off-by: Shawn Guo > --- > .../plat-mxc/devices/platform-sdhci-esdhc-imx.c|1 - > arch/arm/plat-mxc/include/mach/devices-common.h|2 +- what about removing arch/arm/plat-mxc/include/mach/esdhc.h in thi

Re: [PATCH 08/22] mmc: omap_hsmmc: correct debug report error status mnemonics

2011-05-06 Thread S, Venkatraman
On Thu, May 5, 2011 at 5:21 PM, Adrian Hunter wrote: > CERR and BADA were in the wrong place and there are only > 32 not 35. > > Signed-off-by: Adrian Hunter > --- >  drivers/mmc/host/omap_hsmmc.c |   19 +++ >  1 files changed, 11 insertions(+), 8 deletions(-) > > diff --git a/dri