Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 1 | /* |
Yue Ma | 502a28f | 2017-01-03 16:38:44 -0800 | [diff] [blame] | 2 | * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | #ifndef __PLD_COMMON_H__ |
| 29 | #define __PLD_COMMON_H__ |
| 30 | |
| 31 | #include <linux/device.h> |
| 32 | #include <linux/interrupt.h> |
| 33 | #include <linux/pm.h> |
Yu Wang | 66e4ff2 | 2017-02-15 19:09:24 +0800 | [diff] [blame^] | 34 | #include <osapi_linux.h> |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 35 | |
Yuanyuan Liu | 6a313dc | 2016-05-10 14:19:10 -0700 | [diff] [blame] | 36 | #define PLD_IMAGE_FILE "athwlan.bin" |
| 37 | #define PLD_UTF_FIRMWARE_FILE "utf.bin" |
| 38 | #define PLD_BOARD_DATA_FILE "fakeboar.bin" |
| 39 | #define PLD_OTP_FILE "otp.bin" |
| 40 | #define PLD_SETUP_FILE "athsetup.bin" |
| 41 | #define PLD_EPPING_FILE "epping.bin" |
| 42 | #define PLD_EVICTED_FILE "" |
| 43 | |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 44 | /** |
| 45 | * enum pld_bus_type - bus type |
| 46 | * @PLD_BUS_TYPE_NONE: invalid bus type, only return in error cases |
| 47 | * @PLD_BUS_TYPE_PCIE: PCIE bus |
| 48 | * @PLD_BUS_TYPE_SNOC: SNOC bus |
| 49 | */ |
| 50 | enum pld_bus_type { |
| 51 | PLD_BUS_TYPE_NONE = -1, |
| 52 | PLD_BUS_TYPE_PCIE = 0, |
Govind Singh | 6a2fe03 | 2016-05-13 14:09:37 +0530 | [diff] [blame] | 53 | PLD_BUS_TYPE_SNOC, |
Mohit Khanna | 1d531c4 | 2016-05-12 21:35:50 -0700 | [diff] [blame] | 54 | PLD_BUS_TYPE_SDIO, |
| 55 | PLD_BUS_TYPE_USB |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | #define PLD_MAX_FIRMWARE_SIZE (1 * 1024 * 1024) |
| 59 | |
| 60 | /** |
| 61 | * enum pld_bus_width_type - bus bandwith |
| 62 | * @PLD_BUS_WIDTH_NONE: don't vote for bus bandwidth |
| 63 | * @PLD_BUS_WIDTH_LOW: vote for low bus bandwidth |
| 64 | * @PLD_BUS_WIDTH_MEDIUM: vote for medium bus bandwidth |
| 65 | * @PLD_BUS_WIDTH_HIGH: vote for high bus bandwidth |
| 66 | */ |
| 67 | enum pld_bus_width_type { |
| 68 | PLD_BUS_WIDTH_NONE, |
| 69 | PLD_BUS_WIDTH_LOW, |
| 70 | PLD_BUS_WIDTH_MEDIUM, |
| 71 | PLD_BUS_WIDTH_HIGH |
| 72 | }; |
| 73 | |
Yu Wang | 66e4ff2 | 2017-02-15 19:09:24 +0800 | [diff] [blame^] | 74 | #define PLD_MAX_FILE_NAME NAME_MAX |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 75 | |
| 76 | /** |
| 77 | * struct pld_fw_file - WLAN FW file names |
| 78 | * @image_file: WLAN FW image file |
| 79 | * @board_data: WLAN FW board data file |
| 80 | * @otp_data: WLAN FW OTP file |
| 81 | * @utf_file: WLAN FW UTF file |
| 82 | * @utf_board_data: WLAN FW UTF board data file |
| 83 | * @epping_file: WLAN FW EPPING mode file |
| 84 | * @evicted_data: WLAN FW evicted file |
Yuanyuan Liu | 6a313dc | 2016-05-10 14:19:10 -0700 | [diff] [blame] | 85 | * @setup_file: WLAN FW setup file |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 86 | * |
| 87 | * pld_fw_files is used to store WLAN FW file names |
| 88 | */ |
| 89 | struct pld_fw_files { |
| 90 | char image_file[PLD_MAX_FILE_NAME]; |
| 91 | char board_data[PLD_MAX_FILE_NAME]; |
| 92 | char otp_data[PLD_MAX_FILE_NAME]; |
| 93 | char utf_file[PLD_MAX_FILE_NAME]; |
| 94 | char utf_board_data[PLD_MAX_FILE_NAME]; |
| 95 | char epping_file[PLD_MAX_FILE_NAME]; |
| 96 | char evicted_data[PLD_MAX_FILE_NAME]; |
Yuanyuan Liu | 6a313dc | 2016-05-10 14:19:10 -0700 | [diff] [blame] | 97 | char setup_file[PLD_MAX_FILE_NAME]; |
Frank Liu | ab70c84 | 2016-10-20 10:02:18 +0800 | [diff] [blame] | 98 | char ibss_image_file[PLD_MAX_FILE_NAME]; |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 99 | }; |
| 100 | |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 101 | /** |
| 102 | * enum pld_platform_cap_flag - platform capability flag |
| 103 | * @PLD_HAS_EXTERNAL_SWREG: has external regulator |
| 104 | * @PLD_HAS_UART_ACCESS: has UART access |
| 105 | */ |
| 106 | enum pld_platform_cap_flag { |
| 107 | PLD_HAS_EXTERNAL_SWREG = 0x01, |
| 108 | PLD_HAS_UART_ACCESS = 0x02, |
| 109 | }; |
| 110 | |
| 111 | /** |
| 112 | * struct pld_platform_cap - platform capabilities |
| 113 | * @cap_flag: capabilities flag |
| 114 | * |
| 115 | * pld_platform_cap provides platform capabilities which are |
| 116 | * extracted from DTS. |
| 117 | */ |
| 118 | struct pld_platform_cap { |
| 119 | u32 cap_flag; |
| 120 | }; |
| 121 | |
| 122 | /** |
| 123 | * enum pld_driver_status - WLAN driver status |
| 124 | * @PLD_UNINITIALIZED: driver is uninitialized |
| 125 | * @PLD_INITIALIZED: driver is initialized |
| 126 | * @PLD_LOAD_UNLOADL: driver is in load-unload status |
| 127 | */ |
| 128 | enum pld_driver_status { |
| 129 | PLD_UNINITIALIZED, |
| 130 | PLD_INITIALIZED, |
Yuanyuan Liu | 06a342f | 2017-01-12 16:48:19 -0800 | [diff] [blame] | 131 | PLD_LOAD_UNLOAD, |
| 132 | PLD_RECOVERY, |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 133 | }; |
| 134 | |
| 135 | /** |
| 136 | * struct pld_ce_tgt_pipe_cfg - copy engine target pipe configuration |
| 137 | * @pipe_num: pipe number |
| 138 | * @pipe_dir: pipe direction |
| 139 | * @nentries: number of entries |
| 140 | * @nbytes_max: max number of bytes |
| 141 | * @flags: flags |
| 142 | * @reserved: reserved |
| 143 | * |
| 144 | * pld_ce_tgt_pipe_cfg is used to store copy engine target pipe |
| 145 | * configuration. |
| 146 | */ |
| 147 | struct pld_ce_tgt_pipe_cfg { |
| 148 | u32 pipe_num; |
| 149 | u32 pipe_dir; |
| 150 | u32 nentries; |
| 151 | u32 nbytes_max; |
| 152 | u32 flags; |
| 153 | u32 reserved; |
| 154 | }; |
| 155 | |
| 156 | /** |
| 157 | * struct pld_ce_svc_pipe_cfg - copy engine service pipe configuration |
| 158 | * @service_id: service ID |
| 159 | * @pipe_dir: pipe direction |
| 160 | * @pipe_num: pipe number |
| 161 | * |
| 162 | * pld_ce_svc_pipe_cfg is used to store copy engine service pipe |
| 163 | * configuration. |
| 164 | */ |
| 165 | struct pld_ce_svc_pipe_cfg { |
| 166 | u32 service_id; |
| 167 | u32 pipe_dir; |
| 168 | u32 pipe_num; |
| 169 | }; |
| 170 | |
| 171 | /** |
| 172 | * struct pld_shadow_reg_cfg - shadow register configuration |
| 173 | * @ce_id: copy engine ID |
| 174 | * @reg_offset: register offset |
| 175 | * |
| 176 | * pld_shadow_reg_cfg is used to store shadow register configuration. |
| 177 | */ |
| 178 | struct pld_shadow_reg_cfg { |
| 179 | u16 ce_id; |
| 180 | u16 reg_offset; |
| 181 | }; |
| 182 | |
| 183 | /** |
Yue Ma | 502a28f | 2017-01-03 16:38:44 -0800 | [diff] [blame] | 184 | * struct pld_shadow_reg_v2_cfg - shadow register version 2 configuration |
| 185 | * @addr: shadow register physical address |
| 186 | * |
| 187 | * pld_shadow_reg_v2_cfg is used to store shadow register version 2 |
| 188 | * configuration. |
| 189 | */ |
| 190 | struct pld_shadow_reg_v2_cfg { |
| 191 | u32 addr; |
| 192 | }; |
| 193 | |
| 194 | /** |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 195 | * struct pld_wlan_enable_cfg - WLAN FW configuration |
| 196 | * @num_ce_tgt_cfg: number of CE target configuration |
| 197 | * @ce_tgt_cfg: CE target configuration |
| 198 | * @num_ce_svc_pipe_cfg: number of CE service configuration |
| 199 | * @ce_svc_cfg: CE service configuration |
| 200 | * @num_shadow_reg_cfg: number of shadow register configuration |
| 201 | * @shadow_reg_cfg: shadow register configuration |
Yue Ma | 502a28f | 2017-01-03 16:38:44 -0800 | [diff] [blame] | 202 | * @num_shadow_reg_v2_cfg: number of shadow register version 2 configuration |
| 203 | * @shadow_reg_v2_cfg: shadow register version 2 configuration |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 204 | * |
| 205 | * pld_wlan_enable_cfg stores WLAN FW configurations. It will be |
| 206 | * passed to WLAN FW when WLAN host driver calls wlan_enable. |
| 207 | */ |
| 208 | struct pld_wlan_enable_cfg { |
| 209 | u32 num_ce_tgt_cfg; |
| 210 | struct pld_ce_tgt_pipe_cfg *ce_tgt_cfg; |
| 211 | u32 num_ce_svc_pipe_cfg; |
| 212 | struct pld_ce_svc_pipe_cfg *ce_svc_cfg; |
| 213 | u32 num_shadow_reg_cfg; |
| 214 | struct pld_shadow_reg_cfg *shadow_reg_cfg; |
Yue Ma | 502a28f | 2017-01-03 16:38:44 -0800 | [diff] [blame] | 215 | u32 num_shadow_reg_v2_cfg; |
| 216 | struct pld_shadow_reg_v2_cfg *shadow_reg_v2_cfg; |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 217 | }; |
| 218 | |
| 219 | /** |
| 220 | * enum pld_driver_mode - WLAN host driver mode |
| 221 | * @PLD_MISSION: mission mode |
| 222 | * @PLD_FTM: FTM mode |
| 223 | * @PLD_EPPING: EPPING mode |
| 224 | * @PLD_WALTEST: WAL test mode, FW standalone test mode |
| 225 | * @PLD_OFF: OFF mode |
| 226 | */ |
| 227 | enum pld_driver_mode { |
| 228 | PLD_MISSION, |
| 229 | PLD_FTM, |
| 230 | PLD_EPPING, |
| 231 | PLD_WALTEST, |
| 232 | PLD_OFF |
| 233 | }; |
| 234 | |
Yuanyuan Liu | 0de344f | 2016-07-27 10:26:30 -0700 | [diff] [blame] | 235 | #define PLD_MAX_TIMESTAMP_LEN 32 |
| 236 | |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 237 | /** |
| 238 | * struct pld_soc_info - SOC information |
| 239 | * @v_addr: virtual address of preallocated memory |
| 240 | * @p_addr: physical address of preallcoated memory |
Yuanyuan Liu | 0de344f | 2016-07-27 10:26:30 -0700 | [diff] [blame] | 241 | * @chip_id: chip ID |
| 242 | * @chip_family: chip family |
| 243 | * @board_id: board ID |
| 244 | * @soc_id: SOC ID |
| 245 | * @fw_version: FW version |
| 246 | * @fw_build_timestamp: FW build timestamp |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 247 | * |
| 248 | * pld_soc_info is used to store WLAN SOC information. |
| 249 | */ |
| 250 | struct pld_soc_info { |
| 251 | void __iomem *v_addr; |
| 252 | phys_addr_t p_addr; |
Yuanyuan Liu | 0de344f | 2016-07-27 10:26:30 -0700 | [diff] [blame] | 253 | u32 chip_id; |
| 254 | u32 chip_family; |
| 255 | u32 board_id; |
| 256 | u32 soc_id; |
| 257 | u32 fw_version; |
| 258 | char fw_build_timestamp[PLD_MAX_TIMESTAMP_LEN + 1]; |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 259 | }; |
| 260 | |
| 261 | /** |
Yuanyuan Liu | 10fc3d3 | 2017-01-12 15:32:06 -0800 | [diff] [blame] | 262 | * enum pld_recovery_reason - WLAN host driver recovery reason |
| 263 | * @PLD_REASON_DEFAULT: default |
| 264 | * @PLD_REASON_LINK_DOWN: PCIe link down |
| 265 | */ |
| 266 | enum pld_recovery_reason { |
| 267 | PLD_REASON_DEFAULT, |
| 268 | PLD_REASON_LINK_DOWN |
| 269 | }; |
| 270 | |
| 271 | /** |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 272 | * struct pld_driver_ops - driver callback functions |
| 273 | * @probe: required operation, will be called when device is detected |
| 274 | * @remove: required operation, will be called when device is removed |
| 275 | * @shutdown: optional operation, will be called during SSR |
| 276 | * @reinit: optional operation, will be called during SSR |
| 277 | * @crash_shutdown: optional operation, will be called when a crash is |
| 278 | * detected |
| 279 | * @suspend: required operation, will be called for power management |
| 280 | * is enabled |
| 281 | * @resume: required operation, will be called for power management |
| 282 | * is enabled |
| 283 | * @modem_status: optional operation, will be called when platform driver |
| 284 | * sending modem power status to WLAN FW |
Yuanyuan Liu | 06a342f | 2017-01-12 16:48:19 -0800 | [diff] [blame] | 285 | * @update_status: optional operation, will be called when platform driver |
| 286 | * updating driver status |
Yuanyuan Liu | d698eb6 | 2016-04-11 11:43:30 -0700 | [diff] [blame] | 287 | * @runtime_suspend: optional operation, prepare the device for a condition |
| 288 | * in which it won't be able to communicate with the CPU(s) |
| 289 | * and RAM due to power management. |
| 290 | * @runtime_resume: optional operation, put the device into the fully |
| 291 | * active state in response to a wakeup event generated by |
| 292 | * hardware or at the request of software. |
Yuanyuan Liu | 22896aa | 2016-08-29 12:17:20 -0700 | [diff] [blame] | 293 | * @suspend_noirq: optional operation, complete the actions started by suspend(). |
| 294 | * @resume_noirq: optional operation, prepare for the execution of resume() |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 295 | */ |
| 296 | struct pld_driver_ops { |
| 297 | int (*probe)(struct device *dev, |
| 298 | enum pld_bus_type bus_type, |
| 299 | void *bdev, void *id); |
| 300 | void (*remove)(struct device *dev, |
| 301 | enum pld_bus_type bus_type); |
| 302 | void (*shutdown)(struct device *dev, |
| 303 | enum pld_bus_type bus_type); |
| 304 | int (*reinit)(struct device *dev, |
| 305 | enum pld_bus_type bus_type, |
| 306 | void *bdev, void *id); |
| 307 | void (*crash_shutdown)(struct device *dev, |
| 308 | enum pld_bus_type bus_type); |
| 309 | int (*suspend)(struct device *dev, |
| 310 | enum pld_bus_type bus_type, |
| 311 | pm_message_t state); |
| 312 | int (*resume)(struct device *dev, |
| 313 | enum pld_bus_type bus_type); |
Mohit Khanna | 1d531c4 | 2016-05-12 21:35:50 -0700 | [diff] [blame] | 314 | int (*reset_resume)(struct device *dev, |
| 315 | enum pld_bus_type bus_type); |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 316 | void (*modem_status)(struct device *dev, |
| 317 | enum pld_bus_type bus_type, |
| 318 | int state); |
Yuanyuan Liu | 06a342f | 2017-01-12 16:48:19 -0800 | [diff] [blame] | 319 | void (*update_status)(struct device *dev, uint32_t status); |
Yuanyuan Liu | d698eb6 | 2016-04-11 11:43:30 -0700 | [diff] [blame] | 320 | int (*runtime_suspend)(struct device *dev, |
| 321 | enum pld_bus_type bus_type); |
| 322 | int (*runtime_resume)(struct device *dev, |
| 323 | enum pld_bus_type bus_type); |
Yuanyuan Liu | 22896aa | 2016-08-29 12:17:20 -0700 | [diff] [blame] | 324 | int (*suspend_noirq)(struct device *dev, |
| 325 | enum pld_bus_type bus_type); |
| 326 | int (*resume_noirq)(struct device *dev, |
| 327 | enum pld_bus_type bus_type); |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 328 | }; |
| 329 | |
| 330 | int pld_init(void); |
| 331 | void pld_deinit(void); |
| 332 | |
| 333 | int pld_register_driver(struct pld_driver_ops *ops); |
| 334 | void pld_unregister_driver(void); |
| 335 | |
| 336 | int pld_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config, |
| 337 | enum pld_driver_mode mode, const char *host_version); |
| 338 | int pld_wlan_disable(struct device *dev, enum pld_driver_mode mode); |
Yuanyuan Liu | 7a97b8f | 2017-01-27 10:42:52 -0800 | [diff] [blame] | 339 | int pld_set_fw_log_mode(struct device *dev, u8 fw_log_mode); |
Yuanyuan Liu | 6a313dc | 2016-05-10 14:19:10 -0700 | [diff] [blame] | 340 | void pld_get_default_fw_files(struct pld_fw_files *pfw_files); |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 341 | int pld_get_fw_files_for_target(struct device *dev, |
| 342 | struct pld_fw_files *pfw_files, |
| 343 | u32 target_type, u32 target_version); |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 344 | void pld_is_pci_link_down(struct device *dev); |
Yuanyuan Liu | 59f81e0 | 2016-05-19 16:17:38 -0700 | [diff] [blame] | 345 | int pld_shadow_control(struct device *dev, bool enable); |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 346 | int pld_set_wlan_unsafe_channel(struct device *dev, u16 *unsafe_ch_list, |
| 347 | u16 ch_count); |
| 348 | int pld_get_wlan_unsafe_channel(struct device *dev, u16 *unsafe_ch_list, |
| 349 | u16 *ch_count, u16 buf_len); |
| 350 | int pld_wlan_set_dfs_nol(struct device *dev, void *info, u16 info_len); |
| 351 | int pld_wlan_get_dfs_nol(struct device *dev, void *info, u16 info_len); |
Yuanyuan Liu | 10fc3d3 | 2017-01-12 15:32:06 -0800 | [diff] [blame] | 352 | void pld_schedule_recovery_work(struct device *dev, |
| 353 | enum pld_recovery_reason reason); |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 354 | int pld_wlan_pm_control(struct device *dev, bool vote); |
| 355 | void *pld_get_virt_ramdump_mem(struct device *dev, unsigned long *size); |
| 356 | void pld_device_crashed(struct device *dev); |
Yuanyuan Liu | 10fc3d3 | 2017-01-12 15:32:06 -0800 | [diff] [blame] | 357 | void pld_device_self_recovery(struct device *dev, |
| 358 | enum pld_recovery_reason reason); |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 359 | void pld_intr_notify_q6(struct device *dev); |
| 360 | void pld_request_pm_qos(struct device *dev, u32 qos_val); |
| 361 | void pld_remove_pm_qos(struct device *dev); |
| 362 | int pld_request_bus_bandwidth(struct device *dev, int bandwidth); |
| 363 | int pld_get_platform_cap(struct device *dev, struct pld_platform_cap *cap); |
| 364 | void pld_set_driver_status(struct device *dev, enum pld_driver_status status); |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 365 | int pld_get_sha_hash(struct device *dev, const u8 *data, |
| 366 | u32 data_len, u8 *hash_idx, u8 *out); |
| 367 | void *pld_get_fw_ptr(struct device *dev); |
| 368 | int pld_auto_suspend(struct device *dev); |
| 369 | int pld_auto_resume(struct device *dev); |
| 370 | |
| 371 | int pld_ce_request_irq(struct device *dev, unsigned int ce_id, |
| 372 | irqreturn_t (*handler)(int, void *), |
| 373 | unsigned long flags, const char *name, void *ctx); |
| 374 | int pld_ce_free_irq(struct device *dev, unsigned int ce_id, void *ctx); |
| 375 | void pld_enable_irq(struct device *dev, unsigned int ce_id); |
| 376 | void pld_disable_irq(struct device *dev, unsigned int ce_id); |
| 377 | int pld_get_soc_info(struct device *dev, struct pld_soc_info *info); |
| 378 | int pld_get_ce_id(struct device *dev, int irq); |
Yuanyuan Liu | f2ee05f | 2016-07-27 16:52:52 -0700 | [diff] [blame] | 379 | int pld_get_irq(struct device *dev, int ce_id); |
Yuanyuan Liu | 44c4477 | 2016-04-11 11:11:27 -0700 | [diff] [blame] | 380 | void pld_lock_pm_sem(struct device *dev); |
| 381 | void pld_release_pm_sem(struct device *dev); |
Arun Khandavalli | 1496fcb | 2016-07-25 16:53:00 +0530 | [diff] [blame] | 382 | int pld_power_on(struct device *dev); |
| 383 | int pld_power_off(struct device *dev); |
Yuanyuan Liu | 5ef6bfe | 2016-06-16 14:13:07 -0700 | [diff] [blame] | 384 | int pld_athdiag_read(struct device *dev, uint32_t offset, uint32_t memtype, |
| 385 | uint32_t datalen, uint8_t *output); |
| 386 | int pld_athdiag_write(struct device *dev, uint32_t offset, uint32_t memtype, |
| 387 | uint32_t datalen, uint8_t *input); |
Yuanyuan Liu | 137755f | 2016-08-16 13:39:17 -0700 | [diff] [blame] | 388 | void *pld_smmu_get_mapping(struct device *dev); |
| 389 | int pld_smmu_map(struct device *dev, phys_addr_t paddr, |
| 390 | uint32_t *iova_addr, size_t size); |
Yue Ma | fd418ea | 2016-11-21 16:47:13 -0800 | [diff] [blame] | 391 | int pld_get_user_msi_assignment(struct device *dev, char *user_name, |
| 392 | int *num_vectors, uint32_t *user_base_data, |
| 393 | uint32_t *base_vector); |
| 394 | int pld_get_msi_irq(struct device *dev, unsigned int vector); |
| 395 | void pld_get_msi_address(struct device *dev, uint32_t *msi_addr_low, |
| 396 | uint32_t *msi_addr_high); |
Yuanyuan Liu | f97e822 | 2016-09-21 10:31:38 -0700 | [diff] [blame] | 397 | unsigned int pld_socinfo_get_serial_number(struct device *dev); |
Yuanyuan Liu | 7145eb2 | 2016-12-01 10:59:29 -0800 | [diff] [blame] | 398 | uint8_t *pld_get_wlan_mac_address(struct device *dev, uint32_t *num); |
Hardik Kantilal Patel | 9689e93 | 2016-10-18 19:02:39 +0530 | [diff] [blame] | 399 | int pld_is_qmi_disable(struct device *dev); |
| 400 | |
Yuanyuan Liu | d9f7a36 | 2016-01-22 14:27:12 -0800 | [diff] [blame] | 401 | #endif |