Maxime Ripard | aaeb6df | 2012-05-11 15:35:32 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 Free Electrons |
| 3 | * |
| 4 | * Licensed under the GPLv2 or later. |
| 5 | */ |
| 6 | |
| 7 | #ifndef _AT91_ADC_H_ |
| 8 | #define _AT91_ADC_H_ |
| 9 | |
Alexandre Belloni | 84882b0 | 2014-04-15 12:27:59 +0200 | [diff] [blame] | 10 | enum atmel_adc_ts_type { |
| 11 | ATMEL_ADC_TOUCHSCREEN_NONE = 0, |
| 12 | ATMEL_ADC_TOUCHSCREEN_4WIRE = 4, |
| 13 | ATMEL_ADC_TOUCHSCREEN_5WIRE = 5, |
| 14 | }; |
| 15 | |
Maxime Ripard | aaeb6df | 2012-05-11 15:35:32 +0200 | [diff] [blame] | 16 | /** |
Maxime Ripard | aaeb6df | 2012-05-11 15:35:32 +0200 | [diff] [blame] | 17 | * struct at91_adc_trigger - description of triggers |
| 18 | * @name: name of the trigger advertised to the user |
| 19 | * @value: value to set in the ADC's trigger setup register |
| 20 | to enable the trigger |
| 21 | * @is_external: Does the trigger rely on an external pin? |
| 22 | */ |
| 23 | struct at91_adc_trigger { |
| 24 | const char *name; |
| 25 | u8 value; |
| 26 | bool is_external; |
| 27 | }; |
| 28 | |
| 29 | /** |
| 30 | * struct at91_adc_data - platform data for ADC driver |
| 31 | * @channels_used: channels in use on the board as a bitmask |
Maxime Ripard | aaeb6df | 2012-05-11 15:35:32 +0200 | [diff] [blame] | 32 | * @startup_time: startup time of the ADC in microseconds |
| 33 | * @trigger_list: Triggers available in the ADC |
| 34 | * @trigger_number: Number of triggers available in the ADC |
| 35 | * @use_external_triggers: does the board has external triggers availables |
| 36 | * @vref: Reference voltage for the ADC in millivolts |
Alexandre Belloni | 84882b0 | 2014-04-15 12:27:59 +0200 | [diff] [blame] | 37 | * @touchscreen_type: If a touchscreen is connected, its type (4 or 5 wires) |
Maxime Ripard | aaeb6df | 2012-05-11 15:35:32 +0200 | [diff] [blame] | 38 | */ |
| 39 | struct at91_adc_data { |
| 40 | unsigned long channels_used; |
Maxime Ripard | aaeb6df | 2012-05-11 15:35:32 +0200 | [diff] [blame] | 41 | u8 startup_time; |
| 42 | struct at91_adc_trigger *trigger_list; |
| 43 | u8 trigger_number; |
| 44 | bool use_external_triggers; |
| 45 | u16 vref; |
Alexandre Belloni | 84882b0 | 2014-04-15 12:27:59 +0200 | [diff] [blame] | 46 | enum atmel_adc_ts_type touchscreen_type; |
Maxime Ripard | aaeb6df | 2012-05-11 15:35:32 +0200 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | extern void __init at91_add_device_adc(struct at91_adc_data *data); |
| 50 | #endif |