* [PATCH 1/2] mmc: add MMC_QUIRK_DISABLE_CD
@ 2011-04-05 15:02 Ohad Ben-Cohen
2011-04-05 15:02 ` [PATCH 2/2] mmc: quirks: wl1271 is MMC_QUIRK_DISABLE_CD Ohad Ben-Cohen
2011-04-05 15:26 ` [PATCH 1/2] mmc: add MMC_QUIRK_DISABLE_CD Chris Ball
0 siblings, 2 replies; 4+ messages in thread
From: Ohad Ben-Cohen @ 2011-04-05 15:02 UTC (permalink / raw)
To: linux-mmc; +Cc: Chris Ball, Ohad Ben-Cohen
006ebd5d introduced sdio_disable_cd(), which disconnects the pull-up
resistor on CD/DAT[3] (pin 1) of the card.
Make it possible to start using sdio_disable_cd() by introducing
MMC_QUIRK_DISABLE_CD.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
Chris, I've posted this one before. Sending it again, this time with a follow-up patch that uses the new mmc quirks facility. thanks!
drivers/mmc/core/sdio.c | 2 +-
include/linux/mmc/card.h | 6 ++++++
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index c3c2bd0..a5840c0 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -187,7 +187,7 @@ static int sdio_disable_cd(struct mmc_card *card)
int ret;
u8 ctrl;
- if (!card->cccr.disable_cd)
+ if (!mmc_card_disable_cd(card))
return 0;
ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_IF, 0, &ctrl);
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index c7f1532..4e03be8 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -126,6 +126,7 @@ struct mmc_card {
/* (missing CIA registers) */
#define MMC_QUIRK_BROKEN_CLK_GATING (1<<3) /* clock gating the sdio bus will make card fail */
#define MMC_QUIRK_NONSTD_FUNC_IF (1<<4) /* SDIO card has nonstd function interfaces */
+#define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */
unsigned int erase_size; /* erase size in sectors */
unsigned int erase_shift; /* if erase unit is power 2 */
@@ -181,6 +182,11 @@ static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c)
return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
}
+static inline int mmc_card_disable_cd(const struct mmc_card *c)
+{
+ return c->quirks & MMC_QUIRK_DISABLE_CD;
+}
+
static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c)
{
return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF;
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] mmc: quirks: wl1271 is MMC_QUIRK_DISABLE_CD
2011-04-05 15:02 [PATCH 1/2] mmc: add MMC_QUIRK_DISABLE_CD Ohad Ben-Cohen
@ 2011-04-05 15:02 ` Ohad Ben-Cohen
2011-04-05 15:26 ` Chris Ball
2011-04-05 15:26 ` [PATCH 1/2] mmc: add MMC_QUIRK_DISABLE_CD Chris Ball
1 sibling, 1 reply; 4+ messages in thread
From: Ohad Ben-Cohen @ 2011-04-05 15:02 UTC (permalink / raw)
To: linux-mmc; +Cc: Chris Ball, Ohad Ben-Cohen
The wl12xx device supports disconnecting the pull-up resistor on
CD/DAT[3] (pin 1) of the card.
Tell SDIO core to disconnect that resistor during card init,
since we don't need it at that point (and anyway all
hosts shall provide pull-up resistors on all data lines DAT[3:0]
as described in section 6 of the SD physical specification).
As a result, this may save some power, but it's also generally healthy
since it prevents both ends from pulling up that pin, which
results in undesirable asymmetric physical bus.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
drivers/mmc/core/quirks.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/core/quirks.c b/drivers/mmc/core/quirks.c
index 1957398..a4c42ed 100644
--- a/drivers/mmc/core/quirks.c
+++ b/drivers/mmc/core/quirks.c
@@ -66,6 +66,8 @@ static const struct mmc_fixup mmc_fixup_methods[] = {
remove_quirk, MMC_QUIRK_BROKEN_CLK_GATING },
{ SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271,
add_quirk, MMC_QUIRK_NONSTD_FUNC_IF },
+ { SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271,
+ add_quirk, MMC_QUIRK_DISABLE_CD },
{ 0 }
};
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] mmc: add MMC_QUIRK_DISABLE_CD
2011-04-05 15:02 [PATCH 1/2] mmc: add MMC_QUIRK_DISABLE_CD Ohad Ben-Cohen
2011-04-05 15:02 ` [PATCH 2/2] mmc: quirks: wl1271 is MMC_QUIRK_DISABLE_CD Ohad Ben-Cohen
@ 2011-04-05 15:26 ` Chris Ball
1 sibling, 0 replies; 4+ messages in thread
From: Chris Ball @ 2011-04-05 15:26 UTC (permalink / raw)
To: Ohad Ben-Cohen; +Cc: linux-mmc
Hi,
On Tue, Apr 05 2011, Ohad Ben-Cohen wrote:
> 006ebd5d introduced sdio_disable_cd(), which disconnects the pull-up
> resistor on CD/DAT[3] (pin 1) of the card.
>
> Make it possible to start using sdio_disable_cd() by introducing
> MMC_QUIRK_DISABLE_CD.
>
> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
> ---
> Chris, I've posted this one before. Sending it again, this time with a follow-up patch that uses the new mmc quirks facility. thanks!
>
> drivers/mmc/core/sdio.c | 2 +-
> include/linux/mmc/card.h | 6 ++++++
> 2 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> index c3c2bd0..a5840c0 100644
> --- a/drivers/mmc/core/sdio.c
> +++ b/drivers/mmc/core/sdio.c
> @@ -187,7 +187,7 @@ static int sdio_disable_cd(struct mmc_card *card)
> int ret;
> u8 ctrl;
>
> - if (!card->cccr.disable_cd)
> + if (!mmc_card_disable_cd(card))
> return 0;
>
> ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_IF, 0, &ctrl);
> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
> index c7f1532..4e03be8 100644
> --- a/include/linux/mmc/card.h
> +++ b/include/linux/mmc/card.h
> @@ -126,6 +126,7 @@ struct mmc_card {
> /* (missing CIA registers) */
> #define MMC_QUIRK_BROKEN_CLK_GATING (1<<3) /* clock gating the sdio bus will make card fail */
> #define MMC_QUIRK_NONSTD_FUNC_IF (1<<4) /* SDIO card has nonstd function interfaces */
> +#define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */
>
> unsigned int erase_size; /* erase size in sectors */
> unsigned int erase_shift; /* if erase unit is power 2 */
> @@ -181,6 +182,11 @@ static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c)
> return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
> }
>
> +static inline int mmc_card_disable_cd(const struct mmc_card *c)
> +{
> + return c->quirks & MMC_QUIRK_DISABLE_CD;
> +}
> +
> static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c)
> {
> return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF;
Thanks, pushed to mmc-next for .40.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] mmc: quirks: wl1271 is MMC_QUIRK_DISABLE_CD
2011-04-05 15:02 ` [PATCH 2/2] mmc: quirks: wl1271 is MMC_QUIRK_DISABLE_CD Ohad Ben-Cohen
@ 2011-04-05 15:26 ` Chris Ball
0 siblings, 0 replies; 4+ messages in thread
From: Chris Ball @ 2011-04-05 15:26 UTC (permalink / raw)
To: Ohad Ben-Cohen; +Cc: linux-mmc
Hi,
On Tue, Apr 05 2011, Ohad Ben-Cohen wrote:
> The wl12xx device supports disconnecting the pull-up resistor on
> CD/DAT[3] (pin 1) of the card.
>
> Tell SDIO core to disconnect that resistor during card init,
> since we don't need it at that point (and anyway all
> hosts shall provide pull-up resistors on all data lines DAT[3:0]
> as described in section 6 of the SD physical specification).
>
> As a result, this may save some power, but it's also generally healthy
> since it prevents both ends from pulling up that pin, which
> results in undesirable asymmetric physical bus.
>
> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
> ---
> drivers/mmc/core/quirks.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/core/quirks.c b/drivers/mmc/core/quirks.c
> index 1957398..a4c42ed 100644
> --- a/drivers/mmc/core/quirks.c
> +++ b/drivers/mmc/core/quirks.c
> @@ -66,6 +66,8 @@ static const struct mmc_fixup mmc_fixup_methods[] = {
> remove_quirk, MMC_QUIRK_BROKEN_CLK_GATING },
> { SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271,
> add_quirk, MMC_QUIRK_NONSTD_FUNC_IF },
> + { SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271,
> + add_quirk, MMC_QUIRK_DISABLE_CD },
> { 0 }
> };
Thanks, pushed to mmc-next for .40.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-05 15:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-05 15:02 [PATCH 1/2] mmc: add MMC_QUIRK_DISABLE_CD Ohad Ben-Cohen
2011-04-05 15:02 ` [PATCH 2/2] mmc: quirks: wl1271 is MMC_QUIRK_DISABLE_CD Ohad Ben-Cohen
2011-04-05 15:26 ` Chris Ball
2011-04-05 15:26 ` [PATCH 1/2] mmc: add MMC_QUIRK_DISABLE_CD Chris Ball
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).