MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ti_adc_detach

Function ti_adc_detach

freebsd/arm/ti/ti_adc.c:917–945  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

915}
916
917static int
918ti_adc_detach(device_t dev)
919{
920 struct ti_adc_softc *sc;
921
922 sc = device_get_softc(dev);
923
924 /* Turn off the ADC. */
925 TI_ADC_LOCK(sc);
926 ti_adc_reset(sc);
927 ti_adc_setup(sc);
928
929#ifdef EVDEV_SUPPORT
930 evdev_free(sc->sc_evdev);
931#endif
932
933 TI_ADC_UNLOCK(sc);
934
935 TI_ADC_LOCK_DESTROY(sc);
936
937 if (sc->sc_intrhand)
938 bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand);
939 if (sc->sc_irq_res)
940 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res);
941 if (sc->sc_mem_res)
942 bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res);
943
944 return (bus_generic_detach(dev));
945}
946
947static device_method_t ti_adc_methods[] = {
948 DEVMETHOD(device_probe, ti_adc_probe),

Callers 1

ti_adc_attachFunction · 0.85

Calls 6

device_get_softcFunction · 0.85
ti_adc_resetFunction · 0.85
ti_adc_setupFunction · 0.85
bus_teardown_intrFunction · 0.85
bus_release_resourceFunction · 0.85
bus_generic_detachFunction · 0.85

Tested by

no test coverage detected