blob: 3073c51f1237cb10a7710a0b426b1cb01754af1e [file] [log] [blame]
Deepa Dinamani7dc3d4b2013-02-08 16:40:38 -08001/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of The Linux Foundation nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <assert.h>
30#include <reg.h>
31#include <err.h>
32#include <clock.h>
33#include <clock_pll.h>
34#include <clock_lib2.h>
35#include <platform/clock.h>
36#include <platform/iomap.h>
37
38
39/* Mux source select values */
40#define cxo_source_val 0
41#define gpll0_source_val 1
42#define cxo_mm_source_val 0
43#define mmpll0_mm_source_val 1
44#define mmpll1_mm_source_val 2
45#define mmpll3_mm_source_val 3
46#define gpll0_mm_source_val 5
47
48struct clk_freq_tbl rcg_dummy_freq = F_END;
49
50
51/* Clock Operations */
52static struct clk_ops clk_ops_branch =
53{
54 .enable = clock_lib2_branch_clk_enable,
55 .disable = clock_lib2_branch_clk_disable,
56 .set_rate = clock_lib2_branch_set_rate,
57};
58
59static struct clk_ops clk_ops_rcg_mnd =
60{
61 .enable = clock_lib2_rcg_enable,
62 .set_rate = clock_lib2_rcg_set_rate,
63};
64
65static struct clk_ops clk_ops_rcg =
66{
67 .enable = clock_lib2_rcg_enable,
68 .set_rate = clock_lib2_rcg_set_rate,
69};
70
71static struct clk_ops clk_ops_cxo =
72{
73 .enable = cxo_clk_enable,
74 .disable = cxo_clk_disable,
75};
76
77static struct clk_ops clk_ops_pll_vote =
78{
79 .enable = pll_vote_clk_enable,
80 .disable = pll_vote_clk_disable,
81 .auto_off = pll_vote_clk_disable,
82 .is_enabled = pll_vote_clk_is_enabled,
83};
84
85static struct clk_ops clk_ops_vote =
86{
87 .enable = clock_lib2_vote_clk_enable,
88 .disable = clock_lib2_vote_clk_disable,
89};
90
91/* Clock lookup table */
92static struct clk_lookup msm_clocks_8610[] =
93{
94};
95
96void platform_clock_init(void)
97{
98 clk_init(msm_clocks_8610, ARRAY_SIZE(msm_clocks_8610));
99}