123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- #ifndef _CNSS_PCI_PLATFORM_H
- #define _CNSS_PCI_PLATFORM_H
- #include "pci.h"
- #if IS_ENABLED(CONFIG_PCI_MSM)
- int _cnss_pci_enumerate(struct cnss_plat_data *plat_priv, u32 rc_num);
- int cnss_pci_assert_perst(struct cnss_pci_data *pci_priv);
- int cnss_pci_disable_pc(struct cnss_pci_data *pci_priv, bool vote);
- int cnss_pci_set_link_bandwidth(struct cnss_pci_data *pci_priv,
- u16 link_speed, u16 link_width);
- int cnss_pci_set_max_link_speed(struct cnss_pci_data *pci_priv,
- u32 rc_num, u16 link_speed);
- int cnss_reg_pci_event(struct cnss_pci_data *pci_priv);
- void cnss_dereg_pci_event(struct cnss_pci_data *pci_priv);
- int cnss_wlan_adsp_pc_enable(struct cnss_pci_data *pci_priv,
- bool control);
- int cnss_set_pci_link(struct cnss_pci_data *pci_priv, bool link_up);
- int cnss_pci_prevent_l1(struct device *dev);
- void cnss_pci_allow_l1(struct device *dev);
- int cnss_pci_get_msi_assignment(struct cnss_pci_data *pci_priv);
- int cnss_pci_get_one_msi_assignment(struct cnss_pci_data *pci_priv);
- bool cnss_pci_fallback_one_msi(struct cnss_pci_data *pci_priv,
- int *num_vectors);
- bool cnss_pci_is_one_msi(struct cnss_pci_data *pci_priv);
- int cnss_pci_get_one_msi_mhi_irq_array_size(struct cnss_pci_data *pci_priv);
- bool cnss_pci_is_force_one_msi(struct cnss_pci_data *pci_priv);
- int cnss_pci_init_smmu(struct cnss_pci_data *pci_priv);
- void cnss_pci_update_drv_supported(struct cnss_pci_data *pci_priv);
- int _cnss_pci_get_reg_dump(struct cnss_pci_data *pci_priv,
- u8 *buf, u32 len);
- #else
- int _cnss_pci_enumerate(struct cnss_plat_data *plat_priv, u32 rc_num)
- {
- return -EOPNOTSUPP;
- }
- int cnss_pci_assert_perst(struct cnss_pci_data *pci_priv)
- {
- return -EOPNOTSUPP;
- }
- int cnss_pci_disable_pc(struct cnss_pci_data *pci_priv, bool vote)
- {
- return 0;
- }
- int cnss_pci_set_link_bandwidth(struct cnss_pci_data *pci_priv,
- u16 link_speed, u16 link_width)
- {
- return 0;
- }
- int cnss_pci_set_max_link_speed(struct cnss_pci_data *pci_priv,
- u32 rc_num, u16 link_speed)
- {
- return 0;
- }
- int cnss_reg_pci_event(struct cnss_pci_data *pci_priv)
- {
- return 0;
- }
- void cnss_dereg_pci_event(struct cnss_pci_data *pci_priv) {}
- int cnss_wlan_adsp_pc_enable(struct cnss_pci_data *pci_priv, bool control)
- {
- return 0;
- }
- int cnss_set_pci_link(struct cnss_pci_data *pci_priv, bool link_up)
- {
- return 0;
- }
- int cnss_pci_prevent_l1(struct device *dev)
- {
- return 0;
- }
- EXPORT_SYMBOL(cnss_pci_prevent_l1);
- void cnss_pci_allow_l1(struct device *dev)
- {
- }
- EXPORT_SYMBOL(cnss_pci_allow_l1);
- int cnss_pci_get_msi_assignment(struct cnss_pci_data *pci_priv)
- {
- return 0;
- }
- int cnss_pci_init_smmu(struct cnss_pci_data *pci_priv)
- {
- return 0;
- }
- int _cnss_pci_get_reg_dump(struct cnss_pci_data *pci_priv,
- u8 *buf, u32 len)
- {
- return 0;
- }
- void cnss_pci_update_drv_supported(struct cnss_pci_data *pci_priv)
- {
- pci_priv->drv_supported = false;
- }
- #endif /* CONFIG_PCI_MSM */
- static inline bool cnss_pci_get_drv_supported(struct cnss_pci_data *pci_priv)
- {
- return pci_priv->drv_supported;
- }
- #if IS_ENABLED(CONFIG_ARCH_QCOM)
- int cnss_pci_of_reserved_mem_device_init(struct cnss_pci_data *pci_priv);
- int cnss_pci_wake_gpio_init(struct cnss_pci_data *pci_priv);
- void cnss_pci_wake_gpio_deinit(struct cnss_pci_data *pci_priv);
- #endif /* CONFIG_ARCH_QCOM */
- #endif /* _CNSS_PCI_PLATFORM_H*/
|