wlan_gpio_tgt_api.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /**
  18. * DOC: wlan_gpio_tgt_api.h
  19. *
  20. * This header file provide with API declarations to interface with Southbound
  21. */
  22. #ifndef __WLAN_GPIO_CFG_TGT_API_H__
  23. #define __WLAN_GPIO_CFG_TGT_API_H__
  24. #ifdef WLAN_FEATURE_GPIO_CFG
  25. #include <qdf_status.h>
  26. #include <wmi_unified_param.h>
  27. struct wlan_objmgr_psoc;
  28. /**
  29. * tgt_set_gpio_config_req(): API to set GPIO configuration to lmac
  30. * @psoc: the pointer to psoc object manager
  31. * @param: the pointer to gpio cfg info
  32. *
  33. * Return: status of operation
  34. */
  35. QDF_STATUS
  36. tgt_set_gpio_config_req(struct wlan_objmgr_psoc *psoc,
  37. struct gpio_config_params *param);
  38. /**
  39. * tgt_set_gpio_output_req(): API to set GPIO output info to lmac
  40. * @psoc: the pointer to psoc object manager
  41. * @param: the pointer to gpio output info
  42. *
  43. * Return: status of operation
  44. */
  45. QDF_STATUS
  46. tgt_set_gpio_output_req(struct wlan_objmgr_psoc *psoc,
  47. struct gpio_output_params *param);
  48. /**
  49. * tgt_gpio_config() - API to send gpio config request
  50. * @psoc: pointer to psoc object
  51. * @gpio_num: gpio pin number
  52. * @input: enable/disable the gpio pin
  53. * @pull_type: gpio pull type
  54. * @intr_mode: gpio interrupt mode
  55. * @mux_config_val: gpio MUX value
  56. * @drive: gpio drive
  57. * @init_enable: gpio init_enable
  58. *
  59. * Return: status of operation
  60. */
  61. QDF_STATUS tgt_gpio_config(struct wlan_objmgr_psoc *psoc, uint32_t gpio_num,
  62. uint32_t input, uint32_t pull_type,
  63. uint32_t intr_mode, uint32_t mux_config_val,
  64. uint32_t drive, uint32_t init_enable);
  65. /**
  66. * tgt_gpio_output() - API to send gpio output request
  67. * @psoc: pointer to psoc object
  68. * @gpio_num: gpio pin number
  69. * @set: enable/disable the gpio pin
  70. *
  71. * Return: status of operation
  72. */
  73. QDF_STATUS tgt_gpio_output(struct wlan_objmgr_psoc *psoc, uint32_t gpio_num,
  74. uint32_t set);
  75. #else
  76. static QDF_STATUS tgt_gpio_config(struct wlan_objmgr_psoc *psoc,
  77. uint32_t gpio_num, uint32_t input,
  78. uint32_t pull_type, uint32_t intr_mode,
  79. uint32_t mux_config_val, uint32_t drive,
  80. uint32_t init_enable)
  81. {
  82. return QDF_STATUS_SUCCESS;
  83. }
  84. static QDF_STATUS tgt_gpio_output(struct wlan_objmgr_psoc *psoc,
  85. uint32_t gpio_num, uint32_t set)
  86. {
  87. return QDF_STATUS_SUCCESS;
  88. }
  89. #endif /* WLAN_FEATURE_GPIO_CFG */
  90. #endif /* __WLAN_GPIO_TGT_API_H__ */