示例#1
0
/*
 *  CF card detect check function
 */
static void emxx_cfi_detect_check(struct work_struct *work)
{
	hw_regs_t *hws[] = { &emxx_cfi_hw, NULL, NULL, NULL };
	int ret;

	if (gpio_get_value(GPIO_P101) == 0) {
		printk(KERN_INFO "emxx_ide: plag-IN CFCARD\n");
		if (emxx_cfi_host) {
			emxx_cfi_connect = 0;
			mdelay(200);
			ide_host_remove(emxx_cfi_host);
			emxx_cfi_disable();
			emxx_cfi_host = NULL;
		} else {
			emxx_cfi_disable();
			mdelay(200);
		}

		emxx_cfi_host = ide_host_alloc(&emxx_ide_port_info, hws);
		if (!emxx_cfi_host) {
			perr("failed to allocate ide host\n");
			return;
		}

		/* Set the irq handler */
		emxx_cfi_host->irq_handler = emxx_cfi_irq_handler;

		emxx_cfi_enable();

		emxx_cfi_connect = 1;

		emxx_cfi_push++;

		/* Register the CF info into the ide host */
		ret = ide_host_register(emxx_cfi_host,
				&emxx_ide_port_info, hws);

		emxx_cfi_push--;

		if (ret) {
			perr("failed to register ide host\n");
			emxx_cfi_connect = 0;
			ide_host_free(emxx_cfi_host);
			emxx_cfi_disable();
			emxx_cfi_host = NULL;
		}
	} else {
		printk(KERN_INFO "emxx_ide: plag-OUT CFCARD\n");
		if (emxx_cfi_host) {
			emxx_cfi_connect = 0;
			mdelay(200);
			ide_host_remove(emxx_cfi_host);
			emxx_cfi_disable();
			emxx_cfi_host = NULL;
		}
	}
}
示例#2
0
static int __exit tx4938ide_remove(struct platform_device *pdev)
{
    struct ide_host *host = platform_get_drvdata(pdev);

    ide_host_remove(host);
    return 0;
}
示例#3
0
static int plat_ide_remove(struct platform_device *pdev)
{
	struct ide_host *host = dev_get_drvdata(&pdev->dev);

	ide_host_remove(host);

	return 0;
}
示例#4
0
文件: gayle.c 项目: ChineseDr/linux
static int __exit amiga_gayle_ide_remove(struct platform_device *pdev)
{
    struct ide_host *host = platform_get_drvdata(pdev);
    struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

    ide_host_remove(host);
    release_mem_region(res->start, resource_size(res));
    return 0;
}
static void idepnp_remove(struct pnp_dev *dev)
{
	struct ide_host *host = pnp_get_drvdata(dev);

	ide_host_remove(host);

	release_region(pnp_port_start(dev, 1), 1);
	release_region(pnp_port_start(dev, 0), 8);
}
示例#6
0
static void
delkin_cb_remove (struct pci_dev *dev)
{
	struct ide_host *host = pci_get_drvdata(dev);

	ide_host_remove(host);

	pci_release_regions(dev);
	pci_disable_device(dev);
}
示例#7
0
static void __devexit rapide_remove(struct expansion_card *ec)
{
	struct ide_host *host = ecard_get_drvdata(ec);

	ecard_set_drvdata(ec, NULL);

	ide_host_remove(host);

	ecard_release_resources(ec);
}
示例#8
0
/*
 * remove function, release the driver resource
 */
static int __exit emxx_cfi_remove(struct platform_device *pdev)
{
	if (emxx_cfi_host) {
		ide_host_remove(emxx_cfi_host);
		emxx_cfi_disable();
	}

	free_irq(INT_GPIO_101, NULL);
	destroy_workqueue(emxx_cfi_workqueue);

	return 0;
}
示例#9
0
static void __devexit scc_remove(struct pci_dev *dev)
{
	struct scc_ports *ports = pci_get_drvdata(dev);
	struct ide_host *host = ports->host;

	ide_host_remove(host);

	iounmap((void*)ports->dma);
	iounmap((void*)ports->ctl);
	pci_release_selected_regions(dev, (1 << 2) - 1);
	memset(ports, 0, sizeof(*ports));
}
示例#10
0
文件: au1xxx-ide.c 项目: 3null/linux
static int au_ide_remove(struct platform_device *dev)
{
	struct resource *res;
	struct ide_host *host = platform_get_drvdata(dev);
	_auide_hwif *ahwif = &auide_hwif;

	ide_host_remove(host);

	iounmap((void *)ahwif->regbase);

	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
	release_mem_region(res->start, resource_size(res));

	return 0;
}
示例#11
0
static void ide_release(struct pcmcia_device *link)
{
    ide_info_t *info = link->priv;
    struct ide_host *host = info->host;

    DEBUG(0, "ide_release(0x%p)\n", link);

    if (info->ndev)
	
	ide_host_remove(host);

    info->ndev = 0;

    pcmcia_disable_device(link);
} 
示例#12
0
static void ide_release(struct pcmcia_device *link)
{
    ide_info_t *info = link->priv;
    struct ide_host *host = info->host;

    DEBUG(0, "ide_release(0x%p)\n", link);

    if (info->ndev)
	/* FIXME: if this fails we need to queue the cleanup somehow
	   -- need to investigate the required PCMCIA magic */
	ide_host_remove(host);

    info->ndev = 0;

    pcmcia_disable_device(link);
} /* ide_release */
示例#13
0
static void ide_release(struct pcmcia_device *link)
{
    ide_info_t *info = link->priv;
    struct ide_host *host = info->host;

    dev_dbg(&link->dev, "ide_release(0x%p)\n", link);

    if (info->ndev) {
	ide_hwif_t *hwif = host->ports[0];
	unsigned long data_addr, ctl_addr;

	data_addr = hwif->io_ports.data_addr;
	ctl_addr = hwif->io_ports.ctl_addr;

	ide_host_remove(host);
	info->ndev = 0;

	release_region(ctl_addr, 1);
	release_region(data_addr, 8);
    }

    pcmcia_disable_device(link);
} /* ide_release */