From: Ben Dooks <ben-linux@fluff.org>
To: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org,
Lee Hyuk <hyuk1.lee@samsung.com>,
ben-linux@fluff.org
Subject: Re: [PATCH 1/3] ARM: SAMSUNG: Add the member of platdata to implement SDMMC Write Protection
Date: Tue, 15 Jun 2010 13:02:45 +0100 [thread overview]
Message-ID: <20100615120245.GD7248@trinity.fluff.org> (raw)
In-Reply-To: <1276601268-7226-2-git-send-email-kgene.kim@samsung.com>
On Tue, Jun 15, 2010 at 08:27:46PM +0900, Kukjin Kim wrote:
> From: Lee Hyuk <hyuk1.lee@samsung.com>
>
> This patch adds the members of platdata which are cfg_wp and get_ro.
> The cfg_wp is the function for setting the specific GPIO for WP pin
> and get_ro is the function for getting data from the assigned GPIO.
Why not just pass gpio numbers, and have the sdhci-s3c driver claim them
if they are valid?
> Signed-off-by: Hyuk Lee <hyuk1.lee@samsung.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
> arch/arm/plat-samsung/dev-hsmmc.c | 4 ++++
> arch/arm/plat-samsung/dev-hsmmc1.c | 4 ++++
> arch/arm/plat-samsung/dev-hsmmc2.c | 4 ++++
> arch/arm/plat-samsung/dev-hsmmc3.c | 4 ++++
> arch/arm/plat-samsung/include/plat/sdhci.h | 6 ++++++
> 5 files changed, 22 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-samsung/dev-hsmmc.c b/arch/arm/plat-samsung/dev-hsmmc.c
> index 4c05b39..f2bae6f 100644
> --- a/arch/arm/plat-samsung/dev-hsmmc.c
> +++ b/arch/arm/plat-samsung/dev-hsmmc.c
> @@ -65,4 +65,8 @@ void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
> set->cfg_gpio = pd->cfg_gpio;
> if (pd->cfg_card)
> set->cfg_card = pd->cfg_card;
> + if (pd->cfg_wp)
> + set->cfg_wp = pd->cfg_wp;
> + if (pd->get_ro)
> + set->get_ro = pd->get_ro;
> }
> diff --git a/arch/arm/plat-samsung/dev-hsmmc1.c b/arch/arm/plat-samsung/dev-hsmmc1.c
> index e49bc4c..b326e0d 100644
> --- a/arch/arm/plat-samsung/dev-hsmmc1.c
> +++ b/arch/arm/plat-samsung/dev-hsmmc1.c
> @@ -65,4 +65,8 @@ void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
> set->cfg_gpio = pd->cfg_gpio;
> if (pd->cfg_card)
> set->cfg_card = pd->cfg_card;
> + if (pd->cfg_wp)
> + set->cfg_wp = pd->cfg_wp;
> + if (pd->get_ro)
> + set->get_ro = pd->get_ro;
> }
> diff --git a/arch/arm/plat-samsung/dev-hsmmc2.c b/arch/arm/plat-samsung/dev-hsmmc2.c
> index 824580b..3474ef2 100644
> --- a/arch/arm/plat-samsung/dev-hsmmc2.c
> +++ b/arch/arm/plat-samsung/dev-hsmmc2.c
> @@ -66,4 +66,8 @@ void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
> set->cfg_gpio = pd->cfg_gpio;
> if (pd->cfg_card)
> set->cfg_card = pd->cfg_card;
> + if (pd->cfg_wp)
> + set->cfg_wp = pd->cfg_wp;
> + if (pd->get_ro)
> + set->get_ro = pd->get_ro;
> }
> diff --git a/arch/arm/plat-samsung/dev-hsmmc3.c b/arch/arm/plat-samsung/dev-hsmmc3.c
> index 05d5ea4..1da8ea7 100644
> --- a/arch/arm/plat-samsung/dev-hsmmc3.c
> +++ b/arch/arm/plat-samsung/dev-hsmmc3.c
> @@ -69,4 +69,8 @@ void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
> set->cfg_gpio = pd->cfg_gpio;
> if (pd->cfg_card)
> set->cfg_card = pd->cfg_card;
> + if (pd->cfg_wp)
> + set->cfg_wp = pd->cfg_wp;
> + if (pd->get_ro)
> + set->get_ro = pd->get_ro;
> }
> diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
> index 1314ffa..da198d8 100644
> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> @@ -29,6 +29,8 @@ struct mmc_ios;
> * is necessary the controllers and/or GPIO blocks require the
> * changing of driver-strength and other controls dependant on
> * the card and speed of operation.
> + * @cfg_wp: Configure the GPIO in order to allocate WP pin.
> + * @get_ro: Call back function for getting data from the allocated GPIO.
if you just used gpio calls and passed a gpio number here,
you'd not need cfg_wp.
> *
> * Initialisation data specific to either the machine or the platform
> * for the device driver to use or call-back when configuring gpio or
> @@ -45,6 +47,8 @@ struct s3c_sdhci_platdata {
> void __iomem *regbase,
> struct mmc_ios *ios,
> struct mmc_card *card);
> + void (*cfg_wp)(int dev_id);
> + int (*get_ro)(struct mmc_host *mmc);
> };
>
> /**
> @@ -234,6 +238,8 @@ extern void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev,
> struct mmc_ios *ios,
> struct mmc_card *card);
>
> +extern void s3c_sdhci_set_platdata(void);
> +
> #ifdef CONFIG_S3C_DEV_HSMMC
> static inline void s5pv210_default_sdhci0(void)
> {
> --
> 1.6.2.5
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
WARNING: multiple messages have this Message-ID (diff)
From: ben-linux@fluff.org (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] ARM: SAMSUNG: Add the member of platdata to implement SDMMC Write Protection
Date: Tue, 15 Jun 2010 13:02:45 +0100 [thread overview]
Message-ID: <20100615120245.GD7248@trinity.fluff.org> (raw)
In-Reply-To: <1276601268-7226-2-git-send-email-kgene.kim@samsung.com>
On Tue, Jun 15, 2010 at 08:27:46PM +0900, Kukjin Kim wrote:
> From: Lee Hyuk <hyuk1.lee@samsung.com>
>
> This patch adds the members of platdata which are cfg_wp and get_ro.
> The cfg_wp is the function for setting the specific GPIO for WP pin
> and get_ro is the function for getting data from the assigned GPIO.
Why not just pass gpio numbers, and have the sdhci-s3c driver claim them
if they are valid?
> Signed-off-by: Hyuk Lee <hyuk1.lee@samsung.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
> arch/arm/plat-samsung/dev-hsmmc.c | 4 ++++
> arch/arm/plat-samsung/dev-hsmmc1.c | 4 ++++
> arch/arm/plat-samsung/dev-hsmmc2.c | 4 ++++
> arch/arm/plat-samsung/dev-hsmmc3.c | 4 ++++
> arch/arm/plat-samsung/include/plat/sdhci.h | 6 ++++++
> 5 files changed, 22 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-samsung/dev-hsmmc.c b/arch/arm/plat-samsung/dev-hsmmc.c
> index 4c05b39..f2bae6f 100644
> --- a/arch/arm/plat-samsung/dev-hsmmc.c
> +++ b/arch/arm/plat-samsung/dev-hsmmc.c
> @@ -65,4 +65,8 @@ void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
> set->cfg_gpio = pd->cfg_gpio;
> if (pd->cfg_card)
> set->cfg_card = pd->cfg_card;
> + if (pd->cfg_wp)
> + set->cfg_wp = pd->cfg_wp;
> + if (pd->get_ro)
> + set->get_ro = pd->get_ro;
> }
> diff --git a/arch/arm/plat-samsung/dev-hsmmc1.c b/arch/arm/plat-samsung/dev-hsmmc1.c
> index e49bc4c..b326e0d 100644
> --- a/arch/arm/plat-samsung/dev-hsmmc1.c
> +++ b/arch/arm/plat-samsung/dev-hsmmc1.c
> @@ -65,4 +65,8 @@ void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
> set->cfg_gpio = pd->cfg_gpio;
> if (pd->cfg_card)
> set->cfg_card = pd->cfg_card;
> + if (pd->cfg_wp)
> + set->cfg_wp = pd->cfg_wp;
> + if (pd->get_ro)
> + set->get_ro = pd->get_ro;
> }
> diff --git a/arch/arm/plat-samsung/dev-hsmmc2.c b/arch/arm/plat-samsung/dev-hsmmc2.c
> index 824580b..3474ef2 100644
> --- a/arch/arm/plat-samsung/dev-hsmmc2.c
> +++ b/arch/arm/plat-samsung/dev-hsmmc2.c
> @@ -66,4 +66,8 @@ void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
> set->cfg_gpio = pd->cfg_gpio;
> if (pd->cfg_card)
> set->cfg_card = pd->cfg_card;
> + if (pd->cfg_wp)
> + set->cfg_wp = pd->cfg_wp;
> + if (pd->get_ro)
> + set->get_ro = pd->get_ro;
> }
> diff --git a/arch/arm/plat-samsung/dev-hsmmc3.c b/arch/arm/plat-samsung/dev-hsmmc3.c
> index 05d5ea4..1da8ea7 100644
> --- a/arch/arm/plat-samsung/dev-hsmmc3.c
> +++ b/arch/arm/plat-samsung/dev-hsmmc3.c
> @@ -69,4 +69,8 @@ void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
> set->cfg_gpio = pd->cfg_gpio;
> if (pd->cfg_card)
> set->cfg_card = pd->cfg_card;
> + if (pd->cfg_wp)
> + set->cfg_wp = pd->cfg_wp;
> + if (pd->get_ro)
> + set->get_ro = pd->get_ro;
> }
> diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
> index 1314ffa..da198d8 100644
> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> @@ -29,6 +29,8 @@ struct mmc_ios;
> * is necessary the controllers and/or GPIO blocks require the
> * changing of driver-strength and other controls dependant on
> * the card and speed of operation.
> + * @cfg_wp: Configure the GPIO in order to allocate WP pin.
> + * @get_ro: Call back function for getting data from the allocated GPIO.
if you just used gpio calls and passed a gpio number here,
you'd not need cfg_wp.
> *
> * Initialisation data specific to either the machine or the platform
> * for the device driver to use or call-back when configuring gpio or
> @@ -45,6 +47,8 @@ struct s3c_sdhci_platdata {
> void __iomem *regbase,
> struct mmc_ios *ios,
> struct mmc_card *card);
> + void (*cfg_wp)(int dev_id);
> + int (*get_ro)(struct mmc_host *mmc);
> };
>
> /**
> @@ -234,6 +238,8 @@ extern void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev,
> struct mmc_ios *ios,
> struct mmc_card *card);
>
> +extern void s3c_sdhci_set_platdata(void);
> +
> #ifdef CONFIG_S3C_DEV_HSMMC
> static inline void s5pv210_default_sdhci0(void)
> {
> --
> 1.6.2.5
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
next prev parent reply other threads:[~2010-06-15 12:02 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-15 11:27 ARM: S5PV210: Add support SDMMC Write Protection on SMDKV210 Kukjin Kim
2010-06-15 11:27 ` Kukjin Kim
2010-06-15 11:27 ` [PATCH 1/3] ARM: SAMSUNG: Add the member of platdata to implement SDMMC Write Protection Kukjin Kim
2010-06-15 11:27 ` Kukjin Kim
2010-06-15 12:02 ` Ben Dooks [this message]
2010-06-15 12:02 ` Ben Dooks
2010-07-03 1:15 ` Kukjin Kim
2010-07-03 1:15 ` Kukjin Kim
2010-06-15 11:27 ` [PATCH 2/3] ARM: S5PV210: Add support SDMMC WP through EXT_INT on SMDKV210 Kukjin Kim
2010-06-15 11:27 ` Kukjin Kim
2010-06-15 11:52 ` Kyungmin Park
2010-06-15 11:52 ` Kyungmin Park
2010-07-03 1:08 ` Kukjin Kim
2010-07-03 1:08 ` Kukjin Kim
2010-06-15 11:53 ` Maurus Cuelenaere
2010-06-15 11:53 ` Maurus Cuelenaere
2010-07-03 1:11 ` Kukjin Kim
2010-07-03 1:11 ` Kukjin Kim
2010-06-15 11:59 ` Ben Dooks
2010-06-15 11:59 ` Ben Dooks
2010-07-03 1:14 ` Kukjin Kim
2010-07-03 1:14 ` Kukjin Kim
2010-06-15 11:27 ` [PATCH 3/3] sdhci-s3c: Add SDHCI_QUIRK_NO_WP_BIT for Samsung SoC Kukjin Kim
2010-06-15 11:27 ` Kukjin Kim
2010-06-15 12:04 ` Ben Dooks
2010-06-15 12:04 ` Ben Dooks
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=20100615120245.GD7248@trinity.fluff.org \
--to=ben-linux@fluff.org \
--cc=hyuk1.lee@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.