Niranjana Vishwanathapura | f1427ac | 2012-05-03 14:28:21 -0600 | [diff] [blame] | 1 | /* Copyright (c) 2012, Code Aurora Forum. All rights reserved. |
| 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 { |
| 48 | char *name; |
| 49 | uint32_t start; |
| 50 | uint32_t end; |
| 51 | void __iomem *base; |
| 52 | }; |
| 53 | |
| 54 | /* msm pcie device structure */ |
| 55 | struct msm_pcie_dev_t { |
| 56 | struct platform_device *pdev; |
| 57 | |
| 58 | struct msm_pcie_vreg_info_t *vreg; |
| 59 | struct msm_pcie_gpio_info_t *gpio; |
| 60 | struct msm_pcie_clk_info_t *clk; |
| 61 | struct msm_pcie_res_info_t *res; |
| 62 | |
| 63 | void __iomem *parf; |
| 64 | void __iomem *elbi; |
| 65 | void __iomem *pcie20; |
| 66 | void __iomem *axi_conf; |
| 67 | }; |
| 68 | |
| 69 | extern uint32_t msm_pcie_irq_init(struct msm_pcie_dev_t *dev); |
| 70 | extern void msm_pcie_irq_deinit(struct msm_pcie_dev_t *dev); |
| 71 | extern int msm_pcie_get_debug_mask(void); |
| 72 | |
| 73 | #endif |