at91_adc.h 1.4 KB

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