blob: 7a3f49e02686091c9481292f600700da5ac58bd2 [file] [log] [blame]
Manu Gautam5143b252012-01-05 19:25:23 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include "clock.h"
14#include "clock-pcom.h"
15#include "clock-voter.h"
16
17static DEFINE_CLK_PCOM(adm_clk, ADM_CLK, CLKFLAG_SKIP_AUTO_OFF);
18static DEFINE_CLK_PCOM(adsp_clk, ADSP_CLK, CLKFLAG_SKIP_AUTO_OFF);
19static DEFINE_CLK_PCOM(ahb_m_clk, AHB_M_CLK, CLKFLAG_SKIP_AUTO_OFF);
20static DEFINE_CLK_PCOM(ahb_s_clk, AHB_S_CLK, CLKFLAG_SKIP_AUTO_OFF);
21static DEFINE_CLK_PCOM(cam_m_clk, CAM_M_CLK, CLKFLAG_SKIP_AUTO_OFF);
22static DEFINE_CLK_PCOM(axi_rotator_clk, AXI_ROTATOR_CLK, 0);
23static DEFINE_CLK_PCOM(ce_clk, CE_CLK, CLKFLAG_SKIP_AUTO_OFF);
24static DEFINE_CLK_PCOM(csi0_clk, CSI0_CLK, CLKFLAG_SKIP_AUTO_OFF);
25static DEFINE_CLK_PCOM(csi0_p_clk, CSI0_P_CLK, CLKFLAG_SKIP_AUTO_OFF);
26static DEFINE_CLK_PCOM(csi0_vfe_clk, CSI0_VFE_CLK, CLKFLAG_SKIP_AUTO_OFF);
27static DEFINE_CLK_PCOM(csi1_clk, CSI1_CLK, CLKFLAG_SKIP_AUTO_OFF);
28static DEFINE_CLK_PCOM(csi1_p_clk, CSI1_P_CLK, CLKFLAG_SKIP_AUTO_OFF);
29static DEFINE_CLK_PCOM(csi1_vfe_clk, CSI1_VFE_CLK, CLKFLAG_SKIP_AUTO_OFF);
30
31static struct pcom_clk dsi_byte_clk = {
32 .id = P_DSI_BYTE_CLK,
33 .c = {
34 .ops = &clk_ops_pcom_ext_config,
35 .dbg_name = "dsi_byte_clk",
36 CLK_INIT(dsi_byte_clk.c),
37 },
38};
39
40static struct pcom_clk dsi_clk = {
41 .id = P_DSI_CLK,
42 .c = {
43 .ops = &clk_ops_pcom_ext_config,
44 .dbg_name = "dsi_clk",
45 CLK_INIT(dsi_clk.c),
46 },
47};
48
49static struct pcom_clk dsi_esc_clk = {
50 .id = P_DSI_ESC_CLK,
51 .c = {
52 .ops = &clk_ops_pcom_ext_config,
53 .dbg_name = "dsi_esc_clk",
54 CLK_INIT(dsi_esc_clk.c),
55 },
56};
57
58static struct pcom_clk dsi_pixel_clk = {
59 .id = P_DSI_PIXEL_CLK,
60 .c = {
61 .ops = &clk_ops_pcom_ext_config,
62 .dbg_name = "dsi_pixel_clk",
63 CLK_INIT(dsi_pixel_clk.c),
64 },
65};
66
67static DEFINE_CLK_PCOM(dsi_ref_clk, DSI_REF_CLK, 0);
68static DEFINE_CLK_PCOM(ebi1_clk, EBI1_CLK,
69 CLKFLAG_SKIP_AUTO_OFF | CLKFLAG_MIN);
70static DEFINE_CLK_PCOM(ebi2_clk, EBI2_CLK, CLKFLAG_SKIP_AUTO_OFF);
71static DEFINE_CLK_PCOM(ecodec_clk, ECODEC_CLK, CLKFLAG_SKIP_AUTO_OFF);
72static DEFINE_CLK_PCOM(emdh_clk, EMDH_CLK, CLKFLAG_MIN | CLKFLAG_MAX);
73static DEFINE_CLK_PCOM(gp_clk, GP_CLK, CLKFLAG_SKIP_AUTO_OFF);
74static DEFINE_CLK_PCOM(grp_2d_clk, GRP_2D_CLK, CLKFLAG_SKIP_AUTO_OFF);
75static DEFINE_CLK_PCOM(grp_2d_p_clk, GRP_2D_P_CLK, CLKFLAG_SKIP_AUTO_OFF);
76static DEFINE_CLK_PCOM(grp_3d_clk, GRP_3D_CLK, 0);
77static DEFINE_CLK_PCOM(grp_3d_p_clk, GRP_3D_P_CLK, CLKFLAG_SKIP_AUTO_OFF);
78static DEFINE_CLK_PCOM(gsbi1_qup_clk, GSBI1_QUP_CLK, 0);
79static DEFINE_CLK_PCOM(gsbi1_qup_p_clk, GSBI1_QUP_P_CLK, 0);
80static DEFINE_CLK_PCOM(gsbi2_qup_clk, GSBI2_QUP_CLK, 0);
81static DEFINE_CLK_PCOM(gsbi2_qup_p_clk, GSBI2_QUP_P_CLK, 0);
82static DEFINE_CLK_PCOM(gsbi_clk, GSBI_CLK, CLKFLAG_SKIP_AUTO_OFF);
83static DEFINE_CLK_PCOM(gsbi_p_clk, GSBI_P_CLK, CLKFLAG_SKIP_AUTO_OFF);
84static DEFINE_CLK_PCOM(hdmi_clk, HDMI_CLK, CLKFLAG_SKIP_AUTO_OFF);
85static DEFINE_CLK_PCOM(i2c_clk, I2C_CLK, CLKFLAG_SKIP_AUTO_OFF);
86static DEFINE_CLK_PCOM(icodec_rx_clk, ICODEC_RX_CLK, CLKFLAG_SKIP_AUTO_OFF);
87static DEFINE_CLK_PCOM(icodec_tx_clk, ICODEC_TX_CLK, CLKFLAG_SKIP_AUTO_OFF);
88static DEFINE_CLK_PCOM(imem_clk, IMEM_CLK, 0);
89static DEFINE_CLK_PCOM(mdc_clk, MDC_CLK, CLKFLAG_SKIP_AUTO_OFF);
Matt Wagantalla12cc952011-11-08 18:14:50 -080090static DEFINE_CLK_PCOM(mdp_clk, MDP_CLK, CLKFLAG_MIN);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070091static DEFINE_CLK_PCOM(mdp_lcdc_pad_pclk_clk, MDP_LCDC_PAD_PCLK_CLK,
92 CLKFLAG_SKIP_AUTO_OFF);
93static DEFINE_CLK_PCOM(mdp_lcdc_pclk_clk, MDP_LCDC_PCLK_CLK,
94 CLKFLAG_SKIP_AUTO_OFF);
95static DEFINE_CLK_PCOM(mdp_vsync_clk, MDP_VSYNC_CLK, 0);
96static DEFINE_CLK_PCOM(mdp_dsi_p_clk, MDP_DSI_P_CLK, 0);
97static DEFINE_CLK_PCOM(pbus_clk, PBUS_CLK,
98 CLKFLAG_SKIP_AUTO_OFF | CLKFLAG_MIN);
99static DEFINE_CLK_PCOM(pcm_clk, PCM_CLK, CLKFLAG_SKIP_AUTO_OFF);
100static DEFINE_CLK_PCOM(pmdh_clk, PMDH_CLK, CLKFLAG_MIN | CLKFLAG_MAX);
101static DEFINE_CLK_PCOM(sdac_clk, SDAC_CLK, 0);
102static DEFINE_CLK_PCOM(sdc1_clk, SDC1_CLK, 0);
103static DEFINE_CLK_PCOM(sdc1_p_clk, SDC1_P_CLK, 0);
104static DEFINE_CLK_PCOM(sdc2_clk, SDC2_CLK, 0);
105static DEFINE_CLK_PCOM(sdc2_p_clk, SDC2_P_CLK, 0);
106static DEFINE_CLK_PCOM(sdc3_clk, SDC3_CLK, 0);
107static DEFINE_CLK_PCOM(sdc3_p_clk, SDC3_P_CLK, 0);
108static DEFINE_CLK_PCOM(sdc4_clk, SDC4_CLK, 0);
109static DEFINE_CLK_PCOM(sdc4_p_clk, SDC4_P_CLK, 0);
110static DEFINE_CLK_PCOM(spi_clk, SPI_CLK, CLKFLAG_SKIP_AUTO_OFF);
111static DEFINE_CLK_PCOM(tsif_clk, TSIF_CLK, CLKFLAG_SKIP_AUTO_OFF);
112static DEFINE_CLK_PCOM(tsif_p_clk, TSIF_P_CLK, CLKFLAG_SKIP_AUTO_OFF);
113static DEFINE_CLK_PCOM(tsif_ref_clk, TSIF_REF_CLK, CLKFLAG_SKIP_AUTO_OFF);
114static DEFINE_CLK_PCOM(tv_dac_clk, TV_DAC_CLK, CLKFLAG_SKIP_AUTO_OFF);
115static DEFINE_CLK_PCOM(tv_enc_clk, TV_ENC_CLK, CLKFLAG_SKIP_AUTO_OFF);
116static DEFINE_CLK_PCOM(uart1_clk, UART1_CLK, 0);
117static DEFINE_CLK_PCOM(uart1dm_clk, UART1DM_CLK, 0);
118static DEFINE_CLK_PCOM(uart2_clk, UART2_CLK, 0);
119static DEFINE_CLK_PCOM(uart2dm_clk, UART2DM_CLK, 0);
120static DEFINE_CLK_PCOM(uart3_clk, UART3_CLK, 0);
121static DEFINE_CLK_PCOM(usb_hs2_clk, USB_HS2_CLK, 0);
122static DEFINE_CLK_PCOM(usb_hs2_p_clk, USB_HS2_P_CLK, 0);
123static DEFINE_CLK_PCOM(usb_hs3_clk, USB_HS3_CLK, 0);
124static DEFINE_CLK_PCOM(usb_hs3_p_clk, USB_HS3_P_CLK, 0);
125static DEFINE_CLK_PCOM(usb_hs_clk, USB_HS_CLK, 0);
126static DEFINE_CLK_PCOM(usb_hs_core_clk, USB_HS_CORE_CLK, 0);
127static DEFINE_CLK_PCOM(usb_hs_p_clk, USB_HS_P_CLK, 0);
128static DEFINE_CLK_PCOM(usb_otg_clk, USB_OTG_CLK, CLKFLAG_SKIP_AUTO_OFF);
129static DEFINE_CLK_PCOM(usb_phy_clk, USB_PHY_CLK, CLKFLAG_SKIP_AUTO_OFF);
130static DEFINE_CLK_PCOM(vdc_clk, VDC_CLK, CLKFLAG_MIN);
131static DEFINE_CLK_PCOM(vfe_axi_clk, VFE_AXI_CLK, 0);
132static DEFINE_CLK_PCOM(vfe_clk, VFE_CLK, 0);
133static DEFINE_CLK_PCOM(vfe_mdc_clk, VFE_MDC_CLK, 0);
134
135static DEFINE_CLK_VOTER(ebi_acpu_clk, &ebi1_clk.c);
Matt Wagantall9dc01632011-08-17 18:55:04 -0700136static DEFINE_CLK_VOTER(ebi_grp_3d_clk, &ebi1_clk.c);
137static DEFINE_CLK_VOTER(ebi_grp_2d_clk, &ebi1_clk.c);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700138static DEFINE_CLK_VOTER(ebi_lcdc_clk, &ebi1_clk.c);
139static DEFINE_CLK_VOTER(ebi_mddi_clk, &ebi1_clk.c);
140static DEFINE_CLK_VOTER(ebi_tv_clk, &ebi1_clk.c);
141static DEFINE_CLK_VOTER(ebi_usb_clk, &ebi1_clk.c);
142static DEFINE_CLK_VOTER(ebi_vfe_clk, &ebi1_clk.c);
143static DEFINE_CLK_VOTER(ebi_adm_clk, &ebi1_clk.c);
144
Stephen Boydbb600ae2011-08-02 20:11:40 -0700145static struct clk_lookup msm_clocks_7x01a[] = {
Matt Wagantalle1a86062011-08-18 17:46:10 -0700146 CLK_LOOKUP("core_clk", adm_clk.c, "msm_dmov"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700147 CLK_LOOKUP("adsp_clk", adsp_clk.c, NULL),
148 CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL),
149 CLK_LOOKUP("ebi2_clk", ebi2_clk.c, NULL),
150 CLK_LOOKUP("ecodec_clk", ecodec_clk.c, NULL),
151 CLK_LOOKUP("emdh_clk", emdh_clk.c, NULL),
Matt Wagantallb86ad262011-10-24 19:50:29 -0700152 CLK_LOOKUP("core_clk", gp_clk.c, NULL),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700153 CLK_LOOKUP("core_clk", grp_3d_clk.c, "kgsl-3d0.0"),
Matt Wagantallac294852011-08-17 15:44:58 -0700154 CLK_LOOKUP("core_clk", i2c_clk.c, "msm_i2c.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700155 CLK_LOOKUP("icodec_rx_clk", icodec_rx_clk.c, NULL),
156 CLK_LOOKUP("icodec_tx_clk", icodec_tx_clk.c, NULL),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700157 CLK_LOOKUP("mem_clk", imem_clk.c, NULL),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700158 CLK_LOOKUP("mdc_clk", mdc_clk.c, NULL),
159 CLK_LOOKUP("mddi_clk", pmdh_clk.c, NULL),
160 CLK_LOOKUP("mdp_clk", mdp_clk.c, NULL),
161 CLK_LOOKUP("pbus_clk", pbus_clk.c, NULL),
162 CLK_LOOKUP("pcm_clk", pcm_clk.c, NULL),
163 CLK_LOOKUP("sdac_clk", sdac_clk.c, NULL),
Matt Wagantall37ce3842011-08-17 16:00:36 -0700164 CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"),
165 CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"),
166 CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"),
167 CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"),
168 CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"),
169 CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"),
170 CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"),
171 CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"),
Matt Wagantall640e5fd2011-08-17 16:08:53 -0700172 CLK_LOOKUP("core_clk", tsif_clk.c, "msm_tsif.0"),
173 CLK_LOOKUP("ref_clk", tsif_ref_clk.c, "msm_tsif.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700174 CLK_LOOKUP("tv_dac_clk", tv_dac_clk.c, NULL),
175 CLK_LOOKUP("tv_enc_clk", tv_enc_clk.c, NULL),
Matt Wagantalle2522372011-08-17 14:52:21 -0700176 CLK_LOOKUP("core_clk", uart1_clk.c, "msm_serial.0"),
177 CLK_LOOKUP("core_clk", uart2_clk.c, "msm_serial.1"),
178 CLK_LOOKUP("core_clk", uart3_clk.c, "msm_serial.2"),
179 CLK_LOOKUP("core_clk", uart1dm_clk.c, "msm_serial_hs.0"),
180 CLK_LOOKUP("core_clk", uart2dm_clk.c, "msm_serial_hs.1"),
Manu Gautam5143b252012-01-05 19:25:23 -0800181 CLK_LOOKUP("alt_core_clk", usb_hs_clk.c, "msm_otg"),
182 CLK_LOOKUP("iface_clk", usb_hs_p_clk.c, "msm_otg"),
183 CLK_LOOKUP("alt_core_clk", usb_hs_clk.c, "msm_hsusb_otg"),
184 CLK_LOOKUP("iface_clk", usb_hs_p_clk.c, "msm_hsusb_otg"),
185 CLK_LOOKUP("alt_core_clk", usb_hs_clk.c, "msm_hsusb_peripheral"),
186 CLK_LOOKUP("iface_clk", usb_hs_p_clk.c, "msm_hsusb_peripheral"),
187 CLK_LOOKUP("alt_core_clk", usb_otg_clk.c, NULL),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700188 CLK_LOOKUP("vdc_clk", vdc_clk.c, NULL),
189 CLK_LOOKUP("vfe_clk", vfe_clk.c, NULL),
190 CLK_LOOKUP("vfe_mdc_clk", vfe_mdc_clk.c, NULL),
191};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700192
Stephen Boydbb600ae2011-08-02 20:11:40 -0700193struct clock_init_data msm7x01a_clock_init_data __initdata = {
194 .table = msm_clocks_7x01a,
195 .size = ARRAY_SIZE(msm_clocks_7x01a),
196};
197
198static struct clk_lookup msm_clocks_7x27[] = {
Matt Wagantalle1a86062011-08-18 17:46:10 -0700199 CLK_LOOKUP("core_clk", adm_clk.c, "msm_dmov"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700200 CLK_LOOKUP("adsp_clk", adsp_clk.c, NULL),
201 CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL),
202 CLK_LOOKUP("ebi2_clk", ebi2_clk.c, NULL),
203 CLK_LOOKUP("ecodec_clk", ecodec_clk.c, NULL),
Matt Wagantallb86ad262011-10-24 19:50:29 -0700204 CLK_LOOKUP("core_clk", gp_clk.c, NULL),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700205 CLK_LOOKUP("core_clk", grp_3d_clk.c, "kgsl-3d0.0"),
Matt Wagantall49722712011-08-17 18:50:53 -0700206 CLK_LOOKUP("core_clk", grp_3d_clk.c, "footswitch-pcom.2"),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700207 CLK_LOOKUP("iface_clk", grp_3d_p_clk.c, "kgsl-3d0.0"),
Matt Wagantallac294852011-08-17 15:44:58 -0700208 CLK_LOOKUP("core_clk", i2c_clk.c, "msm_i2c.0"),
Matt Wagantall49722712011-08-17 18:50:53 -0700209 CLK_LOOKUP("iface_clk", grp_3d_p_clk.c, "footswitch-pcom.2"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700210 CLK_LOOKUP("icodec_rx_clk", icodec_rx_clk.c, NULL),
211 CLK_LOOKUP("icodec_tx_clk", icodec_tx_clk.c, NULL),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700212 CLK_LOOKUP("mem_clk", imem_clk.c, NULL),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700213 CLK_LOOKUP("mdc_clk", mdc_clk.c, NULL),
214 CLK_LOOKUP("mddi_clk", pmdh_clk.c, NULL),
215 CLK_LOOKUP("mdp_clk", mdp_clk.c, NULL),
216 CLK_LOOKUP("mdp_lcdc_pclk_clk", mdp_lcdc_pclk_clk.c, NULL),
217 CLK_LOOKUP("mdp_lcdc_pad_pclk_clk", mdp_lcdc_pad_pclk_clk.c, NULL),
218 CLK_LOOKUP("mdp_vsync_clk", mdp_vsync_clk.c, NULL),
219 CLK_LOOKUP("pbus_clk", pbus_clk.c, NULL),
220 CLK_LOOKUP("pcm_clk", pcm_clk.c, NULL),
221 CLK_LOOKUP("sdac_clk", sdac_clk.c, NULL),
Matt Wagantall37ce3842011-08-17 16:00:36 -0700222 CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"),
223 CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"),
224 CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"),
225 CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"),
226 CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"),
227 CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"),
228 CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"),
229 CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"),
Matt Wagantall640e5fd2011-08-17 16:08:53 -0700230 CLK_LOOKUP("core_clk", tsif_clk.c, "msm_tsif.0"),
231 CLK_LOOKUP("ref_clk", tsif_ref_clk.c, "msm_tsif.0"),
232 CLK_LOOKUP("iface_clk", tsif_p_clk.c, "msm_tsif.0"),
Matt Wagantalle2522372011-08-17 14:52:21 -0700233 CLK_LOOKUP("core_clk", uart1_clk.c, "msm_serial.0"),
234 CLK_LOOKUP("core_clk", uart2_clk.c, "msm_serial.1"),
235 CLK_LOOKUP("core_clk", uart1dm_clk.c, "msm_serial_hs.0"),
236 CLK_LOOKUP("core_clk", uart2dm_clk.c, "msm_serial_hs.1"),
Manu Gautam5143b252012-01-05 19:25:23 -0800237 CLK_LOOKUP("alt_core_clk", usb_hs_clk.c, "msm_otg"),
238 CLK_LOOKUP("iface_clk", usb_hs_p_clk.c, "msm_otg"),
239 CLK_LOOKUP("alt_core_clk", usb_otg_clk.c, NULL),
240 CLK_LOOKUP("phy_clk", usb_phy_clk.c, "msm_otg"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700241 CLK_LOOKUP("vdc_clk", vdc_clk.c, NULL),
Matt Wagantall49722712011-08-17 18:50:53 -0700242 CLK_LOOKUP("core_clk", vdc_clk.c, "footswitch-pcom.7"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700243 CLK_LOOKUP("vfe_clk", vfe_clk.c, NULL),
Matt Wagantall49722712011-08-17 18:50:53 -0700244 CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-pcom.8"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700245 CLK_LOOKUP("vfe_mdc_clk", vfe_mdc_clk.c, NULL),
246
247 CLK_LOOKUP("ebi1_acpu_clk", ebi_acpu_clk.c, NULL),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700248 CLK_LOOKUP("bus_clk", ebi_grp_3d_clk.c, "kgsl-3d0.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700249 CLK_LOOKUP("ebi1_lcdc_clk", ebi_lcdc_clk.c, NULL),
250 CLK_LOOKUP("ebi1_mddi_clk", ebi_mddi_clk.c, NULL),
Manu Gautam5143b252012-01-05 19:25:23 -0800251 CLK_LOOKUP("core_clk", ebi_usb_clk.c, "msm_otg"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700252 CLK_LOOKUP("ebi1_vfe_clk", ebi_vfe_clk.c, NULL),
Matt Wagantalle1a86062011-08-18 17:46:10 -0700253 CLK_LOOKUP("mem_clk", ebi_adm_clk.c, "msm_dmov"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700254};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700255
Stephen Boydbb600ae2011-08-02 20:11:40 -0700256struct clock_init_data msm7x27_clock_init_data __initdata = {
257 .table = msm_clocks_7x27,
258 .size = ARRAY_SIZE(msm_clocks_7x27),
259};
260
261static struct clk_lookup msm_clocks_7x27a[] = {
Matt Wagantalle1a86062011-08-18 17:46:10 -0700262 CLK_LOOKUP("core_clk", adm_clk.c, "msm_dmov"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700263 CLK_LOOKUP("adsp_clk", adsp_clk.c, NULL),
264 CLK_LOOKUP("ahb_m_clk", ahb_m_clk.c, NULL),
265 CLK_LOOKUP("ahb_s_clk", ahb_s_clk.c, NULL),
266 CLK_LOOKUP("cam_m_clk", cam_m_clk.c, NULL),
267 CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_camera_ov9726.0"),
268 CLK_LOOKUP("csi_pclk", csi0_p_clk.c, "msm_camera_ov9726.0"),
269 CLK_LOOKUP("csi_vfe_clk", csi0_vfe_clk.c, "msm_camera_ov9726.0"),
Taniya Das7a22cdd2011-09-08 14:57:00 +0530270 CLK_LOOKUP("csi_clk", csi0_clk.c, "msm_camera_ov7692.0"),
271 CLK_LOOKUP("csi_pclk", csi0_p_clk.c, "msm_camera_ov7692.0"),
272 CLK_LOOKUP("csi_vfe_clk", csi0_vfe_clk.c, "msm_camera_ov7692.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700273 CLK_LOOKUP("csi_clk", csi1_clk.c, NULL),
274 CLK_LOOKUP("csi_pclk", csi1_p_clk.c, NULL),
275 CLK_LOOKUP("csi_vfe_clk", csi1_vfe_clk.c, NULL),
276 CLK_LOOKUP("dsi_byte_clk", dsi_byte_clk.c, NULL),
277 CLK_LOOKUP("dsi_clk", dsi_clk.c, NULL),
278 CLK_LOOKUP("dsi_esc_clk", dsi_esc_clk.c, NULL),
279 CLK_LOOKUP("dsi_pixel_clk", dsi_pixel_clk.c, NULL),
280 CLK_LOOKUP("dsi_ref_clk", dsi_ref_clk.c, NULL),
281 CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL),
282 CLK_LOOKUP("ebi2_clk", ebi2_clk.c, NULL),
283 CLK_LOOKUP("ecodec_clk", ecodec_clk.c, NULL),
Matt Wagantallb86ad262011-10-24 19:50:29 -0700284 CLK_LOOKUP("core_clk", gp_clk.c, NULL),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700285 CLK_LOOKUP("core_clk", grp_3d_clk.c, "kgsl-3d0.0"),
Matt Wagantall49722712011-08-17 18:50:53 -0700286 CLK_LOOKUP("core_clk", grp_3d_clk.c, "footswitch-pcom.2"),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700287 CLK_LOOKUP("iface_clk", grp_3d_p_clk.c, "kgsl-3d0.0"),
Matt Wagantall49722712011-08-17 18:50:53 -0700288 CLK_LOOKUP("iface_clk", grp_3d_p_clk.c, "footswitch-pcom.2"),
Matt Wagantallac294852011-08-17 15:44:58 -0700289 CLK_LOOKUP("core_clk", gsbi1_qup_clk.c, "qup_i2c.0"),
290 CLK_LOOKUP("core_clk", gsbi2_qup_clk.c, "qup_i2c.1"),
291 CLK_LOOKUP("iface_clk", gsbi1_qup_p_clk.c, "qup_i2c.0"),
292 CLK_LOOKUP("iface_clk", gsbi2_qup_p_clk.c, "qup_i2c.1"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700293 CLK_LOOKUP("icodec_rx_clk", icodec_rx_clk.c, NULL),
294 CLK_LOOKUP("icodec_tx_clk", icodec_tx_clk.c, NULL),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700295 CLK_LOOKUP("mem_clk", imem_clk.c, NULL),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700296 CLK_LOOKUP("mddi_clk", pmdh_clk.c, NULL),
297 CLK_LOOKUP("mdp_clk", mdp_clk.c, NULL),
298 CLK_LOOKUP("mdp_lcdc_pclk_clk", mdp_lcdc_pclk_clk.c, NULL),
299 CLK_LOOKUP("mdp_lcdc_pad_pclk_clk", mdp_lcdc_pad_pclk_clk.c, NULL),
300 CLK_LOOKUP("mdp_vsync_clk", mdp_vsync_clk.c, NULL),
301 CLK_LOOKUP("mdp_dsi_pclk", mdp_dsi_p_clk.c, NULL),
302 CLK_LOOKUP("pbus_clk", pbus_clk.c, NULL),
303 CLK_LOOKUP("pcm_clk", pcm_clk.c, NULL),
304 CLK_LOOKUP("sdac_clk", sdac_clk.c, NULL),
Matt Wagantall37ce3842011-08-17 16:00:36 -0700305 CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"),
306 CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"),
307 CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"),
308 CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"),
309 CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"),
310 CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"),
311 CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"),
312 CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"),
Matt Wagantall640e5fd2011-08-17 16:08:53 -0700313 CLK_LOOKUP("ref_clk", tsif_ref_clk.c, "msm_tsif.0"),
314 CLK_LOOKUP("iface_clk", tsif_p_clk.c, "msm_tsif.0"),
Matt Wagantalle2522372011-08-17 14:52:21 -0700315 CLK_LOOKUP("core_clk", uart1_clk.c, "msm_serial.0"),
316 CLK_LOOKUP("core_clk", uart2_clk.c, "msm_serial.1"),
317 CLK_LOOKUP("core_clk", uart1dm_clk.c, "msm_serial_hs.0"),
318 CLK_LOOKUP("core_clk", uart2dm_clk.c, "msm_serial_hsl.0"),
Manu Gautam5143b252012-01-05 19:25:23 -0800319 CLK_LOOKUP("core_clk", usb_hs_core_clk.c, "msm_otg"),
320 CLK_LOOKUP("alt_core_clk", usb_hs_clk.c, "msm_otg"),
321 CLK_LOOKUP("iface_clk", usb_hs_p_clk.c, "msm_otg"),
322 CLK_LOOKUP("phy_clk", usb_phy_clk.c, "msm_otg"),
323 CLK_LOOKUP("alt_core_clk", usb_hs2_clk.c, "msm_hsusb_host.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700324 CLK_LOOKUP("vdc_clk", vdc_clk.c, NULL),
Matt Wagantall49722712011-08-17 18:50:53 -0700325 CLK_LOOKUP("core_clk", vdc_clk.c, "footswitch-pcom.7"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700326 CLK_LOOKUP("vfe_clk", vfe_clk.c, NULL),
Matt Wagantall49722712011-08-17 18:50:53 -0700327 CLK_LOOKUP("core_clk", vfe_clk.c, "footswitch-pcom.8"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700328 CLK_LOOKUP("vfe_mdc_clk", vfe_mdc_clk.c, NULL),
329
330 CLK_LOOKUP("ebi1_acpu_clk", ebi_acpu_clk.c, NULL),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700331 CLK_LOOKUP("bus_clk", ebi_grp_3d_clk.c, "kgsl-3d0.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700332 CLK_LOOKUP("ebi1_lcdc_clk", ebi_lcdc_clk.c, NULL),
333 CLK_LOOKUP("ebi1_mddi_clk", ebi_mddi_clk.c, NULL),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700334 CLK_LOOKUP("ebi1_vfe_clk", ebi_vfe_clk.c, NULL),
Matt Wagantalle1a86062011-08-18 17:46:10 -0700335 CLK_LOOKUP("mem_clk", ebi_adm_clk.c, "msm_dmov"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700336};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700337
Stephen Boydbb600ae2011-08-02 20:11:40 -0700338struct clock_init_data msm7x27a_clock_init_data __initdata = {
339 .table = msm_clocks_7x27a,
340 .size = ARRAY_SIZE(msm_clocks_7x27a),
341};
342
343static struct clk_lookup msm_clocks_8x50[] = {
Matt Wagantalle1a86062011-08-18 17:46:10 -0700344 CLK_LOOKUP("core_clk", adm_clk.c, "msm_dmov"),
Matt Wagantallc4b3a4d2011-08-17 16:58:39 -0700345 CLK_LOOKUP("core_clk", ce_clk.c, "qce.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700346 CLK_LOOKUP("ebi1_clk", ebi1_clk.c, NULL),
347 CLK_LOOKUP("ebi2_clk", ebi2_clk.c, NULL),
348 CLK_LOOKUP("ecodec_clk", ecodec_clk.c, NULL),
349 CLK_LOOKUP("emdh_clk", emdh_clk.c, NULL),
Matt Wagantallb86ad262011-10-24 19:50:29 -0700350 CLK_LOOKUP("core_clk", gp_clk.c, NULL),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700351 CLK_LOOKUP("core_clk", grp_3d_clk.c, "kgsl-3d0.0"),
Matt Wagantallac294852011-08-17 15:44:58 -0700352 CLK_LOOKUP("core_clk", i2c_clk.c, "msm_i2c.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700353 CLK_LOOKUP("icodec_rx_clk", icodec_rx_clk.c, NULL),
354 CLK_LOOKUP("icodec_tx_clk", icodec_tx_clk.c, NULL),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700355 CLK_LOOKUP("mem_clk", imem_clk.c, NULL),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700356 CLK_LOOKUP("mdc_clk", mdc_clk.c, NULL),
357 CLK_LOOKUP("mddi_clk", pmdh_clk.c, NULL),
358 CLK_LOOKUP("mdp_clk", mdp_clk.c, NULL),
359 CLK_LOOKUP("mdp_lcdc_pclk_clk", mdp_lcdc_pclk_clk.c, NULL),
360 CLK_LOOKUP("mdp_lcdc_pad_pclk_clk", mdp_lcdc_pad_pclk_clk.c, NULL),
361 CLK_LOOKUP("mdp_vsync_clk", mdp_vsync_clk.c, NULL),
362 CLK_LOOKUP("pbus_clk", pbus_clk.c, NULL),
363 CLK_LOOKUP("pcm_clk", pcm_clk.c, NULL),
364 CLK_LOOKUP("sdac_clk", sdac_clk.c, NULL),
Matt Wagantall37ce3842011-08-17 16:00:36 -0700365 CLK_LOOKUP("core_clk", sdc1_clk.c, "msm_sdcc.1"),
366 CLK_LOOKUP("iface_clk", sdc1_p_clk.c, "msm_sdcc.1"),
367 CLK_LOOKUP("core_clk", sdc2_clk.c, "msm_sdcc.2"),
368 CLK_LOOKUP("iface_clk", sdc2_p_clk.c, "msm_sdcc.2"),
369 CLK_LOOKUP("core_clk", sdc3_clk.c, "msm_sdcc.3"),
370 CLK_LOOKUP("iface_clk", sdc3_p_clk.c, "msm_sdcc.3"),
371 CLK_LOOKUP("core_clk", sdc4_clk.c, "msm_sdcc.4"),
372 CLK_LOOKUP("iface_clk", sdc4_p_clk.c, "msm_sdcc.4"),
Matt Wagantallac294852011-08-17 15:44:58 -0700373 CLK_LOOKUP("core_clk", spi_clk.c, "spi_qsd.0"),
374 CLK_DUMMY("iface_clk", SPI_P_CLK, "spi_qsd.0", 0),
Matt Wagantall640e5fd2011-08-17 16:08:53 -0700375 CLK_LOOKUP("core_clk", tsif_clk.c, "msm_tsif.0"),
376 CLK_LOOKUP("ref_clk", tsif_ref_clk.c, "msm_tsif.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700377 CLK_LOOKUP("tv_dac_clk", tv_dac_clk.c, NULL),
378 CLK_LOOKUP("tv_enc_clk", tv_enc_clk.c, NULL),
Matt Wagantalle2522372011-08-17 14:52:21 -0700379 CLK_LOOKUP("core_clk", uart1_clk.c, "msm_serial.0"),
380 CLK_LOOKUP("core_clk", uart2_clk.c, "msm_serial.1"),
381 CLK_LOOKUP("core_clk", uart3_clk.c, "msm_serial.2"),
382 CLK_LOOKUP("core_clk", uart1dm_clk.c, "msm_serial_hs.0"),
383 CLK_LOOKUP("core_clk", uart2dm_clk.c, "msm_serial_hs.1"),
Manu Gautam5143b252012-01-05 19:25:23 -0800384 CLK_LOOKUP("alt_core_clk", usb_hs_clk.c, "msm_otg"),
385 CLK_LOOKUP("iface_clk", usb_hs_p_clk.c, "msm_otg"),
386 CLK_LOOKUP("alt_core_clk", usb_otg_clk.c, NULL),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700387 CLK_LOOKUP("vdc_clk", vdc_clk.c, NULL),
388 CLK_LOOKUP("vfe_clk", vfe_clk.c, NULL),
389 CLK_LOOKUP("vfe_mdc_clk", vfe_mdc_clk.c, NULL),
390 CLK_LOOKUP("vfe_axi_clk", vfe_axi_clk.c, NULL),
Manu Gautam5143b252012-01-05 19:25:23 -0800391 CLK_LOOKUP("alt_core_clk", usb_hs2_clk.c, "msm_hsusb_host.0"),
392 CLK_LOOKUP("iface_clk", usb_hs2_p_clk.c, "msm_hsusb_host.0"),
393 CLK_LOOKUP("alt_core_clk", usb_hs3_clk.c, NULL),
394 CLK_LOOKUP("iface_clk", usb_hs3_p_clk.c, NULL),
395 CLK_LOOKUP("phy_clk", usb_phy_clk.c, "msm_otg"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700396
397 CLK_LOOKUP("ebi1_acpu_clk", ebi_acpu_clk.c, NULL),
Matt Wagantall9dc01632011-08-17 18:55:04 -0700398 CLK_LOOKUP("bus_clk", ebi_grp_3d_clk.c, "kgsl-3d0.0"),
399 CLK_LOOKUP("bus_clk", ebi_grp_2d_clk.c, "kgsl-2d0.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700400 CLK_LOOKUP("ebi1_lcdc_clk", ebi_lcdc_clk.c, NULL),
401 CLK_LOOKUP("ebi1_mddi_clk", ebi_mddi_clk.c, NULL),
402 CLK_LOOKUP("ebi1_tv_clk", ebi_tv_clk.c, NULL),
Manu Gautam5143b252012-01-05 19:25:23 -0800403 CLK_LOOKUP("core_clk", ebi_usb_clk.c, "msm_otg"),
404 CLK_LOOKUP("core_clk", ebi_usb_clk.c, "msm_hsusb_host.0"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700405 CLK_LOOKUP("ebi1_vfe_clk", ebi_vfe_clk.c, NULL),
Matt Wagantalle1a86062011-08-18 17:46:10 -0700406 CLK_LOOKUP("mem_clk", ebi_adm_clk.c, "msm_dmov"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700407
Matt Wagantall9dc01632011-08-17 18:55:04 -0700408 CLK_LOOKUP("iface_clk", grp_3d_p_clk.c, "kgsl-3d0.0"),
409 CLK_LOOKUP("core_clk", grp_2d_clk.c, "kgsl-2d0.0"),
410 CLK_LOOKUP("iface_clk", grp_2d_p_clk.c, "kgsl-2d0.0"),
Matt Wagantallac294852011-08-17 15:44:58 -0700411 CLK_LOOKUP("core_clk", gsbi_clk.c, "qup_i2c.4"),
412 CLK_LOOKUP("iface_clk", gsbi_p_clk.c, "qup_i2c.4"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700413};
Stephen Boydbb600ae2011-08-02 20:11:40 -0700414
415struct clock_init_data qds8x50_clock_init_data __initdata = {
416 .table = msm_clocks_8x50,
417 .size = ARRAY_SIZE(msm_clocks_8x50),
418};