| Duy Truong | e833aca | 2013-02-12 13:35:08 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. | 
| Niranjana Vishwanathapura | f1427ac | 2012-05-03 14:28:21 -0600 | [diff] [blame] | 2 |  * | 
 | 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 | #ifndef __ARCH_ARM_MACH_MSM_PCIE_H | 
 | 14 | #define __ARCH_ARM_MACH_MSM_PCIE_H | 
 | 15 |  | 
 | 16 | #include <linux/clk.h> | 
 | 17 | #include <linux/compiler.h> | 
 | 18 | #include <linux/platform_device.h> | 
 | 19 | #include <linux/regulator/consumer.h> | 
 | 20 | #include <linux/types.h> | 
 | 21 | #include <mach/msm_pcie.h> | 
 | 22 |  | 
 | 23 | #define MSM_PCIE_MAX_VREG 4 | 
 | 24 | #define MSM_PCIE_MAX_CLK  3 | 
 | 25 |  | 
 | 26 | #define PCIE_DBG(x...) do {              \ | 
 | 27 | 	if (msm_pcie_get_debug_mask())   \ | 
 | 28 | 		pr_info(x);              \ | 
 | 29 | 	} while (0) | 
 | 30 |  | 
 | 31 | /* voltage regulator info structrue */ | 
 | 32 | struct msm_pcie_vreg_info_t { | 
 | 33 | 	struct regulator  *hdl; | 
 | 34 | 	char              *name; | 
 | 35 | 	uint32_t           max_v; | 
 | 36 | 	uint32_t           min_v; | 
 | 37 | 	uint32_t           opt_mode; | 
 | 38 | }; | 
 | 39 |  | 
 | 40 | /* clock info structure */ | 
 | 41 | struct msm_pcie_clk_info_t { | 
 | 42 | 	struct clk  *hdl; | 
 | 43 | 	char        *name; | 
 | 44 | }; | 
 | 45 |  | 
 | 46 | /* resource info structure */ | 
 | 47 | struct msm_pcie_res_info_t { | 
| Niranjana Vishwanathapura | 68210ff | 2012-06-24 18:03:49 -0600 | [diff] [blame] | 48 | 	char            *name; | 
 | 49 | 	struct resource *resource; | 
 | 50 | 	void __iomem    *base; | 
| Niranjana Vishwanathapura | f1427ac | 2012-05-03 14:28:21 -0600 | [diff] [blame] | 51 | }; | 
 | 52 |  | 
 | 53 | /* msm pcie device structure */ | 
 | 54 | struct msm_pcie_dev_t { | 
 | 55 | 	struct platform_device       *pdev; | 
 | 56 |  | 
 | 57 | 	struct msm_pcie_vreg_info_t  *vreg; | 
 | 58 | 	struct msm_pcie_gpio_info_t  *gpio; | 
 | 59 | 	struct msm_pcie_clk_info_t   *clk; | 
 | 60 | 	struct msm_pcie_res_info_t   *res; | 
 | 61 |  | 
 | 62 | 	void __iomem                 *parf; | 
 | 63 | 	void __iomem                 *elbi; | 
 | 64 | 	void __iomem                 *pcie20; | 
 | 65 | 	void __iomem                 *axi_conf; | 
| Niranjana Vishwanathapura | 68210ff | 2012-06-24 18:03:49 -0600 | [diff] [blame] | 66 |  | 
 | 67 | 	uint32_t                      axi_bar_start; | 
 | 68 | 	uint32_t                      axi_bar_end; | 
 | 69 |  | 
 | 70 | 	struct resource               dev_mem_res; | 
| Niranjana Vishwanathapura | 459a27d | 2012-07-20 12:23:55 -0600 | [diff] [blame] | 71 |  | 
 | 72 | 	uint32_t                      wake_n; | 
| Niranjana Vishwanathapura | f1427ac | 2012-05-03 14:28:21 -0600 | [diff] [blame] | 73 | }; | 
 | 74 |  | 
 | 75 | extern uint32_t msm_pcie_irq_init(struct msm_pcie_dev_t *dev); | 
 | 76 | extern void msm_pcie_irq_deinit(struct msm_pcie_dev_t *dev); | 
 | 77 | extern int msm_pcie_get_debug_mask(void); | 
 | 78 |  | 
 | 79 | #endif |