Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164737
b: refs/heads/master
c: 006ebd5
h: refs/heads/master
i:
  164735: 2dac260
v: v3
  • Loading branch information
Ohad Ben-Cohen authored and Linus Torvalds committed Sep 23, 2009
1 parent 797923f commit 342acf3
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 653f41b52dfc63fecf4a2333f13be28b159a918c
refs/heads/master: 006ebd5de13854d6250eecc76866bbfad1ff7daf
30 changes: 30 additions & 0 deletions trunk/drivers/mmc/core/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,29 @@ static int sdio_enable_wide(struct mmc_card *card)
return 0;
}

/*
* If desired, disconnect the pull-up resistor on CD/DAT[3] (pin 1)
* of the card. This may be required on certain setups of boards,
* controllers and embedded sdio device which do not need the card's
* pull-up. As a result, card detection is disabled and power is saved.
*/
static int sdio_disable_cd(struct mmc_card *card)
{
int ret;
u8 ctrl;

if (!card->cccr.disable_cd)
return 0;

ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_IF, 0, &ctrl);
if (ret)
return ret;

ctrl |= SDIO_BUS_CD_DISABLE;

return mmc_io_rw_direct(card, 1, 0, SDIO_CCCR_IF, ctrl, NULL);
}

/*
* Test if the card supports high-speed mode and, if so, switch to it.
*/
Expand Down Expand Up @@ -384,6 +407,13 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
if (err)
goto remove;

/*
* If needed, disconnect card detection pull-up resistor.
*/
err = sdio_disable_cd(card);
if (err)
goto remove;

/*
* Initialize (but don't add) all present functions.
*/
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/mmc/card.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ struct sdio_cccr {
low_speed:1,
wide_bus:1,
high_power:1,
high_speed:1;
high_speed:1,
disable_cd:1;
};

struct sdio_cis {
Expand Down

0 comments on commit 342acf3

Please sign in to comment.