1. 01 6月, 2015 2 次提交
    • L
      mmc: Add support for disabling write-protect detection · 9f6e0bff
      Lars-Peter Clausen 提交于
      It is not uncommon to see systems where there is no physical write-protect
      signal (e.g. when using eMMC or microSD card slots). For some controllers,
      which have a dedicated write-protection detection logic (like SDHCI
      controllers), the get_ro() callback can return bogus data in such a case.
      
      Instead of handling this on a per controller basis this patch adds a new
      capability flag to the MMC core that can be set to specify that the result
      of get_ro() is invalid. When the flag is set the core will not call
      get_ro() and assume that the card is always read-write.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      9f6e0bff
    • A
      mmc: host: Add facility to support re-tuning · dfa13ebb
      Adrian Hunter 提交于
      Currently, there is core support for tuning during
      initialization. There can also be a need to re-tune
      periodically (e.g. sdhci) or to re-tune after the
      host controller is powered off (e.g. after PM
      runtime suspend / resume) or to re-tune in response
      to CRC errors.
      
      The main requirements for re-tuning are:
        - ability to enable / disable re-tuning
        - ability to flag that re-tuning is needed
        - ability to re-tune before any request
        - ability to hold off re-tuning if the card is busy
        - ability to hold off re-tuning if re-tuning is in
        progress
        - ability to run a re-tuning timer
      
      To support those requirements 7 members are added to struct
      mmc_host:
      
        unsigned int		can_retune:1;	/* re-tuning can be used */
        unsigned int		doing_retune:1;	/* re-tuning in progress */
        unsigned int		retune_now:1;   /* do re-tuning at next req */
        int			need_retune;	/* re-tuning is needed */
        int			hold_retune;	/* hold off re-tuning */
        unsigned int		retune_period;  /* re-tuning period in secs */
        struct timer_list	retune_timer;	/* for periodic re-tuning */
      
      need_retune is an integer so it can be set without needing
      synchronization. hold_retune is a integer to allow nesting.
      
      Various simple functions are provided to set / clear those
      variables.
      
      Subsequent patches take those functions into use.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      dfa13ebb
  2. 27 3月, 2015 1 次提交
  3. 28 1月, 2015 1 次提交
    • U
      mmc: core: Initial support for MMC power sequences · 3aa8793f
      Ulf Hansson 提交于
      System on chip designs may specify a specific MMC power sequence. To
      successfully detect an (e)MMC/SD/SDIO card, that power sequence must
      be followed while initializing the card.
      
      To be able to handle these SOC specific power sequences, let's add a
      MMC power sequence interface. It provides the following functions to
      help the mmc core to deal with these power sequences.
      
      mmc_pwrseq_alloc() - Invoked from mmc_of_parse(), to initialize data.
      mmc_pwrseq_pre_power_on()- Invoked in the beginning of mmc_power_up().
      mmc_pwrseq_post_power_on()- Invoked at the end in mmc_power_up().
      mmc_pwrseq_power_off()- Invoked from mmc_power_off().
      mmc_pwrseq_free() - Invoked from mmc_free_host(), to free data.
      
      Each MMC power sequence provider will be responsible to implement a set
      of callbacks. These callbacks mirrors the functions above.
      
      This patch adds the skeleton, following patches will extend the core of
      the MMC power sequence and add support for a specific simple MMC power
      sequence.
      
      Do note, since the mmc_pwrseq_alloc() is invoked from mmc_of_parse(),
      host drivers needs to make use of this API to enable the support for
      MMC power sequences. Moreover the MMC power sequence support depends on
      CONFIG_OF.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Reviewed-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      3aa8793f
  4. 19 1月, 2015 1 次提交
  5. 26 11月, 2014 1 次提交
  6. 24 9月, 2014 1 次提交
  7. 09 9月, 2014 3 次提交
  8. 22 5月, 2014 1 次提交
  9. 13 5月, 2014 4 次提交
  10. 22 4月, 2014 1 次提交
  11. 21 4月, 2014 1 次提交
  12. 23 2月, 2014 1 次提交
    • U
      mmc: core: Rename max_discard_to to max_busy_timeout · 68eb80e0
      Ulf Hansson 提交于
      Rename host->max_discard_to to host->max_busy_timeout, to reflect that
      it tells the mmc core layer about the maximum supported busy detection
      timeout by the host.
      
      This timeout is at the moment only applicable to erase/trim/discard
      commands. By the renaming we provide the option of make use of it for
      other commands that cares about busy detection. In other words, those
      commands that wants an R1B response, like for example the mmc switch
      command.
      
      Do note that the max_busy_timeout is supposed to be specified only by
      hosts supporting MMC_CAP_WAIT_WHILE_BUSY.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <chris@printf.net>
      68eb80e0
  13. 14 2月, 2014 6 次提交
  14. 31 10月, 2013 3 次提交
  15. 28 6月, 2013 1 次提交
    • U
      mmc: core: Invent MMC_CAP2_FULL_PWR_CYCLE · 53275c21
      Ulf Hansson 提交于
      MMC_CAP2_FULL_PWR_CYCLE shall be set by host drivers which are able to
      do a complete power cycle of the card. In the eMMC case that includes
      both vcc and vccq.
      
      This CAP is providing the protocol layer with important information,
      needed to take optimized decisions during card initialization and in
      the suspend/resume sequence.
      
      MMC_CAP2_POWEROFF_NOTIFY is replaced by MMC_CAP2_FULL_PWR_CYCLE, since
      it makes sense to use a wider scope for it.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      53275c21
  16. 27 6月, 2013 1 次提交
  17. 27 5月, 2013 4 次提交
    • U
      mmc: core: Restructure and simplify code for mmc sleep|awake · 07a68216
      Ulf Hansson 提交于
      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: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      07a68216
    • U
      mmc: core: Support aggressive power management for (e)MMC/SD · c4d770d7
      Ulf Hansson 提交于
      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: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      c4d770d7
    • M
      mmc: card: Adding support for sanitize in eMMC 4.5 · 775a9362
      Maya Erez 提交于
      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: NYaniv Gardi <ygardi@codeaurora.org>
      Signed-off-by: NMaya Erez <merez@codeaurora.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      775a9362
    • U
      mmc: core: Re-use code for MMC_CAP2_DETECT_ON_ERR in polling mode · b6891679
      Ulf Hansson 提交于
      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: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NKevin Liu <kliu5@marvell.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      b6891679
  18. 13 4月, 2013 1 次提交
  19. 02 4月, 2013 1 次提交
    • K
      leds: trigger: use inline functions instead of macros · 39f7e08a
      Kim, Milo 提交于
      Macros are used in case that an inline function doesn't work.
      Otherwise, use an empty inline function.
      
      (a) Case of !CONFIG_LEDS_TRIGGERS
      Following macros are replaced with inline functions.
        led_trigger_register_simple()
        led_trigger_unregister_simple()
        led_trigger_event()
      To make inline types, the structure, 'led_trigger' should be defined.
      This structure has no member at all.
      
      (b) Case of !CONFIG_LEDS_TRIGGER_IDE_DISK
      ledtrig_ide_activity() macro is replaced with an inline function as well.
      
      (c) DEFINE_LED_TRIGGER() and DEFINE_LED_TRIGGER_GLOBAL()
      Struct 'led_trigger' is defined both cases, with CONFIG_LEDS_TRIGGERS and
      without CONFIG_LEDS_TRIGGERS.
      Those macros are moved out of CONFIG_LED_TRIGGERS because of no-dependency
      on CONFIG_LEDS_TRIGGERS.
      
      (d) Fix build errors in mmc-core driver
      After replacing macros with inline functions, following build errors occur.
      (condition: CONFIG_LEDS_TRIGGERS is not set)
      
        drivers/mmc/core/core.c: In function 'mmc_request_done':
        drivers/mmc/core/core.c:164:25: error: 'struct mmc_host' has no member named 'led'
        drivers/mmc/core/core.c: In function 'mmc_start_request':
        drivers/mmc/core/core.c:254:24: error: 'struct mmc_host' has no member named 'led'
        make[3]: *** [drivers/mmc/core/core.o] Error 1
      
      The reason of these errors is non-existent member variable, 'led'.
      It is only valid when CONFIG_LEDS_TRIGGERS is set.
      But now, it can be used without this dependency.
      To fix build errors, member 'led' is always used without its config option in
      'include/linux/mmc/host.h'.
      Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com>
      Signed-off-by: NBryan Wu <cooloney@gmail.com>
      39f7e08a
  20. 23 3月, 2013 1 次提交
  21. 25 2月, 2013 4 次提交