ad5755.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright 2012 Analog Devices Inc.
  3. *
  4. * Licensed under the GPL-2.
  5. */
  6. #ifndef __LINUX_PLATFORM_DATA_AD5755_H__
  7. #define __LINUX_PLATFORM_DATA_AD5755_H__
  8. enum ad5755_mode {
  9. AD5755_MODE_VOLTAGE_0V_5V = 0,
  10. AD5755_MODE_VOLTAGE_0V_10V = 1,
  11. AD5755_MODE_VOLTAGE_PLUSMINUS_5V = 2,
  12. AD5755_MODE_VOLTAGE_PLUSMINUS_10V = 3,
  13. AD5755_MODE_CURRENT_4mA_20mA = 4,
  14. AD5755_MODE_CURRENT_0mA_20mA = 5,
  15. AD5755_MODE_CURRENT_0mA_24mA = 6,
  16. };
  17. enum ad5755_dc_dc_phase {
  18. AD5755_DC_DC_PHASE_ALL_SAME_EDGE = 0,
  19. AD5755_DC_DC_PHASE_A_B_SAME_EDGE_C_D_OPP_EDGE = 1,
  20. AD5755_DC_DC_PHASE_A_C_SAME_EDGE_B_D_OPP_EDGE = 2,
  21. AD5755_DC_DC_PHASE_90_DEGREE = 3,
  22. };
  23. enum ad5755_dc_dc_freq {
  24. AD5755_DC_DC_FREQ_250kHZ = 0,
  25. AD5755_DC_DC_FREQ_410kHZ = 1,
  26. AD5755_DC_DC_FREQ_650kHZ = 2,
  27. };
  28. enum ad5755_dc_dc_maxv {
  29. AD5755_DC_DC_MAXV_23V = 0,
  30. AD5755_DC_DC_MAXV_24V5 = 1,
  31. AD5755_DC_DC_MAXV_27V = 2,
  32. AD5755_DC_DC_MAXV_29V5 = 3,
  33. };
  34. enum ad5755_slew_rate {
  35. AD5755_SLEW_RATE_64k = 0,
  36. AD5755_SLEW_RATE_32k = 1,
  37. AD5755_SLEW_RATE_16k = 2,
  38. AD5755_SLEW_RATE_8k = 3,
  39. AD5755_SLEW_RATE_4k = 4,
  40. AD5755_SLEW_RATE_2k = 5,
  41. AD5755_SLEW_RATE_1k = 6,
  42. AD5755_SLEW_RATE_500 = 7,
  43. AD5755_SLEW_RATE_250 = 8,
  44. AD5755_SLEW_RATE_125 = 9,
  45. AD5755_SLEW_RATE_64 = 10,
  46. AD5755_SLEW_RATE_32 = 11,
  47. AD5755_SLEW_RATE_16 = 12,
  48. AD5755_SLEW_RATE_8 = 13,
  49. AD5755_SLEW_RATE_4 = 14,
  50. AD5755_SLEW_RATE_0_5 = 15,
  51. };
  52. enum ad5755_slew_step_size {
  53. AD5755_SLEW_STEP_SIZE_1 = 0,
  54. AD5755_SLEW_STEP_SIZE_2 = 1,
  55. AD5755_SLEW_STEP_SIZE_4 = 2,
  56. AD5755_SLEW_STEP_SIZE_8 = 3,
  57. AD5755_SLEW_STEP_SIZE_16 = 4,
  58. AD5755_SLEW_STEP_SIZE_32 = 5,
  59. AD5755_SLEW_STEP_SIZE_64 = 6,
  60. AD5755_SLEW_STEP_SIZE_128 = 7,
  61. AD5755_SLEW_STEP_SIZE_256 = 8,
  62. };
  63. /**
  64. * struct ad5755_platform_data - AD5755 DAC driver platform data
  65. * @ext_dc_dc_compenstation_resistor: Whether an external DC-DC converter
  66. * compensation register is used.
  67. * @dc_dc_phase: DC-DC converter phase.
  68. * @dc_dc_freq: DC-DC converter frequency.
  69. * @dc_dc_maxv: DC-DC maximum allowed boost voltage.
  70. * @dac.mode: The mode to be used for the DAC output.
  71. * @dac.ext_current_sense_resistor: Whether an external current sense resistor
  72. * is used.
  73. * @dac.enable_voltage_overrange: Whether to enable 20% voltage output overrange.
  74. * @dac.slew.enable: Whether to enable digital slew.
  75. * @dac.slew.rate: Slew rate of the digital slew.
  76. * @dac.slew.step_size: Slew step size of the digital slew.
  77. **/
  78. struct ad5755_platform_data {
  79. bool ext_dc_dc_compenstation_resistor;
  80. enum ad5755_dc_dc_phase dc_dc_phase;
  81. enum ad5755_dc_dc_freq dc_dc_freq;
  82. enum ad5755_dc_dc_maxv dc_dc_maxv;
  83. struct {
  84. enum ad5755_mode mode;
  85. bool ext_current_sense_resistor;
  86. bool enable_voltage_overrange;
  87. struct {
  88. bool enable;
  89. enum ad5755_slew_rate rate;
  90. enum ad5755_slew_step_size step_size;
  91. } slew;
  92. } dac[4];
  93. };
  94. #endif