Re: [PATCH 1/4] mmc: mediatek: Add online-tuning support of EMMC/SD

2015-08-26 Thread Ulf Hansson
On 26 August 2015 at 10:40, Chaotian Jing chaotian.j...@mediatek.com wrote: On Tue, 2015-08-25 at 14:07 +0200, Ulf Hansson wrote: On 17 August 2015 at 14:01, Chaotian Jing chaotian.j...@mediatek.com wrote: Hi Ulf, Thanks, please see my comment: On Mon, 2015-08-17 at 13:31 +0200, Ulf

Re: [PATCH 1/4] mmc: mediatek: Add online-tuning support of EMMC/SD

2015-08-25 Thread Ulf Hansson
On 17 August 2015 at 14:01, Chaotian Jing chaotian.j...@mediatek.com wrote: Hi Ulf, Thanks, please see my comment: On Mon, 2015-08-17 at 13:31 +0200, Ulf Hansson wrote: On 12 August 2015 at 10:24, Chaotian Jing chaotian.j...@mediatek.com wrote: Schedule a workqueue to do tuning when CRC

Re: [PATCH 1/4] mmc: mediatek: Add online-tuning support of EMMC/SD

2015-08-17 Thread Ulf Hansson
On 12 August 2015 at 10:24, Chaotian Jing chaotian.j...@mediatek.com wrote: Schedule a workqueue to do tuning when CRC error Call mmc_hw_reset to re-init card when data timeout Thanks to Adrian Hunter, the mmc core already supports re-tuning for the above scenarios through the mmc_retune_*()

Re: [PATCH v6 0/7] Add Mediatek MMC driver

2015-06-18 Thread Ulf Hansson
On 17 June 2015 at 23:01, Paul Gortmaker paul.gortma...@windriver.com wrote: On Tue, Jun 16, 2015 at 4:03 AM, Ulf Hansson ulf.hans...@linaro.org wrote: On 15 June 2015 at 13:20, Chaotian Jing chaotian.j...@mediatek.com wrote: This series enables MMC support on the MT8135/MT8173 platform

Re: [PATCH v6 0/7] Add Mediatek MMC driver

2015-06-16 Thread Ulf Hansson
On 15 June 2015 at 13:20, Chaotian Jing chaotian.j...@mediatek.com wrote: This series enables MMC support on the MT8135/MT8173 platform. MT8135 has 5 MMC controllers and MT8173 has 4 MMC controllers. Changes base on Ulf's comments Make hclk mandatory in the driver code Change host-hclk to

Re: [PATCH v5 2/7] mmc: mediatek: Add Mediatek MMC driver

