Ejemplo n.º 1
0
Archivo: main.c Proyecto: df9ry/daisy
/*
 * Start / stop stuff:
 */
static void spi16_term(void)
{
	printk(KERN_INFO "spi16: Terminate\n");

	printk(KERN_DEBUG "spi16: spi_unregister_driver\n");
	if (spi16_driver_initialized) {
		spi_unregister_driver(&spi16_driver);
		spi16_driver_initialized = false;
	}

	printk(KERN_DEBUG "spi16: spi_unregister_master\n");
	if (spi16_master) {
		spi_unregister_master(spi16_master);
		spi16_master = NULL;
	}

	printk(KERN_DEBUG "spi16: device_unregister\n");
	if (spi16_bus_initialized) {
		device_unregister(&spi16_bus);
		spi16_bus_initialized = false;
	}

	printk(KERN_DEBUG "spi16: bus_unregister\n");
	if (spi16_bus_type_initialized) {
		bus_unregister(&spi16_bus_type);
		spi16_bus_type_initialized = false;
	}

	printk(KERN_DEBUG "spi16: Terminate complete\n");
}
Ejemplo n.º 2
0
static int cns3xxx_spi_remove(struct platform_device *dev)
{
	struct cns3xxx_spi *hw = platform_get_drvdata(dev);

	platform_set_drvdata(dev, NULL);

	spi_unregister_master(hw->master);

	spi_master_put(hw->master);
	return 0;
}
Ejemplo n.º 3
0
int bcm_qspi_remove(struct platform_device *pdev)
{
	struct bcm_qspi *qspi = platform_get_drvdata(pdev);

	bcm_qspi_hw_uninit(qspi);
	clk_disable_unprepare(qspi->clk);
	kfree(qspi->dev_ids);
	spi_unregister_master(qspi->master);

	return 0;
}
Ejemplo n.º 4
0
/**
 * zynq_qspi_remove - Remove method for the QSPI driver
 * @pdev:	Pointer to the platform_device structure
 *
 * This function is called if a device is physically removed from the system or
 * if the driver module is being unloaded. It frees all resources allocated to
 * the device.
 *
 * Return:	0 on success and error value on failure
 */
static int zynq_qspi_remove(struct platform_device *pdev)
{
	struct spi_master *master = platform_get_drvdata(pdev);
	struct zynq_qspi *xqspi = spi_master_get_devdata(master);

	zynq_qspi_write(xqspi, ZYNQ_QSPI_ENABLE_OFFSET, 0);

	clk_disable_unprepare(xqspi->refclk);
	clk_disable_unprepare(xqspi->pclk);

	spi_unregister_master(master);

	return 0;
}
Ejemplo n.º 5
0
/**
 * cdns_spi_remove - Remove method for the SPI driver
 * @pdev:	Pointer to the platform_device structure
 *
 * This function is called if a device is physically removed from the system or
 * if the driver module is being unloaded. It frees all resources allocated to
 * the device.
 *
 * Return:	0 on success and error value on error
 */
static int cdns_spi_remove(struct platform_device *pdev)
{
	struct spi_master *master = platform_get_drvdata(pdev);
	struct cdns_spi *xspi = spi_master_get_devdata(master);

	cdns_spi_write(xspi, CDNS_SPI_ER_OFFSET,
		       CDNS_SPI_ER_DISABLE_MASK);

	clk_disable_unprepare(xspi->ref_clk);
	clk_disable_unprepare(xspi->pclk);

	spi_unregister_master(master);

	return 0;
}
Ejemplo n.º 6
0
/**
 * cdns_spi_remove - Remove method for the SPI driver
 * @pdev:	Pointer to the platform_device structure
 *
 * This function is called if a device is physically removed from the system or
 * if the driver module is being unloaded. It frees all resources allocated to
 * the device.
 *
 * Return:	0 on success and error value on error
 */
static int cdns_spi_remove(struct platform_device *pdev)
{
	struct spi_master *master = platform_get_drvdata(pdev);
	struct cdns_spi *xspi = spi_master_get_devdata(master);

	cdns_spi_write(xspi, CDNS_SPI_ER, CDNS_SPI_ER_DISABLE);

	clk_disable_unprepare(xspi->ref_clk);
	clk_disable_unprepare(xspi->pclk);
	pm_runtime_set_suspended(&pdev->dev);
	pm_runtime_disable(&pdev->dev);

	spi_unregister_master(master);

	return 0;
}
Ejemplo n.º 7
0
int mpc8xxx_spi_remove(struct device *dev)
{
	struct mpc8xxx_spi *mpc8xxx_spi;
	struct spi_master *master;

	master = dev_get_drvdata(dev);
	mpc8xxx_spi = spi_master_get_devdata(master);

	spi_unregister_master(master);

	free_irq(mpc8xxx_spi->irq, mpc8xxx_spi);

	if (mpc8xxx_spi->spi_remove)
		mpc8xxx_spi->spi_remove(mpc8xxx_spi);

	return 0;
}
Ejemplo n.º 8
0
int __devexit mpc8xxx_spi_remove(struct device *dev)
{
	struct mpc8xxx_spi *mpc8xxx_spi;
	struct spi_master *master;

	master = dev_get_drvdata(dev);
	mpc8xxx_spi = spi_master_get_devdata(master);

	flush_workqueue(mpc8xxx_spi->workqueue);
	destroy_workqueue(mpc8xxx_spi->workqueue);
	spi_unregister_master(master);

	free_irq(mpc8xxx_spi->irq, mpc8xxx_spi);

	if (mpc8xxx_spi->spi_remove)
		mpc8xxx_spi->spi_remove(mpc8xxx_spi);

	return 0;
}
Ejemplo n.º 9
0
static int __devexit mpc52xx_spi_remove(struct platform_device *op)
{
	struct spi_master *master = dev_get_drvdata(&op->dev);
	struct mpc52xx_spi *ms = spi_master_get_devdata(master);
	int i;

	free_irq(ms->irq0, ms);
	free_irq(ms->irq1, ms);

	for (i = 0; i < ms->gpio_cs_count; i++)
		gpio_free(ms->gpio_cs[i]);

	kfree(ms->gpio_cs);
	spi_unregister_master(master);
	spi_master_put(master);
	iounmap(ms->regs);

	return 0;
}
Ejemplo n.º 10
0
static int __exit s3c24xx_spi_remove(struct platform_device *dev)
{
    struct s3c24xx_spi *hw = platform_get_drvdata(dev);

    platform_set_drvdata(dev, NULL);

    spi_unregister_master(hw->master);

    clk_disable(hw->clk);
    clk_put(hw->clk);

    free_irq(hw->irq, hw);
    iounmap(hw->regs);

    release_resource(hw->ioarea);
    kfree(hw->ioarea);

    spi_master_put(hw->master);
    return 0;
}
Ejemplo n.º 11
0
/**
 * spi_bitbang_stop - stops the task providing spi communication
 */
void spi_bitbang_stop(struct spi_bitbang *bitbang)
{
	spi_unregister_master(bitbang->master);
}
Ejemplo n.º 12
0
static void bcm53xxspi_bcma_remove(struct bcma_device *core)
{
	struct bcm53xxspi *b53spi = bcma_get_drvdata(core);

	spi_unregister_master(b53spi->master);
}