clock-7x01a.c 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /* arch/arm/mach-msm/clock-7x01a.c
  2. *
  3. * Clock tables for MSM7X01A
  4. *
  5. * Copyright (C) 2007 Google, Inc.
  6. * Copyright (c) 2007 QUALCOMM Incorporated
  7. *
  8. * This software is licensed under the terms of the GNU General Public
  9. * License version 2, as published by the Free Software Foundation, and
  10. * may be copied, distributed, and modified under those terms.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. */
  18. #include <linux/kernel.h>
  19. #include <linux/platform_device.h>
  20. #include "clock.h"
  21. #include "devices.h"
  22. /* clock IDs used by the modem processor */
  23. #define ACPU_CLK 0 /* Applications processor clock */
  24. #define ADM_CLK 1 /* Applications data mover clock */
  25. #define ADSP_CLK 2 /* ADSP clock */
  26. #define EBI1_CLK 3 /* External bus interface 1 clock */
  27. #define EBI2_CLK 4 /* External bus interface 2 clock */
  28. #define ECODEC_CLK 5 /* External CODEC clock */
  29. #define EMDH_CLK 6 /* External MDDI host clock */
  30. #define GP_CLK 7 /* General purpose clock */
  31. #define GRP_CLK 8 /* Graphics clock */
  32. #define I2C_CLK 9 /* I2C clock */
  33. #define ICODEC_RX_CLK 10 /* Internal CODEX RX clock */
  34. #define ICODEC_TX_CLK 11 /* Internal CODEX TX clock */
  35. #define IMEM_CLK 12 /* Internal graphics memory clock */
  36. #define MDC_CLK 13 /* MDDI client clock */
  37. #define MDP_CLK 14 /* Mobile display processor clock */
  38. #define PBUS_CLK 15 /* Peripheral bus clock */
  39. #define PCM_CLK 16 /* PCM clock */
  40. #define PMDH_CLK 17 /* Primary MDDI host clock */
  41. #define SDAC_CLK 18 /* Stereo DAC clock */
  42. #define SDC1_CLK 19 /* Secure Digital Card clocks */
  43. #define SDC1_PCLK 20
  44. #define SDC2_CLK 21
  45. #define SDC2_PCLK 22
  46. #define SDC3_CLK 23
  47. #define SDC3_PCLK 24
  48. #define SDC4_CLK 25
  49. #define SDC4_PCLK 26
  50. #define TSIF_CLK 27 /* Transport Stream Interface clocks */
  51. #define TSIF_REF_CLK 28
  52. #define TV_DAC_CLK 29 /* TV clocks */
  53. #define TV_ENC_CLK 30
  54. #define UART1_CLK 31 /* UART clocks */
  55. #define UART2_CLK 32
  56. #define UART3_CLK 33
  57. #define UART1DM_CLK 34
  58. #define UART2DM_CLK 35
  59. #define USB_HS_CLK 36 /* High speed USB core clock */
  60. #define USB_HS_PCLK 37 /* High speed USB pbus clock */
  61. #define USB_OTG_CLK 38 /* Full speed USB clock */
  62. #define VDC_CLK 39 /* Video controller clock */
  63. #define VFE_CLK 40 /* Camera / Video Front End clock */
  64. #define VFE_MDC_CLK 41 /* VFE MDDI client clock */
  65. #define NR_CLKS 42
  66. #define CLOCK(clk_name, clk_id, clk_dev, clk_flags) { \
  67. .name = clk_name, \
  68. .id = clk_id, \
  69. .flags = clk_flags, \
  70. .dev = clk_dev, \
  71. }
  72. #define OFF CLKFLAG_AUTO_OFF
  73. #define MINMAX CLKFLAG_USE_MIN_MAX_TO_SET
  74. struct clk msm_clocks[] = {
  75. CLOCK("adm_clk", ADM_CLK, NULL, 0),
  76. CLOCK("adsp_clk", ADSP_CLK, NULL, 0),
  77. CLOCK("ebi1_clk", EBI1_CLK, NULL, 0),
  78. CLOCK("ebi2_clk", EBI2_CLK, NULL, 0),
  79. CLOCK("ecodec_clk", ECODEC_CLK, NULL, 0),
  80. CLOCK("emdh_clk", EMDH_CLK, NULL, OFF),
  81. CLOCK("gp_clk", GP_CLK, NULL, 0),
  82. CLOCK("grp_clk", GRP_CLK, NULL, OFF),
  83. CLOCK("i2c_clk", I2C_CLK, &msm_device_i2c.dev, 0),
  84. CLOCK("icodec_rx_clk", ICODEC_RX_CLK, NULL, 0),
  85. CLOCK("icodec_tx_clk", ICODEC_TX_CLK, NULL, 0),
  86. CLOCK("imem_clk", IMEM_CLK, NULL, OFF),
  87. CLOCK("mdc_clk", MDC_CLK, NULL, 0),
  88. CLOCK("mdp_clk", MDP_CLK, NULL, OFF),
  89. CLOCK("pbus_clk", PBUS_CLK, NULL, 0),
  90. CLOCK("pcm_clk", PCM_CLK, NULL, 0),
  91. CLOCK("pmdh_clk", PMDH_CLK, NULL, OFF | MINMAX),
  92. CLOCK("sdac_clk", SDAC_CLK, NULL, OFF),
  93. CLOCK("sdc_clk", SDC1_CLK, &msm_device_sdc1.dev, OFF),
  94. CLOCK("sdc_pclk", SDC1_PCLK, &msm_device_sdc1.dev, OFF),
  95. CLOCK("sdc_clk", SDC2_CLK, &msm_device_sdc2.dev, OFF),
  96. CLOCK("sdc_pclk", SDC2_PCLK, &msm_device_sdc2.dev, OFF),
  97. CLOCK("sdc_clk", SDC3_CLK, &msm_device_sdc3.dev, OFF),
  98. CLOCK("sdc_pclk", SDC3_PCLK, &msm_device_sdc3.dev, OFF),
  99. CLOCK("sdc_clk", SDC4_CLK, &msm_device_sdc4.dev, OFF),
  100. CLOCK("sdc_pclk", SDC4_PCLK, &msm_device_sdc4.dev, OFF),
  101. CLOCK("tsif_clk", TSIF_CLK, NULL, 0),
  102. CLOCK("tsif_ref_clk", TSIF_REF_CLK, NULL, 0),
  103. CLOCK("tv_dac_clk", TV_DAC_CLK, NULL, 0),
  104. CLOCK("tv_enc_clk", TV_ENC_CLK, NULL, 0),
  105. CLOCK("uart_clk", UART1_CLK, &msm_device_uart1.dev, OFF),
  106. CLOCK("uart_clk", UART2_CLK, &msm_device_uart2.dev, 0),
  107. CLOCK("uart_clk", UART3_CLK, &msm_device_uart3.dev, OFF),
  108. CLOCK("uart1dm_clk", UART1DM_CLK, NULL, OFF),
  109. CLOCK("uart2dm_clk", UART2DM_CLK, NULL, 0),
  110. CLOCK("usb_hs_clk", USB_HS_CLK, &msm_device_hsusb.dev, OFF),
  111. CLOCK("usb_hs_pclk", USB_HS_PCLK, &msm_device_hsusb.dev, OFF),
  112. CLOCK("usb_otg_clk", USB_OTG_CLK, NULL, 0),
  113. CLOCK("vdc_clk", VDC_CLK, NULL, OFF | MINMAX),
  114. CLOCK("vfe_clk", VFE_CLK, NULL, OFF),
  115. CLOCK("vfe_mdc_clk", VFE_MDC_CLK, NULL, OFF),
  116. };
  117. unsigned msm_num_clocks = ARRAY_SIZE(msm_clocks);