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