bus.h 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2021-2023 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 QCN7605_DEVICE_ID 0x1102
  21. #define KIWI_VENDOR_ID 0x17CB
  22. #define KIWI_DEVICE_ID 0x1107
  23. #define MANGO_VENDOR_ID 0x17CB
  24. #define MANGO_DEVICE_ID 0x110A
  25. #define PEACH_VENDOR_ID 0x17CB
  26. #define PEACH_DEVICE_ID 0x110E
  27. enum cnss_dev_bus_type cnss_get_dev_bus_type(struct device *dev);
  28. enum cnss_dev_bus_type cnss_get_bus_type(struct cnss_plat_data *plat_priv);
  29. void *cnss_bus_dev_to_bus_priv(struct device *dev);
  30. struct cnss_plat_data *cnss_bus_dev_to_plat_priv(struct device *dev);
  31. int cnss_bus_init(struct cnss_plat_data *plat_priv);
  32. void cnss_bus_deinit(struct cnss_plat_data *plat_priv);
  33. void cnss_bus_add_fw_prefix_name(struct cnss_plat_data *plat_priv,
  34. char *prefix_name, char *name);
  35. int cnss_bus_load_m3(struct cnss_plat_data *plat_priv);
  36. int cnss_bus_handle_dev_sol_irq(struct cnss_plat_data *plat_priv);
  37. int cnss_bus_alloc_fw_mem(struct cnss_plat_data *plat_priv);
  38. int cnss_bus_alloc_qdss_mem(struct cnss_plat_data *plat_priv);
  39. void cnss_bus_free_qdss_mem(struct cnss_plat_data *plat_priv);
  40. u32 cnss_bus_get_wake_irq(struct cnss_plat_data *plat_priv);
  41. int cnss_bus_force_fw_assert_hdlr(struct cnss_plat_data *plat_priv);
  42. int cnss_bus_qmi_send_get(struct cnss_plat_data *plat_priv);
  43. int cnss_bus_qmi_send_put(struct cnss_plat_data *plat_priv);
  44. void cnss_bus_fw_boot_timeout_hdlr(struct timer_list *t);
  45. void cnss_bus_collect_dump_info(struct cnss_plat_data *plat_priv,
  46. bool in_panic);
  47. void cnss_bus_device_crashed(struct cnss_plat_data *plat_priv);
  48. int cnss_bus_call_driver_probe(struct cnss_plat_data *plat_priv);
  49. int cnss_bus_call_driver_remove(struct cnss_plat_data *plat_priv);
  50. int cnss_bus_dev_powerup(struct cnss_plat_data *plat_priv);
  51. int cnss_bus_dev_shutdown(struct cnss_plat_data *plat_priv);
  52. int cnss_bus_dev_crash_shutdown(struct cnss_plat_data *plat_priv);
  53. int cnss_bus_dev_ramdump(struct cnss_plat_data *plat_priv);
  54. int cnss_bus_register_driver_hdlr(struct cnss_plat_data *plat_priv, void *data);
  55. int cnss_bus_unregister_driver_hdlr(struct cnss_plat_data *plat_priv);
  56. int cnss_bus_call_driver_modem_status(struct cnss_plat_data *plat_priv,
  57. int modem_current_status);
  58. int cnss_bus_update_status(struct cnss_plat_data *plat_priv,
  59. enum cnss_driver_status status);
  60. int cnss_bus_update_uevent(struct cnss_plat_data *plat_priv,
  61. enum cnss_driver_status status, void *data);
  62. int cnss_bus_is_device_down(struct cnss_plat_data *plat_priv);
  63. int cnss_bus_check_link_status(struct cnss_plat_data *plat_priv);
  64. int cnss_bus_recover_link_down(struct cnss_plat_data *plat_priv);
  65. int cnss_bus_debug_reg_read(struct cnss_plat_data *plat_priv, u32 offset,
  66. u32 *val, bool raw_access);
  67. int cnss_bus_debug_reg_write(struct cnss_plat_data *plat_priv, u32 offset,
  68. u32 val, bool raw_access);
  69. int cnss_bus_get_iova(struct cnss_plat_data *plat_priv, u64 *addr, u64 *size);
  70. int cnss_bus_get_iova_ipa(struct cnss_plat_data *plat_priv, u64 *addr,
  71. u64 *size);
  72. bool cnss_bus_is_smmu_s1_enabled(struct cnss_plat_data *plat_priv);
  73. int cnss_bus_update_time_sync_period(struct cnss_plat_data *plat_priv,
  74. unsigned int time_sync_period);
  75. void cnss_bus_disable_mhi_satellite_cfg(struct cnss_plat_data *plat_priv);
  76. int cnss_bus_set_therm_cdev_state(struct cnss_plat_data *plat_priv,
  77. unsigned long thermal_state,
  78. int tcdev_id);
  79. #endif /* _CNSS_BUS_H */