FreeBSD/sys/arm/ti/ti_i2c.c
/**
 *	ti_i2c_deactivate - deactivates the controller and releases resources
 *	@dev: i2c device handle
 *
 *
 *
 *	LOCKING:
 *	Assumed called in an atomic context.
 *
 *	RETURNS:
 *	nothing
 */
deactivates the controller and releases resources
@dev: i2c device handle



Assumed called in an atomic context.

nothing
deactivates the controller and releases resources @dev : i2c device handle Assumed called in an atomic context . nothing
static void
ti_i2c_deactivate(device_t dev)
{
	struct ti_i2c_softc *sc = device_get_softc(dev);
	ti_i2c_write_2(sc, I2C_REG_IRQENABLE_CLR, 0xffff);
	ti_i2c_write_2(sc, I2C_REG_STATUS, 0xffff);
	ti_i2c_write_2(sc, I2C_REG_CON, 0);
	if (sc->sc_irq_h != NULL) {
		bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_irq_h);
		sc->sc_irq_h = NULL;
	}
	bus_generic_detach(sc->sc_dev);
	if (sc->sc_mem_res != NULL) {
		bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res);
		sc->sc_mem_res = NULL;
	}
	if (sc->sc_irq_res != NULL) {
		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res);
		sc->sc_irq_res = NULL;
	}
	ti_prcm_clk_disable(sc->clk_id);
}
static void ti_i2c_deactivate ( device_t dev ) { struct ti_i2c_softc * sc = device_get_softc ( dev ) ; ti_i2c_write_2 ( sc , I2C_REG_IRQENABLE_CLR , 0xffff ) ; ti_i2c_write_2 ( sc , I2C_REG_STATUS , 0xffff ) ; ti_i2c_write_2 ( sc , I2C_REG_CON , 0 ) ; if ( sc -> sc_irq_h != NULL ) { bus_teardown_intr ( dev , sc -> sc_irq_res , sc -> sc_irq_h ) ; sc -> sc_irq_h = NULL ; } bus_generic_detach ( sc -> sc_dev ) ; if ( sc -> sc_mem_res != NULL ) { bus_release_resource ( dev , SYS_RES_MEMORY , 0 , sc -> sc_mem_res ) ; sc -> sc_mem_res = NULL ; } if ( sc -> sc_irq_res != NULL ) { bus_release_resource ( dev , SYS_RES_IRQ , 0 , sc -> sc_irq_res ) ; sc -> sc_irq_res = NULL ; } ti_prcm_clk_disable ( sc -> clk_id ) ; }
ti_i2c_deactivate - deactivates the controller and releases resources
      @dev: i2c device handle
ti_i2c_deactivate - deactivates the controller and releases resources @dev : i2c device handle
/* Disable the controller - cancel all transactions. */ /* Release the interrupt handler. */ /* Unmap the I2C controller registers. */ /* Release the IRQ resource. */ /* Finally disable the functional and interface clocks. */