main.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _CNSS_MAIN_H
  7. #define _CNSS_MAIN_H
  8. #if IS_ENABLED(CONFIG_ARM) || IS_ENABLED(CONFIG_ARM64)
  9. #include <asm/arch_timer.h>
  10. #endif
  11. #if IS_ENABLED(CONFIG_ESOC)
  12. #include <linux/esoc_client.h>
  13. #endif
  14. #include <linux/etherdevice.h>
  15. #include <linux/firmware.h>
  16. #if IS_ENABLED(CONFIG_INTERCONNECT)
  17. #include <linux/interconnect.h>
  18. #endif
  19. #include <linux/mailbox_client.h>
  20. #include <linux/pm_qos.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/time64.h>
  23. #ifdef CONFIG_CNSS_OUT_OF_TREE
  24. #include "cnss2.h"
  25. #else
  26. #include <net/cnss2.h>
  27. #endif
  28. #if IS_ENABLED(CONFIG_QCOM_MEMORY_DUMP_V2) || IS_ENABLED(CONFIG_QCOM_MINIDUMP)
  29. #include <soc/qcom/memory_dump.h>
  30. #endif
  31. #if IS_ENABLED(CONFIG_MSM_SUBSYSTEM_RESTART) || \
  32. IS_ENABLED(CONFIG_QCOM_RAMDUMP)
  33. #include <soc/qcom/qcom_ramdump.h>
  34. #endif
  35. #if IS_ENABLED(CONFIG_MSM_SUBSYSTEM_RESTART)
  36. #include <soc/qcom/subsystem_notif.h>
  37. #include <soc/qcom/subsystem_restart.h>
  38. #endif
  39. #include "qmi.h"
  40. #define MAX_NO_OF_MAC_ADDR 4
  41. #define QMI_WLFW_MAX_TIMESTAMP_LEN 32
  42. #define QMI_WLFW_MAX_NUM_MEM_SEG 32
  43. #define QMI_WLFW_MAX_BUILD_ID_LEN 128
  44. #define CNSS_RDDM_TIMEOUT_MS 20000
  45. #define RECOVERY_TIMEOUT 60000
  46. #define WLAN_WD_TIMEOUT_MS 60000
  47. #define WLAN_COLD_BOOT_CAL_TIMEOUT 60000
  48. #define WLAN_MISSION_MODE_TIMEOUT 30000
  49. #define TIME_CLOCK_FREQ_HZ 19200000
  50. #define CNSS_RAMDUMP_MAGIC 0x574C414E
  51. #define CNSS_RAMDUMP_VERSION 0
  52. #define MAX_FIRMWARE_NAME_LEN 40
  53. #define FW_V2_NUMBER 2
  54. #define POWER_ON_RETRY_MAX_TIMES 3
  55. #define POWER_ON_RETRY_DELAY_MS 500
  56. #define CNSS_EVENT_SYNC BIT(0)
  57. #define CNSS_EVENT_UNINTERRUPTIBLE BIT(1)
  58. #define CNSS_EVENT_UNKILLABLE BIT(2)
  59. #define CNSS_EVENT_SYNC_UNINTERRUPTIBLE (CNSS_EVENT_SYNC | \
  60. CNSS_EVENT_UNINTERRUPTIBLE)
  61. #define CNSS_EVENT_SYNC_UNKILLABLE (CNSS_EVENT_SYNC | CNSS_EVENT_UNKILLABLE)
  62. enum cnss_dev_bus_type {
  63. CNSS_BUS_NONE = -1,
  64. CNSS_BUS_PCI,
  65. };
  66. struct cnss_vreg_cfg {
  67. const char *name;
  68. u32 min_uv;
  69. u32 max_uv;
  70. u32 load_ua;
  71. u32 delay_us;
  72. u32 need_unvote;
  73. };
  74. struct cnss_vreg_info {
  75. struct list_head list;
  76. struct regulator *reg;
  77. struct cnss_vreg_cfg cfg;
  78. u32 enabled;
  79. };
  80. enum cnss_vreg_type {
  81. CNSS_VREG_PRIM,
  82. };
  83. struct cnss_clk_cfg {
  84. const char *name;
  85. u32 freq;
  86. u32 required;
  87. };
  88. struct cnss_clk_info {
  89. struct list_head list;
  90. struct clk *clk;
  91. struct cnss_clk_cfg cfg;
  92. u32 enabled;
  93. };
  94. struct cnss_pinctrl_info {
  95. struct pinctrl *pinctrl;
  96. struct pinctrl_state *bootstrap_active;
  97. struct pinctrl_state *wlan_en_active;
  98. struct pinctrl_state *wlan_en_sleep;
  99. int bt_en_gpio;
  100. int xo_clk_gpio; /*qca6490 only */
  101. };
  102. #if IS_ENABLED(CONFIG_MSM_SUBSYSTEM_RESTART)
  103. struct cnss_subsys_info {
  104. struct subsys_device *subsys_device;
  105. struct subsys_desc subsys_desc;
  106. void *subsys_handle;
  107. };
  108. #endif
  109. struct cnss_ramdump_info {
  110. void *ramdump_dev;
  111. unsigned long ramdump_size;
  112. void *ramdump_va;
  113. phys_addr_t ramdump_pa;
  114. #if IS_ENABLED(CONFIG_QCOM_MEMORY_DUMP_V2)
  115. struct msm_dump_data dump_data;
  116. #endif
  117. };
  118. struct cnss_dump_seg {
  119. unsigned long address;
  120. void *v_address;
  121. unsigned long size;
  122. u32 type;
  123. };
  124. struct cnss_dump_data {
  125. u32 version;
  126. u32 magic;
  127. char name[32];
  128. phys_addr_t paddr;
  129. int nentries;
  130. u32 seg_version;
  131. };
  132. struct cnss_ramdump_info_v2 {
  133. void *ramdump_dev;
  134. unsigned long ramdump_size;
  135. void *dump_data_vaddr;
  136. u8 dump_data_valid;
  137. struct cnss_dump_data dump_data;
  138. };
  139. #if IS_ENABLED(CONFIG_ESOC)
  140. struct cnss_esoc_info {
  141. struct esoc_desc *esoc_desc;
  142. u8 notify_modem_status;
  143. void *modem_notify_handler;
  144. int modem_current_status;
  145. };
  146. #endif
  147. #if IS_ENABLED(CONFIG_INTERCONNECT)
  148. /**
  149. * struct cnss_bus_bw_cfg - Interconnect vote data
  150. * @avg_bw: Vote for average bandwidth
  151. * @peak_bw: Vote for peak bandwidth
  152. */
  153. struct cnss_bus_bw_cfg {
  154. u32 avg_bw;
  155. u32 peak_bw;
  156. };
  157. /* Number of bw votes (avg, peak) entries that ICC requires */
  158. #define CNSS_ICC_VOTE_MAX 2
  159. /**
  160. * struct cnss_bus_bw_info - Bus bandwidth config for interconnect path
  161. * @list: Kernel linked list
  162. * @icc_name: Name of interconnect path as defined in Device tree
  163. * @icc_path: Interconnect path data structure
  164. * @cfg_table: Interconnect vote data for average and peak bandwidth
  165. */
  166. struct cnss_bus_bw_info {
  167. struct list_head list;
  168. const char *icc_name;
  169. struct icc_path *icc_path;
  170. struct cnss_bus_bw_cfg *cfg_table;
  171. };
  172. #endif
  173. /**
  174. * struct cnss_interconnect_cfg - CNSS platform interconnect config
  175. * @list_head: List of interconnect path bandwidth configs
  176. * @path_count: Count of interconnect path configured in device tree
  177. * @current_bw_vote: WLAN driver provided bandwidth vote
  178. * @bus_bw_cfg_count: Number of bandwidth configs for voting. It is the array
  179. * size of struct cnss_bus_bw_info.cfg_table
  180. */
  181. struct cnss_interconnect_cfg {
  182. struct list_head list_head;
  183. u32 path_count;
  184. int current_bw_vote;
  185. u32 bus_bw_cfg_count;
  186. };
  187. struct cnss_fw_mem {
  188. size_t size;
  189. void *va;
  190. phys_addr_t pa;
  191. u8 valid;
  192. u32 type;
  193. unsigned long attrs;
  194. };
  195. struct wlfw_rf_chip_info {
  196. u32 chip_id;
  197. u32 chip_family;
  198. };
  199. struct wlfw_rf_board_info {
  200. u32 board_id;
  201. };
  202. struct wlfw_soc_info {
  203. u32 soc_id;
  204. };
  205. struct wlfw_fw_version_info {
  206. u32 fw_version;
  207. char fw_build_timestamp[QMI_WLFW_MAX_TIMESTAMP_LEN + 1];
  208. };
  209. enum cnss_mem_type {
  210. CNSS_MEM_TYPE_MSA,
  211. CNSS_MEM_TYPE_DDR,
  212. CNSS_MEM_BDF,
  213. CNSS_MEM_M3,
  214. CNSS_MEM_CAL_V01,
  215. CNSS_MEM_DPD_V01,
  216. };
  217. enum cnss_fw_dump_type {
  218. CNSS_FW_IMAGE,
  219. CNSS_FW_RDDM,
  220. CNSS_FW_REMOTE_HEAP,
  221. CNSS_FW_DUMP_TYPE_MAX,
  222. };
  223. struct cnss_dump_entry {
  224. u32 type;
  225. u32 entry_start;
  226. u32 entry_num;
  227. };
  228. struct cnss_dump_meta_info {
  229. u32 magic;
  230. u32 version;
  231. u32 chipset;
  232. u32 total_entries;
  233. struct cnss_dump_entry entry[CNSS_FW_DUMP_TYPE_MAX];
  234. };
  235. enum cnss_driver_event_type {
  236. CNSS_DRIVER_EVENT_SERVER_ARRIVE,
  237. CNSS_DRIVER_EVENT_SERVER_EXIT,
  238. CNSS_DRIVER_EVENT_REQUEST_MEM,
  239. CNSS_DRIVER_EVENT_FW_MEM_READY,
  240. CNSS_DRIVER_EVENT_FW_READY,
  241. CNSS_DRIVER_EVENT_COLD_BOOT_CAL_START,
  242. CNSS_DRIVER_EVENT_COLD_BOOT_CAL_DONE,
  243. CNSS_DRIVER_EVENT_REGISTER_DRIVER,
  244. CNSS_DRIVER_EVENT_UNREGISTER_DRIVER,
  245. CNSS_DRIVER_EVENT_RECOVERY,
  246. CNSS_DRIVER_EVENT_FORCE_FW_ASSERT,
  247. CNSS_DRIVER_EVENT_POWER_UP,
  248. CNSS_DRIVER_EVENT_POWER_DOWN,
  249. CNSS_DRIVER_EVENT_IDLE_RESTART,
  250. CNSS_DRIVER_EVENT_IDLE_SHUTDOWN,
  251. CNSS_DRIVER_EVENT_IMS_WFC_CALL_IND,
  252. CNSS_DRIVER_EVENT_WLFW_TWT_CFG_IND,
  253. CNSS_DRIVER_EVENT_QDSS_TRACE_REQ_MEM,
  254. CNSS_DRIVER_EVENT_FW_MEM_FILE_SAVE,
  255. CNSS_DRIVER_EVENT_QDSS_TRACE_FREE,
  256. CNSS_DRIVER_EVENT_QDSS_TRACE_REQ_DATA,
  257. CNSS_DRIVER_EVENT_MAX,
  258. };
  259. enum cnss_driver_state {
  260. CNSS_QMI_WLFW_CONNECTED = 0,
  261. CNSS_FW_MEM_READY,
  262. CNSS_FW_READY,
  263. CNSS_IN_COLD_BOOT_CAL,
  264. CNSS_DRIVER_LOADING,
  265. CNSS_DRIVER_UNLOADING = 5,
  266. CNSS_DRIVER_IDLE_RESTART,
  267. CNSS_DRIVER_IDLE_SHUTDOWN,
  268. CNSS_DRIVER_PROBED,
  269. CNSS_DRIVER_RECOVERY,
  270. CNSS_FW_BOOT_RECOVERY = 10,
  271. CNSS_DEV_ERR_NOTIFY,
  272. CNSS_DRIVER_DEBUG,
  273. CNSS_COEX_CONNECTED,
  274. CNSS_IMS_CONNECTED,
  275. CNSS_IN_SUSPEND_RESUME = 15,
  276. CNSS_IN_REBOOT,
  277. CNSS_COLD_BOOT_CAL_DONE,
  278. CNSS_IN_PANIC,
  279. CNSS_QMI_DEL_SERVER,
  280. CNSS_QMI_DMS_CONNECTED = 20,
  281. CNSS_DAEMON_CONNECTED,
  282. CNSS_PCI_PROBE_DONE,
  283. };
  284. struct cnss_recovery_data {
  285. enum cnss_recovery_reason reason;
  286. };
  287. enum cnss_pins {
  288. CNSS_WLAN_EN,
  289. CNSS_PCIE_TXP,
  290. CNSS_PCIE_TXN,
  291. CNSS_PCIE_RXP,
  292. CNSS_PCIE_RXN,
  293. CNSS_PCIE_REFCLKP,
  294. CNSS_PCIE_REFCLKN,
  295. CNSS_PCIE_RST,
  296. CNSS_PCIE_WAKE,
  297. };
  298. struct cnss_pin_connect_result {
  299. u32 fw_pwr_pin_result;
  300. u32 fw_phy_io_pin_result;
  301. u32 fw_rf_pin_result;
  302. u32 host_pin_result;
  303. };
  304. enum cnss_debug_quirks {
  305. LINK_DOWN_SELF_RECOVERY,
  306. SKIP_DEVICE_BOOT,
  307. USE_CORE_ONLY_FW,
  308. SKIP_RECOVERY,
  309. QMI_BYPASS,
  310. ENABLE_WALTEST,
  311. ENABLE_PCI_LINK_DOWN_PANIC,
  312. FBC_BYPASS,
  313. ENABLE_DAEMON_SUPPORT,
  314. DISABLE_DRV,
  315. DISABLE_IO_COHERENCY,
  316. IGNORE_PCI_LINK_FAILURE,
  317. DISABLE_TIME_SYNC,
  318. };
  319. enum cnss_bdf_type {
  320. CNSS_BDF_BIN,
  321. CNSS_BDF_ELF,
  322. CNSS_BDF_REGDB = 4,
  323. CNSS_BDF_HDS = 6,
  324. };
  325. enum cnss_cal_status {
  326. CNSS_CAL_DONE,
  327. CNSS_CAL_TIMEOUT,
  328. CNSS_CAL_FAILURE,
  329. };
  330. struct cnss_cal_info {
  331. enum cnss_cal_status cal_status;
  332. };
  333. struct cnss_control_params {
  334. unsigned long quirks;
  335. unsigned int mhi_timeout;
  336. unsigned int mhi_m2_timeout;
  337. unsigned int qmi_timeout;
  338. unsigned int bdf_type;
  339. unsigned int time_sync_period;
  340. };
  341. struct cnss_tcs_info {
  342. resource_size_t cmd_base_addr;
  343. void __iomem *cmd_base_addr_io;
  344. };
  345. struct cnss_cpr_info {
  346. resource_size_t tcs_cmd_data_addr;
  347. void __iomem *tcs_cmd_data_addr_io;
  348. u32 cpr_pmic_addr;
  349. u32 voltage;
  350. };
  351. enum cnss_ce_index {
  352. CNSS_CE_00,
  353. CNSS_CE_01,
  354. CNSS_CE_02,
  355. CNSS_CE_03,
  356. CNSS_CE_04,
  357. CNSS_CE_05,
  358. CNSS_CE_06,
  359. CNSS_CE_07,
  360. CNSS_CE_08,
  361. CNSS_CE_09,
  362. CNSS_CE_10,
  363. CNSS_CE_11,
  364. CNSS_CE_COMMON,
  365. };
  366. struct cnss_dms_data {
  367. u32 mac_valid;
  368. u8 mac[QMI_WLFW_MAC_ADDR_SIZE_V01];
  369. };
  370. enum cnss_timeout_type {
  371. CNSS_TIMEOUT_QMI,
  372. CNSS_TIMEOUT_POWER_UP,
  373. CNSS_TIMEOUT_IDLE_RESTART,
  374. CNSS_TIMEOUT_CALIBRATION,
  375. CNSS_TIMEOUT_WLAN_WATCHDOG,
  376. CNSS_TIMEOUT_RDDM,
  377. CNSS_TIMEOUT_RECOVERY,
  378. CNSS_TIMEOUT_DAEMON_CONNECTION,
  379. };
  380. struct cnss_plat_data {
  381. struct platform_device *plat_dev;
  382. void *bus_priv;
  383. enum cnss_dev_bus_type bus_type;
  384. struct list_head vreg_list;
  385. struct list_head clk_list;
  386. struct cnss_pinctrl_info pinctrl_info;
  387. #if IS_ENABLED(CONFIG_MSM_SUBSYSTEM_RESTART)
  388. struct cnss_subsys_info subsys_info;
  389. #endif
  390. struct cnss_ramdump_info ramdump_info;
  391. struct cnss_ramdump_info_v2 ramdump_info_v2;
  392. #if IS_ENABLED(CONFIG_ESOC)
  393. struct cnss_esoc_info esoc_info;
  394. #endif
  395. struct cnss_interconnect_cfg icc;
  396. struct notifier_block modem_nb;
  397. struct notifier_block reboot_nb;
  398. struct notifier_block panic_nb;
  399. struct cnss_platform_cap cap;
  400. struct pm_qos_request qos_request;
  401. struct cnss_device_version device_version;
  402. u32 rc_num;
  403. unsigned long device_id;
  404. enum cnss_driver_status driver_status;
  405. u32 recovery_count;
  406. u8 recovery_enabled;
  407. u8 hds_enabled;
  408. unsigned long driver_state;
  409. struct list_head event_list;
  410. spinlock_t event_lock; /* spinlock for driver work event handling */
  411. struct work_struct event_work;
  412. struct workqueue_struct *event_wq;
  413. struct work_struct recovery_work;
  414. struct delayed_work wlan_reg_driver_work;
  415. struct qmi_handle qmi_wlfw;
  416. struct qmi_handle qmi_dms;
  417. struct wlfw_rf_chip_info chip_info;
  418. struct wlfw_rf_board_info board_info;
  419. struct wlfw_soc_info soc_info;
  420. struct wlfw_fw_version_info fw_version_info;
  421. struct cnss_dev_mem_info dev_mem_info[CNSS_MAX_DEV_MEM_NUM];
  422. char fw_build_id[QMI_WLFW_MAX_BUILD_ID_LEN + 1];
  423. u32 otp_version;
  424. u32 fw_mem_seg_len;
  425. struct cnss_fw_mem fw_mem[QMI_WLFW_MAX_NUM_MEM_SEG];
  426. struct cnss_fw_mem m3_mem;
  427. struct cnss_fw_mem *cal_mem;
  428. u64 cal_time;
  429. bool cbc_file_download;
  430. u32 cal_file_size;
  431. struct completion daemon_connected;
  432. u32 qdss_mem_seg_len;
  433. struct cnss_fw_mem qdss_mem[QMI_WLFW_MAX_NUM_MEM_SEG];
  434. u32 *qdss_reg;
  435. struct cnss_pin_connect_result pin_result;
  436. struct dentry *root_dentry;
  437. atomic_t pm_count;
  438. struct timer_list fw_boot_timer;
  439. struct completion power_up_complete;
  440. struct completion cal_complete;
  441. struct mutex dev_lock; /* mutex for register access through debugfs */
  442. struct mutex driver_ops_lock; /* mutex for external driver ops */
  443. u32 device_freq_hz;
  444. u32 diag_reg_read_addr;
  445. u32 diag_reg_read_mem_type;
  446. u32 diag_reg_read_len;
  447. u8 *diag_reg_read_buf;
  448. u8 cal_done;
  449. u8 powered_on;
  450. u8 use_fw_path_with_prefix;
  451. char firmware_name[MAX_FIRMWARE_NAME_LEN];
  452. char fw_fallback_name[MAX_FIRMWARE_NAME_LEN];
  453. struct completion rddm_complete;
  454. struct completion recovery_complete;
  455. struct cnss_control_params ctrl_params;
  456. struct cnss_cpr_info cpr_info;
  457. u64 antenna;
  458. u64 grant;
  459. struct qmi_handle coex_qmi;
  460. struct qmi_handle ims_qmi;
  461. struct qmi_txn txn;
  462. struct wakeup_source *recovery_ws;
  463. u64 dynamic_feature;
  464. void *get_info_cb_ctx;
  465. int (*get_info_cb)(void *ctx, void *event, int event_len);
  466. bool cbc_enabled;
  467. u8 use_pm_domain;
  468. u8 use_nv_mac;
  469. u8 set_wlaon_pwr_ctrl;
  470. struct cnss_tcs_info tcs_info;
  471. bool fw_pcie_gen_switch;
  472. u8 pcie_gen_speed;
  473. struct cnss_dms_data dms;
  474. int power_up_error;
  475. u32 hw_trc_override;
  476. struct mbox_client mbox_client_data;
  477. struct mbox_chan *mbox_chan;
  478. const char *vreg_ol_cpr, *vreg_ipa;
  479. bool adsp_pc_enabled;
  480. u64 feature_list;
  481. };
  482. #if IS_ENABLED(CONFIG_ARCH_QCOM)
  483. static inline u64 cnss_get_host_timestamp(struct cnss_plat_data *plat_priv)
  484. {
  485. u64 ticks = __arch_counter_get_cntvct();
  486. do_div(ticks, TIME_CLOCK_FREQ_HZ / 100000);
  487. return ticks * 10;
  488. }
  489. #else
  490. static inline u64 cnss_get_host_timestamp(struct cnss_plat_data *plat_priv)
  491. {
  492. struct timespec64 ts;
  493. ktime_get_ts64(&ts);
  494. return (ts.tv_sec * 1000000) + (ts.tv_nsec / 1000);
  495. }
  496. #endif
  497. struct cnss_plat_data *cnss_get_plat_priv(struct platform_device *plat_dev);
  498. void cnss_pm_stay_awake(struct cnss_plat_data *plat_priv);
  499. void cnss_pm_relax(struct cnss_plat_data *plat_priv);
  500. int cnss_driver_event_post(struct cnss_plat_data *plat_priv,
  501. enum cnss_driver_event_type type,
  502. u32 flags, void *data);
  503. int cnss_get_vreg_type(struct cnss_plat_data *plat_priv,
  504. enum cnss_vreg_type type);
  505. void cnss_put_vreg_type(struct cnss_plat_data *plat_priv,
  506. enum cnss_vreg_type type);
  507. int cnss_vreg_on_type(struct cnss_plat_data *plat_priv,
  508. enum cnss_vreg_type type);
  509. int cnss_vreg_off_type(struct cnss_plat_data *plat_priv,
  510. enum cnss_vreg_type type);
  511. int cnss_get_clk(struct cnss_plat_data *plat_priv);
  512. void cnss_put_clk(struct cnss_plat_data *plat_priv);
  513. int cnss_vreg_unvote_type(struct cnss_plat_data *plat_priv,
  514. enum cnss_vreg_type type);
  515. int cnss_get_pinctrl(struct cnss_plat_data *plat_priv);
  516. int cnss_power_on_device(struct cnss_plat_data *plat_priv);
  517. void cnss_power_off_device(struct cnss_plat_data *plat_priv);
  518. bool cnss_is_device_powered_on(struct cnss_plat_data *plat_priv);
  519. int cnss_register_subsys(struct cnss_plat_data *plat_priv);
  520. void cnss_unregister_subsys(struct cnss_plat_data *plat_priv);
  521. int cnss_register_ramdump(struct cnss_plat_data *plat_priv);
  522. void cnss_unregister_ramdump(struct cnss_plat_data *plat_priv);
  523. int cnss_do_ramdump(struct cnss_plat_data *plat_priv);
  524. int cnss_do_elf_ramdump(struct cnss_plat_data *plat_priv);
  525. void cnss_set_pin_connect_status(struct cnss_plat_data *plat_priv);
  526. int cnss_get_cpr_info(struct cnss_plat_data *plat_priv);
  527. int cnss_update_cpr_info(struct cnss_plat_data *plat_priv);
  528. int cnss_va_to_pa(struct device *dev, size_t size, void *va, dma_addr_t dma,
  529. phys_addr_t *pa, unsigned long attrs);
  530. int cnss_minidump_add_region(struct cnss_plat_data *plat_priv,
  531. enum cnss_fw_dump_type type, int seg_no,
  532. void *va, phys_addr_t pa, size_t size);
  533. int cnss_minidump_remove_region(struct cnss_plat_data *plat_priv,
  534. enum cnss_fw_dump_type type, int seg_no,
  535. void *va, phys_addr_t pa, size_t size);
  536. int cnss_enable_int_pow_amp_vreg(struct cnss_plat_data *plat_priv);
  537. int cnss_get_tcs_info(struct cnss_plat_data *plat_priv);
  538. unsigned int cnss_get_timeout(struct cnss_plat_data *plat_priv,
  539. enum cnss_timeout_type);
  540. int cnss_aop_mbox_init(struct cnss_plat_data *plat_priv);
  541. int cnss_request_firmware_direct(struct cnss_plat_data *plat_priv,
  542. const struct firmware **fw_entry,
  543. const char *filename);
  544. int cnss_set_feature_list(struct cnss_plat_data *plat_priv,
  545. enum cnss_feature_v01 feature);
  546. int cnss_get_feature_list(struct cnss_plat_data *plat_priv,
  547. u64 *feature_list);
  548. #endif /* _CNSS_MAIN_H */