30 Aug, 2017

2 commits

  • The mmc_host_ops structure is only stored in the ops field of an
    mmc_host structure, which is declared as const. Thus the mmc_host_ops
    structure itself can be const.

    Done with the help of Coccinelle.

    //
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct mmc_host_ops i@p = { ... };

    @ok1@
    struct mmc_host *mmc;
    identifier r.i;
    position p;
    @@
    mmc->ops = &i@p

    @bad@
    position p != {r.p,ok1.p};
    identifier r.i;
    struct mmc_host_ops e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct mmc_host_ops i = { ... };
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Ulf Hansson

    Julia Lawall
     
  • if user plug out sd card slowly, finally card is plugged out but
    cat /proc/partitions can find that card is still exist in kernel.
    that's because alougth get card detect interrupt but CMD13 still
    can get correct response(all other pins are connected expect card
    detect pin).
    add ops->get_cd() can avoid this issue.

    Signed-off-by: Chaotian Jing
    Signed-off-by: Ulf Hansson

    Chaotian Jing
     

20 Jun, 2017

1 commit


25 Apr, 2017

2 commits

  • Use new core function mmc_get_dma_dir().

    Signed-off-by: Heiner Kallweit
    Signed-off-by: Ulf Hansson

    Heiner Kallweit
     
  • If we don't select a set of better parameters for our emmc host,
    It may easily occur CMD response CRC error. And also it may cause
    cannot boot up issue.

    Fot getting a set of better parameters, our emmc host supports
    data tune mechanism.Therefore, our emmc driver also should change
    to use data tune for CMD line.

    Because our emmc host use the different clock source to sample the
    CMD signal between HS200 and HS400 mode, the parameters are also
    different between these two modes.
    Separate cmd internal delay for HS200/HS400 mode.

    This change can fix "System can not boot up" issue.

    Signed-off-by: Yong Mao
    Signed-off-by: Chaotian Jing
    Signed-off-by: Ulf Hansson

    yong mao
     

16 Mar, 2017

1 commit

  • This patch can fix two issues:

    Issue 1:
    In previous code, div may be overflow when setting clock frequency
    as f_min. We can use DIV_ROUND_UP to fix this boundary related
    issue.

    Issue 2:
    In previous code, we can not set the correct clock frequency when
    div equals 0xff.

    Signed-off-by: Yong Mao
    Signed-off-by: Chaotian Jing
    Reviewed-by: Daniel Kurtz
    Signed-off-by: Ulf Hansson

    yong mao
     

13 Feb, 2017

2 commits


29 Nov, 2016

2 commits

  • The void (*pre_req) callback in the struct mmc_host_ops vtable
    is passing an argument "is_first_req" indicating whether this is
    the first request or not.

    None of the in-kernel users use this parameter: instead, since
    they all just do variants of dma_map* they use the DMA cookie
    to indicate whether a pre* callback has already been done for
    a request when they decide how to handle it.

    Delete the parameter from the callback and all users, as it is
    just pointless cruft.

    Signed-off-by: Linus Walleij
    Acked-by: Jaehoon Chung
    Signed-off-by: Ulf Hansson

    Linus Walleij
     
  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/mmc/host/mtk-sd.ko | grep alias
    $

    After this patch:

    $ modinfo drivers/mmc/host/mtk-sd.ko | grep alias
    alias: of:N*T*Cmediatek,mt8135-mmcC*
    alias: of:N*T*Cmediatek,mt8135-mmc

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Ulf Hansson

    Javier Martinez Canillas
     

25 Jul, 2016

4 commits


02 May, 2016

1 commit

  • Commit 9250aea76bfc ("mmc: core: Enable runtime PM management of host
    devices"), made some calls to the runtime PM API from the driver
    redundant. Especially those which deals with runtime PM reference
    counting, so let's remove them.

    Cc: Chaotian Jing
    Signed-off-by: Ulf Hansson

    Ulf Hansson
     

17 Mar, 2016

2 commits

  • We've introduced a new helper in the MMC core:
    mmc_regulator_set_vqmmc(). Let's use this in mtk-sd. Using this new
    helper has some advantages:

    1. We get the mmc_regulator_set_vqmmc() behavior of trying to match
    VQMMC and VMMC when the signal voltage is 3.3V. This ensures max
    compatibility.

    2. We get rid of a few more warnings when probing unsupported
    voltages.

    3. We get rid of some non-mediatek specific code in mtk-sd.

    Signed-off-by: Nicolas Boichat
    Reviewed-by: Douglas Anderson
    Signed-off-by: Ulf Hansson

    Nicolas Boichat
     
  • In commit ceae98f20e36 ("mmc: core: Try other signal levels
    during power up") we can see that there are times when it's
    valid to try several signal voltages. Don't print an ugly
    error in the logs when that happens.

    Signed-off-by: Nicolas Boichat
    Reviewed-by: Douglas Anderson
    Signed-off-by: Ulf Hansson

    Nicolas Boichat
     

29 Feb, 2016

1 commit


22 Dec, 2015

2 commits


09 Nov, 2015

1 commit

  • drivers/mmc/host/mtk-sd.c: In function ‘get_best_delay’:
    drivers/mmc/host/mtk-sd.c:1284: warning: ‘delay_phase.start’ is used uninitialized in this function
    drivers/mmc/host/mtk-sd.c:1284: warning: ‘delay_phase.maxlen’ is used uninitialized in this function

    If delay is zero, these fields are indeed not initialized.
    Let the compiler preinitialize the whole struct to fix this.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Ulf Hansson

    Geert Uytterhoeven
     

27 Oct, 2015

5 commits


26 Oct, 2015

1 commit


18 Jun, 2015

2 commits