aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/jmicron.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-03-17 16:57:25 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-03-17 16:57:25 -0400
commitebbc2031362cfac7f325f051c619dc39ef4892ed (patch)
tree40f7dfe314053f571be793db10e4dfd308cfd61f /drivers/ide/pci/jmicron.c
parent9c67cd146084040648b72933f138eeb72104be9d (diff)
jmicron: make ide jmicron driver play nice with libata ones
When libata is configured, the device is configured such that SATA and PATA ports live in separate functions with different programming interfaces. pata_jmicron and ide jmicron drivers can drive only the PATA part. This patch makes jmicron match PCI class code such that it doesn't attach itself to the SATA part preventing the proper ahci driver from attaching. This change is suggested by Bartlomiej. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Jeff Garzik <jeff@garzik.org> Cc: justin@jmicron.com Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/jmicron.c')
-rw-r--r--drivers/ide/pci/jmicron.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c
index 53f25500c22b..be4fc96c29e0 100644
--- a/drivers/ide/pci/jmicron.c
+++ b/drivers/ide/pci/jmicron.c
@@ -240,12 +240,31 @@ static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_devi
240 return 0; 240 return 0;
241} 241}
242 242
243/* If libata is configured, jmicron PCI quirk will configure it such
244 * that the SATA ports are in AHCI function while the PATA ports are
245 * in a separate IDE function. In such cases, match device class and
246 * attach only to IDE. If libata isn't configured, keep the old
247 * behavior for backward compatibility.
248 */
249#if defined(CONFIG_ATA) || defined(CONFIG_ATA_MODULE)
250#define JMB_CLASS PCI_CLASS_STORAGE_IDE << 8
251#define JMB_CLASS_MASK 0xffff00
252#else
253#define JMB_CLASS 0
254#define JMB_CLASS_MASK 0
255#endif
256
243static struct pci_device_id jmicron_pci_tbl[] = { 257static struct pci_device_id jmicron_pci_tbl[] = {
244 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 258 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361,
245 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, 259 PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 0},
246 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, 260 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363,
247 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, 261 PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 1},
248 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, 262 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365,
263 PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 2},
264 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366,
265 PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 3},
266 { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368,
267 PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 4},
249 { 0, }, 268 { 0, },
250}; 269};
251 270