112 pci_read_config_byte(fw_dev, 0xCB, &disable);
113 pci_write_config_byte(fw_dev, 0xCA, 0x57);
114 pci_write_config_byte(fw_dev, 0xCB, disable & ~0x02);
115 pci_write_config_byte(fw_dev, 0xCA, write_enable);
116 }
117
118 printk(KERN_INFO DRIVER_NAME
119 ": Controller is now re-enabled.\n");
120
121 return 0;
122}
123
124static int __devinit ricoh_mmc_probe(struct pci_dev *pdev,
125 const struct pci_device_id *ent)
126{
127 u8 rev;
128 u8 ctrlfound = 0;
129
130 struct pci_dev *fw_dev = NULL;
131
132 BUG_ON(pdev == NULL);
133 BUG_ON(ent == NULL);
134
135 pci_read_config_byte(pdev, PCI_CLASS_REVISION, &rev);
136
137 printk(KERN_INFO DRIVER_NAME
138 ": Ricoh MMC controller found at %s [%04x:%04x] (rev %x)\n",
139 pci_name(pdev), (int)pdev->vendor, (int)pdev->device,
140 (int)rev);
141
142 while ((fw_dev =
143 pci_get_device(PCI_VENDOR_ID_RICOH,
144 PCI_DEVICE_ID_RICOH_RL5C476, fw_dev))) {
145 if (PCI_SLOT(pdev->devfn) == PCI_SLOT(fw_dev->devfn) &&
146 pdev->bus == fw_dev->bus) {
147 if (ricoh_mmc_disable(fw_dev) != 0)
148 return -ENODEV;
149
150 pci_set_drvdata(pdev, fw_dev);
151
152 ++ctrlfound;