Exemple #1
0
static int __init macide_init(void)
{
	unsigned long base;
	int irq;
	struct ide_hw hw, *hws[] = { &hw };
	struct ide_port_info d = macide_port_info;

	if (!MACH_IS_MAC)
		return -ENODEV;

	switch (macintosh_config->ide_type) {
	case MAC_IDE_QUADRA:
		base = IDE_BASE;
		irq = IRQ_NUBUS_F;
		break;
	case MAC_IDE_PB:
		base = IDE_BASE;
		irq = IRQ_NUBUS_C;
		break;
	case MAC_IDE_BABOON:
		base = BABOON_BASE;
		d.port_ops = NULL;
		irq = IRQ_BABOON_1;
		break;
	default:
		return -ENODEV;
	}

//	printk(KERN_INFO "ide: Macintosh %s IDE controller\n",
;

	macide_setup_ports(&hw, base, irq);

	return ide_host_add(&d, hws, 1, NULL);
}
Exemple #2
0
static int __init macide_init(void)
{
    ide_hwif_t *hwif;
    ide_ack_intr_t *ack_intr;
    unsigned long base;
    int irq;
    hw_regs_t hw;

    if (!MACH_IS_MAC)
        return -ENODEV;

    switch (macintosh_config->ide_type) {
    case MAC_IDE_QUADRA:
        base = IDE_BASE;
        ack_intr = macide_ack_intr;
        irq = IRQ_NUBUS_F;
        break;
    case MAC_IDE_PB:
        base = IDE_BASE;
        ack_intr = macide_ack_intr;
        irq = IRQ_NUBUS_C;
        break;
    case MAC_IDE_BABOON:
        base = BABOON_BASE;
        ack_intr = NULL;
        irq = IRQ_BABOON_1;
        break;
    default:
        return -ENODEV;
    }

    printk(KERN_INFO "ide: Macintosh %s IDE controller\n",
             mac_ide_name[macintosh_config->ide_type - 1]);

    macide_setup_ports(&hw, base, irq, ack_intr);

    hwif = ide_find_port();
    if (hwif) {
        u8 index = hwif->index;
        u8 idx[4] = { index, 0xff, 0xff, 0xff };

        ide_init_port_data(hwif, index);
        ide_init_port_hw(hwif, &hw);

        ide_device_add(idx, NULL);
    }

    return 0;
}
static int __init macide_init(void)
{
	ide_ack_intr_t *ack_intr;
	unsigned long base;
	int irq;
	hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };

	if (!MACH_IS_MAC)
		return -ENODEV;

	switch (macintosh_config->ide_type) {
	case MAC_IDE_QUADRA:
		base = IDE_BASE;
		ack_intr = macide_ack_intr;
		irq = IRQ_NUBUS_F;
		break;
	case MAC_IDE_PB:
		base = IDE_BASE;
		ack_intr = macide_ack_intr;
		irq = IRQ_NUBUS_C;
		break;
	case MAC_IDE_BABOON:
		base = BABOON_BASE;
		ack_intr = NULL;
		irq = IRQ_BABOON_1;
		break;
	default:
		return -ENODEV;
	}

	printk(KERN_INFO "ide: Macintosh %s IDE controller\n",
			 mac_ide_name[macintosh_config->ide_type - 1]);

	macide_setup_ports(&hw, base, irq, ack_intr);

	return ide_host_add(&macide_port_info, hws, NULL);
}