Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 1 | /* |
Nirav Shah | fb79af8 | 2018-03-12 18:10:33 +0530 | [diff] [blame] | 2 | * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 3 | * |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 19 | #ifndef __PLD_PCIE_H__ |
| 20 | #define __PLD_PCIE_H__ |
| 21 | |
Yuanyuan Liu | 16a5562 | 2016-09-14 16:15:59 -0700 | [diff] [blame] | 22 | #ifdef CONFIG_PLD_PCIE_CNSS |
Yue Ma | e6a7a32 | 2016-08-31 11:09:23 -0700 | [diff] [blame] | 23 | #include <net/cnss2.h> |
| 24 | #endif |
Yuanyuan Liu | f7aea12 | 2016-05-25 16:39:40 -0700 | [diff] [blame] | 25 | #include "pld_internal.h" |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 26 | |
Nirav Shah | fb79af8 | 2018-03-12 18:10:33 +0530 | [diff] [blame] | 27 | #ifndef HIF_PCI |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 28 | static inline int pld_pcie_register_driver(void) |
| 29 | { |
| 30 | return 0; |
| 31 | } |
| 32 | |
| 33 | static inline void pld_pcie_unregister_driver(void) |
| 34 | { |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 35 | } |
| 36 | |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 37 | static inline int pld_pcie_get_ce_id(struct device *dev, int irq) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 38 | { |
| 39 | return 0; |
| 40 | } |
| 41 | #else |
| 42 | int pld_pcie_register_driver(void); |
| 43 | void pld_pcie_unregister_driver(void); |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 44 | int pld_pcie_get_ce_id(struct device *dev, int irq); |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 45 | #endif |
| 46 | |
Yue Ma | 0804752 | 2016-11-08 18:53:26 -0800 | [diff] [blame] | 47 | #ifndef CONFIG_PLD_PCIE_CNSS |
| 48 | static inline int pld_pcie_wlan_enable(struct device *dev, |
| 49 | struct pld_wlan_enable_cfg *config, |
| 50 | enum pld_driver_mode mode, |
| 51 | const char *host_version) |
| 52 | { |
| 53 | return 0; |
| 54 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 55 | |
Yue Ma | 0804752 | 2016-11-08 18:53:26 -0800 | [diff] [blame] | 56 | static inline int pld_pcie_wlan_disable(struct device *dev, |
| 57 | enum pld_driver_mode mode) |
| 58 | { |
| 59 | return 0; |
| 60 | } |
| 61 | #else |
| 62 | int pld_pcie_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config, |
| 63 | enum pld_driver_mode mode, const char *host_version); |
| 64 | int pld_pcie_wlan_disable(struct device *dev, enum pld_driver_mode mode); |
| 65 | #endif |
| 66 | |
Nirav Shah | 74be384 | 2018-06-26 19:17:25 +0530 | [diff] [blame^] | 67 | #if defined(CONFIG_PLD_PCIE_CNSS) |
Yuanyuan Liu | 81982b9 | 2017-04-13 14:25:19 -0700 | [diff] [blame] | 68 | static inline int pld_pcie_set_fw_log_mode(struct device *dev, u8 fw_log_mode) |
| 69 | { |
| 70 | return cnss_set_fw_log_mode(dev, fw_log_mode); |
| 71 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 72 | |
| 73 | static inline void pld_pcie_intr_notify_q6(struct device *dev) |
Yuanyuan Liu | 81982b9 | 2017-04-13 14:25:19 -0700 | [diff] [blame] | 74 | { |
| 75 | } |
| 76 | #else |
| 77 | static inline int pld_pcie_set_fw_log_mode(struct device *dev, u8 fw_log_mode) |
| 78 | { |
| 79 | return 0; |
| 80 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 81 | |
| 82 | static inline void pld_pcie_intr_notify_q6(struct device *dev) |
Yuanyuan Liu | 81982b9 | 2017-04-13 14:25:19 -0700 | [diff] [blame] | 83 | { |
| 84 | } |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 85 | #endif |
| 86 | |
Yuanyuan Liu | 11f526a | 2016-05-18 10:22:07 -0700 | [diff] [blame] | 87 | #if (!defined(CONFIG_PLD_PCIE_CNSS)) || (!defined(CONFIG_CNSS_SECURE_FW)) |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 88 | static inline int pld_pcie_get_sha_hash(struct device *dev, const u8 *data, |
Yuanyuan Liu | 59f81e0 | 2016-05-19 16:17:38 -0700 | [diff] [blame] | 89 | u32 data_len, u8 *hash_idx, u8 *out) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 90 | { |
| 91 | return 0; |
| 92 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 93 | |
| 94 | static inline void *pld_pcie_get_fw_ptr(struct device *dev) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 95 | { |
| 96 | return NULL; |
| 97 | } |
Yuanyuan Liu | 59f81e0 | 2016-05-19 16:17:38 -0700 | [diff] [blame] | 98 | #else |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 99 | static inline int pld_pcie_get_sha_hash(struct device *dev, const u8 *data, |
Yuanyuan Liu | 16a5562 | 2016-09-14 16:15:59 -0700 | [diff] [blame] | 100 | u32 data_len, u8 *hash_idx, u8 *out) |
| 101 | { |
| 102 | return cnss_get_sha_hash(data, data_len, hash_idx, out); |
| 103 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 104 | |
| 105 | static inline void *pld_pcie_get_fw_ptr(struct device *dev) |
Yuanyuan Liu | 16a5562 | 2016-09-14 16:15:59 -0700 | [diff] [blame] | 106 | { |
| 107 | return cnss_get_fw_ptr(); |
| 108 | } |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 109 | #endif |
| 110 | |
Yuanyuan Liu | 11f526a | 2016-05-18 10:22:07 -0700 | [diff] [blame] | 111 | #if (!defined(CONFIG_PLD_PCIE_CNSS)) || (!defined(CONFIG_PCI_MSM)) |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 112 | static inline int pld_pcie_wlan_pm_control(struct device *dev, bool vote) |
Yuanyuan Liu | 466ccb7 | 2016-04-21 15:13:22 -0700 | [diff] [blame] | 113 | { |
| 114 | return 0; |
| 115 | } |
Yuanyuan Liu | 59f81e0 | 2016-05-19 16:17:38 -0700 | [diff] [blame] | 116 | #else |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 117 | static inline int pld_pcie_wlan_pm_control(struct device *dev, bool vote) |
| 118 | { |
| 119 | return cnss_wlan_pm_control(dev, vote); |
| 120 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 121 | #endif |
Yuanyuan Liu | 466ccb7 | 2016-04-21 15:13:22 -0700 | [diff] [blame] | 122 | |
Yuanyuan Liu | 11f526a | 2016-05-18 10:22:07 -0700 | [diff] [blame] | 123 | #ifndef CONFIG_PLD_PCIE_CNSS |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 124 | static inline int |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 125 | pld_pcie_get_fw_files_for_target(struct device *dev, |
| 126 | struct pld_fw_files *pfw_files, |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 127 | u32 target_type, u32 target_version) |
| 128 | { |
Yuanyuan Liu | 6a313dc | 2016-05-10 14:19:10 -0700 | [diff] [blame] | 129 | pld_get_default_fw_files(pfw_files); |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 130 | return 0; |
| 131 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 132 | |
Yuanyuan Liu | 10fc3d3 | 2017-01-12 15:32:06 -0800 | [diff] [blame] | 133 | static inline void pld_pcie_link_down(struct device *dev) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 134 | { |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 135 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 136 | |
Yue Ma | 6dbbb18 | 2017-04-26 17:06:05 -0700 | [diff] [blame] | 137 | static inline int pld_pcie_athdiag_read(struct device *dev, uint32_t offset, |
| 138 | uint32_t memtype, uint32_t datalen, |
| 139 | uint8_t *output) |
| 140 | { |
| 141 | return 0; |
| 142 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 143 | |
Yue Ma | 6dbbb18 | 2017-04-26 17:06:05 -0700 | [diff] [blame] | 144 | static inline int pld_pcie_athdiag_write(struct device *dev, uint32_t offset, |
| 145 | uint32_t memtype, uint32_t datalen, |
| 146 | uint8_t *input) |
| 147 | { |
| 148 | return 0; |
| 149 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 150 | |
| 151 | static inline void |
| 152 | pld_pcie_schedule_recovery_work(struct device *dev, |
| 153 | enum pld_recovery_reason reason) |
Yuanyuan Liu | 0e0aa93 | 2016-05-12 10:17:58 -0700 | [diff] [blame] | 154 | { |
Yuanyuan Liu | 0e0aa93 | 2016-05-12 10:17:58 -0700 | [diff] [blame] | 155 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 156 | |
| 157 | static inline void *pld_pcie_get_virt_ramdump_mem(struct device *dev, |
| 158 | unsigned long *size) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 159 | { |
| 160 | return NULL; |
| 161 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 162 | |
| 163 | static inline void pld_pcie_device_crashed(struct device *dev) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 164 | { |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 165 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 166 | |
Yuanyuan Liu | 10fc3d3 | 2017-01-12 15:32:06 -0800 | [diff] [blame] | 167 | static inline void pld_pcie_device_self_recovery(struct device *dev, |
| 168 | enum pld_recovery_reason reason) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 169 | { |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 170 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 171 | |
| 172 | static inline void pld_pcie_request_pm_qos(struct device *dev, u32 qos_val) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 173 | { |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 174 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 175 | |
| 176 | static inline void pld_pcie_remove_pm_qos(struct device *dev) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 177 | { |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 178 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 179 | |
| 180 | static inline int pld_pcie_request_bus_bandwidth(struct device *dev, |
| 181 | int bandwidth) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 182 | { |
| 183 | return 0; |
| 184 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 185 | |
| 186 | static inline int pld_pcie_get_platform_cap(struct device *dev, |
| 187 | struct pld_platform_cap *cap) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 188 | { |
| 189 | return 0; |
| 190 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 191 | |
Yue Ma | cd24386 | 2016-11-04 19:21:16 -0700 | [diff] [blame] | 192 | static inline int pld_pcie_get_soc_info(struct device *dev, |
| 193 | struct pld_soc_info *info) |
| 194 | { |
| 195 | return 0; |
| 196 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 197 | |
Yue Ma | 5ff417c | 2017-10-30 11:13:12 -0700 | [diff] [blame] | 198 | static inline int pld_pcie_auto_suspend(struct device *dev) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 199 | { |
| 200 | return 0; |
| 201 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 202 | |
| 203 | static inline int pld_pcie_auto_resume(struct device *dev) |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 204 | { |
| 205 | return 0; |
| 206 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 207 | |
| 208 | static inline void pld_pcie_lock_pm_sem(struct device *dev) |
Yuanyuan Liu | 44c4477 | 2016-04-11 11:11:27 -0700 | [diff] [blame] | 209 | { |
Yuanyuan Liu | 44c4477 | 2016-04-11 11:11:27 -0700 | [diff] [blame] | 210 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 211 | |
| 212 | static inline void pld_pcie_release_pm_sem(struct device *dev) |
Yuanyuan Liu | 44c4477 | 2016-04-11 11:11:27 -0700 | [diff] [blame] | 213 | { |
Yuanyuan Liu | 44c4477 | 2016-04-11 11:11:27 -0700 | [diff] [blame] | 214 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 215 | |
Arun Khandavalli | 1496fcb | 2016-07-25 16:53:00 +0530 | [diff] [blame] | 216 | static inline int pld_pcie_power_on(struct device *dev) |
| 217 | { |
| 218 | return 0; |
| 219 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 220 | |
Arun Khandavalli | 1496fcb | 2016-07-25 16:53:00 +0530 | [diff] [blame] | 221 | static inline int pld_pcie_power_off(struct device *dev) |
| 222 | { |
| 223 | return 0; |
| 224 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 225 | |
Yue Ma | 63d360a | 2017-06-20 17:00:35 -0700 | [diff] [blame] | 226 | static inline int pld_pcie_force_assert_target(struct device *dev) |
| 227 | { |
| 228 | return -EINVAL; |
| 229 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 230 | |
Yue Ma | fd418ea | 2016-11-21 16:47:13 -0800 | [diff] [blame] | 231 | static inline int pld_pcie_get_user_msi_assignment(struct device *dev, |
| 232 | char *user_name, |
| 233 | int *num_vectors, |
| 234 | uint32_t *user_base_data, |
| 235 | uint32_t *base_vector) |
| 236 | { |
| 237 | return 0; |
| 238 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 239 | |
Yue Ma | fd418ea | 2016-11-21 16:47:13 -0800 | [diff] [blame] | 240 | static inline int pld_pcie_get_msi_irq(struct device *dev, unsigned int vector) |
| 241 | { |
| 242 | return 0; |
| 243 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 244 | |
Yue Ma | fd418ea | 2016-11-21 16:47:13 -0800 | [diff] [blame] | 245 | static inline void pld_pcie_get_msi_address(struct device *dev, |
| 246 | uint32_t *msi_addr_low, |
| 247 | uint32_t *msi_addr_high) |
| 248 | { |
| 249 | return; |
| 250 | } |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 251 | #else |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 252 | int pld_pcie_get_fw_files_for_target(struct device *dev, |
| 253 | struct pld_fw_files *pfw_files, |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 254 | u32 target_type, u32 target_version); |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 255 | int pld_pcie_get_platform_cap(struct device *dev, struct pld_platform_cap *cap); |
Yue Ma | cd24386 | 2016-11-04 19:21:16 -0700 | [diff] [blame] | 256 | int pld_pcie_get_soc_info(struct device *dev, struct pld_soc_info *info); |
Yuanyuan Liu | 10fc3d3 | 2017-01-12 15:32:06 -0800 | [diff] [blame] | 257 | void pld_pcie_schedule_recovery_work(struct device *dev, |
| 258 | enum pld_recovery_reason reason); |
| 259 | void pld_pcie_device_self_recovery(struct device *dev, |
| 260 | enum pld_recovery_reason reason); |
Komal Seelam | 355b147 | 2016-09-02 14:36:21 +0530 | [diff] [blame] | 261 | |
Yuanyuan Liu | 10fc3d3 | 2017-01-12 15:32:06 -0800 | [diff] [blame] | 262 | static inline void pld_pcie_link_down(struct device *dev) |
Yuanyuan Liu | 16a5562 | 2016-09-14 16:15:59 -0700 | [diff] [blame] | 263 | { |
Yuanyuan Liu | 10fc3d3 | 2017-01-12 15:32:06 -0800 | [diff] [blame] | 264 | cnss_pci_link_down(dev); |
Yuanyuan Liu | 16a5562 | 2016-09-14 16:15:59 -0700 | [diff] [blame] | 265 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 266 | |
Yue Ma | 6dbbb18 | 2017-04-26 17:06:05 -0700 | [diff] [blame] | 267 | static inline int pld_pcie_athdiag_read(struct device *dev, uint32_t offset, |
| 268 | uint32_t memtype, uint32_t datalen, |
| 269 | uint8_t *output) |
| 270 | { |
| 271 | return cnss_athdiag_read(dev, offset, memtype, datalen, output); |
| 272 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 273 | |
Yue Ma | 6dbbb18 | 2017-04-26 17:06:05 -0700 | [diff] [blame] | 274 | static inline int pld_pcie_athdiag_write(struct device *dev, uint32_t offset, |
| 275 | uint32_t memtype, uint32_t datalen, |
| 276 | uint8_t *input) |
| 277 | { |
| 278 | return cnss_athdiag_write(dev, offset, memtype, datalen, input); |
| 279 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 280 | |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 281 | static inline void *pld_pcie_get_virt_ramdump_mem(struct device *dev, |
| 282 | unsigned long *size) |
| 283 | { |
| 284 | return cnss_get_virt_ramdump_mem(dev, size); |
| 285 | } |
| 286 | |
| 287 | static inline void pld_pcie_device_crashed(struct device *dev) |
| 288 | { |
| 289 | cnss_device_crashed(dev); |
| 290 | } |
| 291 | |
| 292 | static inline void pld_pcie_request_pm_qos(struct device *dev, u32 qos_val) |
| 293 | { |
| 294 | cnss_request_pm_qos(dev, qos_val); |
| 295 | } |
| 296 | |
| 297 | static inline void pld_pcie_remove_pm_qos(struct device *dev) |
| 298 | { |
| 299 | cnss_remove_pm_qos(dev); |
| 300 | } |
| 301 | |
| 302 | static inline int pld_pcie_request_bus_bandwidth(struct device *dev, |
| 303 | int bandwidth) |
| 304 | { |
| 305 | return cnss_request_bus_bandwidth(dev, bandwidth); |
| 306 | } |
| 307 | |
| 308 | static inline int pld_pcie_auto_suspend(struct device *dev) |
| 309 | { |
| 310 | return cnss_auto_suspend(dev); |
| 311 | } |
| 312 | |
| 313 | static inline int pld_pcie_auto_resume(struct device *dev) |
| 314 | { |
| 315 | return cnss_auto_resume(dev); |
| 316 | } |
| 317 | |
| 318 | static inline void pld_pcie_lock_pm_sem(struct device *dev) |
| 319 | { |
| 320 | cnss_lock_pm_sem(dev); |
| 321 | } |
| 322 | |
| 323 | static inline void pld_pcie_release_pm_sem(struct device *dev) |
| 324 | { |
| 325 | cnss_release_pm_sem(dev); |
| 326 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 327 | |
Yuanyuan Liu | 16a5562 | 2016-09-14 16:15:59 -0700 | [diff] [blame] | 328 | static inline int pld_pcie_power_on(struct device *dev) |
| 329 | { |
| 330 | return cnss_power_up(dev); |
| 331 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 332 | |
Yuanyuan Liu | 16a5562 | 2016-09-14 16:15:59 -0700 | [diff] [blame] | 333 | static inline int pld_pcie_power_off(struct device *dev) |
| 334 | { |
| 335 | return cnss_power_down(dev); |
| 336 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 337 | |
Yue Ma | 63d360a | 2017-06-20 17:00:35 -0700 | [diff] [blame] | 338 | static inline int pld_pcie_force_assert_target(struct device *dev) |
| 339 | { |
| 340 | return cnss_force_fw_assert(dev); |
| 341 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 342 | |
Yue Ma | fd418ea | 2016-11-21 16:47:13 -0800 | [diff] [blame] | 343 | static inline int pld_pcie_get_user_msi_assignment(struct device *dev, |
| 344 | char *user_name, |
| 345 | int *num_vectors, |
| 346 | uint32_t *user_base_data, |
| 347 | uint32_t *base_vector) |
| 348 | { |
| 349 | return cnss_get_user_msi_assignment(dev, user_name, num_vectors, |
| 350 | user_base_data, base_vector); |
| 351 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 352 | |
Yue Ma | fd418ea | 2016-11-21 16:47:13 -0800 | [diff] [blame] | 353 | static inline int pld_pcie_get_msi_irq(struct device *dev, unsigned int vector) |
| 354 | { |
| 355 | return cnss_get_msi_irq(dev, vector); |
| 356 | } |
Yue Ma | 85761e6 | 2017-10-30 11:13:45 -0700 | [diff] [blame] | 357 | |
Yue Ma | fd418ea | 2016-11-21 16:47:13 -0800 | [diff] [blame] | 358 | static inline void pld_pcie_get_msi_address(struct device *dev, |
| 359 | uint32_t *msi_addr_low, |
| 360 | uint32_t *msi_addr_high) |
| 361 | { |
| 362 | cnss_get_msi_address(dev, msi_addr_low, msi_addr_high); |
| 363 | } |
Komal Seelam | 355b147 | 2016-09-02 14:36:21 +0530 | [diff] [blame] | 364 | #endif |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 365 | #endif |