blob: 34dae77951cb299dcadacfe24a19d6c9ca6e27e5 [file] [log] [blame]
Matt Wagantalld55b90f2012-02-23 23:27:44 -08001/*
Duy Truonge833aca2013-02-12 13:35:08 -08002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Brian Swetland600f7cf2008-09-09 11:04:14 -07003 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef __ARCH_ARM_MACH_MSM_CLOCK_H
16#define __ARCH_ARM_MACH_MSM_CLOCK_H
17
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070018#include <linux/clkdev.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070019
Stephen Boydbb600ae2011-08-02 20:11:40 -070020/**
21 * struct clock_init_data - SoC specific clock initialization data
22 * @table: table of lookups to add
23 * @size: size of @table
Matt Wagantallb64888f2012-04-02 21:35:07 -070024 * @pre_init: called before initializing the clock driver.
25 * @post_init: called after registering @table. clock APIs can be called inside.
Stephen Boydbb600ae2011-08-02 20:11:40 -070026 * @late_init: called during late init
27 */
28struct clock_init_data {
29 struct clk_lookup *table;
30 size_t size;
Matt Wagantallb64888f2012-04-02 21:35:07 -070031 void (*pre_init)(void);
32 void (*post_init)(void);
Stephen Boydbb600ae2011-08-02 20:11:40 -070033 int (*late_init)(void);
34};
35
Vikram Mulukutla489e39e2011-08-31 18:04:05 -070036extern struct clock_init_data msm9615_clock_init_data;
Tianyi Gou41515e22011-09-01 19:37:43 -070037extern struct clock_init_data apq8064_clock_init_data;
Stephen Boydbb600ae2011-08-02 20:11:40 -070038extern struct clock_init_data fsm9xxx_clock_init_data;
39extern struct clock_init_data msm7x01a_clock_init_data;
40extern struct clock_init_data msm7x27_clock_init_data;
41extern struct clock_init_data msm7x27a_clock_init_data;
42extern struct clock_init_data msm7x30_clock_init_data;
43extern struct clock_init_data msm8960_clock_init_data;
Stephen Boydbb600ae2011-08-02 20:11:40 -070044extern struct clock_init_data msm8x60_clock_init_data;
45extern struct clock_init_data qds8x50_clock_init_data;
Taniya Das7c9f0512011-12-02 14:26:46 +053046extern struct clock_init_data msm8625_dummy_clock_init_data;
Tianyi Goue3d4f542012-03-15 17:06:45 -070047extern struct clock_init_data msm8930_clock_init_data;
Patrick Dalyc9f51b92012-08-27 16:10:26 -070048extern struct clock_init_data msm8930_pm8917_clock_init_data;
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070049extern struct clock_init_data msm8974_clock_init_data;
Vikram Mulukutla19245e02012-07-23 15:58:04 -070050extern struct clock_init_data msm8974_rumi_clock_init_data;
Stephen Boydbb600ae2011-08-02 20:11:40 -070051
Matt Wagantallc7764192012-02-27 15:54:43 -080052int msm_clock_init(struct clock_init_data *data);
Patrick Daly0a78a0e2012-07-23 13:18:59 -070053int find_vdd_level(struct clk *clk, unsigned long rate);
Brian Swetland600f7cf2008-09-09 11:04:14 -070054
Matt Wagantalld64560fe2011-01-26 16:20:54 -080055#ifdef CONFIG_DEBUG_FS
Matt Wagantallc7764192012-02-27 15:54:43 -080056int clock_debug_init(void);
57int clock_debug_register(struct clk_lookup *t, size_t s);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070058void clock_debug_print_enabled(void);
Matt Wagantalld64560fe2011-01-26 16:20:54 -080059#else
Matt Wagantallc7764192012-02-27 15:54:43 -080060static inline int clock_debug_init(void) { return 0; }
61static inline int clock_debug_register(struct clk_lookup *t, size_t s)
62{
63 return 0;
64}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070065static inline void clock_debug_print_enabled(void) { return; }
Matt Wagantalld64560fe2011-01-26 16:20:54 -080066#endif
67
Brian Swetland600f7cf2008-09-09 11:04:14 -070068#endif