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

Function ti_adc_enable_proc

freebsd/arm/ti/ti_adc.c:297–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297static int
298ti_adc_enable_proc(SYSCTL_HANDLER_ARGS)
299{
300 int error;
301 int32_t enable;
302 struct ti_adc_softc *sc;
303 struct ti_adc_input *input;
304
305 input = (struct ti_adc_input *)arg1;
306 sc = input->sc;
307
308 enable = input->enable;
309 error = sysctl_handle_int(oidp, &enable, sizeof(enable),
310 req);
311 if (error != 0 || req->newptr == NULL)
312 return (error);
313
314 if (enable)
315 enable = 1;
316
317 TI_ADC_LOCK(sc);
318 /* Setup the ADC as needed. */
319 if (input->enable != enable) {
320 input->enable = enable;
321 ti_adc_setup(sc);
322 if (input->enable == 0)
323 input->value = 0;
324 }
325 TI_ADC_UNLOCK(sc);
326
327 return (0);
328}
329
330static int
331ti_adc_open_delay_proc(SYSCTL_HANDLER_ARGS)

Callers

nothing calls this directly

Calls 2

sysctl_handle_intFunction · 0.85
ti_adc_setupFunction · 0.85

Tested by

no test coverage detected