From: Ryan Mallon <rmallon@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 01/12] mmc: mmc_spi: Support CD/RO GPIOs
Date: Thu, 25 Jul 2013 23:45:26 +0000 [thread overview]
Message-ID: <51F1B896.8020005@gmail.com> (raw)
In-Reply-To: <1374794808-21890-2-git-send-email-laurent.pinchart+renesas@ideasonboard.com>
On 26/07/13 09:26, Laurent Pinchart wrote:
> Add support for passing CD/RO GPIO numbers directly to the mmc_spi
> driver instead of relying solely on board code callbacks to retrieve the
> CD/RO signals values.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
> drivers/mmc/host/mmc_spi.c | 32 +++++++++++++++++++++---------
> drivers/mmc/host/of_mmc_spi.c | 46 +++++++++++--------------------------------
> include/linux/spi/mmc_spi.h | 11 +++++++++++
> 3 files changed, 46 insertions(+), 43 deletions(-)
>
> diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
> index 74145d1..4e83908 100644
> --- a/drivers/mmc/host/mmc_spi.c
> +++ b/drivers/mmc/host/mmc_spi.c
> @@ -36,6 +36,7 @@
>
> #include <linux/mmc/host.h>
> #include <linux/mmc/mmc.h> /* for R1_SPI_* bit values */
> +#include <linux/mmc/slot-gpio.h>
>
> #include <linux/spi/spi.h>
> #include <linux/spi/mmc_spi.h>
> @@ -1278,11 +1279,8 @@ static int mmc_spi_get_ro(struct mmc_host *mmc)
>
> if (host->pdata && host->pdata->get_ro)
> return !!host->pdata->get_ro(mmc->parent);
> - /*
> - * Board doesn't support read only detection; let the mmc core
> - * decide what to do.
> - */
> - return -ENOSYS;
> + else
> + return mmc_gpio_get_ro(mmc);
Why not just have the board file assign mmc_gpio_get_ro as
host->pdata->get_ro? This would eliminate the need for the
MMC_SPI_USE_RO_GPIO flag.
Also, if host->pdata->get_ro is not set then this will assume
mmc_gpio_get_ro is valid, even if MMC_SPI_USE_RO_GPIO is not set. I'm
guessing it will end up returning -ENOSYS, but they way the code reads
is that if the host doesn't have get_ro function set, then it is must be
a gpio.
Same applies for the other callbacks.
~Ryan
next prev parent reply other threads:[~2013-07-25 23:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 23:26 [PATCH 00/12] Remove platform callbacks from mmc_spi, sh_mmcif and sh_mobile_sdhi drivers Laurent Pinchart
2013-07-25 23:26 ` [PATCH 01/12] mmc: mmc_spi: Support CD/RO GPIOs Laurent Pinchart
2013-07-25 23:45 ` Ryan Mallon [this message]
2013-07-26 0:04 ` Laurent Pinchart
2013-07-26 0:23 ` Ryan Mallon
2013-07-26 9:51 ` Laurent Pinchart
2013-07-25 23:26 ` [PATCH 02/12] ARM: ep93xx: vision_ep9307: Use MMC CD and RO GPIO Laurent Pinchart
2013-07-25 23:33 ` H Hartley Sweeten
2013-07-26 0:19 ` H Hartley Sweeten
2013-07-26 9:54 ` Laurent Pinchart
2013-07-26 16:26 ` H Hartley Sweeten
2013-07-25 23:26 ` [PATCH 03/12] sh: ecovec24: Use MMC/SDHI " Laurent Pinchart
2013-07-25 23:26 ` [PATCH 04/12] sh: ecovec24: Remove mmcif .down_pwr() callback Laurent Pinchart
2013-07-25 23:26 ` [PATCH 05/12] sh: ecovec24: Remove MMCIF and SDHI .set_pwr() callbacks Laurent Pinchart
2013-07-25 23:26 ` [PATCH 06/12] mmc: mmc_spi: Remove platform data .get_cd() and .get_ro() callbacks Laurent Pinchart
2013-07-25 23:26 ` [PATCH 07/12] mmc: sh_mmcif: Remove .down_pwr() callback from platform data Laurent Pinchart
2013-07-25 23:26 ` [PATCH 08/12] mmc: sh_mmcif: Remove .set_pwr() " Laurent Pinchart
2013-07-25 23:26 ` [PATCH 09/12] mmc: sh_mobile_sdhi: Remove .get_cd() " Laurent Pinchart
2013-07-25 23:26 ` [PATCH 10/12] mmc: sh_mobile_sdhi: Remove .set_pwr() " Laurent Pinchart
2013-07-25 23:26 ` [PATCH 11/12] mmc: tmio-mmc: Remove .get_cd() " Laurent Pinchart
2013-07-25 23:26 ` [PATCH 12/12] mmc: tmio-mmc: Remove .set_pwr() " Laurent Pinchart
2013-07-25 23:37 ` [PATCH 00/12] Remove platform callbacks from mmc_spi, sh_mmcif and sh_mobile_sdhi drivers Ryan Mallon
2013-07-26 7:01 ` Guennadi Liakhovetski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51F1B896.8020005@gmail.com \
--to=rmallon@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).