Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31659
b: refs/heads/master
c: 6743527
h: refs/heads/master
i:
  31657: c50b3df
  31655: 401e148
v: v3
  • Loading branch information
Pierre Ossman authored and Russell King committed Jul 2, 2006
1 parent d080d15 commit 83cb60c
Show file tree
Hide file tree
Showing 3 changed files with 34 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: d96649ed5ace812ffc8d86252d7c663326ca47f8
refs/heads/master: 6743527441430586aa82a0dee1b2700a2a974ebc
30 changes: 29 additions & 1 deletion trunk/drivers/mmc/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
#define DBG(f, x...) \
pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x)

static unsigned int debug_nodma = 0;
static unsigned int debug_forcedma = 0;

static const struct pci_device_id pci_ids[] __devinitdata = {
/* handle any SD host controller */
{PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00)},
Expand Down Expand Up @@ -1105,6 +1108,16 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
return -ENODEV;
}

if ((pdev->class & 0x0000FF) == PCI_SDHCI_IFVENDOR) {
printk(KERN_ERR DRIVER_NAME ": Vendor specific interface. Aborting.\n");
return -ENODEV;
}

if ((pdev->class & 0x0000FF) > PCI_SDHCI_IFVENDOR) {
printk(KERN_ERR DRIVER_NAME ": Unknown interface. Aborting.\n");
return -ENODEV;
}

mmc = mmc_alloc_host(sizeof(struct sdhci_host), &pdev->dev);
if (!mmc)
return -ENOMEM;
Expand Down Expand Up @@ -1146,7 +1159,16 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)

caps = readl(host->ioaddr + SDHCI_CAPABILITIES);

if ((caps & SDHCI_CAN_DO_DMA) && ((pdev->class & 0x0000FF) == 0x01))
if (debug_nodma)
DBG("DMA forced off\n");
else if (debug_forcedma) {
DBG("DMA forced on\n");
host->flags |= SDHCI_USE_DMA;
} else if ((pdev->class & 0x0000FF) != PCI_SDHCI_IFDMA)
DBG("Controller doesn't have DMA interface\n");
else if (!(caps & SDHCI_CAN_DO_DMA))
DBG("Controller doesn't have DMA capability\n");
else
host->flags |= SDHCI_USE_DMA;

if (host->flags & SDHCI_USE_DMA) {
Expand Down Expand Up @@ -1429,7 +1451,13 @@ static void __exit sdhci_drv_exit(void)
module_init(sdhci_drv_init);
module_exit(sdhci_drv_exit);

module_param(debug_nodma, uint, 0444);
module_param(debug_forcedma, uint, 0444);

MODULE_AUTHOR("Pierre Ossman <drzeus@drzeus.cx>");
MODULE_DESCRIPTION("Secure Digital Host Controller Interface driver");
MODULE_VERSION(DRIVER_VERSION);
MODULE_LICENSE("GPL");

MODULE_PARM_DESC(debug_nodma, "Forcefully disable DMA transfers. (default 0)");
MODULE_PARM_DESC(debug_forcedma, "Forcefully enable DMA transfers. (default 0)");
4 changes: 4 additions & 0 deletions trunk/drivers/mmc/sdhci.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
* PCI registers
*/

#define PCI_SDHCI_IFPIO 0x00
#define PCI_SDHCI_IFDMA 0x01
#define PCI_SDHCI_IFVENDOR 0x02

#define PCI_SLOT_INFO 0x40 /* 8 bits */
#define PCI_SLOT_INFO_SLOTS(x) ((x >> 4) & 7)
#define PCI_SLOT_INFO_FIRST_BAR_MASK 0x07
Expand Down

0 comments on commit 83cb60c

Please sign in to comment.