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 wrote: > On Tue, 2015-08-25 at 14:07 +0200, Ulf Hansson wrote: >> On 17 August 2015 at 14:01, Chaotian Jing wrote: >> > Hi Ulf, >> > Thanks, please see my comment: >> > On Mon, 2015-08-17 at 13:31 +0200, Ulf Hansson

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 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 wrote: >> > Schedule a workqueue to do tuning when CRC error >> >

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 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_*() APIs. SDHCI driver has alr

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

2015-06-18 Thread Ulf Hansson
On 17 June 2015 at 23:01, Paul Gortmaker wrote: > On Tue, Jun 16, 2015 at 4:03 AM, Ulf Hansson wrote: >> On 15 June 2015 at 13:20, Chaotian Jing wrote: >>> This series enables MMC support on the MT8135/MT8173 platform. >>> MT8135 has 5 MMC controllers and M

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

2015-06-16 Thread Ulf Hansson
On 15 June 2015 at 13:20, Chaotian Jing 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 host->src_clk_freq > A

Re: [PATCH v5 1/7] mmc: dt-bindings: add Mediatek MMC bindings

2015-06-10 Thread Ulf Hansson
On 10 June 2015 at 04:24, Chaotian Jing wrote: > Document the device-tree binding of Mediatek MMC host > > Signed-off-by: Chaotian Jing > --- > Documentation/devicetree/bindings/mmc/mtk-sd.txt | 32 > > 1 file changed, 32 insertions(+) > create mode 100644 Documentatio

Re: [PATCH v5 3/7] mmc: mediatek: Add PM support for MMC driver

2015-06-10 Thread Ulf Hansson
On 10 June 2015 at 04:24, Chaotian Jing wrote: > Add PM support for Mediatek MMC driver > Save/restore registers when PM > > Signed-off-by: Chaotian Jing > --- > drivers/mmc/host/mtk-sd.c | 88 > +-- > 1 file changed, 85 insertions(+), 3 deletions(-)

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"); > +

Re: [PATCH v2 0/6] UHS-I support for sh_mobile_sdhi

2015-06-10 Thread Ulf Hansson
On 10 June 2015 at 01:21, Ben Hutchings wrote: > This series adds support for UHS-I in sh_mobile_sdhi, partly implemented > in tmio_mmc. This does not yet include tuning for SDR-104, but SDR-50 now > works on the R8A7790 Lager board and another development board. > > The pfc block needs to be rec

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 wrote: > On Tue, 2015-05-26 at 14:33 +0200, Ulf Hansson wrote: >> [...] >> >> >> >> > +{ >> >> >> > + unsigned long tmo = jiffies + msecs_to_jiffies(20); >> >> >> &

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(

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.

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 wrote: > Ulf, > > On Tue, Mar 31, 2015 at 02:23:06PM +0200, Ulf Hansson wrote: >> On 17 March 2015 at 04:13, Chaotian Jing wrote: >> > + >> > + msdc_set_buswidth(host, ios->bus_width); >> > + >&g

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) >> > +

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 wrote: > Add PM support for Mediatek MMC driver > > Signed-off-by: Chaotian Jing > --- > drivers/mmc/host/mtk-sd.c | 94 > ++- > 1 file changed, 93 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host

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 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 > --- > drivers/mmc/host/Kconfig |8 + > drivers/mmc

Re: [PATCH 2/3] mmc: host: don't use devm_pinctrl_get_select_default() in probe

2014-12-23 Thread Ulf Hansson
On 22 December 2014 at 23:16, Wolfram Sang wrote: > Since commit ab78029ecc34 (drivers/pinctrl: grab default handles from device > core), we can rely on device core for setting the default pins. > > Signed-off-by: Wolfram Sang Thanks! Applied for next, with an updated prefix of the commit header

Re: [PATCH] mmc: core: fix card detection regression

2014-11-05 Thread Ulf Hansson
On 5 November 2014 01:22, Kristina Martšenko wrote: > Since commit 89168b489915 ("mmc: core: restore detect line inversion > semantics"), the SD card on i.MX28 (and possibly other) devices isn't > detected and booting stops at: > > [4.120617] Waiting for root device /dev/mmcblk0p3... > > This

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

2014-10-02 Thread Ulf Hansson
On 2 October 2014 09:08, Linus Walleij 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 set if inversion wa

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

2014-10-01 Thread Ulf Hansson
On 1 October 2014 16:44, Ulf Hansson wrote: > On 1 October 2014 15:45, Linus Walleij wrote: >> commit 98e90de99a0c43bd434da814c882c4332441871e >> "mmc: host: switch OF parser to use gpio descriptors" >> switched the semantic behaviour of card detect and read >&g

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

2014-10-01 Thread Ulf Hansson
On 1 October 2014 15:45, Linus Walleij 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 set if inversion wa

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 wrote: > On Wed, Aug 27, 2014 at 1:00 PM, Linus Walleij > wrote: > >> This switches the central MMC OF parser to use gpio descriptors >> instead of grabbing GPIOs explicitly from the device tree. >> This strips out an unecessary use of the integer-based G

Re: [PATCH 4/4 v2] mmc: mmci: augment driver to handle gpio descriptors

2014-08-29 Thread Ulf Hansson
On 27 August 2014 15:13, Linus Walleij wrote: > Currently the MMCI driver will only handle GPIO descriptors > implicitly through the device tree probe glue in mmc_of_init(), > but devices instatiated other ways such as through board files > and passing descriptors using the GPIO descriptor table w

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

2014-08-29 Thread Ulf Hansson
On 27 August 2014 13:00, Linus Walleij wrote: > This switches the central MMC OF parser to use gpio descriptors > instead of grabbing GPIOs explicitly from the device tree. > This strips out an unecessary use of the integer-based GPIO > API that we want to get rid of, cuts down on code as the > gp

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 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 works as there are

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 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 > Signed-off-by: Linus Walleij Thanks! Applied for next. Kind re

Re: [PATCH 4/4] mmc: mmci: augment driver to handle gpio descriptors

2014-08-27 Thread Ulf Hansson
On 27 August 2014 13:00, Linus Walleij wrote: > Currently the MMCI driver will only handle GPIO descriptors > implicitly through the device tree probe glue in mmc_of_init(), > but devices instatiated other ways such as through board files > and passing descriptors using the GPIO descriptor table w

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

2014-08-19 Thread Ulf Hansson
On 19 August 2014 05:28, Linus Walleij 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 error. > > However that i

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

2014-08-18 Thread Ulf Hansson
On 18 August 2014 17:20, Linus Walleij 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 migrated to GPIOLIB anyway.

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 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 works as there are

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

2014-08-18 Thread Ulf Hansson
On 12 August 2014 19:25, Linus Walleij 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. > > Cc: Alexandre Courbot > Signed-off-by: Linus Walleij Thanks! Applied for next. Kind regards

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

2014-08-18 Thread Ulf Hansson
On 12 August 2014 19:25, Linus Walleij wrote: > This switches the central MMC OF parser to use gpio descriptors > instead of grabbing GPIOs explicitly from the device tree. > This strips out an unecessary use of the integer-based GPIO > API that we want to get rid of, cuts down on code as the > gp

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

2014-06-16 Thread Ulf Hansson
nd not suitable for a common chip driver. > 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 > De

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

2014-03-31 Thread Ulf Hansson
ug if gpio chip registration fails */ > + ret = gpiochip_add(chip); > + if (ret < 0) > + return ret; > + > + /* Enable GPIO clock */ > + gpio->clk = devm_clk_get(&pdev->dev, NULL); > + if (IS_ERR(gpio->c