Yan He | 620fe16 | 2013-01-29 12:32:20 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, 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; |
Yan He | 620fe16 | 2013-01-29 12:32:20 -0800 | [diff] [blame] | 73 | uint32_t vreg_n; |
Rohit Vaswani | afe4820 | 2013-03-05 15:10:47 -0800 | [diff] [blame] | 74 | uint32_t parf_deemph; |
| 75 | uint32_t parf_swing; |
Niranjana Vishwanathapura | f1427ac | 2012-05-03 14:28:21 -0600 | [diff] [blame] | 76 | }; |
| 77 | |
| 78 | extern uint32_t msm_pcie_irq_init(struct msm_pcie_dev_t *dev); |
| 79 | extern void msm_pcie_irq_deinit(struct msm_pcie_dev_t *dev); |
| 80 | extern int msm_pcie_get_debug_mask(void); |
| 81 | |
| 82 | #endif |