aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/slot-gpio.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-04-22mmc: Delay the card_event callback into the mmc_rescan workerMarkus Mayer1-3/+1
This change removes the callback from atomic context which it doesn't need to be in, and puts it in line with the debounced rescan. This code is based on these e-mail threads with Christian Daudt: https://lkml.org/lkml/2013/8/19/539 https://lkml.org/lkml/2014/3/19/79 Signed-off-by: Markus Mayer <markus.mayer@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <chris@printf.net>
2014-03-17mmc: slot-gpio: Add GPIO descriptor based CD GPIO APIAdrian Hunter1-1/+80
Add functions to request a CD GPIO using the GPIO descriptor API. Note that the new request function is paired with mmc_gpiod_free_cd() not mmc_gpio_free_cd(). Note also that it must be called prior to mmc_add_host() otherwise the caller must also call mmc_gpiod_request_cd_irq(). Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <chris@printf.net>
2014-03-17mmc: slot-gpio: Split out CD IRQ request into a separate functionAdrian Hunter1-23/+35
In preparation for adding a descriptor-based CD GPIO API, split out CD IRQ request into a separate function. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <chris@printf.net>
2014-03-17mmc: slot-gpio: Record GPIO descriptors instead of GPIO numbersAdrian Hunter1-18/+27
In preparation for adding a descriptor-based CD GPIO API, switch from recording GPIO numbers to recording GPIO descriptors. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Chris Ball <chris@printf.net>
2013-08-24mmc: slot-gpio: Add debouncing capability to mmc_gpio_request_cd()Laurent Pinchart1-1/+13
Add a debounce parameter to the mmc_gpio_request_cd() function that enables GPIO debouncing when set to a non-zero value. This can be used by MMC host drivers to enable debouncing on the card detect signal. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Chris Ball <cjb@laptop.org>
2013-02-11mmc: slot-gpio: use devm_* managed functions to ease usersShawn Guo1-6/+51
Use devm_* managed functions, so that slot-gpio users do not have to call mmc_gpio_free_ro/cd to free up resources requested in mmc_gpio_request_ro/cd. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2012-12-07mmc: extend the slot-gpio card-detection to use host's .card_event() methodGuennadi Liakhovetski1-1/+7
The slot-gpio API provides a generic card-detection handler. To support a wider range of hosts it has to call the host's card-event callback, if implemented. Also increase the debounce interval to 200ms to match the SDHCI driver. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Reviewed-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
2012-09-11mmc: slot-gpio: Fix missing assignment to ctx->ro_gpioChris Ball1-1/+7
mmc_gpio_request_ro() doesn't store the requested gpio in ctx->ro_gpio. As a result, subsequent calls to mmc_gpio_get_ro() will always fail with -ENOSYS because the gpio number isn't available to that function. Cc: stable <stable@vger.kernel.org> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2012-07-21mmc: core: add WP pin handler to slot functionsGuennadi Liakhovetski1-1/+51
Card Write-Protect pin is often implemented, using a GPIO, which makes it simple to provide a generic handler for it. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2012-07-21mmc: core: convert slot functions to managed allocationGuennadi Liakhovetski1-13/+38
This prepares for the addition of further slot functions. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2012-07-21mmc: add CD GPIO polling support to slot functionsGuennadi Liakhovetski1-13/+43
A simple extension of mmc slot functions add support for CD GPIO polling for cases where the GPIO cannot produce interrupts, or where this is not desired for some reason. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2012-07-21mmc: core: use a more generic name for slot function types and fieldsGuennadi Liakhovetski1-4/+4
struct mmc_host::hotplug is becoming a generic hook for slot functions. Rename it accordingly. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
2012-07-10mmc: extend and rename cd-gpio helpers to handle more slot GPIO functionsGuennadi Liakhovetski1-0/+83
GPIOs can be used in MMC/SD-card slots not only for hotplug detection, but also to implement the write-protection pin. Rename cd-gpio helpers to slot-gpio to make addition of further slot GPIO functions possible. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>