diff options
author | loos <loos@FreeBSD.org> | 2014-05-17 19:06:46 +0000 |
---|---|---|
committer | loos <loos@FreeBSD.org> | 2014-05-17 19:06:46 +0000 |
commit | 7e7928763170f8b10771c099cf46224daaf67bca (patch) | |
tree | 836e93aec06dd9083febeae2d2b6642897e6ace0 /sys/arm/ti/am335x | |
parent | 1253f26158ac37c8e2dbe8087203a2059aa2bb56 (diff) | |
download | FreeBSD-src-7e7928763170f8b10771c099cf46224daaf67bca.zip FreeBSD-src-7e7928763170f8b10771c099cf46224daaf67bca.tar.gz |
Adds the ADC driver for TI AM3xxx SoC family.
The ADC has a 12bit resolution and its raw output can be read via sysctl(8)
interface.
The driver allows the setup of ADC clock, samples average and open delay
(the number of clock cycles to wait before start the conversion).
The TSC_ADC module is set in the general purpose mode (no touchscreen
support).
Tested on Beaglebone-black.
Written based on AM335x TRM.
Diffstat (limited to 'sys/arm/ti/am335x')
-rw-r--r-- | sys/arm/ti/am335x/am335x_prcm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/arm/ti/am335x/am335x_prcm.c b/sys/arm/ti/am335x/am335x_prcm.c index a146b76..325a838 100644 --- a/sys/arm/ti/am335x/am335x_prcm.c +++ b/sys/arm/ti/am335x/am335x_prcm.c @@ -107,6 +107,7 @@ __FBSDID("$FreeBSD$"); #define CM_WKUP_CM_CLKDCOLDO_DPLL_PER (CM_WKUP + 0x07C) #define CM_WKUP_CM_CLKMODE_DPLL_DISP (CM_WKUP + 0x098) #define CM_WKUP_I2C0_CLKCTRL (CM_WKUP + 0x0B8) +#define CM_WKUP_ADC_TSC_CLKCTRL (CM_WKUP + 0x0BC) #define CM_DPLL 0x500 #define CLKSEL_TIMER7_CLK (CM_DPLL + 0x004) @@ -260,6 +261,9 @@ struct ti_clock_dev ti_clk_devmap[] = { AM335X_GENERIC_CLOCK_DEV(I2C1_CLK), AM335X_GENERIC_CLOCK_DEV(I2C2_CLK), + /* TSC_ADC */ + AM335X_GENERIC_CLOCK_DEV(TSC_ADC_CLK), + /* EDMA */ AM335X_GENERIC_CLOCK_DEV(EDMA_TPCC_CLK), AM335X_GENERIC_CLOCK_DEV(EDMA_TPTC0_CLK), @@ -337,6 +341,9 @@ static struct am335x_clk_details g_am335x_clk_details[] = { _CLK_DETAIL(I2C1_CLK, CM_PER_I2C1_CLKCTRL, 0), _CLK_DETAIL(I2C2_CLK, CM_PER_I2C2_CLKCTRL, 0), + /* TSC_ADC module */ + _CLK_DETAIL(TSC_ADC_CLK, CM_WKUP_ADC_TSC_CLKCTRL, 0), + /* EDMA modules */ _CLK_DETAIL(EDMA_TPCC_CLK, CM_PER_TPCC_CLKCTRL, 0), _CLK_DETAIL(EDMA_TPTC0_CLK, CM_PER_TPTC0_CLKCTRL, 0), |