main.h 15 KB

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