diff options
Diffstat (limited to 'sys/arm/ti/ti_adc.c')
-rw-r--r-- | sys/arm/ti/ti_adc.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/arm/ti/ti_adc.c b/sys/arm/ti/ti_adc.c index d65afc6..f11091f 100644 --- a/sys/arm/ti/ti_adc.c +++ b/sys/arm/ti/ti_adc.c @@ -161,11 +161,9 @@ ti_adc_input_setup(struct ti_adc_softc *sc, int32_t ain) /* Set the negative voltage reference. */ val &= ~ADC_STEP_RFM_MSK; - val |= ADC_STEP_RFM_VREFN << ADC_STEP_RFM_SHIFT; /* Set the positive voltage reference. */ val &= ~ADC_STEP_RFP_MSK; - val |= ADC_STEP_RFP_VREFP << ADC_STEP_RFP_SHIFT; /* Set the samples average. */ val &= ~ADC_STEP_AVG_MSK; @@ -450,11 +448,9 @@ ti_adc_idlestep_init(struct ti_adc_softc *sc) /* Set the negative voltage reference. */ val &= ~ADC_STEP_RFM_MSK; - val |= ADC_STEP_RFM_VREFN << ADC_STEP_RFM_SHIFT; /* Set the positive voltage reference. */ val &= ~ADC_STEP_RFP_MSK; - val |= ADC_STEP_RFP_VREFP << ADC_STEP_RFP_SHIFT; /* Connect the input to VREFN. */ val &= ~ADC_STEP_INP_MSK; @@ -484,6 +480,11 @@ ti_adc_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; + /* Activate the ADC_TSC module. */ + err = ti_prcm_clk_enable(TSC_ADC_CLK); + if (err) + return (err); + rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -509,11 +510,6 @@ ti_adc_attach(device_t dev) return (ENXIO); } - /* Activate the ADC_TSC module. */ - err = ti_prcm_clk_enable(TSC_ADC_CLK); - if (err) - return (err); - /* Check the ADC revision. */ rev = ADC_READ4(sc, ADC_REVISION); device_printf(dev, |