blob: e294f4c8cc7bb5ab824b5217025d666398b85491 [file] [log] [blame]
Matt Wagantall33d01f52012-02-23 23:27:44 -08001/*
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -08002 * Copyright (c) 2012-2013, 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 {
Vikram Mulukutla4785ab62012-12-10 20:51:22 -080029 struct list_head list;
Stephen Boydbb600ae2011-08-02 20:11:40 -070030 struct clk_lookup *table;
31 size_t size;
Matt Wagantallb64888f2012-04-02 21:35:07 -070032 void (*pre_init)(void);
33 void (*post_init)(void);
Stephen Boydbb600ae2011-08-02 20:11:40 -070034 int (*late_init)(void);
35};
36
Vikram Mulukutla489e39e2011-08-31 18:04:05 -070037extern struct clock_init_data msm9615_clock_init_data;
Tianyi Gou389ba432012-10-01 13:58:38 -070038extern struct clock_init_data msm9625_clock_init_data;
Tianyi Gou41515e22011-09-01 19:37:43 -070039extern struct clock_init_data apq8064_clock_init_data;
Stephen Boydbb600ae2011-08-02 20:11:40 -070040extern struct clock_init_data fsm9xxx_clock_init_data;
41extern struct clock_init_data msm7x01a_clock_init_data;
42extern struct clock_init_data msm7x27_clock_init_data;
43extern struct clock_init_data msm7x27a_clock_init_data;
44extern struct clock_init_data msm7x30_clock_init_data;
45extern struct clock_init_data msm8960_clock_init_data;
Stephen Boydbb600ae2011-08-02 20:11:40 -070046extern struct clock_init_data msm8x60_clock_init_data;
47extern struct clock_init_data qds8x50_clock_init_data;
Taniya Das7c9f0512011-12-02 14:26:46 +053048extern struct clock_init_data msm8625_dummy_clock_init_data;
Tianyi Goue3d4f542012-03-15 17:06:45 -070049extern struct clock_init_data msm8930_clock_init_data;
Patrick Daly1a3859f2012-08-27 16:10:26 -070050extern struct clock_init_data msm8930_pm8917_clock_init_data;
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070051extern struct clock_init_data msm8974_clock_init_data;
Vikram Mulukutla19245e02012-07-23 15:58:04 -070052extern struct clock_init_data msm8974_rumi_clock_init_data;
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080053extern struct clock_init_data msm8610_clock_init_data;
54extern struct clock_init_data msm8610_rumi_clock_init_data;
Patrick Dalyeb370ea2012-10-23 11:57:50 -070055extern struct clock_init_data msm8226_clock_init_data;
56extern struct clock_init_data msm8226_rumi_clock_init_data;
Tianyi Gou30e19b82013-05-06 20:53:24 -070057extern struct clock_init_data msm8084_clock_init_data;
Taniya Das890bc7d2013-05-15 15:44:27 +053058extern struct clock_init_data mpq8092_clock_init_data;
Patrick Daly565b65a2013-06-07 16:09:12 -070059extern struct clock_init_data msmkrypton_clock_init_data;
Stephen Boydbb600ae2011-08-02 20:11:40 -070060
Matt Wagantall665f0cf2012-02-27 15:54:43 -080061int msm_clock_init(struct clock_init_data *data);
Patrick Daly0a78a0e2012-07-23 13:18:59 -070062int find_vdd_level(struct clk *clk, unsigned long rate);
Brian Swetland600f7cf2008-09-09 11:04:14 -070063
Matt Wagantalld64560fe2011-01-26 16:20:54 -080064#ifdef CONFIG_DEBUG_FS
Matt Wagantall665f0cf2012-02-27 15:54:43 -080065int clock_debug_register(struct clk_lookup *t, size_t s);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070066void clock_debug_print_enabled(void);
Matt Wagantalld64560fe2011-01-26 16:20:54 -080067#else
Matt Wagantall665f0cf2012-02-27 15:54:43 -080068static inline int clock_debug_register(struct clk_lookup *t, size_t s)
69{
70 return 0;
71}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070072static inline void clock_debug_print_enabled(void) { return; }
Matt Wagantalld64560fe2011-01-26 16:20:54 -080073#endif
74
Brian Swetland600f7cf2008-09-09 11:04:14 -070075#endif