| 295 | } |
| 296 | |
| 297 | static int |
| 298 | ti_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 | |
| 330 | static int |
| 331 | ti_adc_open_delay_proc(SYSCTL_HANDLER_ARGS) |
nothing calls this directly
no test coverage detected