2015-06-10 Thread Ulf Hansson
[...] +static int msdc_drv_probe(struct platform_device *pdev) +{ + struct mmc_host *mmc; + struct msdc_host *host; + struct resource *res; + int ret; + + if (!pdev-dev.of_node) { + dev_err(pdev-dev, No DT found\n); + return

Re: [PATCH v4 2/7] mmc: mediatek: Add Mediatek MMC driver

2015-06-04 Thread Ulf Hansson
On 27 May 2015 at 13:34, Chaotian Jing chaotian.j...@mediatek.com wrote: On Tue, 2015-05-26 at 14:33 +0200, Ulf Hansson wrote: [...] +{ + unsigned long tmo = jiffies + msecs_to_jiffies(20); + + while ((readl(host-base + SDC_STS) SDC_STS_CMDBUSY

Re: [PATCH v4 2/7] mmc: mediatek: Add Mediatek MMC driver

2015-05-26 Thread Ulf Hansson
[...] +{ + unsigned long tmo = jiffies + msecs_to_jiffies(20); + + while ((readl(host-base + SDC_STS) SDC_STS_CMDBUSY) +time_before(jiffies, tmo)) + continue; + + if (readl(host-base + SDC_STS) SDC_STS_CMDBUSY) {

Re: [PATCH v4 2/7] mmc: mediatek: Add Mediatek MMC driver

2015-05-22 Thread Ulf Hansson
[...] You are invoking msdc_gate_clock() and msdc_ungate_clock() in a balanced manner, thus hclk_enabled is redundant. Please remove it. on drv-probe(), already invoke the msdc_ungate_clock(), so, when the runtime pm resume invoke the msdc_ungate_clock(), the hclk already enabled. That's

Re: [PATCH v2 2/5] mmc: mediatek: Add Mediatek MMC driver

2015-04-17 Thread Ulf Hansson
On 17 April 2015 at 11:12, Sascha Hauer s.ha...@pengutronix.de wrote: Ulf, On Tue, Mar 31, 2015 at 02:23:06PM +0200, Ulf Hansson wrote: On 17 March 2015 at 04:13, Chaotian Jing chaotian.j...@mediatek.com wrote: + + msdc_set_buswidth(host, ios-bus_width); + + /* Suspend

Re: 答复: [PATCH v2 2/5] mmc: mediatek: Add Mediatek MMC driver

2015-04-08 Thread Ulf Hansson
[...] + +struct mt_bdma_desc { + u32 first_u32; +#define BDMA_DESC_EOL (1 0) +#define BDMA_DESC_CHECKSUM (0xff 8) /* bit8 ~ bit15 */ +#define BDMA_DESC_BLKPAD (1 17) +#define BDMA_DESC_DWPAD(1 18) + u32 next; + u32 ptr;

Re: [PATCH v2 2/5] mmc: mediatek: Add Mediatek MMC driver

2015-03-31 Thread Ulf Hansson
On 17 March 2015 at 04:13, Chaotian Jing chaotian.j...@mediatek.com wrote: Add Mediatek MMC driver code Would be nice to get simple overview of what features the driver/controller supports. Please add that to the commit message. Signed-off-by: Chaotian Jing chaotian.j...@mediatek.com ---

Re: [PATCH v2 3/5] mmc: mediatek: Add PM support for MMC driver

2015-03-31 Thread Ulf Hansson
On 17 March 2015 at 04:13, Chaotian Jing chaotian.j...@mediatek.com wrote: Add PM support for Mediatek MMC driver Signed-off-by: Chaotian Jing chaotian.j...@mediatek.com --- drivers/mmc/host/mtk-sd.c | 94 ++- 1 file changed, 93 insertions(+), 1

Re: [PATCH v4] mmc: core: restore detect line inversion semantics

2014-10-02 Thread Ulf Hansson
On 2 October 2014 09:08, Linus Walleij linus.wall...@linaro.org wrote: commit 98e90de99a0c43bd434da814c882c4332441871e mmc: host: switch OF parser to use gpio descriptors switched the semantic behaviour of card detect and read only flags such that the inversion capability flag would only be

Re: [PATCH 3/4 v2] mmc: host: switch OF parser to use gpio descriptors

2014-09-09 Thread Ulf Hansson
On 9 September 2014 09:05, Linus Walleij linus.wall...@linaro.org wrote: On Wed, Aug 27, 2014 at 1:00 PM, Linus Walleij linus.wall...@linaro.org wrote: This switches the central MMC OF parser to use gpio descriptors instead of grabbing GPIOs explicitly from the device tree. This strips out

Re: [PATCH 2/4] mmc: slot-gpio: add gpiod variant to get wp GPIO

2014-08-29 Thread Ulf Hansson
On 27 August 2014 13:00, Linus Walleij linus.wall...@linaro.org wrote: This makes it possible to get the write protect (read only) GPIO line from a GPIO descriptor. Written to exactly mirror the card detect function. Acked-by: Alexandre Courbot acour...@nvidia.com Signed-off-by: Linus

Re: [PATCH 1/4] mmc: slot-gpio: switch to use flags when getting GPIO

2014-08-29 Thread Ulf Hansson
On 27 August 2014 13:00, Linus Walleij linus.wall...@linaro.org wrote: When the slot GPIO driver gets the GPIO to be used for card detect, it is now possible to specify a flag to have the line set up as input. Get rid of the explicit setup call for input and use the flag. The extra argument

Re: [PATCH] mmc: slot-gpio: restore error reporting

2014-08-19 Thread Ulf Hansson
On 19 August 2014 05:28, Linus Walleij linus.wall...@linaro.org wrote: The patch switching the MMC core to use GPIO descriptors depromoted errors to debug messages for unsuccessful attempt to get CD or WP GPIOs. This was because sometimes these are not specified, and that should not be an

Re: [PATCH 1/4] mmc: slot-gpio: switch to use flags when getting GPIO

2014-08-18 Thread Ulf Hansson
On 12 August 2014 19:25, Linus Walleij linus.wall...@linaro.org wrote: When the slot GPIO driver gets the GPIO to be used for card detect, it is now possible to specify a flag to have the line set up as input. Get rid of the explicit setup call for input and use the flag. The extra argument

Re: [PATCH] mmc: select GPIOLIB for MMC support

2014-08-18 Thread Ulf Hansson
On 18 August 2014 17:20, Linus Walleij linus.wall...@linaro.org wrote: The slot-gpio support has been compiled into the core for some time, and it basically requires GPIOLIB to be present, very few systems are using the archaic GPIO API (just defined function names) and those should be

Re: [RFC PATCH] gpio: Add a defer reset object to send board specific reset

2014-06-16 Thread Ulf Hansson
. If I understand correct, you need a per device reset functionality? And obviously the reset implementation is board/SoC specific. We have the Reset Controller framework, drivers/reset. Could this help you? Kind regards Ulf Hansson Defer Reset Object -- The defer reset object

Re: [PATCH 1/2] GPIO: Add driver for Zynq GPIO controller

2014-03-31 Thread Ulf Hansson
= platform_get_drvdata(pdev); + Converting to use clk_prepare|unprepare from the runtime PM callbacks, means you can simplify the code here by using pm_runtime_force_suspend(). If you don't like that, at least you need a pm_runtime_get_sync(). Kind regards Ulf Hansson + clk_disable_unprepare(gpio-clk