bus.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _CNSS_BUS_H
  7. #define _CNSS_BUS_H
  8. #include "main.h"
  9. #define QCA6174_VENDOR_ID 0x168C
  10. #define QCA6174_DEVICE_ID 0x003E
  11. #define QCA6174_REV_ID_OFFSET 0x08
  12. #define QCA6174_REV3_VERSION 0x5020000
  13. #define QCA6174_REV3_2_VERSION 0x5030000
  14. #define QCA6290_VENDOR_ID 0x17CB
  15. #define QCA6290_DEVICE_ID 0x1100
  16. #define QCA6390_VENDOR_ID 0x17CB
  17. #define QCA6390_DEVICE_ID 0x1101
  18. #define QCA6490_VENDOR_ID 0x17CB
  19. #define QCA6490_DEVICE_ID 0x1103
  20. #define KIWI_VENDOR_ID 0x17CB
  21. #define KIWI_DEVICE_ID 0x1107
  22. #define MANGO_VENDOR_ID 0x17CB
  23. #define MANGO_DEVICE_ID 0x110A
  24. enum cnss_dev_bus_type cnss_get_dev_bus_type(struct device *dev);
  25. enum cnss_dev_bus_type cnss_get_bus_type(struct cnss_plat_data *plat_priv);
  26. void *cnss_bus_dev_to_bus_priv(struct device *dev);
  27. struct cnss_plat_data *cnss_bus_dev_to_plat_priv(struct device *dev);
  28. int cnss_bus_init(struct cnss_plat_data *plat_priv);
  29. void cnss_bus_deinit(struct cnss_plat_data *plat_priv);
  30. void cnss_bus_add_fw_prefix_name(struct cnss_plat_data *plat_priv,
  31. char *prefix_name, char *name);
  32. int cnss_bus_load_m3(struct cnss_plat_data *plat_priv);
  33. int cnss_bus_handle_dev_sol_irq(struct cnss_plat_data *plat_priv);
  34. int cnss_bus_alloc_fw_mem(struct cnss_plat_data *plat_priv);
  35. int cnss_bus_alloc_qdss_mem(struct cnss_plat_data *plat_priv);
  36. void cnss_bus_free_qdss_mem(struct cnss_plat_data *plat_priv);
  37. u32 cnss_bus_get_wake_irq(struct cnss_plat_data *plat_priv);
  38. int cnss_bus_force_fw_assert_hdlr(struct cnss_plat_data *plat_priv);
  39. int cnss_bus_qmi_send_get(struct cnss_plat_data *plat_priv);
  40. int cnss_bus_qmi_send_put(struct cnss_plat_data *plat_priv);
  41. void cnss_bus_fw_boot_timeout_hdlr(struct timer_list *t);
  42. void cnss_bus_collect_dump_info(struct cnss_plat_data *plat_priv,
  43. bool in_panic);
  44. void cnss_bus_device_crashed(struct cnss_plat_data *plat_priv);
  45. int cnss_bus_call_driver_probe(struct cnss_plat_data *plat_priv);
  46. int cnss_bus_call_driver_remove(struct cnss_plat_data *plat_priv);
  47. int cnss_bus_dev_powerup(struct cnss_plat_data *plat_priv);
  48. int cnss_bus_dev_shutdown(struct cnss_plat_data *plat_priv);
  49. int cnss_bus_dev_crash_shutdown(struct cnss_plat_data *plat_priv);
  50. int cnss_bus_dev_ramdump(struct cnss_plat_data *plat_priv);
  51. int cnss_bus_register_driver_hdlr(struct cnss_plat_data *plat_priv, void *data);
  52. int cnss_bus_unregister_driver_hdlr(struct cnss_plat_data *plat_priv);
  53. int cnss_bus_call_driver_modem_status(struct cnss_plat_data *plat_priv,
  54. int modem_current_status);
  55. int cnss_bus_update_status(struct cnss_plat_data *plat_priv,
  56. enum cnss_driver_status status);
  57. int cnss_bus_update_uevent(struct cnss_plat_data *plat_priv,
  58. enum cnss_driver_status status, void *data);
  59. int cnss_bus_is_device_down(struct cnss_plat_data *plat_priv);
  60. int cnss_bus_check_link_status(struct cnss_plat_data *plat_priv);
  61. int cnss_bus_recover_link_down(struct cnss_plat_data *plat_priv);
  62. int cnss_bus_debug_reg_read(struct cnss_plat_data *plat_priv, u32 offset,
  63. u32 *val, bool raw_access);
  64. int cnss_bus_debug_reg_write(struct cnss_plat_data *plat_priv, u32 offset,
  65. u32 val, bool raw_access);
  66. int cnss_bus_get_iova(struct cnss_plat_data *plat_priv, u64 *addr, u64 *size);
  67. int cnss_bus_get_iova_ipa(struct cnss_plat_data *plat_priv, u64 *addr,
  68. u64 *size);
  69. int cnss_bus_update_time_sync_period(struct cnss_plat_data *plat_priv,
  70. unsigned int time_sync_period);
  71. void cnss_bus_disable_mhi_satellite_cfg(struct cnss_plat_data *plat_priv);
  72. #endif /* _CNSS_BUS_H */