diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2013-12-09 18:15:14 +0100 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2013-12-09 18:15:14 +0100 |
commit | 4b35ad648e9b5017e5c570ef61eeafc655eda6f1 (patch) | |
tree | 4f7399fef7c345d33e8460a6ec1c70b3ef30e780 /arch/arm | |
parent | 66e65cc258a0f4cc3b999a2b7a6c9b1fa9c4eef5 (diff) |
colibri_t30/apalis_t30: enable STMPE ADC driver
Make use of the new STMPE ADC driver to expose the four free ADC
channels on the STMPE811 to userspace.
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/configs/apalis_t30_defconfig | 1 | ||||
-rw-r--r-- | arch/arm/configs/colibri_t30_defconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-apalis_t30.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-colibri_t30.c | 11 |
4 files changed, 22 insertions, 2 deletions
diff --git a/arch/arm/configs/apalis_t30_defconfig b/arch/arm/configs/apalis_t30_defconfig index f6db363c83ac..ee513a932fc9 100644 --- a/arch/arm/configs/apalis_t30_defconfig +++ b/arch/arm/configs/apalis_t30_defconfig @@ -351,6 +351,7 @@ CONFIG_RTC_DRV_TEGRA=y CONFIG_RTC_DRV_TPS6591x=y CONFIG_STAGING=y CONFIG_IIO=y +CONFIG_STMPE_ADC=y CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y diff --git a/arch/arm/configs/colibri_t30_defconfig b/arch/arm/configs/colibri_t30_defconfig index 14ed94512715..f0f5481890e7 100644 --- a/arch/arm/configs/colibri_t30_defconfig +++ b/arch/arm/configs/colibri_t30_defconfig @@ -293,6 +293,7 @@ CONFIG_RTC_DRV_TEGRA=y CONFIG_RTC_DRV_TPS6591x=y CONFIG_STAGING=y CONFIG_IIO=y +CONFIG_STMPE_ADC=y CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y diff --git a/arch/arm/mach-tegra/board-apalis_t30.c b/arch/arm/mach-tegra/board-apalis_t30.c index a5eabb35ddae..87a4b1a975a3 100644 --- a/arch/arm/mach-tegra/board-apalis_t30.c +++ b/arch/arm/mach-tegra/board-apalis_t30.c @@ -338,12 +338,21 @@ static struct stmpe_ts_platform_data stmpe811_ts_data = { .touch_det_delay = 5, /* 5 ms touch detect interrupt delay */ }; +/* STMPE811 ADC controller */ +static struct stmpe_adc_platform_data stmpe811_adc_data = { + .sample_time = 4, /* ADC converstion time: 80 clocks */ + .mod_12b = 1, /* 12-bit ADC */ + .ref_sel = 0, /* internal ADC reference */ + .adc_freq = 1, /* 3.25 MHz ADC clock speed */ +}; + static struct stmpe_platform_data stmpe811_data = { - .blocks = STMPE_BLOCK_TOUCHSCREEN, + .blocks = STMPE_BLOCK_TOUCHSCREEN | STMPE_BLOCK_ADC, .id = 1, .irq_base = STMPE811_IRQ_BASE, .irq_trigger = IRQF_TRIGGER_FALLING, .ts = &stmpe811_ts_data, + .adc = &stmpe811_adc_data, }; static void lm95245_probe_callback(struct device *dev); diff --git a/arch/arm/mach-tegra/board-colibri_t30.c b/arch/arm/mach-tegra/board-colibri_t30.c index af8fdeaddf75..63ce67307ee9 100644 --- a/arch/arm/mach-tegra/board-colibri_t30.c +++ b/arch/arm/mach-tegra/board-colibri_t30.c @@ -483,12 +483,21 @@ static struct stmpe_ts_platform_data stmpe811_ts_data = { .touch_det_delay = 5, /* 5 ms touch detect interrupt delay */ }; +/* STMPE811 ADC controller */ +static struct stmpe_adc_platform_data stmpe811_adc_data = { + .sample_time = 4, /* ADC converstion time: 80 clocks */ + .mod_12b = 1, /* 12-bit ADC */ + .ref_sel = 0, /* internal ADC reference */ + .adc_freq = 1, /* 3.25 MHz ADC clock speed */ +}; + static struct stmpe_platform_data stmpe811_data = { - .blocks = STMPE_BLOCK_TOUCHSCREEN, + .blocks = STMPE_BLOCK_TOUCHSCREEN | STMPE_BLOCK_ADC, .id = 1, .irq_base = STMPE811_IRQ_BASE, .irq_trigger = IRQF_TRIGGER_FALLING, .ts = &stmpe811_ts_data, + .adc = &stmpe811_adc_data, }; static void lm95245_probe_callback(struct device *dev); |