si5351.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Si5351A/B/C programmable clock generator platform_data.
  3. */
  4. #ifndef __LINUX_PLATFORM_DATA_SI5351_H__
  5. #define __LINUX_PLATFORM_DATA_SI5351_H__
  6. /**
  7. * enum si5351_pll_src - Si5351 pll clock source
  8. * @SI5351_PLL_SRC_DEFAULT: default, do not change eeprom config
  9. * @SI5351_PLL_SRC_XTAL: pll source clock is XTAL input
  10. * @SI5351_PLL_SRC_CLKIN: pll source clock is CLKIN input (Si5351C only)
  11. */
  12. enum si5351_pll_src {
  13. SI5351_PLL_SRC_DEFAULT = 0,
  14. SI5351_PLL_SRC_XTAL = 1,
  15. SI5351_PLL_SRC_CLKIN = 2,
  16. };
  17. /**
  18. * enum si5351_multisynth_src - Si5351 multisynth clock source
  19. * @SI5351_MULTISYNTH_SRC_DEFAULT: default, do not change eeprom config
  20. * @SI5351_MULTISYNTH_SRC_VCO0: multisynth source clock is VCO0
  21. * @SI5351_MULTISYNTH_SRC_VCO1: multisynth source clock is VCO1/VXCO
  22. */
  23. enum si5351_multisynth_src {
  24. SI5351_MULTISYNTH_SRC_DEFAULT = 0,
  25. SI5351_MULTISYNTH_SRC_VCO0 = 1,
  26. SI5351_MULTISYNTH_SRC_VCO1 = 2,
  27. };
  28. /**
  29. * enum si5351_clkout_src - Si5351 clock output clock source
  30. * @SI5351_CLKOUT_SRC_DEFAULT: default, do not change eeprom config
  31. * @SI5351_CLKOUT_SRC_MSYNTH_N: clkout N source clock is multisynth N
  32. * @SI5351_CLKOUT_SRC_MSYNTH_0_4: clkout N source clock is multisynth 0 (N<4)
  33. * or 4 (N>=4)
  34. * @SI5351_CLKOUT_SRC_XTAL: clkout N source clock is XTAL
  35. * @SI5351_CLKOUT_SRC_CLKIN: clkout N source clock is CLKIN (Si5351C only)
  36. */
  37. enum si5351_clkout_src {
  38. SI5351_CLKOUT_SRC_DEFAULT = 0,
  39. SI5351_CLKOUT_SRC_MSYNTH_N = 1,
  40. SI5351_CLKOUT_SRC_MSYNTH_0_4 = 2,
  41. SI5351_CLKOUT_SRC_XTAL = 3,
  42. SI5351_CLKOUT_SRC_CLKIN = 4,
  43. };
  44. /**
  45. * enum si5351_drive_strength - Si5351 clock output drive strength
  46. * @SI5351_DRIVE_DEFAULT: default, do not change eeprom config
  47. * @SI5351_DRIVE_2MA: 2mA clock output drive strength
  48. * @SI5351_DRIVE_4MA: 4mA clock output drive strength
  49. * @SI5351_DRIVE_6MA: 6mA clock output drive strength
  50. * @SI5351_DRIVE_8MA: 8mA clock output drive strength
  51. */
  52. enum si5351_drive_strength {
  53. SI5351_DRIVE_DEFAULT = 0,
  54. SI5351_DRIVE_2MA = 2,
  55. SI5351_DRIVE_4MA = 4,
  56. SI5351_DRIVE_6MA = 6,
  57. SI5351_DRIVE_8MA = 8,
  58. };
  59. /**
  60. * enum si5351_disable_state - Si5351 clock output disable state
  61. * @SI5351_DISABLE_DEFAULT: default, do not change eeprom config
  62. * @SI5351_DISABLE_LOW: CLKx is set to a LOW state when disabled
  63. * @SI5351_DISABLE_HIGH: CLKx is set to a HIGH state when disabled
  64. * @SI5351_DISABLE_FLOATING: CLKx is set to a FLOATING state when
  65. * disabled
  66. * @SI5351_DISABLE_NEVER: CLKx is NEVER disabled
  67. */
  68. enum si5351_disable_state {
  69. SI5351_DISABLE_DEFAULT = 0,
  70. SI5351_DISABLE_LOW,
  71. SI5351_DISABLE_HIGH,
  72. SI5351_DISABLE_FLOATING,
  73. SI5351_DISABLE_NEVER,
  74. };
  75. /**
  76. * struct si5351_clkout_config - Si5351 clock output configuration
  77. * @clkout: clkout number
  78. * @multisynth_src: multisynth source clock
  79. * @clkout_src: clkout source clock
  80. * @pll_master: if true, clkout can also change pll rate
  81. * @drive: output drive strength
  82. * @rate: initial clkout rate, or default if 0
  83. */
  84. struct si5351_clkout_config {
  85. enum si5351_multisynth_src multisynth_src;
  86. enum si5351_clkout_src clkout_src;
  87. enum si5351_drive_strength drive;
  88. enum si5351_disable_state disable_state;
  89. bool pll_master;
  90. unsigned long rate;
  91. };
  92. /**
  93. * struct si5351_platform_data - Platform data for the Si5351 clock driver
  94. * @clk_xtal: xtal input clock
  95. * @clk_clkin: clkin input clock
  96. * @pll_src: array of pll source clock setting
  97. * @clkout: array of clkout configuration
  98. */
  99. struct si5351_platform_data {
  100. enum si5351_pll_src pll_src[2];
  101. struct si5351_clkout_config clkout[8];
  102. };
  103. #endif