Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270296
b: refs/heads/master
c: c43fd77
h: refs/heads/master
v: v3
  • Loading branch information
Adrian Hunter authored and Chris Ball committed Oct 26, 2011
1 parent d3030e8 commit ec5111c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 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: e840ce134ba5c617af97a2adbedefb0a9c0bb5a7
refs/heads/master: c43fd7746698a10aa6435d62ec28f977dd6246cc
17 changes: 13 additions & 4 deletions trunk/drivers/mmc/host/sdhci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ struct sdhci_pci_slot;

struct sdhci_pci_fixes {
unsigned int quirks;
bool allow_runtime_pm;

int (*probe) (struct sdhci_pci_chip *);

Expand All @@ -72,6 +73,7 @@ struct sdhci_pci_chip {
struct pci_dev *pdev;

unsigned int quirks;
bool allow_runtime_pm;
const struct sdhci_pci_fixes *fixes;

int num_slots; /* Slots on controller */
Expand Down Expand Up @@ -305,16 +307,19 @@ static const struct sdhci_pci_fixes sdhci_intel_mrst_hc1_hc2 = {

static const struct sdhci_pci_fixes sdhci_intel_mfd_sd = {
.quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
.allow_runtime_pm = true,
.probe_slot = mfd_sd_probe_slot,
.remove_slot = mfd_sd_remove_slot,
};

static const struct sdhci_pci_fixes sdhci_intel_mfd_sdio = {
.quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
.allow_runtime_pm = true,
};

static const struct sdhci_pci_fixes sdhci_intel_mfd_emmc = {
.quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
.allow_runtime_pm = true,
.probe_slot = mfd_emmc_probe_slot,
.remove_slot = mfd_emmc_remove_slot,
};
Expand Down Expand Up @@ -1355,8 +1360,10 @@ static int __devinit sdhci_pci_probe(struct pci_dev *pdev,

chip->pdev = pdev;
chip->fixes = (const struct sdhci_pci_fixes *)ent->driver_data;
if (chip->fixes)
if (chip->fixes) {
chip->quirks = chip->fixes->quirks;
chip->allow_runtime_pm = chip->fixes->allow_runtime_pm;
}
chip->num_slots = slots;

pci_set_drvdata(pdev, chip);
Expand All @@ -1381,7 +1388,8 @@ static int __devinit sdhci_pci_probe(struct pci_dev *pdev,
chip->slots[i] = slot;
}

sdhci_pci_runtime_pm_allow(&pdev->dev);
if (chip->allow_runtime_pm)
sdhci_pci_runtime_pm_allow(&pdev->dev);

return 0;

Expand All @@ -1399,11 +1407,12 @@ static void __devexit sdhci_pci_remove(struct pci_dev *pdev)
int i;
struct sdhci_pci_chip *chip;

sdhci_pci_runtime_pm_forbid(&pdev->dev);

chip = pci_get_drvdata(pdev);

if (chip) {
if (chip->allow_runtime_pm)
sdhci_pci_runtime_pm_forbid(&pdev->dev);

for (i = 0; i < chip->num_slots; i++)
sdhci_pci_remove_slot(chip->slots[i]);

Expand Down

0 comments on commit ec5111c

Please sign in to comment.