main.h 16 KB

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